google-apis-merchantapi_accounts_v1beta 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1613 @@
1
+ # Copyright 2020 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
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module MerchantapiAccountsV1beta
23
+ # Merchant API
24
+ #
25
+ # Programmatically manage your Merchant Center Accounts.
26
+ #
27
+ # @example
28
+ # require 'google/apis/merchantapi_accounts_v1beta'
29
+ #
30
+ # Merchantapi = Google::Apis::MerchantapiAccountsV1beta # Alias the module
31
+ # service = Merchantapi::MerchantService.new
32
+ #
33
+ # @see https://developers.devsite.corp.google.com/merchant/api
34
+ class MerchantService < Google::Apis::Core::BaseService
35
+ DEFAULT_ENDPOINT_TEMPLATE = "https://merchantapi.$UNIVERSE_DOMAIN$/"
36
+
37
+ # @return [String]
38
+ # API key. Your API key identifies your project and provides you with API access,
39
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
40
+ attr_accessor :key
41
+
42
+ # @return [String]
43
+ # Available to use for quota purposes for server-side applications. Can be any
44
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
45
+ attr_accessor :quota_user
46
+
47
+ def initialize
48
+ super(DEFAULT_ENDPOINT_TEMPLATE, '',
49
+ client_name: 'google-apis-merchantapi_accounts_v1beta',
50
+ client_version: Google::Apis::MerchantapiAccountsV1beta::GEM_VERSION)
51
+ @batch_path = 'batch'
52
+ end
53
+
54
+ # Creates a standalone Merchant Center account with additional configuration.
55
+ # Adds the user that makes the request as an admin for the new account.
56
+ # @param [Google::Apis::MerchantapiAccountsV1beta::CreateAndConfigureAccountRequest] create_and_configure_account_request_object
57
+ # @param [String] fields
58
+ # Selector specifying which fields to include in a partial response.
59
+ # @param [String] quota_user
60
+ # Available to use for quota purposes for server-side applications. Can be any
61
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
62
+ # @param [Google::Apis::RequestOptions] options
63
+ # Request-specific options
64
+ #
65
+ # @yield [result, err] Result & error if block supplied
66
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Account] parsed result object
67
+ # @yieldparam err [StandardError] error object if request failed
68
+ #
69
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Account]
70
+ #
71
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
72
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
73
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
74
+ def create_and_configure_account(create_and_configure_account_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
75
+ command = make_simple_command(:post, 'accounts/v1beta/accounts:createAndConfigure', options)
76
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::CreateAndConfigureAccountRequest::Representation
77
+ command.request_object = create_and_configure_account_request_object
78
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Account::Representation
79
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Account
80
+ command.query['fields'] = fields unless fields.nil?
81
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
82
+ execute_or_queue_command(command, &block)
83
+ end
84
+
85
+ # Deletes the specified account regardless of its type: standalone, MCA or sub-
86
+ # account. Deleting an MCA leads to the deletion of all of its sub-accounts.
87
+ # Executing this method requires admin access.
88
+ # @param [String] name
89
+ # Required. The name of the account to delete. Format: `accounts/`account``
90
+ # @param [String] fields
91
+ # Selector specifying which fields to include in a partial response.
92
+ # @param [String] quota_user
93
+ # Available to use for quota purposes for server-side applications. Can be any
94
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
95
+ # @param [Google::Apis::RequestOptions] options
96
+ # Request-specific options
97
+ #
98
+ # @yield [result, err] Result & error if block supplied
99
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Empty] parsed result object
100
+ # @yieldparam err [StandardError] error object if request failed
101
+ #
102
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Empty]
103
+ #
104
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
105
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
106
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
107
+ def delete_account(name, fields: nil, quota_user: nil, options: nil, &block)
108
+ command = make_simple_command(:delete, 'accounts/v1beta/{+name}', options)
109
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Empty::Representation
110
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Empty
111
+ command.params['name'] = name unless name.nil?
112
+ command.query['fields'] = fields unless fields.nil?
113
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
114
+ execute_or_queue_command(command, &block)
115
+ end
116
+
117
+ # Retrieves an account from your Merchant Center account. After inserting,
118
+ # updating, or deleting an account, it may take several minutes before changes
119
+ # take effect.
120
+ # @param [String] name
121
+ # Required. The name of the account to retrieve. Format: `accounts/`account``
122
+ # @param [String] fields
123
+ # Selector specifying which fields to include in a partial response.
124
+ # @param [String] quota_user
125
+ # Available to use for quota purposes for server-side applications. Can be any
126
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
127
+ # @param [Google::Apis::RequestOptions] options
128
+ # Request-specific options
129
+ #
130
+ # @yield [result, err] Result & error if block supplied
131
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Account] parsed result object
132
+ # @yieldparam err [StandardError] error object if request failed
133
+ #
134
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Account]
135
+ #
136
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
137
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
138
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
139
+ def get_account(name, fields: nil, quota_user: nil, options: nil, &block)
140
+ command = make_simple_command(:get, 'accounts/v1beta/{+name}', options)
141
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Account::Representation
142
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Account
143
+ command.params['name'] = name unless name.nil?
144
+ command.query['fields'] = fields unless fields.nil?
145
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
146
+ execute_or_queue_command(command, &block)
147
+ end
148
+
149
+ # Retrieves the business identity of an account.
150
+ # @param [String] name
151
+ # Required. The resource name of the business identity. Format: `accounts/`
152
+ # account`/businessIdentity`
153
+ # @param [String] fields
154
+ # Selector specifying which fields to include in a partial response.
155
+ # @param [String] quota_user
156
+ # Available to use for quota purposes for server-side applications. Can be any
157
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
158
+ # @param [Google::Apis::RequestOptions] options
159
+ # Request-specific options
160
+ #
161
+ # @yield [result, err] Result & error if block supplied
162
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::BusinessIdentity] parsed result object
163
+ # @yieldparam err [StandardError] error object if request failed
164
+ #
165
+ # @return [Google::Apis::MerchantapiAccountsV1beta::BusinessIdentity]
166
+ #
167
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
168
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
169
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
170
+ def get_account_business_identity(name, fields: nil, quota_user: nil, options: nil, &block)
171
+ command = make_simple_command(:get, 'accounts/v1beta/{+name}', options)
172
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::BusinessIdentity::Representation
173
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::BusinessIdentity
174
+ command.params['name'] = name unless name.nil?
175
+ command.query['fields'] = fields unless fields.nil?
176
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
177
+ execute_or_queue_command(command, &block)
178
+ end
179
+
180
+ # Retrieves the business info of an account.
181
+ # @param [String] name
182
+ # Required. The resource name of the business info. Format: `accounts/`account`/
183
+ # businessInfo`
184
+ # @param [String] fields
185
+ # Selector specifying which fields to include in a partial response.
186
+ # @param [String] quota_user
187
+ # Available to use for quota purposes for server-side applications. Can be any
188
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
189
+ # @param [Google::Apis::RequestOptions] options
190
+ # Request-specific options
191
+ #
192
+ # @yield [result, err] Result & error if block supplied
193
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::BusinessInfo] parsed result object
194
+ # @yieldparam err [StandardError] error object if request failed
195
+ #
196
+ # @return [Google::Apis::MerchantapiAccountsV1beta::BusinessInfo]
197
+ #
198
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
199
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
200
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
201
+ def get_account_business_info(name, fields: nil, quota_user: nil, options: nil, &block)
202
+ command = make_simple_command(:get, 'accounts/v1beta/{+name}', options)
203
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::BusinessInfo::Representation
204
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::BusinessInfo
205
+ command.params['name'] = name unless name.nil?
206
+ command.query['fields'] = fields unless fields.nil?
207
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
208
+ execute_or_queue_command(command, &block)
209
+ end
210
+
211
+ # Retrieves a store's homepage.
212
+ # @param [String] name
213
+ # Required. The name of the homepage to retrieve. Format: `accounts/`account`/
214
+ # homepage`
215
+ # @param [String] fields
216
+ # Selector specifying which fields to include in a partial response.
217
+ # @param [String] quota_user
218
+ # Available to use for quota purposes for server-side applications. Can be any
219
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
220
+ # @param [Google::Apis::RequestOptions] options
221
+ # Request-specific options
222
+ #
223
+ # @yield [result, err] Result & error if block supplied
224
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Homepage] parsed result object
225
+ # @yieldparam err [StandardError] error object if request failed
226
+ #
227
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Homepage]
228
+ #
229
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
230
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
231
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
232
+ def get_account_homepage(name, fields: nil, quota_user: nil, options: nil, &block)
233
+ command = make_simple_command(:get, 'accounts/v1beta/{+name}', options)
234
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Homepage::Representation
235
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Homepage
236
+ command.params['name'] = name unless name.nil?
237
+ command.query['fields'] = fields unless fields.nil?
238
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
239
+ execute_or_queue_command(command, &block)
240
+ end
241
+
242
+ # Retrieve shipping setting information.
243
+ # @param [String] name
244
+ # Required. The name of the shipping setting to retrieve. Format: `accounts/`
245
+ # account`/shippingsetting`
246
+ # @param [String] fields
247
+ # Selector specifying which fields to include in a partial response.
248
+ # @param [String] quota_user
249
+ # Available to use for quota purposes for server-side applications. Can be any
250
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
251
+ # @param [Google::Apis::RequestOptions] options
252
+ # Request-specific options
253
+ #
254
+ # @yield [result, err] Result & error if block supplied
255
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::ShippingSettings] parsed result object
256
+ # @yieldparam err [StandardError] error object if request failed
257
+ #
258
+ # @return [Google::Apis::MerchantapiAccountsV1beta::ShippingSettings]
259
+ #
260
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
261
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
262
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
263
+ def get_account_shipping_settings(name, fields: nil, quota_user: nil, options: nil, &block)
264
+ command = make_simple_command(:get, 'accounts/v1beta/{+name}', options)
265
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::ShippingSettings::Representation
266
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::ShippingSettings
267
+ command.params['name'] = name unless name.nil?
268
+ command.query['fields'] = fields unless fields.nil?
269
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
270
+ execute_or_queue_command(command, &block)
271
+ end
272
+
273
+ # Lists accounts accessible to the calling user and matching the constraints of
274
+ # the request such as page size or filters. This is not just listing the sub-
275
+ # accounts of an MCA, but all accounts the calling user has access to including
276
+ # other MCAs, linked accounts, standalone accounts and so on.
277
+ # @param [String] filter
278
+ # Optional. Returns only accounts that match the [filter](/merchant/api/guides/
279
+ # accounts/filter). For more details, see the [filter syntax reference](/
280
+ # merchant/api/guides/accounts/filter-syntax).
281
+ # @param [Fixnum] page_size
282
+ # Optional. The maximum number of accounts to return. The service may return
283
+ # fewer than this value. If unspecified, at most 250 accounts are returned. The
284
+ # maximum value is 500; values above 500 are coerced to 500.
285
+ # @param [String] page_token
286
+ # Optional. A page token, received from a previous `ListAccounts` call. Provide
287
+ # this to retrieve the subsequent page. When paginating, all other parameters
288
+ # provided to `ListAccounts` must match the call that provided the page token.
289
+ # @param [String] fields
290
+ # Selector specifying which fields to include in a partial response.
291
+ # @param [String] quota_user
292
+ # Available to use for quota purposes for server-side applications. Can be any
293
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
294
+ # @param [Google::Apis::RequestOptions] options
295
+ # Request-specific options
296
+ #
297
+ # @yield [result, err] Result & error if block supplied
298
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::ListAccountsResponse] parsed result object
299
+ # @yieldparam err [StandardError] error object if request failed
300
+ #
301
+ # @return [Google::Apis::MerchantapiAccountsV1beta::ListAccountsResponse]
302
+ #
303
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
304
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
305
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
306
+ def list_accounts(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
307
+ command = make_simple_command(:get, 'accounts/v1beta/accounts', options)
308
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::ListAccountsResponse::Representation
309
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::ListAccountsResponse
310
+ command.query['filter'] = filter unless filter.nil?
311
+ command.query['pageSize'] = page_size unless page_size.nil?
312
+ command.query['pageToken'] = page_token unless page_token.nil?
313
+ command.query['fields'] = fields unless fields.nil?
314
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
315
+ execute_or_queue_command(command, &block)
316
+ end
317
+
318
+ # List all sub-accounts for a given multi client account. This is a convenience
319
+ # wrapper for the more powerful `ListAccounts` method. This method will produce
320
+ # the same results as calling `ListsAccounts` with the following filter: `
321
+ # relationship(providerId=`parent` AND service(type="ACCOUNT_AGGREGATION"))`
322
+ # @param [String] provider
323
+ # Required. The parent account. Format: `accounts/`account``
324
+ # @param [Fixnum] page_size
325
+ # Optional. The maximum number of accounts to return. The service may return
326
+ # fewer than this value. If unspecified, at most 250 accounts are returned. The
327
+ # maximum value is 500; values above 500 are coerced to 500.
328
+ # @param [String] page_token
329
+ # Optional. A page token, received from a previous `ListAccounts` call. Provide
330
+ # this to retrieve the subsequent page. When paginating, all other parameters
331
+ # provided to `ListAccounts` must match the call that provided the page token.
332
+ # @param [String] fields
333
+ # Selector specifying which fields to include in a partial response.
334
+ # @param [String] quota_user
335
+ # Available to use for quota purposes for server-side applications. Can be any
336
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
337
+ # @param [Google::Apis::RequestOptions] options
338
+ # Request-specific options
339
+ #
340
+ # @yield [result, err] Result & error if block supplied
341
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::ListSubAccountsResponse] parsed result object
342
+ # @yieldparam err [StandardError] error object if request failed
343
+ #
344
+ # @return [Google::Apis::MerchantapiAccountsV1beta::ListSubAccountsResponse]
345
+ #
346
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
347
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
348
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
349
+ def list_account_subaccounts(provider, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
350
+ command = make_simple_command(:get, 'accounts/v1beta/{+provider}:listSubaccounts', options)
351
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::ListSubAccountsResponse::Representation
352
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::ListSubAccountsResponse
353
+ command.params['provider'] = provider unless provider.nil?
354
+ command.query['pageSize'] = page_size unless page_size.nil?
355
+ command.query['pageToken'] = page_token unless page_token.nil?
356
+ command.query['fields'] = fields unless fields.nil?
357
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
358
+ execute_or_queue_command(command, &block)
359
+ end
360
+
361
+ # Updates an account regardless of its type: standalone, MCA or sub-account.
362
+ # Executing this method requires admin access.
363
+ # @param [String] name
364
+ # Identifier. The resource name of the account. Format: `accounts/`account``
365
+ # @param [Google::Apis::MerchantapiAccountsV1beta::Account] account_object
366
+ # @param [String] update_mask
367
+ # Required. List of fields being updated.
368
+ # @param [String] fields
369
+ # Selector specifying which fields to include in a partial response.
370
+ # @param [String] quota_user
371
+ # Available to use for quota purposes for server-side applications. Can be any
372
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
373
+ # @param [Google::Apis::RequestOptions] options
374
+ # Request-specific options
375
+ #
376
+ # @yield [result, err] Result & error if block supplied
377
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Account] parsed result object
378
+ # @yieldparam err [StandardError] error object if request failed
379
+ #
380
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Account]
381
+ #
382
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
383
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
384
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
385
+ def patch_account(name, account_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
386
+ command = make_simple_command(:patch, 'accounts/v1beta/{+name}', options)
387
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::Account::Representation
388
+ command.request_object = account_object
389
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Account::Representation
390
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Account
391
+ command.params['name'] = name unless name.nil?
392
+ command.query['updateMask'] = update_mask unless update_mask.nil?
393
+ command.query['fields'] = fields unless fields.nil?
394
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
395
+ execute_or_queue_command(command, &block)
396
+ end
397
+
398
+ # Updates the business identity of an account. Executing this method requires
399
+ # admin access.
400
+ # @param [String] name
401
+ # Identifier. The resource name of the business identity. Format: `accounts/`
402
+ # account`/businessIdentity`
403
+ # @param [Google::Apis::MerchantapiAccountsV1beta::BusinessIdentity] business_identity_object
404
+ # @param [String] update_mask
405
+ # Required. List of fields being updated.
406
+ # @param [String] fields
407
+ # Selector specifying which fields to include in a partial response.
408
+ # @param [String] quota_user
409
+ # Available to use for quota purposes for server-side applications. Can be any
410
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
411
+ # @param [Google::Apis::RequestOptions] options
412
+ # Request-specific options
413
+ #
414
+ # @yield [result, err] Result & error if block supplied
415
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::BusinessIdentity] parsed result object
416
+ # @yieldparam err [StandardError] error object if request failed
417
+ #
418
+ # @return [Google::Apis::MerchantapiAccountsV1beta::BusinessIdentity]
419
+ #
420
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
421
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
422
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
423
+ def update_account_business_identity(name, business_identity_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
424
+ command = make_simple_command(:patch, 'accounts/v1beta/{+name}', options)
425
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::BusinessIdentity::Representation
426
+ command.request_object = business_identity_object
427
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::BusinessIdentity::Representation
428
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::BusinessIdentity
429
+ command.params['name'] = name unless name.nil?
430
+ command.query['updateMask'] = update_mask unless update_mask.nil?
431
+ command.query['fields'] = fields unless fields.nil?
432
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
433
+ execute_or_queue_command(command, &block)
434
+ end
435
+
436
+ # Updates the business info of an account. Executing this method requires admin
437
+ # access.
438
+ # @param [String] name
439
+ # Identifier. The resource name of the business info. Format: `accounts/`account`
440
+ # /businessInfo`
441
+ # @param [Google::Apis::MerchantapiAccountsV1beta::BusinessInfo] business_info_object
442
+ # @param [String] update_mask
443
+ # Required. List of fields being updated.
444
+ # @param [String] fields
445
+ # Selector specifying which fields to include in a partial response.
446
+ # @param [String] quota_user
447
+ # Available to use for quota purposes for server-side applications. Can be any
448
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
449
+ # @param [Google::Apis::RequestOptions] options
450
+ # Request-specific options
451
+ #
452
+ # @yield [result, err] Result & error if block supplied
453
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::BusinessInfo] parsed result object
454
+ # @yieldparam err [StandardError] error object if request failed
455
+ #
456
+ # @return [Google::Apis::MerchantapiAccountsV1beta::BusinessInfo]
457
+ #
458
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
459
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
460
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
461
+ def update_account_business_info(name, business_info_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
462
+ command = make_simple_command(:patch, 'accounts/v1beta/{+name}', options)
463
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::BusinessInfo::Representation
464
+ command.request_object = business_info_object
465
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::BusinessInfo::Representation
466
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::BusinessInfo
467
+ command.params['name'] = name unless name.nil?
468
+ command.query['updateMask'] = update_mask unless update_mask.nil?
469
+ command.query['fields'] = fields unless fields.nil?
470
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
471
+ execute_or_queue_command(command, &block)
472
+ end
473
+
474
+ # Updates a store's homepage. Executing this method requires admin access.
475
+ # @param [String] name
476
+ # Identifier. The resource name of the store's homepage. Format: `accounts/`
477
+ # account`/homepage`
478
+ # @param [Google::Apis::MerchantapiAccountsV1beta::Homepage] homepage_object
479
+ # @param [String] update_mask
480
+ # Required. List of fields being updated.
481
+ # @param [String] fields
482
+ # Selector specifying which fields to include in a partial response.
483
+ # @param [String] quota_user
484
+ # Available to use for quota purposes for server-side applications. Can be any
485
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
486
+ # @param [Google::Apis::RequestOptions] options
487
+ # Request-specific options
488
+ #
489
+ # @yield [result, err] Result & error if block supplied
490
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Homepage] parsed result object
491
+ # @yieldparam err [StandardError] error object if request failed
492
+ #
493
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Homepage]
494
+ #
495
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
496
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
497
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
498
+ def update_account_homepage(name, homepage_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
499
+ command = make_simple_command(:patch, 'accounts/v1beta/{+name}', options)
500
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::Homepage::Representation
501
+ command.request_object = homepage_object
502
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Homepage::Representation
503
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Homepage
504
+ command.params['name'] = name unless name.nil?
505
+ command.query['updateMask'] = update_mask unless update_mask.nil?
506
+ command.query['fields'] = fields unless fields.nil?
507
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
508
+ execute_or_queue_command(command, &block)
509
+ end
510
+
511
+ # Returns the tax rules that match the conditions of GetAccountTaxRequest
512
+ # @param [String] name
513
+ # Required. The name from which tax settings will be retrieved
514
+ # @param [String] fields
515
+ # Selector specifying which fields to include in a partial response.
516
+ # @param [String] quota_user
517
+ # Available to use for quota purposes for server-side applications. Can be any
518
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
519
+ # @param [Google::Apis::RequestOptions] options
520
+ # Request-specific options
521
+ #
522
+ # @yield [result, err] Result & error if block supplied
523
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::AccountTax] parsed result object
524
+ # @yieldparam err [StandardError] error object if request failed
525
+ #
526
+ # @return [Google::Apis::MerchantapiAccountsV1beta::AccountTax]
527
+ #
528
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
529
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
530
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
531
+ def get_account_accounttax(name, fields: nil, quota_user: nil, options: nil, &block)
532
+ command = make_simple_command(:get, 'accounts/v1beta/{+name}', options)
533
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::AccountTax::Representation
534
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::AccountTax
535
+ command.params['name'] = name unless name.nil?
536
+ command.query['fields'] = fields unless fields.nil?
537
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
538
+ execute_or_queue_command(command, &block)
539
+ end
540
+
541
+ # Lists the tax settings of the sub-accounts only in your Merchant Center
542
+ # account. This method can only be called on a multi-client account, otherwise
543
+ # it'll return an error.
544
+ # @param [String] parent
545
+ # Required. The parent, which owns this collection of account tax. Format:
546
+ # accounts/`account`
547
+ # @param [Fixnum] page_size
548
+ # The maximum number of tax settings to return in the response, used for paging.
549
+ # @param [String] page_token
550
+ # The token returned by the previous request.
551
+ # @param [String] fields
552
+ # Selector specifying which fields to include in a partial response.
553
+ # @param [String] quota_user
554
+ # Available to use for quota purposes for server-side applications. Can be any
555
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
556
+ # @param [Google::Apis::RequestOptions] options
557
+ # Request-specific options
558
+ #
559
+ # @yield [result, err] Result & error if block supplied
560
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::ListAccountTaxResponse] parsed result object
561
+ # @yieldparam err [StandardError] error object if request failed
562
+ #
563
+ # @return [Google::Apis::MerchantapiAccountsV1beta::ListAccountTaxResponse]
564
+ #
565
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
566
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
567
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
568
+ def list_account_accounttaxes(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
569
+ command = make_simple_command(:get, 'accounts/v1beta/{+parent}/accounttax', options)
570
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::ListAccountTaxResponse::Representation
571
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::ListAccountTaxResponse
572
+ command.params['parent'] = parent unless parent.nil?
573
+ command.query['pageSize'] = page_size unless page_size.nil?
574
+ command.query['pageToken'] = page_token unless page_token.nil?
575
+ command.query['fields'] = fields unless fields.nil?
576
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
577
+ execute_or_queue_command(command, &block)
578
+ end
579
+
580
+ # Updates the tax settings of the account.
581
+ # @param [String] name
582
+ # Identifier. The name of the tax setting. Format: "`account_tax.name=accounts/`
583
+ # account``"
584
+ # @param [Google::Apis::MerchantapiAccountsV1beta::AccountTax] account_tax_object
585
+ # @param [String] update_mask
586
+ # The list of fields to be updated
587
+ # @param [String] fields
588
+ # Selector specifying which fields to include in a partial response.
589
+ # @param [String] quota_user
590
+ # Available to use for quota purposes for server-side applications. Can be any
591
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
592
+ # @param [Google::Apis::RequestOptions] options
593
+ # Request-specific options
594
+ #
595
+ # @yield [result, err] Result & error if block supplied
596
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::AccountTax] parsed result object
597
+ # @yieldparam err [StandardError] error object if request failed
598
+ #
599
+ # @return [Google::Apis::MerchantapiAccountsV1beta::AccountTax]
600
+ #
601
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
602
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
603
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
604
+ def patch_account_accounttax(name, account_tax_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
605
+ command = make_simple_command(:patch, 'accounts/v1beta/{+name}', options)
606
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::AccountTax::Representation
607
+ command.request_object = account_tax_object
608
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::AccountTax::Representation
609
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::AccountTax
610
+ command.params['name'] = name unless name.nil?
611
+ command.query['updateMask'] = update_mask unless update_mask.nil?
612
+ command.query['fields'] = fields unless fields.nil?
613
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
614
+ execute_or_queue_command(command, &block)
615
+ end
616
+
617
+ # Claims a store's homepage. Executing this method requires admin access. If the
618
+ # homepage is already claimed, this will recheck the verification (unless the
619
+ # merchant is exempted from claiming, which also exempts from verification) and
620
+ # return a successful response. If ownership can no longer be verified, it will
621
+ # return an error, but it won't clear the claim. In case of failure, a canonical
622
+ # error message will be returned: * PERMISSION_DENIED: user doesn't have the
623
+ # necessary permissions on this MC account; * FAILED_PRECONDITION: - The account
624
+ # is not a Merchant Center account; - MC account doesn't have a homepage; -
625
+ # claiming failed (in this case the error message will contain more details).
626
+ # @param [String] name
627
+ # Required. The name of the homepage to claim. Format: `accounts/`account`/
628
+ # homepage`
629
+ # @param [Google::Apis::MerchantapiAccountsV1beta::ClaimHomepageRequest] claim_homepage_request_object
630
+ # @param [String] fields
631
+ # Selector specifying which fields to include in a partial response.
632
+ # @param [String] quota_user
633
+ # Available to use for quota purposes for server-side applications. Can be any
634
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
635
+ # @param [Google::Apis::RequestOptions] options
636
+ # Request-specific options
637
+ #
638
+ # @yield [result, err] Result & error if block supplied
639
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Homepage] parsed result object
640
+ # @yieldparam err [StandardError] error object if request failed
641
+ #
642
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Homepage]
643
+ #
644
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
645
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
646
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
647
+ def claim_homepage(name, claim_homepage_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
648
+ command = make_simple_command(:post, 'accounts/v1beta/{+name}:claim', options)
649
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::ClaimHomepageRequest::Representation
650
+ command.request_object = claim_homepage_request_object
651
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Homepage::Representation
652
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Homepage
653
+ command.params['name'] = name unless name.nil?
654
+ command.query['fields'] = fields unless fields.nil?
655
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
656
+ execute_or_queue_command(command, &block)
657
+ end
658
+
659
+ # Unclaims a store's homepage. Executing this method requires admin access.
660
+ # @param [String] name
661
+ # Required. The name of the homepage to unclaim. Format: `accounts/`account`/
662
+ # homepage`
663
+ # @param [Google::Apis::MerchantapiAccountsV1beta::UnclaimHomepageRequest] unclaim_homepage_request_object
664
+ # @param [String] fields
665
+ # Selector specifying which fields to include in a partial response.
666
+ # @param [String] quota_user
667
+ # Available to use for quota purposes for server-side applications. Can be any
668
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
669
+ # @param [Google::Apis::RequestOptions] options
670
+ # Request-specific options
671
+ #
672
+ # @yield [result, err] Result & error if block supplied
673
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Homepage] parsed result object
674
+ # @yieldparam err [StandardError] error object if request failed
675
+ #
676
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Homepage]
677
+ #
678
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
679
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
680
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
681
+ def unclaim_homepage(name, unclaim_homepage_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
682
+ command = make_simple_command(:post, 'accounts/v1beta/{+name}:unclaim', options)
683
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::UnclaimHomepageRequest::Representation
684
+ command.request_object = unclaim_homepage_request_object
685
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Homepage::Representation
686
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Homepage
687
+ command.params['name'] = name unless name.nil?
688
+ command.query['fields'] = fields unless fields.nil?
689
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
690
+ execute_or_queue_command(command, &block)
691
+ end
692
+
693
+ # Lists all account issues of a Merchant Center account.
694
+ # @param [String] parent
695
+ # Required. The parent, which owns this collection of issues. Format: `accounts/`
696
+ # account``
697
+ # @param [String] language_code
698
+ # Optional. The issues in the response will have human-readable fields in the
699
+ # given language. The format is [BCP-47](https://tools.ietf.org/html/bcp47),
700
+ # such as `en-US` or `sr-Latn`. If not value is provided, `en-US` will be used.
701
+ # @param [Fixnum] page_size
702
+ # Optional. The maximum number of issues to return. The service may return fewer
703
+ # than this value. If unspecified, at most 50 users will be returned. The
704
+ # maximum value is 100; values above 100 will be coerced to 100
705
+ # @param [String] page_token
706
+ # Optional. A page token, received from a previous `ListAccountIssues` call.
707
+ # Provide this to retrieve the subsequent page. When paginating, all other
708
+ # parameters provided to `ListAccountIssues` must match the call that provided
709
+ # the page token.
710
+ # @param [String] time_zone_id
711
+ # IANA Time Zone Database time zone, e.g. "America/New_York".
712
+ # @param [String] time_zone_version
713
+ # Optional. IANA Time Zone Database version number, e.g. "2019a".
714
+ # @param [String] fields
715
+ # Selector specifying which fields to include in a partial response.
716
+ # @param [String] quota_user
717
+ # Available to use for quota purposes for server-side applications. Can be any
718
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
719
+ # @param [Google::Apis::RequestOptions] options
720
+ # Request-specific options
721
+ #
722
+ # @yield [result, err] Result & error if block supplied
723
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::ListAccountIssuesResponse] parsed result object
724
+ # @yieldparam err [StandardError] error object if request failed
725
+ #
726
+ # @return [Google::Apis::MerchantapiAccountsV1beta::ListAccountIssuesResponse]
727
+ #
728
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
729
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
730
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
731
+ def list_account_issues(parent, language_code: nil, page_size: nil, page_token: nil, time_zone_id: nil, time_zone_version: nil, fields: nil, quota_user: nil, options: nil, &block)
732
+ command = make_simple_command(:get, 'accounts/v1beta/{+parent}/issues', options)
733
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::ListAccountIssuesResponse::Representation
734
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::ListAccountIssuesResponse
735
+ command.params['parent'] = parent unless parent.nil?
736
+ command.query['languageCode'] = language_code unless language_code.nil?
737
+ command.query['pageSize'] = page_size unless page_size.nil?
738
+ command.query['pageToken'] = page_token unless page_token.nil?
739
+ command.query['timeZone.id'] = time_zone_id unless time_zone_id.nil?
740
+ command.query['timeZone.version'] = time_zone_version unless time_zone_version.nil?
741
+ command.query['fields'] = fields unless fields.nil?
742
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
743
+ execute_or_queue_command(command, &block)
744
+ end
745
+
746
+ # Gets an existing return policy.
747
+ # @param [String] name
748
+ # Required. The name of the return policy to retrieve. Format: `accounts/`
749
+ # account`/onlineReturnPolicies/`return_policy``
750
+ # @param [String] fields
751
+ # Selector specifying which fields to include in a partial response.
752
+ # @param [String] quota_user
753
+ # Available to use for quota purposes for server-side applications. Can be any
754
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
755
+ # @param [Google::Apis::RequestOptions] options
756
+ # Request-specific options
757
+ #
758
+ # @yield [result, err] Result & error if block supplied
759
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::OnlineReturnPolicy] parsed result object
760
+ # @yieldparam err [StandardError] error object if request failed
761
+ #
762
+ # @return [Google::Apis::MerchantapiAccountsV1beta::OnlineReturnPolicy]
763
+ #
764
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
765
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
766
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
767
+ def get_account_online_return_policy(name, fields: nil, quota_user: nil, options: nil, &block)
768
+ command = make_simple_command(:get, 'accounts/v1beta/{+name}', options)
769
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::OnlineReturnPolicy::Representation
770
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::OnlineReturnPolicy
771
+ command.params['name'] = name unless name.nil?
772
+ command.query['fields'] = fields unless fields.nil?
773
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
774
+ execute_or_queue_command(command, &block)
775
+ end
776
+
777
+ # Lists all existing return policies.
778
+ # @param [String] parent
779
+ # Required. The merchant account for which to list return policies. Format: `
780
+ # accounts/`account``
781
+ # @param [Fixnum] page_size
782
+ # Optional. The maximum number of `OnlineReturnPolicy` resources to return. The
783
+ # service returns fewer than this value if the number of return policies for the
784
+ # given merchant is less that than the `pageSize`. The default value is 10. The
785
+ # maximum value is 100; If a value higher than the maximum is specified, then
786
+ # the `pageSize` will default to the maximum
787
+ # @param [String] page_token
788
+ # Optional. A page token, received from a previous `ListOnlineReturnPolicies`
789
+ # call. Provide the page token to retrieve the subsequent page. When paginating,
790
+ # all other parameters provided to `ListOnlineReturnPolicies` must match the
791
+ # call that provided the page token. The token returned as nextPageToken in the
792
+ # response to the previous request.
793
+ # @param [String] fields
794
+ # Selector specifying which fields to include in a partial response.
795
+ # @param [String] quota_user
796
+ # Available to use for quota purposes for server-side applications. Can be any
797
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
798
+ # @param [Google::Apis::RequestOptions] options
799
+ # Request-specific options
800
+ #
801
+ # @yield [result, err] Result & error if block supplied
802
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::ListOnlineReturnPoliciesResponse] parsed result object
803
+ # @yieldparam err [StandardError] error object if request failed
804
+ #
805
+ # @return [Google::Apis::MerchantapiAccountsV1beta::ListOnlineReturnPoliciesResponse]
806
+ #
807
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
808
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
809
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
810
+ def list_account_online_return_policies(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
811
+ command = make_simple_command(:get, 'accounts/v1beta/{+parent}/onlineReturnPolicies', options)
812
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::ListOnlineReturnPoliciesResponse::Representation
813
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::ListOnlineReturnPoliciesResponse
814
+ command.params['parent'] = parent unless parent.nil?
815
+ command.query['pageSize'] = page_size unless page_size.nil?
816
+ command.query['pageToken'] = page_token unless page_token.nil?
817
+ command.query['fields'] = fields unless fields.nil?
818
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
819
+ execute_or_queue_command(command, &block)
820
+ end
821
+
822
+ # Disable participation in the specified program for the account. Executing this
823
+ # method requires admin access.
824
+ # @param [String] name
825
+ # Required. The name of the program for which to disable participation for the
826
+ # given account. Format: `accounts/`account`/programs/`program``
827
+ # @param [Google::Apis::MerchantapiAccountsV1beta::DisableProgramRequest] disable_program_request_object
828
+ # @param [String] fields
829
+ # Selector specifying which fields to include in a partial response.
830
+ # @param [String] quota_user
831
+ # Available to use for quota purposes for server-side applications. Can be any
832
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
833
+ # @param [Google::Apis::RequestOptions] options
834
+ # Request-specific options
835
+ #
836
+ # @yield [result, err] Result & error if block supplied
837
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Program] parsed result object
838
+ # @yieldparam err [StandardError] error object if request failed
839
+ #
840
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Program]
841
+ #
842
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
843
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
844
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
845
+ def disable_program(name, disable_program_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
846
+ command = make_simple_command(:post, 'accounts/v1beta/{+name}:disable', options)
847
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::DisableProgramRequest::Representation
848
+ command.request_object = disable_program_request_object
849
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Program::Representation
850
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Program
851
+ command.params['name'] = name unless name.nil?
852
+ command.query['fields'] = fields unless fields.nil?
853
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
854
+ execute_or_queue_command(command, &block)
855
+ end
856
+
857
+ # Enable participation in the specified program for the account. Executing this
858
+ # method requires admin access.
859
+ # @param [String] name
860
+ # Required. The name of the program for which to enable participation for the
861
+ # given account. Format: `accounts/`account`/programs/`program``
862
+ # @param [Google::Apis::MerchantapiAccountsV1beta::EnableProgramRequest] enable_program_request_object
863
+ # @param [String] fields
864
+ # Selector specifying which fields to include in a partial response.
865
+ # @param [String] quota_user
866
+ # Available to use for quota purposes for server-side applications. Can be any
867
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
868
+ # @param [Google::Apis::RequestOptions] options
869
+ # Request-specific options
870
+ #
871
+ # @yield [result, err] Result & error if block supplied
872
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Program] parsed result object
873
+ # @yieldparam err [StandardError] error object if request failed
874
+ #
875
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Program]
876
+ #
877
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
878
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
879
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
880
+ def enable_program(name, enable_program_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
881
+ command = make_simple_command(:post, 'accounts/v1beta/{+name}:enable', options)
882
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::EnableProgramRequest::Representation
883
+ command.request_object = enable_program_request_object
884
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Program::Representation
885
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Program
886
+ command.params['name'] = name unless name.nil?
887
+ command.query['fields'] = fields unless fields.nil?
888
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
889
+ execute_or_queue_command(command, &block)
890
+ end
891
+
892
+ # Retrieves the specified program for the account.
893
+ # @param [String] name
894
+ # Required. The name of the program to retrieve. Format: `accounts/`account`/
895
+ # programs/`program``
896
+ # @param [String] fields
897
+ # Selector specifying which fields to include in a partial response.
898
+ # @param [String] quota_user
899
+ # Available to use for quota purposes for server-side applications. Can be any
900
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
901
+ # @param [Google::Apis::RequestOptions] options
902
+ # Request-specific options
903
+ #
904
+ # @yield [result, err] Result & error if block supplied
905
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Program] parsed result object
906
+ # @yieldparam err [StandardError] error object if request failed
907
+ #
908
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Program]
909
+ #
910
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
911
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
912
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
913
+ def get_account_program(name, fields: nil, quota_user: nil, options: nil, &block)
914
+ command = make_simple_command(:get, 'accounts/v1beta/{+name}', options)
915
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Program::Representation
916
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Program
917
+ command.params['name'] = name unless name.nil?
918
+ command.query['fields'] = fields unless fields.nil?
919
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
920
+ execute_or_queue_command(command, &block)
921
+ end
922
+
923
+ # Retrieves all programs for the account.
924
+ # @param [String] parent
925
+ # Required. The name of the account for which to retrieve all programs. Format: `
926
+ # accounts/`account``
927
+ # @param [Fixnum] page_size
928
+ # Optional. The maximum number of programs to return in a single response. If
929
+ # unspecified (or 0), a default size of 1000 is used. The maximum value is 1000;
930
+ # values above 1000 will be coerced to 1000.
931
+ # @param [String] page_token
932
+ # Optional. A continuation token, received from a previous `ListPrograms` call.
933
+ # Provide this to retrieve the next page.
934
+ # @param [String] fields
935
+ # Selector specifying which fields to include in a partial response.
936
+ # @param [String] quota_user
937
+ # Available to use for quota purposes for server-side applications. Can be any
938
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
939
+ # @param [Google::Apis::RequestOptions] options
940
+ # Request-specific options
941
+ #
942
+ # @yield [result, err] Result & error if block supplied
943
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::ListProgramsResponse] parsed result object
944
+ # @yieldparam err [StandardError] error object if request failed
945
+ #
946
+ # @return [Google::Apis::MerchantapiAccountsV1beta::ListProgramsResponse]
947
+ #
948
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
949
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
950
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
951
+ def list_account_programs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
952
+ command = make_simple_command(:get, 'accounts/v1beta/{+parent}/programs', options)
953
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::ListProgramsResponse::Representation
954
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::ListProgramsResponse
955
+ command.params['parent'] = parent unless parent.nil?
956
+ command.query['pageSize'] = page_size unless page_size.nil?
957
+ command.query['pageToken'] = page_token unless page_token.nil?
958
+ command.query['fields'] = fields unless fields.nil?
959
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
960
+ execute_or_queue_command(command, &block)
961
+ end
962
+
963
+ # Creates a region definition in your Merchant Center account. Executing this
964
+ # method requires admin access.
965
+ # @param [String] parent
966
+ # Required. The account to create a region for. Format: `accounts/`account``
967
+ # @param [Google::Apis::MerchantapiAccountsV1beta::Region] region_object
968
+ # @param [String] region_id
969
+ # Required. The identifier for the region, unique over all regions of the same
970
+ # account.
971
+ # @param [String] fields
972
+ # Selector specifying which fields to include in a partial response.
973
+ # @param [String] quota_user
974
+ # Available to use for quota purposes for server-side applications. Can be any
975
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
976
+ # @param [Google::Apis::RequestOptions] options
977
+ # Request-specific options
978
+ #
979
+ # @yield [result, err] Result & error if block supplied
980
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Region] parsed result object
981
+ # @yieldparam err [StandardError] error object if request failed
982
+ #
983
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Region]
984
+ #
985
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
986
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
987
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
988
+ def create_account_region(parent, region_object = nil, region_id: nil, fields: nil, quota_user: nil, options: nil, &block)
989
+ command = make_simple_command(:post, 'accounts/v1beta/{+parent}/regions', options)
990
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::Region::Representation
991
+ command.request_object = region_object
992
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Region::Representation
993
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Region
994
+ command.params['parent'] = parent unless parent.nil?
995
+ command.query['regionId'] = region_id unless region_id.nil?
996
+ command.query['fields'] = fields unless fields.nil?
997
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
998
+ execute_or_queue_command(command, &block)
999
+ end
1000
+
1001
+ # Deletes a region definition from your Merchant Center account. Executing this
1002
+ # method requires admin access.
1003
+ # @param [String] name
1004
+ # Required. The name of the region to delete. Format: `accounts/`account`/
1005
+ # regions/`region``
1006
+ # @param [String] fields
1007
+ # Selector specifying which fields to include in a partial response.
1008
+ # @param [String] quota_user
1009
+ # Available to use for quota purposes for server-side applications. Can be any
1010
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1011
+ # @param [Google::Apis::RequestOptions] options
1012
+ # Request-specific options
1013
+ #
1014
+ # @yield [result, err] Result & error if block supplied
1015
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Empty] parsed result object
1016
+ # @yieldparam err [StandardError] error object if request failed
1017
+ #
1018
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Empty]
1019
+ #
1020
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1021
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1022
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1023
+ def delete_account_region(name, fields: nil, quota_user: nil, options: nil, &block)
1024
+ command = make_simple_command(:delete, 'accounts/v1beta/{+name}', options)
1025
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Empty::Representation
1026
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Empty
1027
+ command.params['name'] = name unless name.nil?
1028
+ command.query['fields'] = fields unless fields.nil?
1029
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1030
+ execute_or_queue_command(command, &block)
1031
+ end
1032
+
1033
+ # Retrieves a region defined in your Merchant Center account.
1034
+ # @param [String] name
1035
+ # Required. The name of the region to retrieve. Format: `accounts/`account`/
1036
+ # regions/`region``
1037
+ # @param [String] fields
1038
+ # Selector specifying which fields to include in a partial response.
1039
+ # @param [String] quota_user
1040
+ # Available to use for quota purposes for server-side applications. Can be any
1041
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1042
+ # @param [Google::Apis::RequestOptions] options
1043
+ # Request-specific options
1044
+ #
1045
+ # @yield [result, err] Result & error if block supplied
1046
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Region] parsed result object
1047
+ # @yieldparam err [StandardError] error object if request failed
1048
+ #
1049
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Region]
1050
+ #
1051
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1052
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1053
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1054
+ def get_account_region(name, fields: nil, quota_user: nil, options: nil, &block)
1055
+ command = make_simple_command(:get, 'accounts/v1beta/{+name}', options)
1056
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Region::Representation
1057
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Region
1058
+ command.params['name'] = name unless name.nil?
1059
+ command.query['fields'] = fields unless fields.nil?
1060
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1061
+ execute_or_queue_command(command, &block)
1062
+ end
1063
+
1064
+ # Lists the regions in your Merchant Center account.
1065
+ # @param [String] parent
1066
+ # Required. The account to list regions for. Format: `accounts/`account``
1067
+ # @param [Fixnum] page_size
1068
+ # Optional. The maximum number of regions to return. The service may return
1069
+ # fewer than this value. If unspecified, at most 50 regions will be returned.
1070
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
1071
+ # @param [String] page_token
1072
+ # Optional. A page token, received from a previous `ListRegions` call. Provide
1073
+ # this to retrieve the subsequent page. When paginating, all other parameters
1074
+ # provided to `ListRegions` must match the call that provided the page token.
1075
+ # @param [String] fields
1076
+ # Selector specifying which fields to include in a partial response.
1077
+ # @param [String] quota_user
1078
+ # Available to use for quota purposes for server-side applications. Can be any
1079
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1080
+ # @param [Google::Apis::RequestOptions] options
1081
+ # Request-specific options
1082
+ #
1083
+ # @yield [result, err] Result & error if block supplied
1084
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::ListRegionsResponse] parsed result object
1085
+ # @yieldparam err [StandardError] error object if request failed
1086
+ #
1087
+ # @return [Google::Apis::MerchantapiAccountsV1beta::ListRegionsResponse]
1088
+ #
1089
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1090
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1091
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1092
+ def list_account_regions(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1093
+ command = make_simple_command(:get, 'accounts/v1beta/{+parent}/regions', options)
1094
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::ListRegionsResponse::Representation
1095
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::ListRegionsResponse
1096
+ command.params['parent'] = parent unless parent.nil?
1097
+ command.query['pageSize'] = page_size unless page_size.nil?
1098
+ command.query['pageToken'] = page_token unless page_token.nil?
1099
+ command.query['fields'] = fields unless fields.nil?
1100
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1101
+ execute_or_queue_command(command, &block)
1102
+ end
1103
+
1104
+ # Updates a region definition in your Merchant Center account. Executing this
1105
+ # method requires admin access.
1106
+ # @param [String] name
1107
+ # Identifier. The resource name of the region. Format: `accounts/`account`/
1108
+ # regions/`region``
1109
+ # @param [Google::Apis::MerchantapiAccountsV1beta::Region] region_object
1110
+ # @param [String] update_mask
1111
+ # Optional. The comma-separated field mask indicating the fields to update.
1112
+ # Example: `"displayName,postalCodeArea.regionCode"`.
1113
+ # @param [String] fields
1114
+ # Selector specifying which fields to include in a partial response.
1115
+ # @param [String] quota_user
1116
+ # Available to use for quota purposes for server-side applications. Can be any
1117
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1118
+ # @param [Google::Apis::RequestOptions] options
1119
+ # Request-specific options
1120
+ #
1121
+ # @yield [result, err] Result & error if block supplied
1122
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Region] parsed result object
1123
+ # @yieldparam err [StandardError] error object if request failed
1124
+ #
1125
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Region]
1126
+ #
1127
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1128
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1129
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1130
+ def patch_account_region(name, region_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
1131
+ command = make_simple_command(:patch, 'accounts/v1beta/{+name}', options)
1132
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::Region::Representation
1133
+ command.request_object = region_object
1134
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Region::Representation
1135
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Region
1136
+ command.params['name'] = name unless name.nil?
1137
+ command.query['updateMask'] = update_mask unless update_mask.nil?
1138
+ command.query['fields'] = fields unless fields.nil?
1139
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1140
+ execute_or_queue_command(command, &block)
1141
+ end
1142
+
1143
+ # Replace the shipping setting of a merchant with the request shipping setting.
1144
+ # Executing this method requires admin access.
1145
+ # @param [String] parent
1146
+ # Required. The account where this product will be inserted. Format: accounts/`
1147
+ # account`
1148
+ # @param [Google::Apis::MerchantapiAccountsV1beta::ShippingSettings] shipping_settings_object
1149
+ # @param [String] fields
1150
+ # Selector specifying which fields to include in a partial response.
1151
+ # @param [String] quota_user
1152
+ # Available to use for quota purposes for server-side applications. Can be any
1153
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1154
+ # @param [Google::Apis::RequestOptions] options
1155
+ # Request-specific options
1156
+ #
1157
+ # @yield [result, err] Result & error if block supplied
1158
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::ShippingSettings] parsed result object
1159
+ # @yieldparam err [StandardError] error object if request failed
1160
+ #
1161
+ # @return [Google::Apis::MerchantapiAccountsV1beta::ShippingSettings]
1162
+ #
1163
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1164
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1165
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1166
+ def insert_account_shipping_setting(parent, shipping_settings_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1167
+ command = make_simple_command(:post, 'accounts/v1beta/{+parent}/shippingSettings:insert', options)
1168
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::ShippingSettings::Representation
1169
+ command.request_object = shipping_settings_object
1170
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::ShippingSettings::Representation
1171
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::ShippingSettings
1172
+ command.params['parent'] = parent unless parent.nil?
1173
+ command.query['fields'] = fields unless fields.nil?
1174
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1175
+ execute_or_queue_command(command, &block)
1176
+ end
1177
+
1178
+ # Returns the state of a terms of service agreement.
1179
+ # @param [String] name
1180
+ # Required. The resource name of the terms of service version. Format: `accounts/
1181
+ # `account`/termsOfServiceAgreementState/`identifier``
1182
+ # @param [String] fields
1183
+ # Selector specifying which fields to include in a partial response.
1184
+ # @param [String] quota_user
1185
+ # Available to use for quota purposes for server-side applications. Can be any
1186
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1187
+ # @param [Google::Apis::RequestOptions] options
1188
+ # Request-specific options
1189
+ #
1190
+ # @yield [result, err] Result & error if block supplied
1191
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::TermsOfServiceAgreementState] parsed result object
1192
+ # @yieldparam err [StandardError] error object if request failed
1193
+ #
1194
+ # @return [Google::Apis::MerchantapiAccountsV1beta::TermsOfServiceAgreementState]
1195
+ #
1196
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1197
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1198
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1199
+ def get_account_terms_of_service_agreement_state(name, fields: nil, quota_user: nil, options: nil, &block)
1200
+ command = make_simple_command(:get, 'accounts/v1beta/{+name}', options)
1201
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::TermsOfServiceAgreementState::Representation
1202
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::TermsOfServiceAgreementState
1203
+ command.params['name'] = name unless name.nil?
1204
+ command.query['fields'] = fields unless fields.nil?
1205
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1206
+ execute_or_queue_command(command, &block)
1207
+ end
1208
+
1209
+ # Retrieves the state of the agreement for the application terms of service.
1210
+ # @param [String] parent
1211
+ # Required. The account for which to get a TermsOfServiceAgreementState Format: `
1212
+ # accounts/`account``
1213
+ # @param [String] fields
1214
+ # Selector specifying which fields to include in a partial response.
1215
+ # @param [String] quota_user
1216
+ # Available to use for quota purposes for server-side applications. Can be any
1217
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1218
+ # @param [Google::Apis::RequestOptions] options
1219
+ # Request-specific options
1220
+ #
1221
+ # @yield [result, err] Result & error if block supplied
1222
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::TermsOfServiceAgreementState] parsed result object
1223
+ # @yieldparam err [StandardError] error object if request failed
1224
+ #
1225
+ # @return [Google::Apis::MerchantapiAccountsV1beta::TermsOfServiceAgreementState]
1226
+ #
1227
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1228
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1229
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1230
+ def retrieve_account_terms_of_service_agreement_state_for_application(parent, fields: nil, quota_user: nil, options: nil, &block)
1231
+ command = make_simple_command(:get, 'accounts/v1beta/{+parent}/termsOfServiceAgreementStates:retrieveForApplication', options)
1232
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::TermsOfServiceAgreementState::Representation
1233
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::TermsOfServiceAgreementState
1234
+ command.params['parent'] = parent unless parent.nil?
1235
+ command.query['fields'] = fields unless fields.nil?
1236
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1237
+ execute_or_queue_command(command, &block)
1238
+ end
1239
+
1240
+ # Creates a Merchant Center account user. Executing this method requires admin
1241
+ # access.
1242
+ # @param [String] parent
1243
+ # Required. The resource name of the account for which a user will be created.
1244
+ # Format: `accounts/`account``
1245
+ # @param [Google::Apis::MerchantapiAccountsV1beta::User] user_object
1246
+ # @param [String] user_id
1247
+ # Required. The email address of the user (for example, `john.doe@gmail.com`).
1248
+ # @param [String] fields
1249
+ # Selector specifying which fields to include in a partial response.
1250
+ # @param [String] quota_user
1251
+ # Available to use for quota purposes for server-side applications. Can be any
1252
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1253
+ # @param [Google::Apis::RequestOptions] options
1254
+ # Request-specific options
1255
+ #
1256
+ # @yield [result, err] Result & error if block supplied
1257
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::User] parsed result object
1258
+ # @yieldparam err [StandardError] error object if request failed
1259
+ #
1260
+ # @return [Google::Apis::MerchantapiAccountsV1beta::User]
1261
+ #
1262
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1263
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1264
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1265
+ def create_account_user(parent, user_object = nil, user_id: nil, fields: nil, quota_user: nil, options: nil, &block)
1266
+ command = make_simple_command(:post, 'accounts/v1beta/{+parent}/users', options)
1267
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::User::Representation
1268
+ command.request_object = user_object
1269
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::User::Representation
1270
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::User
1271
+ command.params['parent'] = parent unless parent.nil?
1272
+ command.query['userId'] = user_id unless user_id.nil?
1273
+ command.query['fields'] = fields unless fields.nil?
1274
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1275
+ execute_or_queue_command(command, &block)
1276
+ end
1277
+
1278
+ # Deletes a Merchant Center account user. Executing this method requires admin
1279
+ # access.
1280
+ # @param [String] name
1281
+ # Required. The name of the user to delete. Format: `accounts/`account`/users/`
1282
+ # email`` It is also possible to delete the user corresponding to the caller by
1283
+ # using `me` rather than an email address as in `accounts/`account`/users/me`.
1284
+ # @param [String] fields
1285
+ # Selector specifying which fields to include in a partial response.
1286
+ # @param [String] quota_user
1287
+ # Available to use for quota purposes for server-side applications. Can be any
1288
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1289
+ # @param [Google::Apis::RequestOptions] options
1290
+ # Request-specific options
1291
+ #
1292
+ # @yield [result, err] Result & error if block supplied
1293
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Empty] parsed result object
1294
+ # @yieldparam err [StandardError] error object if request failed
1295
+ #
1296
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Empty]
1297
+ #
1298
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1299
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1300
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1301
+ def delete_account_user(name, fields: nil, quota_user: nil, options: nil, &block)
1302
+ command = make_simple_command(:delete, 'accounts/v1beta/{+name}', options)
1303
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Empty::Representation
1304
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Empty
1305
+ command.params['name'] = name unless name.nil?
1306
+ command.query['fields'] = fields unless fields.nil?
1307
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1308
+ execute_or_queue_command(command, &block)
1309
+ end
1310
+
1311
+ # Retrieves a Merchant Center account user.
1312
+ # @param [String] name
1313
+ # Required. The name of the user to retrieve. Format: `accounts/`account`/users/`
1314
+ # email`` It is also possible to retrieve the user corresponding to the caller
1315
+ # by using `me` rather than an email address as in `accounts/`account`/users/me`.
1316
+ # @param [String] fields
1317
+ # Selector specifying which fields to include in a partial response.
1318
+ # @param [String] quota_user
1319
+ # Available to use for quota purposes for server-side applications. Can be any
1320
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1321
+ # @param [Google::Apis::RequestOptions] options
1322
+ # Request-specific options
1323
+ #
1324
+ # @yield [result, err] Result & error if block supplied
1325
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::User] parsed result object
1326
+ # @yieldparam err [StandardError] error object if request failed
1327
+ #
1328
+ # @return [Google::Apis::MerchantapiAccountsV1beta::User]
1329
+ #
1330
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1331
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1332
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1333
+ def get_account_user(name, fields: nil, quota_user: nil, options: nil, &block)
1334
+ command = make_simple_command(:get, 'accounts/v1beta/{+name}', options)
1335
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::User::Representation
1336
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::User
1337
+ command.params['name'] = name unless name.nil?
1338
+ command.query['fields'] = fields unless fields.nil?
1339
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1340
+ execute_or_queue_command(command, &block)
1341
+ end
1342
+
1343
+ # Returns the email preferences for a Merchant Center account user. Use the name=
1344
+ # accounts/*/users/me/emailPreferences alias to get preferences for the
1345
+ # authenticated user.
1346
+ # @param [String] name
1347
+ # Required. The name of the `EmailPreferences` resource. Format: `accounts/`
1348
+ # account`/users/`email`/emailPreferences`
1349
+ # @param [String] fields
1350
+ # Selector specifying which fields to include in a partial response.
1351
+ # @param [String] quota_user
1352
+ # Available to use for quota purposes for server-side applications. Can be any
1353
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1354
+ # @param [Google::Apis::RequestOptions] options
1355
+ # Request-specific options
1356
+ #
1357
+ # @yield [result, err] Result & error if block supplied
1358
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::EmailPreferences] parsed result object
1359
+ # @yieldparam err [StandardError] error object if request failed
1360
+ #
1361
+ # @return [Google::Apis::MerchantapiAccountsV1beta::EmailPreferences]
1362
+ #
1363
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1364
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1365
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1366
+ def get_account_user_email_preferences(name, fields: nil, quota_user: nil, options: nil, &block)
1367
+ command = make_simple_command(:get, 'accounts/v1beta/{+name}', options)
1368
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::EmailPreferences::Representation
1369
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::EmailPreferences
1370
+ command.params['name'] = name unless name.nil?
1371
+ command.query['fields'] = fields unless fields.nil?
1372
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1373
+ execute_or_queue_command(command, &block)
1374
+ end
1375
+
1376
+ # Lists all users of a Merchant Center account.
1377
+ # @param [String] parent
1378
+ # Required. The parent, which owns this collection of users. Format: `accounts/`
1379
+ # account``
1380
+ # @param [Fixnum] page_size
1381
+ # Optional. The maximum number of users to return. The service may return fewer
1382
+ # than this value. If unspecified, at most 50 users will be returned. The
1383
+ # maximum value is 100; values above 100 will be coerced to 100
1384
+ # @param [String] page_token
1385
+ # Optional. A page token, received from a previous `ListUsers` call. Provide
1386
+ # this to retrieve the subsequent page. When paginating, all other parameters
1387
+ # provided to `ListUsers` must match the call that provided the page token.
1388
+ # @param [String] fields
1389
+ # Selector specifying which fields to include in a partial response.
1390
+ # @param [String] quota_user
1391
+ # Available to use for quota purposes for server-side applications. Can be any
1392
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1393
+ # @param [Google::Apis::RequestOptions] options
1394
+ # Request-specific options
1395
+ #
1396
+ # @yield [result, err] Result & error if block supplied
1397
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::ListUsersResponse] parsed result object
1398
+ # @yieldparam err [StandardError] error object if request failed
1399
+ #
1400
+ # @return [Google::Apis::MerchantapiAccountsV1beta::ListUsersResponse]
1401
+ #
1402
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1403
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1404
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1405
+ def list_account_users(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1406
+ command = make_simple_command(:get, 'accounts/v1beta/{+parent}/users', options)
1407
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::ListUsersResponse::Representation
1408
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::ListUsersResponse
1409
+ command.params['parent'] = parent unless parent.nil?
1410
+ command.query['pageSize'] = page_size unless page_size.nil?
1411
+ command.query['pageToken'] = page_token unless page_token.nil?
1412
+ command.query['fields'] = fields unless fields.nil?
1413
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1414
+ execute_or_queue_command(command, &block)
1415
+ end
1416
+
1417
+ # Updates a Merchant Center account user. Executing this method requires admin
1418
+ # access.
1419
+ # @param [String] name
1420
+ # Identifier. The resource name of the user. Format: `accounts/`account`/user/`
1421
+ # email`` Use `me` to refer to your own email address, for example `accounts/`
1422
+ # account`/users/me`.
1423
+ # @param [Google::Apis::MerchantapiAccountsV1beta::User] user_object
1424
+ # @param [String] update_mask
1425
+ # Required. List of fields being updated.
1426
+ # @param [String] fields
1427
+ # Selector specifying which fields to include in a partial response.
1428
+ # @param [String] quota_user
1429
+ # Available to use for quota purposes for server-side applications. Can be any
1430
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1431
+ # @param [Google::Apis::RequestOptions] options
1432
+ # Request-specific options
1433
+ #
1434
+ # @yield [result, err] Result & error if block supplied
1435
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::User] parsed result object
1436
+ # @yieldparam err [StandardError] error object if request failed
1437
+ #
1438
+ # @return [Google::Apis::MerchantapiAccountsV1beta::User]
1439
+ #
1440
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1441
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1442
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1443
+ def patch_account_user(name, user_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
1444
+ command = make_simple_command(:patch, 'accounts/v1beta/{+name}', options)
1445
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::User::Representation
1446
+ command.request_object = user_object
1447
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::User::Representation
1448
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::User
1449
+ command.params['name'] = name unless name.nil?
1450
+ command.query['updateMask'] = update_mask unless update_mask.nil?
1451
+ command.query['fields'] = fields unless fields.nil?
1452
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1453
+ execute_or_queue_command(command, &block)
1454
+ end
1455
+
1456
+ # Updates the email preferences for a Merchant Center account user. MCA users
1457
+ # should specify the MCA account rather than a sub-account of the MCA.
1458
+ # Preferences which are not explicitly selected in the update mask will not be
1459
+ # updated. It is invalid for updates to specify an UNCONFIRMED opt-in status
1460
+ # value. Use the name=accounts/*/users/me/emailPreferences alias to update
1461
+ # preferences for the authenticated user.
1462
+ # @param [String] name
1463
+ # Identifier. The name of the EmailPreferences. The endpoint is only supported
1464
+ # for the authenticated user.
1465
+ # @param [Google::Apis::MerchantapiAccountsV1beta::EmailPreferences] email_preferences_object
1466
+ # @param [String] update_mask
1467
+ # Required. List of fields being updated.
1468
+ # @param [String] fields
1469
+ # Selector specifying which fields to include in a partial response.
1470
+ # @param [String] quota_user
1471
+ # Available to use for quota purposes for server-side applications. Can be any
1472
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1473
+ # @param [Google::Apis::RequestOptions] options
1474
+ # Request-specific options
1475
+ #
1476
+ # @yield [result, err] Result & error if block supplied
1477
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::EmailPreferences] parsed result object
1478
+ # @yieldparam err [StandardError] error object if request failed
1479
+ #
1480
+ # @return [Google::Apis::MerchantapiAccountsV1beta::EmailPreferences]
1481
+ #
1482
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1483
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1484
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1485
+ def update_account_user_email_preferences(name, email_preferences_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
1486
+ command = make_simple_command(:patch, 'accounts/v1beta/{+name}', options)
1487
+ command.request_representation = Google::Apis::MerchantapiAccountsV1beta::EmailPreferences::Representation
1488
+ command.request_object = email_preferences_object
1489
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::EmailPreferences::Representation
1490
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::EmailPreferences
1491
+ command.params['name'] = name unless name.nil?
1492
+ command.query['updateMask'] = update_mask unless update_mask.nil?
1493
+ command.query['fields'] = fields unless fields.nil?
1494
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1495
+ execute_or_queue_command(command, &block)
1496
+ end
1497
+
1498
+ # Accepts a `TermsOfService`. Executing this method requires admin access.
1499
+ # @param [String] name
1500
+ # Required. The resource name of the terms of service version. Format: `
1501
+ # termsOfService/`version``
1502
+ # @param [String] account
1503
+ # Required. The account for which to accept the ToS.
1504
+ # @param [String] region_code
1505
+ # Required. Region code as defined by [CLDR](https://cldr.unicode.org/). This is
1506
+ # either a country when the ToS applies specifically to that country or 001 when
1507
+ # it applies globally.
1508
+ # @param [String] fields
1509
+ # Selector specifying which fields to include in a partial response.
1510
+ # @param [String] quota_user
1511
+ # Available to use for quota purposes for server-side applications. Can be any
1512
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1513
+ # @param [Google::Apis::RequestOptions] options
1514
+ # Request-specific options
1515
+ #
1516
+ # @yield [result, err] Result & error if block supplied
1517
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::Empty] parsed result object
1518
+ # @yieldparam err [StandardError] error object if request failed
1519
+ #
1520
+ # @return [Google::Apis::MerchantapiAccountsV1beta::Empty]
1521
+ #
1522
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1523
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1524
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1525
+ def accept_terms_of_service(name, account: nil, region_code: nil, fields: nil, quota_user: nil, options: nil, &block)
1526
+ command = make_simple_command(:get, 'accounts/v1beta/{+name}:accept', options)
1527
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::Empty::Representation
1528
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::Empty
1529
+ command.params['name'] = name unless name.nil?
1530
+ command.query['account'] = account unless account.nil?
1531
+ command.query['regionCode'] = region_code unless region_code.nil?
1532
+ command.query['fields'] = fields unless fields.nil?
1533
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1534
+ execute_or_queue_command(command, &block)
1535
+ end
1536
+
1537
+ # Retrieves the `TermsOfService` associated with the provided version.
1538
+ # @param [String] name
1539
+ # Required. The resource name of the terms of service version. Format: `
1540
+ # termsOfService/`version``
1541
+ # @param [String] fields
1542
+ # Selector specifying which fields to include in a partial response.
1543
+ # @param [String] quota_user
1544
+ # Available to use for quota purposes for server-side applications. Can be any
1545
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1546
+ # @param [Google::Apis::RequestOptions] options
1547
+ # Request-specific options
1548
+ #
1549
+ # @yield [result, err] Result & error if block supplied
1550
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::TermsOfService] parsed result object
1551
+ # @yieldparam err [StandardError] error object if request failed
1552
+ #
1553
+ # @return [Google::Apis::MerchantapiAccountsV1beta::TermsOfService]
1554
+ #
1555
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1556
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1557
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1558
+ def get_terms_of_service(name, fields: nil, quota_user: nil, options: nil, &block)
1559
+ command = make_simple_command(:get, 'accounts/v1beta/{+name}', options)
1560
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::TermsOfService::Representation
1561
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::TermsOfService
1562
+ command.params['name'] = name unless name.nil?
1563
+ command.query['fields'] = fields unless fields.nil?
1564
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1565
+ execute_or_queue_command(command, &block)
1566
+ end
1567
+
1568
+ # Retrieves the latest version of the `TermsOfService` for a given `kind` and `
1569
+ # region_code`.
1570
+ # @param [String] kind
1571
+ # The Kind this terms of service version applies to.
1572
+ # @param [String] region_code
1573
+ # Region code as defined by [CLDR](https://cldr.unicode.org/). This is either a
1574
+ # country when the ToS applies specifically to that country or 001 when it
1575
+ # applies globally.
1576
+ # @param [String] fields
1577
+ # Selector specifying which fields to include in a partial response.
1578
+ # @param [String] quota_user
1579
+ # Available to use for quota purposes for server-side applications. Can be any
1580
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1581
+ # @param [Google::Apis::RequestOptions] options
1582
+ # Request-specific options
1583
+ #
1584
+ # @yield [result, err] Result & error if block supplied
1585
+ # @yieldparam result [Google::Apis::MerchantapiAccountsV1beta::TermsOfService] parsed result object
1586
+ # @yieldparam err [StandardError] error object if request failed
1587
+ #
1588
+ # @return [Google::Apis::MerchantapiAccountsV1beta::TermsOfService]
1589
+ #
1590
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1591
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1592
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1593
+ def retrieve_terms_of_service_latest(kind: nil, region_code: nil, fields: nil, quota_user: nil, options: nil, &block)
1594
+ command = make_simple_command(:get, 'accounts/v1beta/termsOfService:retrieveLatest', options)
1595
+ command.response_representation = Google::Apis::MerchantapiAccountsV1beta::TermsOfService::Representation
1596
+ command.response_class = Google::Apis::MerchantapiAccountsV1beta::TermsOfService
1597
+ command.query['kind'] = kind unless kind.nil?
1598
+ command.query['regionCode'] = region_code unless region_code.nil?
1599
+ command.query['fields'] = fields unless fields.nil?
1600
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1601
+ execute_or_queue_command(command, &block)
1602
+ end
1603
+
1604
+ protected
1605
+
1606
+ def apply_command_defaults(command)
1607
+ command.query['key'] = key unless key.nil?
1608
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1609
+ end
1610
+ end
1611
+ end
1612
+ end
1613
+ end