Skip to content

Commit

Permalink
feat: Add ListSkus, ListOffers API definitions for Cloud Channel API.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 346583784
  • Loading branch information
Google APIs authored and copybara-github committed Dec 9, 2020
1 parent 98476fa commit a53dc02
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 4 deletions.
1 change: 0 additions & 1 deletion google/cloud/channel/v1/entitlements.proto
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ message Entitlement {
}

// Output only. Resource name of an entitlement in the form:
//
// accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

Expand Down
2 changes: 1 addition & 1 deletion google/cloud/channel/v1/products.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ message Sku {
Product product = 3;
}

// Represents a Product/SKU/Offers marketing information.
// Represents a Product/SKU/Offer's marketing information.
message MarketingInfo {
// Human readable name.
string display_name = 1;
Expand Down
97 changes: 95 additions & 2 deletions google/cloud/channel/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,32 @@ service CloudChannelService {
};
}

// Lists the SKUs for a product the reseller is authorized to sell.
//
// Possible Error Codes:
//
// * INVALID_ARGUMENT: Missing or invalid required parameters in the
// request.
rpc ListSkus(ListSkusRequest) returns (ListSkusResponse) {
option (google.api.http) = {
get: "/v1/{parent=products/*}/skus"
};
option (google.api.method_signature) = "parent";
}

// Lists the Offers the reseller can sell.
//
// Possible Error Codes:
//
// * INVALID_ARGUMENT: Missing or invalid required parameters in the
// request.
rpc ListOffers(ListOffersRequest) returns (ListOffersResponse) {
option (google.api.http) = {
get: "/v1/{parent=accounts/*}/offers"
};
option (google.api.method_signature) = "parent";
}

// Lists the Purchasable SKUs for following use cases:
// (a) SKUs that can be newly purchased for a customer
// (b) SKUs that can be upgraded/downgraded to, for an entitlement.
Expand Down Expand Up @@ -1517,6 +1543,75 @@ message ListProductsResponse {
string next_page_token = 2;
}

// Request message for ListSkus.
message ListSkusRequest {
// Required. The resource name of the Product for which to list SKUs.
// The parent takes the format: products/{product_id}.
// Supports products/- to retrieve SKUs for all products.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "cloudchannel.googleapis.com/Product"
}
];

// Required. Resource name of the reseller.
// Format: accounts/{account_id}.
string account = 2 [(google.api.field_behavior) = REQUIRED];

// Optional. Requested page size. Server might return fewer results than requested.
// If unspecified, at most 100 SKUs will be returned.
// The maximum value is 1000; values above 1000 will be coerced to 1000.
int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. A token identifying a page of results, if other than the first one.
// Optional.
string page_token = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. The BCP-47 language code, such as "en-US". If specified, the
// response will be localized to the corresponding language code. Default is
// "en-US".
string language_code = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for ListSkus.
message ListSkusResponse {
// The list of SKUs requested.
repeated Sku skus = 1;

// A token to retrieve the next page of results.
string next_page_token = 2;
}

// Request message for ListOffers.
message ListOffersRequest {
// Required. The resource name of the reseller account from which to list Offers.
// The parent takes the format: accounts/{account_id}.
string parent = 1 [(google.api.field_behavior) = REQUIRED];

// Optional. Requested page size. Server might return fewer results than requested.
// If unspecified, at most 500 Offers will be returned.
// The maximum value is 1000; values above 1000 will be coerced to 1000.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. A token identifying a page of results, if other than the first one.
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. The BCP-47 language code, such as "en-US". If specified, the
// response will be localized to the corresponding language code. Default is
// "en-US".
string language_code = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for ListOffers.
message ListOffersResponse {
// The list of Offers requested.
repeated Offer offers = 1;

// A token to retrieve the next page of results.
string next_page_token = 2;
}

// Request message for ListPurchasableSkus.
message ListPurchasableSkusRequest {
// List SKUs for CreateEntitlement purchase for the customer.
Expand Down Expand Up @@ -1544,7 +1639,6 @@ message ListPurchasableSkusRequest {

// Required. Resource name of the entitlement.
// Format:
//
// accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
string entitlement = 1 [(google.api.field_behavior) = REQUIRED];

Expand Down Expand Up @@ -1614,7 +1708,6 @@ message ListPurchasableOffersRequest {
message ChangeOfferPurchase {
// Required. Resource name of the entitlement.
// Format:
//
// accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
string entitlement = 1 [(google.api.field_behavior) = REQUIRED];

Expand Down

0 comments on commit a53dc02

Please sign in to comment.