Skip to content

Commit 5dc6342

Browse files
feat: [css] Introduce QuotaService for CSS API (#6249)
* feat: Introduce QuotaService for CSS API docs: A comment for field `name` in message `.google.shopping.css.v1.CssProductInput` is changed docs: A comment for field `name` in message `.google.shopping.css.v1.DeleteCssProductInputRequest` is changed PiperOrigin-RevId: 745220517 Source-Link: googleapis/googleapis@819f798 Source-Link: googleapis/googleapis-gen@8ca281b Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXNob3BwaW5nLWNzcy8uT3dsQm90LnlhbWwiLCJoIjoiOGNhMjgxYmE3MmIwZjAyOGI5ODY0NzlhYmQ5MjdhYmNkZGFmODkyOCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 8d5fcaf commit 5dc6342

31 files changed

Lines changed: 4254 additions & 6 deletions

packages/google-shopping-css/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
135135
| Css_product_inputs_service.update_css_product_input | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-css/samples/generated/v1/css_product_inputs_service.update_css_product_input.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-css/samples/generated/v1/css_product_inputs_service.update_css_product_input.js,packages/google-shopping-css/samples/README.md) |
136136
| Css_products_service.get_css_product | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-css/samples/generated/v1/css_products_service.get_css_product.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-css/samples/generated/v1/css_products_service.get_css_product.js,packages/google-shopping-css/samples/README.md) |
137137
| Css_products_service.list_css_products | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-css/samples/generated/v1/css_products_service.list_css_products.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-css/samples/generated/v1/css_products_service.list_css_products.js,packages/google-shopping-css/samples/README.md) |
138+
| Quota_service.list_quota_groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-css/samples/generated/v1/quota_service.list_quota_groups.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-css/samples/generated/v1/quota_service.list_quota_groups.js,packages/google-shopping-css/samples/README.md) |
138139
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-shopping-css/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-shopping-css/samples/quickstart.js,packages/google-shopping-css/samples/README.md) |
139140

140141

