|
| 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