@googleapis/merchantapi 8.0.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -692,6 +692,19 @@ export declare namespace merchantapi_accounts_v1beta {
692
692
  */
693
693
  warehouseBasedDeliveryTimes?: Schema$WarehouseBasedDeliveryTime[];
694
694
  }
695
+ /**
696
+ * Represents a developer registration owned by a Merchant account.
697
+ */
698
+ export interface Schema$DeveloperRegistration {
699
+ /**
700
+ * Output only. The GCP ids attached to this developer registration
701
+ */
702
+ gcpIds?: string[] | null;
703
+ /**
704
+ * Identifier. The `name` (ID) of the developer registration. Generated by the Content API upon creation of a new `DeveloperRegistration`. The `account` represents the merchant ID of the merchant that owns the registration.
705
+ */
706
+ name?: string | null;
707
+ }
695
708
  /**
696
709
  * Request message for the DisableProgram method.
697
710
  */
@@ -1280,7 +1293,7 @@ export declare namespace merchantapi_accounts_v1beta {
1280
1293
  */
1281
1294
  itemConditions?: string[] | null;
1282
1295
  /**
1283
- * Required. Immutable. This field represents the unique user-defined label of the return policy. It is important to note that the same label cannot be used in different return policies for the same country. Unless a product specifies a specific label attribute, policies will be automatically labeled as 'default'. To assign a custom return policy to certain product groups, follow the instructions provided in the [Return policy label] (https://support.google.com/merchants/answer/9445425). The label can contain up to 50 characters.
1296
+ * Optional. Immutable. This field represents the unique user-defined label of the return policy for the given country. It is important to note that the same label cannot be used in different return policies for the same country. If not given, policies will be automatically treated as the 'default' for the country. When using label, you are creating an exception policy in that country to assign a custom return policy to certain product groups, follow the instructions provided in the [Return policy label] (https://support.google.com/merchants/answer/9445425). The label can contain up to 50 characters.
1284
1297
  */
1285
1298
  label?: string | null;
1286
1299
  /**
@@ -1618,6 +1631,15 @@ export declare namespace merchantapi_accounts_v1beta {
1618
1631
  */
1619
1632
  shippingEligible?: boolean | null;
1620
1633
  }
1634
+ /**
1635
+ * Request message for the RegisterGCP method.
1636
+ */
1637
+ export interface Schema$RegisterGCPRequest {
1638
+ /**
1639
+ * Immutable. If the developer email provided is associated with a user in the merchant account provided, the user will be updated to have "API developer" access type and the email preference corresponding to that user will be updated to have the new "API notifications" preference. If the developer email provided is not associated with any user we will just add it as a contact. The email preference corresponding to that contact will have the new "API notifications" preference
1640
+ */
1641
+ developerEmail?: string | null;
1642
+ }
1621
1643
  /**
1622
1644
  * Request to reject an account service.
1623
1645
  */
