|
| 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.merchant.quota.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.Merchant.Quota.V1"; |
| 25 | +option go_package = "cloud.google.com/go/shopping/merchant/quota/apiv1/quotapb;quotapb"; |
| 26 | +option java_multiple_files = true; |
| 27 | +option java_outer_classname = "AccountLimitsProto"; |
| 28 | +option java_package = "com.google.shopping.merchant.quota.v1"; |
| 29 | +option php_namespace = "Google\\Shopping\\Merchant\\Quota\\V1"; |
| 30 | +option ruby_package = "Google::Shopping::Merchant::Quota::V1"; |
| 31 | + |
| 32 | +// Service to retrieve account limits. |
| 33 | +service AccountLimitsService { |
| 34 | + option (google.api.default_host) = "merchantapi.googleapis.com"; |
| 35 | + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; |
| 36 | + |
| 37 | + // Retrieves an account limit. |
| 38 | + rpc GetAccountLimit(GetAccountLimitRequest) returns (AccountLimit) { |
| 39 | + option (google.api.http) = { |
| 40 | + get: "/accounts/v1/{name=accounts/*/limits/*}" |
| 41 | + }; |
| 42 | + option (google.api.method_signature) = "name"; |
| 43 | + } |
| 44 | + |
| 45 | + // Lists the limits of an account. |
| 46 | + rpc ListAccountLimits(ListAccountLimitsRequest) |
| 47 | + returns (ListAccountLimitsResponse) { |
| 48 | + option (google.api.http) = { |
| 49 | + get: "/accounts/v1/{parent=accounts/*}/limits" |
| 50 | + }; |
| 51 | + option (google.api.method_signature) = "parent"; |
| 52 | + } |
| 53 | +} |
| 54 | + |
| 55 | +// The limit for products. |
| 56 | +message ProductLimit { |
| 57 | + // The scope of the limit. |
| 58 | + enum Scope { |
| 59 | + // Default value. Should not be used. |
| 60 | + SCOPE_UNSPECIFIED = 0; |
| 61 | + |
| 62 | + // Limit for products in non-EEA countries. |
| 63 | + ADS_NON_EEA = 1; |
| 64 | + |
| 65 | + // Limit for products in EEA countries. |
| 66 | + ADS_EEA = 2; |
| 67 | + } |
| 68 | + |
| 69 | + // Required. The scope of the product limit. |
| 70 | + Scope scope = 1 [(google.api.field_behavior) = REQUIRED]; |
| 71 | + |
| 72 | + // Required. The maximum number of products that are allowed in the account in |
| 73 | + // the given scope. |
| 74 | + int64 limit = 2 [(google.api.field_behavior) = REQUIRED]; |
| 75 | +} |
| 76 | + |
| 77 | +// A limit of a certain type that is applied to an account. |
| 78 | +message AccountLimit { |
| 79 | + option (google.api.resource) = { |
| 80 | + type: "merchantapi.googleapis.com/AccountLimit" |
| 81 | + pattern: "accounts/{account}/limits/{limit}" |
| 82 | + plural: "accountLimits" |
| 83 | + singular: "accountLimit" |
| 84 | + }; |
| 85 | + |
| 86 | + // The type of the limit. |
| 87 | + oneof type { |
| 88 | + // The limit for products. |
| 89 | + ProductLimit products = 100; |
| 90 | + } |
| 91 | + |
| 92 | + // Identifier. The limit part of the name will be a combination of the type |
| 93 | + // and the scope. For example: `accounts/123/limits/products~ADS_NON_EEA` |
| 94 | + // |
| 95 | + // Format: `accounts/{account}/limits/{limit}` |
| 96 | + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; |
| 97 | +} |
| 98 | + |
| 99 | +// Request message for the `GetAccountLimit` method. |
| 100 | +message GetAccountLimitRequest { |
| 101 | + // Required. The name of the limit to retrieve. |
| 102 | + // Format: `accounts/{account}/limits/{limit}` |
| 103 | + // For example: `accounts/123/limits/products~ADS_NON_EEA` |
| 104 | + string name = 1 [ |
| 105 | + (google.api.field_behavior) = REQUIRED, |
| 106 | + (google.api.resource_reference) = { |
| 107 | + type: "merchantapi.googleapis.com/AccountLimit" |
| 108 | + } |
| 109 | + ]; |
| 110 | +} |
| 111 | + |
| 112 | +// Request message for the `ListAccountLimits` method. |
| 113 | +message ListAccountLimitsRequest { |
| 114 | + // Required. The parent account. |
| 115 | + // Format: `accounts/{account}` |
| 116 | + string parent = 1 [ |
| 117 | + (google.api.field_behavior) = REQUIRED, |
| 118 | + (google.api.resource_reference) = { |
| 119 | + type: "merchantapi.googleapis.com/Account" |
| 120 | + } |
| 121 | + ]; |
| 122 | + |
| 123 | + // Optional. The maximum number of limits to return. The service may return |
| 124 | + // fewer than this value. If unspecified, at most 100 limits will be returned. |
| 125 | + // The maximum value is 100; values above 100 will be coerced to 100. |
| 126 | + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; |
| 127 | + |
| 128 | + // Optional. A page token, received from a previous `ListAccountLimits` call. |
| 129 | + // Provide this to retrieve the subsequent page. |
| 130 | + // |
| 131 | + // When paginating, all other parameters provided to `ListAccountLimits` must |
| 132 | + // match the call that provided the page token. |
| 133 | + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; |
| 134 | + |
| 135 | + // Required. A filter on the limit `type` is required, for example, `type = |
| 136 | + // "products"`. |
| 137 | + string filter = 4 [(google.api.field_behavior) = REQUIRED]; |
| 138 | +} |
| 139 | + |
| 140 | +// Response message for the `ListAccountLimits` method. |
| 141 | +message ListAccountLimitsResponse { |
| 142 | + // The limits for the given account. |
| 143 | + repeated AccountLimit account_limits = 1; |
| 144 | + |
| 145 | + // A token, which can be sent as `page_token` to retrieve the next page. |
| 146 | + // If this field is omitted, there are no subsequent pages. |
| 147 | + string next_page_token = 2; |
| 148 | +} |
0 commit comments