|
| 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.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 | +import "google/protobuf/field_mask.proto"; |
| 24 | + |
| 25 | +option csharp_namespace = "Google.Shopping.Merchant.Accounts.V1"; |
| 26 | +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1/accountspb;accountspb"; |
| 27 | +option java_multiple_files = true; |
| 28 | +option java_outer_classname = "AccountRelationshipsProto"; |
| 29 | +option java_package = "com.google.shopping.merchant.accounts.v1"; |
| 30 | +option php_namespace = "Google\\Shopping\\Merchant\\Accounts\\V1"; |
| 31 | +option ruby_package = "Google::Shopping::Merchant::Accounts::V1"; |
| 32 | + |
| 33 | +// Service to support AccountRelationship API. |
| 34 | +service AccountRelationshipsService { |
| 35 | + option (google.api.default_host) = "merchantapi.googleapis.com"; |
| 36 | + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; |
| 37 | + |
| 38 | + // Retrieve an account relationship. |
| 39 | + rpc GetAccountRelationship(GetAccountRelationshipRequest) |
| 40 | + returns (AccountRelationship) { |
| 41 | + option (google.api.http) = { |
| 42 | + get: "/accounts/v1/{name=accounts/*/relationships/*}" |
| 43 | + }; |
| 44 | + option (google.api.method_signature) = "name"; |
| 45 | + } |
| 46 | + |
| 47 | + // Updates the account relationship. Executing this method requires admin |
| 48 | + // access. |
| 49 | + rpc UpdateAccountRelationship(UpdateAccountRelationshipRequest) |
| 50 | + returns (AccountRelationship) { |
| 51 | + option (google.api.http) = { |
| 52 | + patch: "/accounts/v1/{account_relationship.name=accounts/*/relationships/*}" |
| 53 | + body: "account_relationship" |
| 54 | + }; |
| 55 | + option (google.api.method_signature) = "account_relationship,update_mask"; |
| 56 | + } |
| 57 | + |
| 58 | + // List account relationships for the specified account. |
| 59 | + rpc ListAccountRelationships(ListAccountRelationshipsRequest) |
| 60 | + returns (ListAccountRelationshipsResponse) { |
| 61 | + option (google.api.http) = { |
| 62 | + get: "/accounts/v1/{parent=accounts/*}/relationships" |
| 63 | + }; |
| 64 | + option (google.api.method_signature) = "parent"; |
| 65 | + } |
| 66 | +} |
| 67 | + |
| 68 | +// The `AccountRelationship` message defines a formal connection between a |
| 69 | +// merchant's account and a service provider's account. This relationship |
| 70 | +// enables the provider to offer specific services to the business, such as |
| 71 | +// product management or campaign management. It specifies the access rights |
| 72 | +// and permissions to the business's data relevant to those services. |
| 73 | +// |
| 74 | +// Establishing an account relationship involves linking the merchant's account |
| 75 | +// with a provider's account. The provider could be another Google account (like |
| 76 | +// Google Ads or Google My Business) or a third-party platform (such as Shopify |
| 77 | +// or WooCommerce). |
| 78 | +message AccountRelationship { |
| 79 | + option (google.api.resource) = { |
| 80 | + type: "merchantapi.googleapis.com/AccountRelationship" |
| 81 | + pattern: "accounts/{account}/relationships/{relationship}" |
| 82 | + plural: "accountRelationships" |
| 83 | + singular: "accountRelationship" |
| 84 | + }; |
| 85 | + |
| 86 | + // Identifier. The resource name of the account relationship. |
| 87 | + // Format: `accounts/{account}/relationships/{relationship}`. For example, |
| 88 | + // `accounts/123456/relationships/567890`. |
| 89 | + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; |
| 90 | + |
| 91 | + // Immutable. The provider of the service. Either the reference to an account |
| 92 | + // such as `providers/123` or a well-known service provider (one of |
| 93 | + // `providers/GOOGLE_ADS` or `providers/GOOGLE_BUSINESS_PROFILE`). |
| 94 | + optional string provider = 2 [(google.api.field_behavior) = IMMUTABLE]; |
| 95 | + |
| 96 | + // Output only. The human-readable display name of the provider account. |
| 97 | + string provider_display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 98 | + |
| 99 | + // Optional. An optional alias you can assign to this account relationship. |
| 100 | + // This alias acts as a convenient identifier for your own reference and |
| 101 | + // management. It must be unique among all your account relationships with the |
| 102 | + // same provider. |
| 103 | + // |
| 104 | + // For example, you might use `account_id_alias` to assign a friendly name |
| 105 | + // to this relationship for easier identification in your systems. |
| 106 | + string account_id_alias = 4 [(google.api.field_behavior) = OPTIONAL]; |
| 107 | +} |
| 108 | + |
| 109 | +// Request to get an account relationship. |
| 110 | +message GetAccountRelationshipRequest { |
| 111 | + // Required. The resource name of the account relationship to get. |
| 112 | + // Format: `accounts/{account}/relationships/{relationship}`. For example, |
| 113 | + // `accounts/123456/relationships/567890`. |
| 114 | + string name = 1 [ |
| 115 | + (google.api.field_behavior) = REQUIRED, |
| 116 | + (google.api.resource_reference) = { |
| 117 | + type: "merchantapi.googleapis.com/AccountRelationship" |
| 118 | + } |
| 119 | + ]; |
| 120 | +} |
| 121 | + |
| 122 | +// Request message for the `UpdateAccountRelationship` method. |
| 123 | +message UpdateAccountRelationshipRequest { |
| 124 | + // Required. The new version of the account relationship. |
| 125 | + AccountRelationship account_relationship = 1 |
| 126 | + [(google.api.field_behavior) = REQUIRED]; |
| 127 | + |
| 128 | + // Optional. List of fields being updated. |
| 129 | + // |
| 130 | + // The following fields are supported (in both `snake_case` and |
| 131 | + // `lowerCamelCase`): |
| 132 | + // |
| 133 | + // - `account_id_alias` |
| 134 | + google.protobuf.FieldMask update_mask = 2 |
| 135 | + [(google.api.field_behavior) = OPTIONAL]; |
| 136 | +} |
| 137 | + |
| 138 | +// Request to list account relationships. |
| 139 | +message ListAccountRelationshipsRequest { |
| 140 | + // Required. The parent account of the account relationship to filter by. |
| 141 | + // Format: `accounts/{account}` |
| 142 | + string parent = 1 [ |
| 143 | + (google.api.field_behavior) = REQUIRED, |
| 144 | + (google.api.resource_reference) = { |
| 145 | + type: "merchantapi.googleapis.com/Account" |
| 146 | + } |
| 147 | + ]; |
| 148 | + |
| 149 | + // Optional. The token returned by the previous `list` request. |
| 150 | + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; |
| 151 | + |
| 152 | + // Optional. The maximum number of elements to return in the response. Use for |
| 153 | + // paging. If no `page_size` is specified, `100` is used as the default value. |
| 154 | + // The maximum allowed value is `1000`. |
| 155 | + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; |
| 156 | +} |
| 157 | + |
| 158 | +// Response after trying to list account relationships. |
| 159 | +message ListAccountRelationshipsResponse { |
| 160 | + // The account relationships that match your filter. |
| 161 | + repeated AccountRelationship account_relationships = 1; |
| 162 | + |
| 163 | + // A page token. You can send the `page_token` to get the next page. |
| 164 | + // Only included in the `list` response if there are more pages. |
| 165 | + string next_page_token = 2; |
| 166 | +} |
0 commit comments