@@ -1969,6 +1991,11 @@ export declare namespace merchantapi_accounts_v1beta {
1969
1991
  */
1970
1992
  export interface Schema$UnclaimHomepageRequest {
1971
1993
  }
1994
+ /**
1995
+ * Request message for the UnregisterGCP method.
1996
+ */
1997
+ export interface Schema$UnregisterGCPRequest {
1998
+ }
1972
1999
  /**
1973
2000
  * URL settings for cart or checkout URL.
1974
2001
  */
@@ -2098,6 +2125,7 @@ export declare namespace merchantapi_accounts_v1beta {
2098
2125
  automaticImprovements: Resource$Accounts$Automaticimprovements;
2099
2126
  businessIdentity: Resource$Accounts$Businessidentity;
2100
2127
  businessInfo: Resource$Accounts$Businessinfo;
2128
+ developerRegistration: Resource$Accounts$Developerregistration;
2101
2129
  emailPreferences: Resource$Accounts$Emailpreferences;
2102
2130
  gbpAccounts: Resource$Accounts$Gbpaccounts;
2103
2131
  homepage: Resource$Accounts$Homepage;
@@ -2312,6 +2340,67 @@ export declare namespace merchantapi_accounts_v1beta {
2312
2340
  get(params: Params$Resource$Accounts$Get, options: MethodOptions | BodyResponseCallback<Schema$Account>, callback: BodyResponseCallback<Schema$Account>): void;
2313
2341
  get(params: Params$Resource$Accounts$Get, callback: BodyResponseCallback<Schema$Account>): void;
2314
2342
  get(callback: BodyResponseCallback<Schema$Account>): void;
2343
+ /**
2344
+ * Retrieves a developer registration for a merchant.
2345
+ * @example
2346
+ * ```js
2347
+ * // Before running the sample:
2348
+ * // - Enable the API at:
2349
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
2350
+ * // - Login into gcloud by running:
2351
+ * // ```sh
2352
+ * // $ gcloud auth application-default login
2353
+ * // ```
2354
+ * // - Install the npm module by running:
2355
+ * // ```sh
2356
+ * // $ npm install googleapis
2357
+ * // ```
2358
+ *
2359
+ * const {google} = require('googleapis');
2360
+ * const merchantapi = google.merchantapi('accounts_v1beta');
2361
+ *
2362
+ * async function main() {
2363
+ * const auth = new google.auth.GoogleAuth({
2364
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2365
+ * scopes: ['https://www.googleapis.com/auth/content'],
2366
+ * });
2367
+ *
2368
+ * // Acquire an auth client, and bind it to all future calls
2369
+ * const authClient = await auth.getClient();
2370
+ * google.options({auth: authClient});
2371
+ *
2372
+ * // Do the magic
2373
+ * const res = await merchantapi.accounts.getDeveloperRegistration({
2374
+ * // Required. The `name` (ID) of the developer registration.
2375
+ * name: 'accounts/my-account/developerRegistration',
2376
+ * });
2377
+ * console.log(res.data);
2378
+ *
2379
+ * // Example response
2380
+ * // {
2381
+ * // "gcpIds": [],
2382
+ * // "name": "my_name"
2383
+ * // }
2384
+ * }
2385
+ *
2386
+ * main().catch(e => {
2387
+ * console.error(e);
2388
+ * throw e;
2389
+ * });
2390
+ *
2391
+ * ```
2392
+ *
2393
+ * @param params - Parameters for request
2394
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2395
+ * @param callback - Optional callback that handles the response.
2396
+ * @returns A promise if used with async/await, or void if used with a callback.
2397
+ */
2398
+ getDeveloperRegistration(params: Params$Resource$Accounts$Getdeveloperregistration, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
2399
+ getDeveloperRegistration(params?: Params$Resource$Accounts$Getdeveloperregistration, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$DeveloperRegistration>>;
2400
+ getDeveloperRegistration(params: Params$Resource$Accounts$Getdeveloperregistration, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
2401
+ getDeveloperRegistration(params: Params$Resource$Accounts$Getdeveloperregistration, options: MethodOptions | BodyResponseCallback<Schema$DeveloperRegistration>, callback: BodyResponseCallback<Schema$DeveloperRegistration>): void;
2402
+ getDeveloperRegistration(params: Params$Resource$Accounts$Getdeveloperregistration, callback: BodyResponseCallback<Schema$DeveloperRegistration>): void;
2403
+ getDeveloperRegistration(callback: BodyResponseCallback<Schema$DeveloperRegistration>): void;
2315
2404
  /**
2316
2405
  * Note: For the `accounts.list` method, quota and limits usage are charged for each user, and not for the Merchant Center ID or the advanced account ID. To list several sub-accounts, you should use the `accounts.listSubaccounts` method, which is more suitable for advanced accounts use case.
2317
2406
  * @example
@@ -2547,6 +2636,12 @@ export declare namespace merchantapi_accounts_v1beta {
2547
2636
  */
2548
2637
  name?: string;
2549
2638
  }
2639
+ export interface Params$Resource$Accounts$Getdeveloperregistration extends StandardParameters {
2640
+ /**
2641
+ * Required. The `name` (ID) of the developer registration.
2642
+ */
2643
+ name?: string;
2644
+ }
2550
2645
  export interface Params$Resource$Accounts$List extends StandardParameters {
2551
2646
  /**
2552
2647
  * Optional. Returns only accounts that match the [filter](https://developers.google.com/merchant/api/guides/accounts/filter). For more details, see the [filter syntax reference](https://developers.google.com/merchant/api/guides/accounts/filter-syntax).
@@ -3259,6 +3354,163 @@ export declare namespace merchantapi_accounts_v1beta {
3259
3354
  */
3260
3355
  requestBody?: Schema$BusinessInfo;
3261
3356
  }
3357
+ export class Resource$Accounts$Developerregistration {
3358
+ context: APIRequestContext;
3359
+ constructor(context: APIRequestContext);
3360
+ /**
3361
+ * Registers the GCP used for the API call to the shopping account passed in the request. Will create a user with an "API developer" and add the "developer_email" as a contact with "API notifications" email preference on.
3362
+ * @example
3363
+ * ```js
3364
+ * // Before running the sample:
3365
+ * // - Enable the API at:
3366
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
3367
+ * // - Login into gcloud by running:
3368
+ * // ```sh
3369
+ * // $ gcloud auth application-default login
3370
+ * // ```
3371
+ * // - Install the npm module by running:
3372
+ * // ```sh
3373
+ * // $ npm install googleapis
3374
+ * // ```
3375
+ *
3376
+ * const {google} = require('googleapis');
3377
+ * const merchantapi = google.merchantapi('accounts_v1beta');
3378
+ *
3379
+ * async function main() {
3380
+ * const auth = new google.auth.GoogleAuth({
3381
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3382
+ * scopes: ['https://www.googleapis.com/auth/content'],
3383
+ * });
3384
+ *
3385
+ * // Acquire an auth client, and bind it to all future calls
3386
+ * const authClient = await auth.getClient();
3387
+ * google.options({auth: authClient});
3388
+ *
3389
+ * // Do the magic
3390
+ * const res = await merchantapi.accounts.developerRegistration.registerGcp({
3391
+ * // Required. The name of the developer registration to be created for the merchant account that the GCP will be registered with. Format: `accounts/{account\}/developerRegistration`
3392
+ * name: 'accounts/my-account/developerRegistration',
3393
+ *
3394
+ * // Request body metadata
3395
+ * requestBody: {
3396
+ * // request body parameters
3397
+ * // {
3398
+ * // "developerEmail": "my_developerEmail"
3399
+ * // }
3400
+ * },
3401
+ * });
3402
+ * console.log(res.data);
3403
+ *
3404
+ * // Example response
3405
+ * // {
3406
+ * // "gcpIds": [],
3407
+ * // "name": "my_name"
3408
+ * // }
3409
+ * }
3410
+ *
3411
+ * main().catch(e => {
3412
+ * console.error(e);
3413
+ * throw e;
3414
+ * });
3415
+ *
3416
+ * ```
3417
+ *
3418
+ * @param params - Parameters for request
3419
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
3420
+ * @param callback - Optional callback that handles the response.
3421
+ * @returns A promise if used with async/await, or void if used with a callback.
3422
+ */
3423
+ registerGcp(params: Params$Resource$Accounts$Developerregistration$Registergcp, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
3424
+ registerGcp(params?: Params$Resource$Accounts$Developerregistration$Registergcp, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$DeveloperRegistration>>;
3425
+ registerGcp(params: Params$Resource$Accounts$Developerregistration$Registergcp, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
3426
+ registerGcp(params: Params$Resource$Accounts$Developerregistration$Registergcp, options: MethodOptions | BodyResponseCallback<Schema$DeveloperRegistration>, callback: BodyResponseCallback<Schema$DeveloperRegistration>): void;
3427
+ registerGcp(params: Params$Resource$Accounts$Developerregistration$Registergcp, callback: BodyResponseCallback<Schema$DeveloperRegistration>): void;
3428
+ registerGcp(callback: BodyResponseCallback<Schema$DeveloperRegistration>): void;
3429
+ /**
3430
+ * Unregister the calling GCP from the calling shopping account. Note that the GCP will still be able to access the API for at most 1 day from the unregister succussful call.
3431
+ * @example
3432
+ * ```js
3433
+ * // Before running the sample:
3434
+ * // - Enable the API at:
3435
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
3436
+ * // - Login into gcloud by running:
3437
+ * // ```sh
3438
+ * // $ gcloud auth application-default login
3439
+ * // ```
3440
+ * // - Install the npm module by running:
3441
+ * // ```sh
3442
+ * // $ npm install googleapis
3443
+ * // ```
3444
+ *
3445
+ * const {google} = require('googleapis');
3446
+ * const merchantapi = google.merchantapi('accounts_v1beta');
3447
+ *
3448
+ * async function main() {
3449
+ * const auth = new google.auth.GoogleAuth({
3450
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3451
+ * scopes: ['https://www.googleapis.com/auth/content'],
3452
+ * });
3453
+ *
3454
+ * // Acquire an auth client, and bind it to all future calls
3455
+ * const authClient = await auth.getClient();
3456
+ * google.options({auth: authClient});
3457
+ *
3458
+ * // Do the magic
3459
+ * const res = await merchantapi.accounts.developerRegistration.unregisterGcp({
3460
+ * // Required. The name of the developer registration to be created for the merchant account that the GCP will be registered with. Format: `accounts/{account\}/developerRegistration`
3461
+ * name: 'accounts/my-account/developerRegistration',
3462
+ *
3463
+ * // Request body metadata
3464
+ * requestBody: {
3465
+ * // request body parameters
3466
+ * // {}
3467
+ * },
3468
+ * });
3469
+ * console.log(res.data);
3470
+ *
3471
+ * // Example response
3472
+ * // {}
3473
+ * }
3474
+ *
3475
+ * main().catch(e => {
3476
+ * console.error(e);
3477
+ * throw e;
3478
+ * });
3479
+ *
3480
+ * ```
3481
+ *
3482
+ * @param params - Parameters for request
3483
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
3484
+ * @param callback - Optional callback that handles the response.
3485
+ * @returns A promise if used with async/await, or void if used with a callback.
3486
+ */
3487
+ unregisterGcp(params: Params$Resource$Accounts$Developerregistration$Unregistergcp, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
3488
+ unregisterGcp(params?: Params$Resource$Accounts$Developerregistration$Unregistergcp, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
3489
+ unregisterGcp(params: Params$Resource$Accounts$Developerregistration$Unregistergcp, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
3490
+ unregisterGcp(params: Params$Resource$Accounts$Developerregistration$Unregistergcp, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
3491
+ unregisterGcp(params: Params$Resource$Accounts$Developerregistration$Unregistergcp, callback: BodyResponseCallback<Schema$Empty>): void;
3492
+ unregisterGcp(callback: BodyResponseCallback<Schema$Empty>): void;
3493
+ }
3494
+ export interface Params$Resource$Accounts$Developerregistration$Registergcp extends StandardParameters {
3495
+ /**
3496
+ * Required. The name of the developer registration to be created for the merchant account that the GCP will be registered with. Format: `accounts/{account\}/developerRegistration`
3497
+ */
3498
+ name?: string;
3499
+ /**
3500
+ * Request body metadata
3501
+ */
3502
+ requestBody?: Schema$RegisterGCPRequest;
3503
+ }
3504
+ export interface Params$Resource$Accounts$Developerregistration$Unregistergcp extends StandardParameters {
3505
+ /**
3506
+ * Required. The name of the developer registration to be created for the merchant account that the GCP will be registered with. Format: `accounts/{account\}/developerRegistration`
3507
+ */
3508
+ name?: string;
3509
+ /**
3510
+ * Request body metadata
3511
+ */
3512
+ requestBody?: Schema$UnregisterGCPRequest;
3513
+ }
3262
3514
  export class Resource$Accounts$Emailpreferences {
3263
3515
  context: APIRequestContext;
3264
3516
  constructor(context: APIRequestContext);
@@ -4915,7 +5167,7 @@ export declare namespace merchantapi_accounts_v1beta {
4915
5167
  * const res = await merchantapi.accounts.onlineReturnPolicies.patch({
4916
5168
  * // Identifier. The name of the `OnlineReturnPolicy` resource. Format: `accounts/{account\}/onlineReturnPolicies/{return_policy\}`
4917
5169
  * name: 'accounts/my-account/onlineReturnPolicies/my-onlineReturnPolicie',
4918
- * // Optional. List of fields being updated. The following fields are supported (in both `snake_case` and `lowerCamelCase`): - `accept_defective_only` - `accept_exchange` - `item_conditions` - `policy` - `process_refund_days` - `restocking_fee` - `return_methods` - `return_policy_uri` - `return_shipping_fee`
5170
+ * // Optional. Only support updating the entire OnlineReturnPolicy message. For update_mask, always use `*`.
4919
5171
  * updateMask: 'placeholder-value',
4920
5172
  *
4921
5173
  * // Request body metadata
@@ -5023,7 +5275,7 @@ export declare namespace merchantapi_accounts_v1beta {
5023
5275
  */
5024
5276
  name?: string;
5025
5277
  /**
5026
- * Optional. List of fields being updated. The following fields are supported (in both `snake_case` and `lowerCamelCase`): - `accept_defective_only` - `accept_exchange` - `item_conditions` - `policy` - `process_refund_days` - `restocking_fee` - `return_methods` - `return_policy_uri` - `return_shipping_fee`
5278
+ * Optional. Only support updating the entire OnlineReturnPolicy message. For update_mask, always use `*`.
5027
5279
  */
5028
5280
  updateMask?: string;
5029
5281
  /**
@@ -50,6 +50,7 @@ var merchantapi_accounts_v1beta;
50
50
  this.automaticImprovements = new Resource$Accounts$Automaticimprovements(this.context);
51
51
  this.businessIdentity = new Resource$Accounts$Businessidentity(this.context);
52
52
  this.businessInfo = new Resource$Accounts$Businessinfo(this.context);
53
+ this.developerRegistration = new Resource$Accounts$Developerregistration(this.context);
53
54
  this.emailPreferences = new Resource$Accounts$Emailpreferences(this.context);
54
55
  this.gbpAccounts = new Resource$Accounts$Gbpaccounts(this.context);
55
56
  this.homepage = new Resource$Accounts$Homepage(this.context);
@@ -159,6 +160,38 @@ var merchantapi_accounts_v1beta;
159
160
  return (0, googleapis_common_1.createAPIRequest)(parameters);
160
161
  }
161
162
  }
163
+ getDeveloperRegistration(paramsOrCallback, optionsOrCallback, callback) {
164
+ let params = (paramsOrCallback ||
165
+ {});
166
+ let options = (optionsOrCallback || {});
167
+ if (typeof paramsOrCallback === 'function') {
168
+ callback = paramsOrCallback;
169
+ params = {};
170
+ options = {};
171
+ }
172
+ if (typeof optionsOrCallback === 'function') {
173
+ callback = optionsOrCallback;
174
+ options = {};
175
+ }
176
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
177
+ const parameters = {
178
+ options: Object.assign({
179
+ url: (rootUrl + '/accounts/v1beta/{+name}').replace(/([^:]\/)\/+/g, '$1'),
180
+ method: 'GET',
181
+ apiVersion: '',
182
+ }, options),
183
+ params,
184
+ requiredParams: ['name'],
185
+ pathParams: ['name'],
186
+ context: this.context,
187
+ };
188
+ if (callback) {
189
+ (0, googleapis_common_1.createAPIRequest)(parameters, callback);
190
+ }
191
+ else {
192
+ return (0, googleapis_common_1.createAPIRequest)(parameters);
193
+ }
194
+ }
162
195
  list(paramsOrCallback, optionsOrCallback, callback) {
163
196
  let params = (paramsOrCallback || {});
164
197
  let options = (optionsOrCallback || {});
@@ -541,6 +574,78 @@ var merchantapi_accounts_v1beta;
541
574
  }
542
575
  }
543
576
  merchantapi_accounts_v1beta.Resource$Accounts$Businessinfo = Resource$Accounts$Businessinfo;
577
+ class Resource$Accounts$Developerregistration {
578
+ constructor(context) {
579
+ this.context = context;
580
+ }
581
+ registerGcp(paramsOrCallback, optionsOrCallback, callback) {
582
+ let params = (paramsOrCallback ||
583
+ {});
584
+ let options = (optionsOrCallback || {});
585
+ if (typeof paramsOrCallback === 'function') {
586
+ callback = paramsOrCallback;
587
+ params =
588
+ {};
589
+ options = {};
590
+ }
591
+ if (typeof optionsOrCallback === 'function') {
592
+ callback = optionsOrCallback;
593
+ options = {};
594
+ }
595
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
596
+ const parameters = {
597
+ options: Object.assign({
598
+ url: (rootUrl + '/accounts/v1beta/{+name}:registerGcp').replace(/([^:]\/)\/+/g, '$1'),
599
+ method: 'POST',
600
+ apiVersion: '',
601
+ }, options),
602
+ params,
603
+ requiredParams: ['name'],
604
+ pathParams: ['name'],
605
+ context: this.context,
606
+ };
607
+ if (callback) {
608
+ (0, googleapis_common_1.createAPIRequest)(parameters, callback);
609
+ }
610
+ else {
611
+ return (0, googleapis_common_1.createAPIRequest)(parameters);
612
+ }
613
+ }
614
+ unregisterGcp(paramsOrCallback, optionsOrCallback, callback) {
615
+ let params = (paramsOrCallback ||
616
+ {});
617
+ let options = (optionsOrCallback || {});
618
+ if (typeof paramsOrCallback === 'function') {
619
+ callback = paramsOrCallback;
620
+ params =
621
+ {};
622
+ options = {};
623
+ }
624
+ if (typeof optionsOrCallback === 'function') {
625
+ callback = optionsOrCallback;
626
+ options = {};
627
+ }
628
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
629
+ const parameters = {
630
+ options: Object.assign({
631
+ url: (rootUrl + '/accounts/v1beta/{+name}:unregisterGcp').replace(/([^:]\/)\/+/g, '$1'),
632
+ method: 'POST',
633
+ apiVersion: '',
634
+ }, options),
635
+ params,
636
+ requiredParams: ['name'],
637
+ pathParams: ['name'],
638
+ context: this.context,
639
+ };
640
+ if (callback) {
641
+ (0, googleapis_common_1.createAPIRequest)(parameters, callback);
642
+ }
643
+ else {
644
+ return (0, googleapis_common_1.createAPIRequest)(parameters);
645
+ }
646
+ }
647
+ }
648
+ merchantapi_accounts_v1beta.Resource$Accounts$Developerregistration = Resource$Accounts$Developerregistration;
544
649
  class Resource$Accounts$Emailpreferences {
545
650
  constructor(context) {
546
651
  this.context = context;