Skip to content

Commit 97d42c6

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add/Update API definitions for Cloud Channel API, including
* Update descriptions of APIs. * Add additional_bindings to HTTP annotations of Customer related APIs (list/create/get/update/delete). * Add a new LookupOffer RPC and LookupOfferRequest proto. * Add a new enum value LICENSE_CAP_CHANGED to enum EntitlementEvent.Type. PiperOrigin-RevId: 378177991
1 parent 3b7d5d2 commit 97d42c6

3 files changed

Lines changed: 76 additions & 31 deletions

File tree

google/cloud/channel/v1/customers.proto

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,36 +42,33 @@ message Customer {
4242
// Required. Name of the organization that the customer entity represents.
4343
string org_display_name = 2 [(google.api.field_behavior) = REQUIRED];
4444

45-
// Required. Address of the organization of the customer entity.
46-
// Region and zip codes are required to enforce US laws and embargoes.
47-
// Valid address lines are required for all customers.
48-
// Language code is discarded. Use the Customer-level language code to set the
49-
// customer's language.
45+
// Required. The organization address for the customer. To enforce US laws and
46+
// embargoes, we require a region and zip code. You must provide valid
47+
// addresses for every customer. To set the customer's language, use the
48+
// Customer-level language code.
5049
google.type.PostalAddress org_postal_address = 3 [(google.api.field_behavior) = REQUIRED];
5150

5251
// Primary contact info.
5352
ContactInfo primary_contact_info = 4;
5453

55-
// Secondary contact email.
56-
// Alternate email and primary contact email are required to have different
57-
// domains if primary contact email is present.
58-
// When creating admin.google.com accounts, users get notified credentials at
59-
// this email. This email address is also used as a recovery email.
54+
// Secondary contact email. You need to provide an alternate email to create
55+
// different domains if a primary contact email already exists. Users will
56+
// receive a notification with credentials when you create an admin.google.com
57+
// account. Secondary emails are also recovery email addresses.
6058
string alternate_email = 5;
6159

62-
// Required. Primary domain used by the customer.
63-
// Domain of primary contact email is required to be same as the provided
64-
// domain.
60+
// Required. The customer's primary domain. Must match the primary contact
61+
// email's domain.
6562
string domain = 6 [(google.api.field_behavior) = REQUIRED];
6663

67-
// Output only. The time at which the customer is created.
64+
// Output only. Time when the customer was created.
6865
google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
6966

70-
// Output only. The time at which the customer is updated.
67+
// Output only. Time when the customer was updated.
7168
google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
7269

73-
// Output only. Customer's cloud_identity_id.
74-
// Populated only if a Cloud Identity resource exists for this customer.
70+
// Output only. The customer's Cloud Identity ID if the customer has a Cloud
71+
// Identity resource.
7572
string cloud_identity_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
7673

7774
// Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
@@ -90,25 +87,24 @@ message Customer {
9087

9188
// Contact information for a customer account.
9289
message ContactInfo {
93-
// First name of the contact in the customer account.
90+
// The customer account contact's first name.
9491
string first_name = 1;
9592

96-
// Last name of the contact in the customer account.
93+
// The customer account contact's last name.
9794
string last_name = 2;
9895

99-
// Output only. Display name of the contact in the customer account.
100-
// Populated by combining customer first name and last name.
96+
// Output only. The customer account contact's display name, formatted as a
97+
// combination of the customer's first and last name.
10198
string display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
10299

103-
// Email of the contact in the customer account.
104-
// Email is required for entitlements that need creation of admin.google.com
105-
// accounts. The email will be the username used in credentials to access the
106-
// admin.google.com account.
100+
// The customer account's contact email. Required for entitlements that create
101+
// admin.google.com accounts, and serves as the customer's username for those
102+
// accounts.
107103
string email = 5;
108104

109-
// Optional. Job title of the contact in the customer account.
105+
// Optional. The customer account contact's job title.
110106
string title = 6 [(google.api.field_behavior) = OPTIONAL];
111107

112-
// Phone number of the contact in the customer account.
108+
// The customer account's contact phone number.
113109
string phone = 7;
114110
}

google/cloud/channel/v1/service.proto

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,13 @@ service CloudChannelService {
7171
rpc ListCustomers(ListCustomersRequest) returns (ListCustomersResponse) {
7272
option (google.api.http) = {
7373
get: "/v1/{parent=accounts/*}/customers"
74+
additional_bindings {
75+
get: "/v1/{parent=accounts/*/channelPartnerLinks/*}/customers"
76+
}
7477
};
7578
}
7679

77-
// Returns a requested [Customer][google.cloud.channel.v1.Customer] resource.
80+
// Returns the requested [Customer][google.cloud.channel.v1.Customer] resource.
7881
//
7982
// Possible error codes:
8083
//
@@ -89,6 +92,9 @@ service CloudChannelService {
8992
rpc GetCustomer(GetCustomerRequest) returns (Customer) {
9093
option (google.api.http) = {
9194
get: "/v1/{name=accounts/*/customers/*}"
95+
additional_bindings {
96+
get: "/v1/{name=accounts/*/channelPartnerLinks/*/customers/*}"
97+
}
9298
};
9399
option (google.api.method_signature) = "name";
94100
}
@@ -133,6 +139,10 @@ service CloudChannelService {
133139
option (google.api.http) = {
134140
post: "/v1/{parent=accounts/*}/customers"
135141
body: "customer"
142+
additional_bindings {
143+
post: "/v1/{parent=accounts/*/channelPartnerLinks/*}/customers"
144+
body: "customer"
145+
}
136146
};
137147
}
138148

@@ -152,10 +162,14 @@ service CloudChannelService {
152162
option (google.api.http) = {
153163
patch: "/v1/{customer.name=accounts/*/customers/*}"
154164
body: "customer"
165+
additional_bindings {
166+
patch: "/v1/{customer.name=accounts/*/channelPartnerLinks/*/customers/*}"
167+
body: "customer"
168+
}
155169
};
156170
}
157171

158-
// Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently and irreversibly.
172+
// Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently.
159173
//
160174
// Possible error codes:
161175
//
@@ -167,6 +181,9 @@ service CloudChannelService {
167181
rpc DeleteCustomer(DeleteCustomerRequest) returns (google.protobuf.Empty) {
168182
option (google.api.http) = {
169183
delete: "/v1/{name=accounts/*/customers/*}"
184+
additional_bindings {
185+
delete: "/v1/{name=accounts/*/channelPartnerLinks/*/customers/*}"
186+
}
170187
};
171188
option (google.api.method_signature) = "name";
172189
}
@@ -268,7 +285,7 @@ service CloudChannelService {
268285
};
269286
}
270287

271-
// Returns a requested [Entitlement][google.cloud.channel.v1.Entitlement] resource.
288+
// Returns the requested [Entitlement][google.cloud.channel.v1.Entitlement] resource.
272289
//
273290
// Possible error codes:
274291
//
@@ -670,7 +687,7 @@ service CloudChannelService {
670687
};
671688
}
672689

673-
// Returns a requested [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource.
690+
// Returns the requested [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource.
674691
// You must be a distributor to call this method.
675692
//
676693
// Possible error codes:
@@ -746,6 +763,22 @@ service CloudChannelService {
746763
};
747764
}
748765

766+
// Returns the requested [Offer][google.cloud.channel.v1.Offer] resource.
767+
//
768+
// Possible error codes:
769+
//
770+
// * PERMISSION_DENIED: The entitlement doesn't belong to the reseller.
771+
// * INVALID_ARGUMENT: Required request parameters are missing or invalid.
772+
// * NOT_FOUND: Entitlement or offer was not found.
773+
//
774+
// Return value:
775+
// The [Offer][google.cloud.channel.v1.Offer] resource.
776+
rpc LookupOffer(LookupOfferRequest) returns (Offer) {
777+
option (google.api.http) = {
778+
get: "/v1/{entitlement=accounts/*/customers/*/entitlements/*}:lookupOffer"
779+
};
780+
}
781+
749782
// Lists the Products the reseller is authorized to sell.
750783
//
751784
// Possible error codes:
@@ -1508,6 +1541,19 @@ message ActivateEntitlementRequest {
15081541
string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
15091542
}
15101543

1544+
// Request message for LookupOffer.
1545+
message LookupOfferRequest {
1546+
// Required. The resource name of the entitlement to retrieve the Offer.
1547+
// Entitlement uses the format:
1548+
// accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
1549+
string entitlement = 1 [
1550+
(google.api.field_behavior) = REQUIRED,
1551+
(google.api.resource_reference) = {
1552+
type: "cloudchannel.googleapis.com/Entitlement"
1553+
}
1554+
];
1555+
}
1556+
15111557
// Request message for ListProducts.
15121558
message ListProductsRequest {
15131559
// Required. The resource name of the reseller account.

google/cloud/channel/v1/subscriber_event.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ message EntitlementEvent {
9090

9191
// License was assigned to or revoked from a user.
9292
LICENSE_ASSIGNMENT_CHANGED = 12;
93+
94+
// License cap was changed for the entitlement.
95+
LICENSE_CAP_CHANGED = 13;
9396
}
9497

9598
// Resource name of an entitlement of the form:

0 commit comments

Comments
 (0)