packages/google-shopping-css/protos/google/shopping/css/v1/css_product_inputs.proto

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ message CssProductInput {
9191

9292
// The name of the CSS Product input.
9393
// Format:
94-
// `accounts/{account}/cssProductInputs/{css_product_input}`
94+
// `accounts/{account}/cssProductInputs/{css_product_input}`, where the
95+
// last section `css_product_input` consists of 3 parts:
96+
// contentLanguage~feedLabel~offerId. Example:
97+
// accounts/123/cssProductInputs/de~DE~rawProvidedId123
9598
string name = 1;
9699

97100
// Output only. The name of the processed CSS Product.
@@ -205,7 +208,10 @@ message UpdateCssProductInputRequest {
205208
// Request message for the DeleteCssProductInput method.
206209
message DeleteCssProductInputRequest {
207210
// Required. The name of the CSS product input resource to delete.
208-
// Format: accounts/{account}/cssProductInputs/{css_product_input}
211+
// Format: accounts/{account}/cssProductInputs/{css_product_input}, where the
212+
// last section `css_product_input` consists of 3 parts:
213+
// contentLanguage~feedLabel~offerId. Example:
214+
// accounts/123/cssProductInputs/de~DE~rawProvidedId123
209215
string name = 1 [
210216
(google.api.field_behavior) = REQUIRED,
211217
(google.api.resource_reference) = {
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.shopping.css.v1;
18+
19+
import "google/api/annotations.proto";
20+
import "google/api/client.proto";
21+
import "google/api/field_behavior.proto";
22+
import "google/api/resource.proto";
23+
24+
option csharp_namespace = "Google.Shopping.Css.V1";
25+
option go_package = "cloud.google.com/go/shopping/css/apiv1/csspb;csspb";
26+
option java_multiple_files = true;
27+
option java_outer_classname = "QuotaProto";
28+
option java_package = "com.google.shopping.css.v1";
29+
option php_namespace = "Google\\Shopping\\Css\\V1";
30+
option ruby_package = "Google::Shopping::Css::V1";
31+
32+
// Service to get method call quota information per CSS API method.
33+
service QuotaService {
34+
option (google.api.default_host) = "css.googleapis.com";
35+
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content";
36+
37+
// Lists the daily call quota and usage per group for your CSS Center account.
38+
rpc ListQuotaGroups(ListQuotaGroupsRequest)
39+
returns (ListQuotaGroupsResponse) {
40+
option (google.api.http) = {
41+
get: "/v1/{parent=accounts/*}/quotas"
42+
};
43+
option (google.api.method_signature) = "parent";
44+
}
45+
}
46+
47+
// The group information for methods in the CSS API. The quota is shared
48+
// between all methods in the group. Even if none of the methods within the
49+
// group have usage the information for the group is returned.
50+
message QuotaGroup {
51+
option (google.api.resource) = {
52+
type: "css.googleapis.com/QuotaGroup"
53+
pattern: "accounts/{account}/quotaGroups/{quota_group}"
54+
plural: "quotaGroups"
55+
singular: "quotaGroup"
56+
};
57+
58+
// Identifier. The resource name of the quota group.
59+
// Format: accounts/{account}/quotas/{group}
60+
// Example: `accounts/12345678/quotas/css-products-insert`
61+
// Note: The {group} part is not guaranteed to follow a specific pattern.
62+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
63+
64+
// Output only. The current quota usage, meaning the number of calls already
65+
// made on a given day to the methods in the group. The daily quota limits
66+
// reset at at 12:00 PM midday UTC.
67+
int64 quota_usage = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
68+
69+
// Output only. The maximum number of calls allowed per day for the group.
70+
int64 quota_limit = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
71+
72+
// Output only. The maximum number of calls allowed per minute for the group.
73+
int64 quota_minute_limit = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
74+
75+
// Output only. List of all methods group quota applies to.
76+
repeated MethodDetails method_details = 4
77+
[(google.api.field_behavior) = OUTPUT_ONLY];
78+
}
79+
80+
// The method details per method in the CSS API.
81+
message MethodDetails {
82+
// Output only. The name of the method for example
83+
// `cssproductsservice.listcssproducts`.
84+
string method = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
85+
86+
// Output only. The API version that the method belongs to.
87+
string version = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
88+
89+
// Output only. The sub-API that the method belongs to. In the CSS API, this
90+
// is always `css`.
91+
string subapi = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
92+
93+
// Output only. The path for the method such as
94+
// `v1/cssproductsservice.listcssproducts`.
95+
string path = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
96+
}
97+
98+
// Request message for the ListQuotaGroups method.
99+
message ListQuotaGroupsRequest {
100+
// Required. The CSS account that owns the collection of method quotas and
101+
// resources. In most cases, this is the CSS domain. Format:
102+
// accounts/{account}
103+
string parent = 1 [
104+
(google.api.field_behavior) = REQUIRED,
105+
(google.api.resource_reference) = {
106+
child_type: "css.googleapis.com/QuotaGroup"
107+
}
108+
];
109+
110+
// Optional. The maximum number of quotas to return in the response, used
111+
// for paging. Defaults to 500; values above 1000 will be coerced to 1000.
112+
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
113+
114+
// Optional. Token (if provided) to retrieve the subsequent page. All other
115+
// parameters must match the original call that provided the page token.
116+
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
117+
}
118+
119+
// Response message for the ListMethodGroups method.
120+
message ListQuotaGroupsResponse {
121+
// The methods, current quota usage and limits per each group. The quota is
122+
// shared between all methods in the group. The groups are sorted in
123+
// descending order based on
124+
// [quota_usage][google.shopping.css.v1.QuotaGroup.quota_usage].
125+
repeated QuotaGroup quota_groups = 1;
126+
127+
// A token, which can be sent as `page_token` to retrieve the next page.
128+
// If this field is omitted, there are no subsequent pages.
129+
string next_page_token = 2;
130+
}

0 commit comments

Comments
 (0)