1// Copyright 2023 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 15syntax = "proto3"; 16 17package google.shopping.css.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23 24option csharp_namespace = "Google.Shopping.Css.V1"; 25option go_package = "cloud.google.com/go/shopping/css/apiv1/csspb;csspb"; 26option java_multiple_files = true; 27option java_outer_classname = "AccountsProto"; 28option java_package = "com.google.shopping.css.v1"; 29option php_namespace = "Google\\Shopping\\Css\\V1"; 30option ruby_package = "Google::Shopping::Css::V1"; 31 32// Service for managing CSS/MC account information. 33service AccountsService { 34 option (google.api.default_host) = "css.googleapis.com"; 35 option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; 36 37 // Lists all the accounts under the specified CSS account ID, and 38 // optionally filters by label ID and account name. 39 rpc ListChildAccounts(ListChildAccountsRequest) 40 returns (ListChildAccountsResponse) { 41 option (google.api.http) = { 42 get: "/v1/{parent=accounts/*}:listChildAccounts" 43 }; 44 option (google.api.method_signature) = "parent"; 45 } 46 47 // Retrieves a single CSS/MC account by ID. 48 rpc GetAccount(GetAccountRequest) returns (Account) { 49 option (google.api.http) = { 50 get: "/v1/{name=accounts/*}" 51 }; 52 option (google.api.method_signature) = "name"; 53 } 54 55 // Updates labels assigned to CSS/MC accounts by a CSS domain. 56 rpc UpdateLabels(UpdateAccountLabelsRequest) returns (Account) { 57 option (google.api.http) = { 58 post: "/v1/{name=accounts/*}:updateLabels" 59 body: "*" 60 }; 61 option (google.api.method_signature) = "name"; 62 } 63} 64 65// The request message for the `ListChildAccounts` method. 66message ListChildAccountsRequest { 67 // Required. The parent account. Must be a CSS group or domain. 68 // Format: accounts/{account} 69 string parent = 1 [ 70 (google.api.field_behavior) = REQUIRED, 71 (google.api.resource_reference) = { type: "css.googleapis.com/Account" } 72 ]; 73 74 // If set, only the MC accounts with the given label ID will be returned. 75 optional int64 label_id = 2; 76 77 // If set, only the MC accounts with the given name (case sensitive) will be 78 // returned. 79 optional string full_name = 3; 80 81 // Optional. The maximum number of accounts to return. The service may return 82 // fewer than this value. If unspecified, at most 50 accounts will be 83 // returned. The maximum value is 1000; values above 1000 will be coerced to 84 // 1000. 85 int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; 86 87 // Optional. A page token, received from a previous `ListChildAccounts` call. 88 // Provide this to retrieve the subsequent page. 89 // 90 // When paginating, all other parameters provided to `ListChildAccounts` must 91 // match the call that provided the page token. 92 string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; 93} 94 95// Response message for the `ListChildAccounts` method. 96message ListChildAccountsResponse { 97 // The CSS/MC accounts returned for the specified CSS parent account. 98 repeated Account accounts = 1; 99 100 // A token, which can be sent as `page_token` to retrieve the next page. 101 // If this field is omitted, there are no subsequent pages. 102 string next_page_token = 2; 103} 104 105// The request message for the `GetAccount` method. 106message GetAccountRequest { 107 // Required. The name of the managed CSS/MC account. 108 // Format: accounts/{account} 109 string name = 1 [ 110 (google.api.field_behavior) = REQUIRED, 111 (google.api.resource_reference) = { type: "css.googleapis.com/Account" } 112 ]; 113 114 // Optional. Only required when retrieving MC account information. 115 // The CSS domain that is the parent resource of the MC account. 116 // Format: accounts/{account} 117 optional string parent = 2 [ 118 (google.api.field_behavior) = OPTIONAL, 119 (google.api.resource_reference) = { type: "css.googleapis.com/Account" } 120 ]; 121} 122 123// The request message for the `UpdateLabels` method. 124message UpdateAccountLabelsRequest { 125 // Required. The label resource name. 126 // Format: accounts/{account} 127 string name = 1 [ 128 (google.api.field_behavior) = REQUIRED, 129 (google.api.resource_reference) = { type: "css.googleapis.com/Account" } 130 ]; 131 132 // The list of label IDs to overwrite the existing account label IDs. 133 // If the list is empty, all currently assigned label IDs will be deleted. 134 repeated int64 label_ids = 2; 135 136 // Optional. Only required when updating MC account labels. 137 // The CSS domain that is the parent resource of the MC account. 138 // Format: accounts/{account} 139 optional string parent = 3 [ 140 (google.api.field_behavior) = OPTIONAL, 141 (google.api.resource_reference) = { type: "css.googleapis.com/Account" } 142 ]; 143} 144 145// Information about CSS/MC account. 146message Account { 147 option (google.api.resource) = { 148 type: "css.googleapis.com/Account" 149 pattern: "accounts/{account}" 150 plural: "accounts" 151 singular: "account" 152 }; 153 154 // The account type. 155 enum AccountType { 156 // Unknown account type. 157 ACCOUNT_TYPE_UNSPECIFIED = 0; 158 159 // CSS group account. 160 CSS_GROUP = 1; 161 162 // CSS domain account. 163 CSS_DOMAIN = 2; 164 165 // MC Primary CSS MCA account. 166 MC_PRIMARY_CSS_MCA = 3; 167 168 // MC CSS MCA account. 169 MC_CSS_MCA = 4; 170 171 // MC Marketplace MCA account. 172 MC_MARKETPLACE_MCA = 5; 173 174 // MC Other MCA account. 175 MC_OTHER_MCA = 6; 176 177 // MC Standalone account. 178 MC_STANDALONE = 7; 179 180 // MC MCA sub-account. 181 MC_MCA_SUBACCOUNT = 8; 182 } 183 184 // The label resource name. 185 // Format: accounts/{account} 186 string name = 1; 187 188 // Output only. Immutable. The CSS/MC account's full name. 189 string full_name = 2 [ 190 (google.api.field_behavior) = OUTPUT_ONLY, 191 (google.api.field_behavior) = IMMUTABLE 192 ]; 193 194 // The CSS/MC account's short display name. 195 optional string display_name = 3; 196 197 // Output only. Immutable. The CSS/MC account's homepage. 198 optional string homepage_uri = 4 [ 199 (google.api.field_behavior) = OUTPUT_ONLY, 200 (google.api.field_behavior) = IMMUTABLE 201 ]; 202 203 // The CSS/MC account's parent resource. CSS group for CSS domains; CSS 204 // domain for MC accounts. Returned only if the user has access to the 205 // parent account. 206 optional string parent = 5; 207 208 // Manually created label IDs assigned to the CSS/MC account by a CSS parent 209 // account. 210 repeated int64 label_ids = 6; 211 212 // Automatically created label IDs assigned to the MC account by 213 // CSS Center. 214 repeated int64 automatic_label_ids = 7; 215 216 // Output only. The type of this account. 217 AccountType account_type = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; 218} 219