|
| 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.accounts.v1beta; |
| 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 | +import "google/protobuf/empty.proto"; |
| 24 | + |
| 25 | +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; |
| 26 | +option java_multiple_files = true; |
| 27 | +option java_outer_classname = "GbpAccountsProto"; |
| 28 | +option java_package = "com.google.shopping.merchant.accounts.v1beta"; |
| 29 | + |
| 30 | +// The service facilitates the management of a merchant's Google Business |
| 31 | +// Profile (GBP) account settings. This API defines the following resource |
| 32 | +// model: |
| 33 | +// - [GbpAccount][google.shopping.merchant.accounts.v1.GbpAccount] |
| 34 | +service GbpAccountsService { |
| 35 | + option (google.api.default_host) = "merchantapi.googleapis.com"; |
| 36 | + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; |
| 37 | + |
| 38 | + // List the GBP accounts for a given merchant. |
| 39 | + rpc ListGbpAccounts(ListGbpAccountsRequest) |
| 40 | + returns (ListGbpAccountsResponse) { |
| 41 | + option (google.api.http) = { |
| 42 | + get: "/accounts/v1beta/{parent=accounts/*}/gbpAccounts" |
| 43 | + }; |
| 44 | + option (google.api.method_signature) = "parent"; |
| 45 | + } |
| 46 | + |
| 47 | + // Link the specified merchant to a GBP account for all countries. |
| 48 | + rpc LinkGbpAccount(LinkGbpAccountRequest) returns (LinkGbpAccountResponse) { |
| 49 | + option (google.api.http) = { |
| 50 | + post: "/accounts/v1beta/{parent=accounts/*}/gbpAccounts:linkGbpAccount" |
| 51 | + body: "*" |
| 52 | + }; |
| 53 | + option (google.api.method_signature) = "parent"; |
| 54 | + } |
| 55 | +} |
| 56 | + |
| 57 | +// Collection of information related to a Google Business Profile (GBP) account. |
| 58 | +message GbpAccount { |
| 59 | + option (google.api.resource) = { |
| 60 | + type: "merchantapi.googleapis.com/GbpAccount" |
| 61 | + pattern: "accounts/{account}/gbpAccounts/{gbp_account}" |
| 62 | + plural: "gbpAccounts" |
| 63 | + singular: "gbpAccount" |
| 64 | + }; |
| 65 | + |
| 66 | + // The type of the GBP account. |
| 67 | + enum Type { |
| 68 | + // Default value. This value is unused. |
| 69 | + TYPE_UNSPECIFIED = 0; |
| 70 | + |
| 71 | + // The GBP account is a user account. |
| 72 | + USER = 1; |
| 73 | + |
| 74 | + // The GBP account is a business account. |
| 75 | + BUSINESS_ACCOUNT = 2; |
| 76 | + } |
| 77 | + |
| 78 | + // Identifier. The resource name of the GBP account. Format: |
| 79 | + // `accounts/{account}/gbpAccount/{gbp_account}` |
| 80 | + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; |
| 81 | + |
| 82 | + // The id of the GBP account. |
| 83 | + string gbp_account_id = 2; |
| 84 | + |
| 85 | + // The type of the Business Profile. |
| 86 | + Type type = 3; |
| 87 | + |
| 88 | + // The name of the Business Profile. |
| 89 | + // For personal accounts: Email id of the owner. |
| 90 | + // For Business accounts: Name of the Business Account. |
| 91 | + string gbp_account_name = 5; |
| 92 | + |
| 93 | + // Number of listings under this account. |
| 94 | + int64 listing_count = 6; |
| 95 | +} |
| 96 | + |
| 97 | +// Request message for the ListGbpAccounts method. |
| 98 | +message ListGbpAccountsRequest { |
| 99 | + // Required. The name of the parent resource under which the GBP accounts are |
| 100 | + // listed. Format: `accounts/{account}`. |
| 101 | + string parent = 1 [ |
| 102 | + (google.api.field_behavior) = REQUIRED, |
| 103 | + (google.api.resource_reference) = { |
| 104 | + type: "merchantapi.googleapis.com/Account" |
| 105 | + } |
| 106 | + ]; |
| 107 | + |
| 108 | + // Optional. The maximum number of `GbpAccount` resources to return. The |
| 109 | + // service returns fewer than this value if the number of gbp accounts is less |
| 110 | + // that than the `pageSize`. The default value is 50. The maximum value is |
| 111 | + // 1000; If a value higher than the maximum is specified, then the `pageSize` |
| 112 | + // will default to the maximum. |
| 113 | + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; |
| 114 | + |
| 115 | + // Optional. A page token, received from a previous `ListGbpAccounts` call. |
| 116 | + // Provide the page token to retrieve the subsequent page. |
| 117 | + // |
| 118 | + // When paginating, all other parameters provided to `ListGbpAccounts` must |
| 119 | + // match the call that provided the page token. |
| 120 | + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; |
| 121 | +} |
| 122 | + |
| 123 | +// Response message for the ListGbpAccounts method. |
| 124 | +message ListGbpAccountsResponse { |
| 125 | + // The GBP accounts from the specified merchant in the specified country. |
| 126 | + repeated GbpAccount gbp_accounts = 1; |
| 127 | + |
| 128 | + // A token, which can be sent as `page_token` to retrieve the next page. |
| 129 | + // If this field is omitted, there are no subsequent pages. |
| 130 | + string next_page_token = 2; |
| 131 | +} |
| 132 | + |
| 133 | +// Request message for the LinkGbpAccount method. |
| 134 | +message LinkGbpAccountRequest { |
| 135 | + // Required. The name of the parent resource to which the GBP account is |
| 136 | + // linked. Format: `accounts/{account}`. |
| 137 | + string parent = 1 [ |
| 138 | + (google.api.field_behavior) = REQUIRED, |
| 139 | + (google.api.resource_reference) = { |
| 140 | + type: "merchantapi.googleapis.com/Account" |
| 141 | + } |
| 142 | + ]; |
| 143 | + |
| 144 | + // Required. The email address of the Business Profile account. |
| 145 | + string gbp_email = 2 [(google.api.field_behavior) = REQUIRED]; |
| 146 | +} |
| 147 | + |
| 148 | +// Response message for the LinkGbpAccount method. |
| 149 | +message LinkGbpAccountResponse { |
| 150 | + // Empty response. |
| 151 | + google.protobuf.Empty response = 1; |
| 152 | +} |
0 commit comments