@googleapis/merchantapi 12.0.0 → 13.1.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.
package/accounts_v1.ts CHANGED
@@ -445,6 +445,51 @@ export namespace merchantapi_accounts_v1 {
445
445
  */
446
446
  allowShippingImprovements?: boolean | null;
447
447
  }
448
+ /**
449
+ * Request message for the `BatchCreateRegions` method.
450
+ */
451
+ export interface Schema$BatchCreateRegionsRequest {
452
+ /**
453
+ * Required. The region(s) to create. The maximum number of regions that can be created in a batch is 100.
454
+ */
455
+ requests?: Schema$CreateRegionRequest[];
456
+ }
457
+ /**
458
+ * Response message for the `BatchCreateRegions` method.
459
+ */
460
+ export interface Schema$BatchCreateRegionsResponse {
461
+ /**
462
+ * The created region(s).
463
+ */
464
+ regions?: Schema$Region[];
465
+ }
466
+ /**
467
+ * Request message for the `BatchDeleteRegions` method.
468
+ */
469
+ export interface Schema$BatchDeleteRegionsRequest {
470
+ /**
471
+ * Required. The names of the regions to delete. A maximum of 100 regions can be deleted in a batch.
472
+ */
473
+ requests?: Schema$DeleteRegionRequest[];
474
+ }
475
+ /**
476
+ * Request message for the `BatchUpdateRegions` method.
477
+ */
478
+ export interface Schema$BatchUpdateRegionsRequest {
479
+ /**
480
+ * Required. The region(s) to update. The maximum number of regions that can be updated in a batch is 100.
481
+ */
482
+ requests?: Schema$UpdateRegionRequest[];
483
+ }
484
+ /**
485
+ * Response message for the `BatchUpdateRegions` method.
486
+ */
487
+ export interface Schema$BatchUpdateRegionsResponse {
488
+ /**
489
+ * The updated region(s).
490
+ */
491
+ regions?: Schema$Region[];
492
+ }
448
493
  /**
449
494
  * Business days of the warehouse.
450
495
  */
@@ -612,6 +657,23 @@ export namespace merchantapi_accounts_v1 {
612
657
  */
613
658
  user?: Schema$AddUser[];
614
659
  }
660
+ /**
661
+ * Request message for the `CreateRegion` method.
662
+ */
663
+ export interface Schema$CreateRegionRequest {
664
+ /**
665
+ * Required. The account to create a region for. Format: `accounts/{account\}`
666
+ */
667
+ parent?: string | null;
668
+ /**
669
+ * Required. The region to create.
670
+ */
671
+ region?: Schema$Region;
672
+ /**
673
+ * Required. The identifier for the region, unique over all regions of the same account.
674
+ */
675
+ regionId?: string | null;
676
+ }
615
677
  /**
616
678
  * Customer service information.
617
679
  */
@@ -680,6 +742,15 @@ export namespace merchantapi_accounts_v1 {
680
742
  */
681
743
  year?: number | null;
682
744
  }
745
+ /**
746
+ * Request message for the `DeleteRegion` method.
747
+ */
748
+ export interface Schema$DeleteRegionRequest {
749
+ /**
750
+ * Required. The name of the region to delete. Format: `accounts/{account\}/regions/{region\}`
751
+ */
752
+ name?: string | null;
753
+ }
683
754
  /**
684
755
  * Time spent in various aspects from order to the delivery of the product.
685
756
  */
@@ -819,6 +890,15 @@ export namespace merchantapi_accounts_v1 {
819
890
  */
820
891
  geotargetCriteriaIds?: string[] | null;
821
892
  }
893
+ /**
894
+ * Response message for the GetAccountForGcpRegistration method.
895
+ */
896
+ export interface Schema$GetAccountForGcpRegistrationResponse {
897
+ /**
898
+ * The name of the merchant account id that the GCP is registered with.
899
+ */
900
+ name?: string | null;
901
+ }
822
902
  /**
823
903
  * The current status of establishing of the service. (for example, pending approval or approved).
824
904
  */
@@ -1560,7 +1640,7 @@ export namespace merchantapi_accounts_v1 {
1560
1640
  resourceType?: string | null;
1561
1641
  }
1562
1642
  /**
1563
- * Defines participation in a given program for the specified account. Programs provide a mechanism for adding functionality to a Merchant Center accounts. A typical example of this is the [Free product listings](https://support.google.com/merchants/answer/13889434) program, which enables products from a business's store to be shown across Google for free. The following list is the available set of program resource IDs accessible through the API: * `free-listings` * `shopping-ads` * `youtube-shopping-checkout`
1643
+ * Defines participation in a given program for the specified account. Programs provide a mechanism for adding functionality to a Merchant Center accounts. A typical example of this is the [Free product listings](https://support.google.com/merchants/answer/13889434) program, which enables products from a business's store to be shown across Google for free. The following list is the available set of program resource IDs accessible through the API: * `checkout` * `free-listings` * `shopping-ads` * `youtube-shopping-checkout`
1564
1644
  */
1565
1645
  export interface Schema$Program {
1566
1646
  /**
@@ -1660,7 +1740,7 @@ export namespace merchantapi_accounts_v1 {
1660
1740
  */
1661
1741
  export interface Schema$RegisterGcpRequest {
1662
1742
  /**
1663
- * 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
1743
+ * 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. Make sure the email used is associated with a Google Account (Google Workspace account or Gmail account) and is not a service account as service accounts can't receive emails.
1664
1744
  */
1665
1745
  developerEmail?: string | null;
1666
1746
  }
@@ -2016,6 +2096,19 @@ export namespace merchantapi_accounts_v1 {
2016
2096
  * Request message for the UnregisterGCP method.
2017
2097
  */
2018
2098
  export interface Schema$UnregisterGcpRequest {}
2099
+ /**
2100
+ * Request message for the `UpdateRegion` method.
2101
+ */
2102
+ export interface Schema$UpdateRegionRequest {
2103
+ /**
2104
+ * Required. The updated region.
2105
+ */
2106
+ region?: Schema$Region;
2107
+ /**
2108
+ * Optional. The comma-separated field mask indicating the fields to update. Example: `"displayName,postalCodeArea.regionCode"`.
2109
+ */
2110
+ updateMask?: string | null;
2111
+ }
2019
2112
  /**
2020
2113
  * URL settings for cart or checkout URL.
2021
2114
  */
@@ -2350,7 +2443,7 @@ export namespace merchantapi_accounts_v1 {
2350
2443
  }
2351
2444
 
2352
2445
  /**
2353
- * Deletes the specified account regardless of its type: standalone, advanced account or sub-account. Deleting an advanced account leads to the deletion of all of its sub-accounts. Executing this method requires admin access. The deletion succeeds only if the account does not provide services to any other account and has no processed offers. You can use the `force` parameter to override this.
2446
+ * Deletes the specified account regardless of its type: standalone, advanced account or sub-account. Deleting an advanced account leads to the deletion of all of its sub-accounts. This also deletes the account's [developer registration entity](/merchant/api/reference/rest/accounts_v1/accounts.developerRegistration) and any associated GCP project to the account. Executing this method requires admin access. The deletion succeeds only if the account does not provide services to any other account and has no processed offers. You can use the `force` parameter to override this.
2354
2447
  * @example
2355
2448
  * ```js
2356
2449
  * // Before running the sample:
@@ -2627,6 +2720,149 @@ export namespace merchantapi_accounts_v1 {
2627
2720
  }
2628
2721
  }
2629
2722
 
2723
+ /**
2724
+ * Retrieves the merchant account that the calling GCP is registered with.
2725
+ * @example
2726
+ * ```js
2727
+ * // Before running the sample:
2728
+ * // - Enable the API at:
2729
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
2730
+ * // - Login into gcloud by running:
2731
+ * // ```sh
2732
+ * // $ gcloud auth application-default login
2733
+ * // ```
2734
+ * // - Install the npm module by running:
2735
+ * // ```sh
2736
+ * // $ npm install googleapis
2737
+ * // ```
2738
+ *
2739
+ * const {google} = require('googleapis');
2740
+ * const merchantapi = google.merchantapi('accounts_v1');
2741
+ *
2742
+ * async function main() {
2743
+ * const auth = new google.auth.GoogleAuth({
2744
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2745
+ * scopes: ['https://www.googleapis.com/auth/content'],
2746
+ * });
2747
+ *
2748
+ * // Acquire an auth client, and bind it to all future calls
2749
+ * const authClient = await auth.getClient();
2750
+ * google.options({auth: authClient});
2751
+ *
2752
+ * // Do the magic
2753
+ * const res = await merchantapi.accounts.getAccountForGcpRegistration({});
2754
+ * console.log(res.data);
2755
+ *
2756
+ * // Example response
2757
+ * // {
2758
+ * // "name": "my_name"
2759
+ * // }
2760
+ * }
2761
+ *
2762
+ * main().catch(e => {
2763
+ * console.error(e);
2764
+ * throw e;
2765
+ * });
2766
+ *
2767
+ * ```
2768
+ *
2769
+ * @param params - Parameters for request
2770
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2771
+ * @param callback - Optional callback that handles the response.
2772
+ * @returns A promise if used with async/await, or void if used with a callback.
2773
+ */
2774
+ getAccountForGcpRegistration(
2775
+ params: Params$Resource$Accounts$Getaccountforgcpregistration,
2776
+ options: StreamMethodOptions
2777
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2778
+ getAccountForGcpRegistration(
2779
+ params?: Params$Resource$Accounts$Getaccountforgcpregistration,
2780
+ options?: MethodOptions
2781
+ ): Promise<
2782
+ GaxiosResponseWithHTTP2<Schema$GetAccountForGcpRegistrationResponse>
2783
+ >;
2784
+ getAccountForGcpRegistration(
2785
+ params: Params$Resource$Accounts$Getaccountforgcpregistration,
2786
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
2787
+ callback: BodyResponseCallback<Readable>
2788
+ ): void;
2789
+ getAccountForGcpRegistration(
2790
+ params: Params$Resource$Accounts$Getaccountforgcpregistration,
2791
+ options:
2792
+ | MethodOptions
2793
+ | BodyResponseCallback<Schema$GetAccountForGcpRegistrationResponse>,
2794
+ callback: BodyResponseCallback<Schema$GetAccountForGcpRegistrationResponse>
2795
+ ): void;
2796
+ getAccountForGcpRegistration(
2797
+ params: Params$Resource$Accounts$Getaccountforgcpregistration,
2798
+ callback: BodyResponseCallback<Schema$GetAccountForGcpRegistrationResponse>
2799
+ ): void;
2800
+ getAccountForGcpRegistration(
2801
+ callback: BodyResponseCallback<Schema$GetAccountForGcpRegistrationResponse>
2802
+ ): void;
2803
+ getAccountForGcpRegistration(
2804
+ paramsOrCallback?:
2805
+ | Params$Resource$Accounts$Getaccountforgcpregistration
2806
+ | BodyResponseCallback<Schema$GetAccountForGcpRegistrationResponse>
2807
+ | BodyResponseCallback<Readable>,
2808
+ optionsOrCallback?:
2809
+ | MethodOptions
2810
+ | StreamMethodOptions
2811
+ | BodyResponseCallback<Schema$GetAccountForGcpRegistrationResponse>
2812
+ | BodyResponseCallback<Readable>,
2813
+ callback?:
2814
+ | BodyResponseCallback<Schema$GetAccountForGcpRegistrationResponse>
2815
+ | BodyResponseCallback<Readable>
2816
+ ):
2817
+ | void
2818
+ | Promise<
2819
+ GaxiosResponseWithHTTP2<Schema$GetAccountForGcpRegistrationResponse>
2820
+ >
2821
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2822
+ let params = (paramsOrCallback ||
2823
+ {}) as Params$Resource$Accounts$Getaccountforgcpregistration;
2824
+ let options = (optionsOrCallback || {}) as MethodOptions;
2825
+
2826
+ if (typeof paramsOrCallback === 'function') {
2827
+ callback = paramsOrCallback;
2828
+ params = {} as Params$Resource$Accounts$Getaccountforgcpregistration;
2829
+ options = {};
2830
+ }
2831
+
2832
+ if (typeof optionsOrCallback === 'function') {
2833
+ callback = optionsOrCallback;
2834
+ options = {};
2835
+ }
2836
+
2837
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
2838
+ const parameters = {
2839
+ options: Object.assign(
2840
+ {
2841
+ url: (
2842
+ rootUrl + '/accounts/v1/accounts:getAccountForGcpRegistration'
2843
+ ).replace(/([^:]\/)\/+/g, '$1'),
2844
+ method: 'GET',
2845
+ apiVersion: '',
2846
+ },
2847
+ options
2848
+ ),
2849
+ params,
2850
+ requiredParams: [],
2851
+ pathParams: [],
2852
+ context: this.context,
2853
+ };
2854
+ if (callback) {
2855
+ createAPIRequest<Schema$GetAccountForGcpRegistrationResponse>(
2856
+ parameters,
2857
+ callback as BodyResponseCallback<unknown>
2858
+ );
2859
+ } else {
2860
+ return createAPIRequest<Schema$GetAccountForGcpRegistrationResponse>(
2861
+ parameters
2862
+ );
2863
+ }
2864
+ }
2865
+
2630
2866
  /**
2631
2867
  * 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.
2632
2868
  * @example
@@ -3098,6 +3334,8 @@ export namespace merchantapi_accounts_v1 {
3098
3334
  */
3099
3335
  name?: string;
3100
3336
  }
3337
+ export interface Params$Resource$Accounts$Getaccountforgcpregistration
3338
+ extends StandardParameters {}
3101
3339
  export interface Params$Resource$Accounts$List extends StandardParameters {
3102
3340
  /**
3103
3341
  * 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).
@@ -9570,7 +9808,7 @@ export namespace merchantapi_accounts_v1 {
9570
9808
  }
9571
9809
 
9572
9810
  /**
9573
- * Creates a region definition in your Merchant Center account. Executing this method requires admin access.
9811
+ * Creates one or more regions in your Merchant Center account. Executing this method requires admin access.
9574
9812
  * @example
9575
9813
  * ```js
9576
9814
  * // Before running the sample:
@@ -9599,22 +9837,15 @@ export namespace merchantapi_accounts_v1 {
9599
9837
  * google.options({auth: authClient});
9600
9838
  *
9601
9839
  * // Do the magic
9602
- * const res = await merchantapi.accounts.regions.create({
9603
- * // Required. The account to create a region for. Format: `accounts/{account\}`
9840
+ * const res = await merchantapi.accounts.regions.batchCreate({
9841
+ * // Required. The account to create one or more regions for. Format: `accounts/{account\}`
9604
9842
  * parent: 'accounts/my-account',
9605
- * // Required. The identifier for the region, unique over all regions of the same account.
9606
- * regionId: 'placeholder-value',
9607
9843
  *
9608
9844
  * // Request body metadata
9609
9845
  * requestBody: {
9610
9846
  * // request body parameters
9611
9847
  * // {
9612
- * // "displayName": "my_displayName",
9613
- * // "geotargetArea": {},
9614
- * // "name": "my_name",
9615
- * // "postalCodeArea": {},
9616
- * // "regionalInventoryEligible": false,
9617
- * // "shippingEligible": false
9848
+ * // "requests": []
9618
9849
  * // }
9619
9850
  * },
9620
9851
  * });
@@ -9622,12 +9853,7 @@ export namespace merchantapi_accounts_v1 {
9622
9853
  *
9623
9854
  * // Example response
9624
9855
  * // {
9625
- * // "displayName": "my_displayName",
9626
- * // "geotargetArea": {},
9627
- * // "name": "my_name",
9628
- * // "postalCodeArea": {},
9629
- * // "regionalInventoryEligible": false,
9630
- * // "shippingEligible": false
9856
+ * // "regions": []
9631
9857
  * // }
9632
9858
  * }
9633
9859
  *
@@ -9643,53 +9869,57 @@ export namespace merchantapi_accounts_v1 {
9643
9869
  * @param callback - Optional callback that handles the response.
9644
9870
  * @returns A promise if used with async/await, or void if used with a callback.
9645
9871
  */
9646
- create(
9647
- params: Params$Resource$Accounts$Regions$Create,
9872
+ batchCreate(
9873
+ params: Params$Resource$Accounts$Regions$Batchcreate,
9648
9874
  options: StreamMethodOptions
9649
9875
  ): Promise<GaxiosResponseWithHTTP2<Readable>>;
9650
- create(
9651
- params?: Params$Resource$Accounts$Regions$Create,
9876
+ batchCreate(
9877
+ params?: Params$Resource$Accounts$Regions$Batchcreate,
9652
9878
  options?: MethodOptions
9653
- ): Promise<GaxiosResponseWithHTTP2<Schema$Region>>;
9654
- create(
9655
- params: Params$Resource$Accounts$Regions$Create,
9879
+ ): Promise<GaxiosResponseWithHTTP2<Schema$BatchCreateRegionsResponse>>;
9880
+ batchCreate(
9881
+ params: Params$Resource$Accounts$Regions$Batchcreate,
9656
9882
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
9657
9883
  callback: BodyResponseCallback<Readable>
9658
9884
  ): void;
9659
- create(
9660
- params: Params$Resource$Accounts$Regions$Create,
9661
- options: MethodOptions | BodyResponseCallback<Schema$Region>,
9662
- callback: BodyResponseCallback<Schema$Region>
9885
+ batchCreate(
9886
+ params: Params$Resource$Accounts$Regions$Batchcreate,
9887
+ options:
9888
+ | MethodOptions
9889
+ | BodyResponseCallback<Schema$BatchCreateRegionsResponse>,
9890
+ callback: BodyResponseCallback<Schema$BatchCreateRegionsResponse>
9663
9891
  ): void;
9664
- create(
9665
- params: Params$Resource$Accounts$Regions$Create,
9666
- callback: BodyResponseCallback<Schema$Region>
9892
+ batchCreate(
9893
+ params: Params$Resource$Accounts$Regions$Batchcreate,
9894
+ callback: BodyResponseCallback<Schema$BatchCreateRegionsResponse>
9667
9895
  ): void;
9668
- create(callback: BodyResponseCallback<Schema$Region>): void;
9669
- create(
9896
+ batchCreate(
9897
+ callback: BodyResponseCallback<Schema$BatchCreateRegionsResponse>
9898
+ ): void;
9899
+ batchCreate(
9670
9900
  paramsOrCallback?:
9671
- | Params$Resource$Accounts$Regions$Create
9672
- | BodyResponseCallback<Schema$Region>
9901
+ | Params$Resource$Accounts$Regions$Batchcreate
9902
+ | BodyResponseCallback<Schema$BatchCreateRegionsResponse>
9673
9903
  | BodyResponseCallback<Readable>,
9674
9904
  optionsOrCallback?:
9675
9905
  | MethodOptions
9676
9906
  | StreamMethodOptions
9677
- | BodyResponseCallback<Schema$Region>
9907
+ | BodyResponseCallback<Schema$BatchCreateRegionsResponse>
9678
9908
  | BodyResponseCallback<Readable>,
9679
9909
  callback?:
9680
- | BodyResponseCallback<Schema$Region>
9910
+ | BodyResponseCallback<Schema$BatchCreateRegionsResponse>
9681
9911
  | BodyResponseCallback<Readable>
9682
9912
  ):
9683
9913
  | void
9684
- | Promise<GaxiosResponseWithHTTP2<Schema$Region>>
9914
+ | Promise<GaxiosResponseWithHTTP2<Schema$BatchCreateRegionsResponse>>
9685
9915
  | Promise<GaxiosResponseWithHTTP2<Readable>> {
9686
9916
  let params = (paramsOrCallback ||
9687
- {}) as Params$Resource$Accounts$Regions$Create;
9917
+ {}) as Params$Resource$Accounts$Regions$Batchcreate;
9688
9918
  let options = (optionsOrCallback || {}) as MethodOptions;
9689
9919
 
9690
9920
  if (typeof paramsOrCallback === 'function') {
9691
9921
  callback = paramsOrCallback;
9692
- params = {} as Params$Resource$Accounts$Regions$Create;
9922
+ params = {} as Params$Resource$Accounts$Regions$Batchcreate;
9693
9923
  options = {};
9694
9924
  }
9695
9925
 
@@ -9702,10 +9932,9 @@ export namespace merchantapi_accounts_v1 {
9702
9932
  const parameters = {
9703
9933
  options: Object.assign(
9704
9934
  {
9705
- url: (rootUrl + '/accounts/v1/{+parent}/regions').replace(
9706
- /([^:]\/)\/+/g,
9707
- '$1'
9708
- ),
9935
+ url: (
9936
+ rootUrl + '/accounts/v1/{+parent}/regions:batchCreate'
9937
+ ).replace(/([^:]\/)\/+/g, '$1'),
9709
9938
  method: 'POST',
9710
9939
  apiVersion: '',
9711
9940
  },
@@ -9717,17 +9946,17 @@ export namespace merchantapi_accounts_v1 {
9717
9946
  context: this.context,
9718
9947
  };
9719
9948
  if (callback) {
9720
- createAPIRequest<Schema$Region>(
9949
+ createAPIRequest<Schema$BatchCreateRegionsResponse>(
9721
9950
  parameters,
9722
9951
  callback as BodyResponseCallback<unknown>
9723
9952
  );
9724
9953
  } else {
9725
- return createAPIRequest<Schema$Region>(parameters);
9954
+ return createAPIRequest<Schema$BatchCreateRegionsResponse>(parameters);
9726
9955
  }
9727
9956
  }
9728
9957
 
9729
9958
  /**
9730
- * Deletes a region definition from your Merchant Center account. Executing this method requires admin access.
9959
+ * Deletes multiple regions by name from your Merchant Center account. Executing this method requires admin access.
9731
9960
  * @example
9732
9961
  * ```js
9733
9962
  * // Before running the sample:
@@ -9756,9 +9985,17 @@ export namespace merchantapi_accounts_v1 {
9756
9985
  * google.options({auth: authClient});
9757
9986
  *
9758
9987
  * // Do the magic
9759
- * const res = await merchantapi.accounts.regions.delete({
9760
- * // Required. The name of the region to delete. Format: `accounts/{account\}/regions/{region\}`
9761
- * name: 'accounts/my-account/regions/my-region',
9988
+ * const res = await merchantapi.accounts.regions.batchDelete({
9989
+ * // Required. The account to delete one or more regions from. Format: `accounts/{account\}`
9990
+ * parent: 'accounts/my-account',
9991
+ *
9992
+ * // Request body metadata
9993
+ * requestBody: {
9994
+ * // request body parameters
9995
+ * // {
9996
+ * // "requests": []
9997
+ * // }
9998
+ * },
9762
9999
  * });
9763
10000
  * console.log(res.data);
9764
10001
  *
@@ -9778,32 +10015,32 @@ export namespace merchantapi_accounts_v1 {
9778
10015
  * @param callback - Optional callback that handles the response.
9779
10016
  * @returns A promise if used with async/await, or void if used with a callback.
9780
10017
  */
9781
- delete(
9782
- params: Params$Resource$Accounts$Regions$Delete,
10018
+ batchDelete(
10019
+ params: Params$Resource$Accounts$Regions$Batchdelete,
9783
10020
  options: StreamMethodOptions
9784
10021
  ): Promise<GaxiosResponseWithHTTP2<Readable>>;
9785
- delete(
9786
- params?: Params$Resource$Accounts$Regions$Delete,
10022
+ batchDelete(
10023
+ params?: Params$Resource$Accounts$Regions$Batchdelete,
9787
10024
  options?: MethodOptions
9788
10025
  ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
9789
- delete(
9790
- params: Params$Resource$Accounts$Regions$Delete,
10026
+ batchDelete(
10027
+ params: Params$Resource$Accounts$Regions$Batchdelete,
9791
10028
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
9792
10029
  callback: BodyResponseCallback<Readable>
9793
10030
  ): void;
9794
- delete(
9795
- params: Params$Resource$Accounts$Regions$Delete,
10031
+ batchDelete(
10032
+ params: Params$Resource$Accounts$Regions$Batchdelete,
9796
10033
  options: MethodOptions | BodyResponseCallback<Schema$Empty>,
9797
10034
  callback: BodyResponseCallback<Schema$Empty>
9798
10035
  ): void;
9799
- delete(
9800
- params: Params$Resource$Accounts$Regions$Delete,
10036
+ batchDelete(
10037
+ params: Params$Resource$Accounts$Regions$Batchdelete,
9801
10038
  callback: BodyResponseCallback<Schema$Empty>
9802
10039
  ): void;
9803
- delete(callback: BodyResponseCallback<Schema$Empty>): void;
9804
- delete(
10040
+ batchDelete(callback: BodyResponseCallback<Schema$Empty>): void;
10041
+ batchDelete(
9805
10042
  paramsOrCallback?:
9806
- | Params$Resource$Accounts$Regions$Delete
10043
+ | Params$Resource$Accounts$Regions$Batchdelete
9807
10044
  | BodyResponseCallback<Schema$Empty>
9808
10045
  | BodyResponseCallback<Readable>,
9809
10046
  optionsOrCallback?:
@@ -9819,12 +10056,12 @@ export namespace merchantapi_accounts_v1 {
9819
10056
  | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
9820
10057
  | Promise<GaxiosResponseWithHTTP2<Readable>> {
9821
10058
  let params = (paramsOrCallback ||
9822
- {}) as Params$Resource$Accounts$Regions$Delete;
10059
+ {}) as Params$Resource$Accounts$Regions$Batchdelete;
9823
10060
  let options = (optionsOrCallback || {}) as MethodOptions;
9824
10061
 
9825
10062
  if (typeof paramsOrCallback === 'function') {
9826
10063
  callback = paramsOrCallback;
9827
- params = {} as Params$Resource$Accounts$Regions$Delete;
10064
+ params = {} as Params$Resource$Accounts$Regions$Batchdelete;
9828
10065
  options = {};
9829
10066
  }
9830
10067
 
@@ -9837,10 +10074,449 @@ export namespace merchantapi_accounts_v1 {
9837
10074
  const parameters = {
9838
10075
  options: Object.assign(
9839
10076
  {
9840
- url: (rootUrl + '/accounts/v1/{+name}').replace(
9841
- /([^:]\/)\/+/g,
9842
- '$1'
9843
- ),
10077
+ url: (
10078
+ rootUrl + '/accounts/v1/{+parent}/regions:batchDelete'
10079
+ ).replace(/([^:]\/)\/+/g, '$1'),
10080
+ method: 'POST',
10081
+ apiVersion: '',
10082
+ },
10083
+ options
10084
+ ),
10085
+ params,
10086
+ requiredParams: ['parent'],
10087
+ pathParams: ['parent'],
10088
+ context: this.context,
10089
+ };
10090
+ if (callback) {
10091
+ createAPIRequest<Schema$Empty>(
10092
+ parameters,
10093
+ callback as BodyResponseCallback<unknown>
10094
+ );
10095
+ } else {
10096
+ return createAPIRequest<Schema$Empty>(parameters);
10097
+ }
10098
+ }
10099
+
10100
+ /**
10101
+ * Updates one or more regions in your Merchant Center account. Executing this method requires admin access.
10102
+ * @example
10103
+ * ```js
10104
+ * // Before running the sample:
10105
+ * // - Enable the API at:
10106
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
10107
+ * // - Login into gcloud by running:
10108
+ * // ```sh
10109
+ * // $ gcloud auth application-default login
10110
+ * // ```
10111
+ * // - Install the npm module by running:
10112
+ * // ```sh
10113
+ * // $ npm install googleapis
10114
+ * // ```
10115
+ *
10116
+ * const {google} = require('googleapis');
10117
+ * const merchantapi = google.merchantapi('accounts_v1');
10118
+ *
10119
+ * async function main() {
10120
+ * const auth = new google.auth.GoogleAuth({
10121
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
10122
+ * scopes: ['https://www.googleapis.com/auth/content'],
10123
+ * });
10124
+ *
10125
+ * // Acquire an auth client, and bind it to all future calls
10126
+ * const authClient = await auth.getClient();
10127
+ * google.options({auth: authClient});
10128
+ *
10129
+ * // Do the magic
10130
+ * const res = await merchantapi.accounts.regions.batchUpdate({
10131
+ * // Required. The account to update one or more regions for. Format: `accounts/{account\}`
10132
+ * parent: 'accounts/my-account',
10133
+ *
10134
+ * // Request body metadata
10135
+ * requestBody: {
10136
+ * // request body parameters
10137
+ * // {
10138
+ * // "requests": []
10139
+ * // }
10140
+ * },
10141
+ * });
10142
+ * console.log(res.data);
10143
+ *
10144
+ * // Example response
10145
+ * // {
10146
+ * // "regions": []
10147
+ * // }
10148
+ * }
10149
+ *
10150
+ * main().catch(e => {
10151
+ * console.error(e);
10152
+ * throw e;
10153
+ * });
10154
+ *
10155
+ * ```
10156
+ *
10157
+ * @param params - Parameters for request
10158
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
10159
+ * @param callback - Optional callback that handles the response.
10160
+ * @returns A promise if used with async/await, or void if used with a callback.
10161
+ */
10162
+ batchUpdate(
10163
+ params: Params$Resource$Accounts$Regions$Batchupdate,
10164
+ options: StreamMethodOptions
10165
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
10166
+ batchUpdate(
10167
+ params?: Params$Resource$Accounts$Regions$Batchupdate,
10168
+ options?: MethodOptions
10169
+ ): Promise<GaxiosResponseWithHTTP2<Schema$BatchUpdateRegionsResponse>>;
10170
+ batchUpdate(
10171
+ params: Params$Resource$Accounts$Regions$Batchupdate,
10172
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
10173
+ callback: BodyResponseCallback<Readable>
10174
+ ): void;
10175
+ batchUpdate(
10176
+ params: Params$Resource$Accounts$Regions$Batchupdate,
10177
+ options:
10178
+ | MethodOptions
10179
+ | BodyResponseCallback<Schema$BatchUpdateRegionsResponse>,
10180
+ callback: BodyResponseCallback<Schema$BatchUpdateRegionsResponse>
10181
+ ): void;
10182
+ batchUpdate(
10183
+ params: Params$Resource$Accounts$Regions$Batchupdate,
10184
+ callback: BodyResponseCallback<Schema$BatchUpdateRegionsResponse>
10185
+ ): void;
10186
+ batchUpdate(
10187
+ callback: BodyResponseCallback<Schema$BatchUpdateRegionsResponse>
10188
+ ): void;
10189
+ batchUpdate(
10190
+ paramsOrCallback?:
10191
+ | Params$Resource$Accounts$Regions$Batchupdate
10192
+ | BodyResponseCallback<Schema$BatchUpdateRegionsResponse>
10193
+ | BodyResponseCallback<Readable>,
10194
+ optionsOrCallback?:
10195
+ | MethodOptions
10196
+ | StreamMethodOptions
10197
+ | BodyResponseCallback<Schema$BatchUpdateRegionsResponse>
10198
+ | BodyResponseCallback<Readable>,
10199
+ callback?:
10200
+ | BodyResponseCallback<Schema$BatchUpdateRegionsResponse>
10201
+ | BodyResponseCallback<Readable>
10202
+ ):
10203
+ | void
10204
+ | Promise<GaxiosResponseWithHTTP2<Schema$BatchUpdateRegionsResponse>>
10205
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
10206
+ let params = (paramsOrCallback ||
10207
+ {}) as Params$Resource$Accounts$Regions$Batchupdate;
10208
+ let options = (optionsOrCallback || {}) as MethodOptions;
10209
+
10210
+ if (typeof paramsOrCallback === 'function') {
10211
+ callback = paramsOrCallback;
10212
+ params = {} as Params$Resource$Accounts$Regions$Batchupdate;
10213
+ options = {};
10214
+ }
10215
+
10216
+ if (typeof optionsOrCallback === 'function') {
10217
+ callback = optionsOrCallback;
10218
+ options = {};
10219
+ }
10220
+
10221
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
10222
+ const parameters = {
10223
+ options: Object.assign(
10224
+ {
10225
+ url: (
10226
+ rootUrl + '/accounts/v1/{+parent}/regions:batchUpdate'
10227
+ ).replace(/([^:]\/)\/+/g, '$1'),
10228
+ method: 'POST',
10229
+ apiVersion: '',
10230
+ },
10231
+ options
10232
+ ),
10233
+ params,
10234
+ requiredParams: ['parent'],
10235
+ pathParams: ['parent'],
10236
+ context: this.context,
10237
+ };
10238
+ if (callback) {
10239
+ createAPIRequest<Schema$BatchUpdateRegionsResponse>(
10240
+ parameters,
10241
+ callback as BodyResponseCallback<unknown>
10242
+ );
10243
+ } else {
10244
+ return createAPIRequest<Schema$BatchUpdateRegionsResponse>(parameters);
10245
+ }
10246
+ }
10247
+
10248
+ /**
10249
+ * Creates a region definition in your Merchant Center account. Executing this method requires admin access.
10250
+ * @example
10251
+ * ```js
10252
+ * // Before running the sample:
10253
+ * // - Enable the API at:
10254
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
10255
+ * // - Login into gcloud by running:
10256
+ * // ```sh
10257
+ * // $ gcloud auth application-default login
10258
+ * // ```
10259
+ * // - Install the npm module by running:
10260
+ * // ```sh
10261
+ * // $ npm install googleapis
10262
+ * // ```
10263
+ *
10264
+ * const {google} = require('googleapis');
10265
+ * const merchantapi = google.merchantapi('accounts_v1');
10266
+ *
10267
+ * async function main() {
10268
+ * const auth = new google.auth.GoogleAuth({
10269
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
10270
+ * scopes: ['https://www.googleapis.com/auth/content'],
10271
+ * });
10272
+ *
10273
+ * // Acquire an auth client, and bind it to all future calls
10274
+ * const authClient = await auth.getClient();
10275
+ * google.options({auth: authClient});
10276
+ *
10277
+ * // Do the magic
10278
+ * const res = await merchantapi.accounts.regions.create({
10279
+ * // Required. The account to create a region for. Format: `accounts/{account\}`
10280
+ * parent: 'accounts/my-account',
10281
+ * // Required. The identifier for the region, unique over all regions of the same account.
10282
+ * regionId: 'placeholder-value',
10283
+ *
10284
+ * // Request body metadata
10285
+ * requestBody: {
10286
+ * // request body parameters
10287
+ * // {
10288
+ * // "displayName": "my_displayName",
10289
+ * // "geotargetArea": {},
10290
+ * // "name": "my_name",
10291
+ * // "postalCodeArea": {},
10292
+ * // "regionalInventoryEligible": false,
10293
+ * // "shippingEligible": false
10294
+ * // }
10295
+ * },
10296
+ * });
10297
+ * console.log(res.data);
10298
+ *
10299
+ * // Example response
10300
+ * // {
10301
+ * // "displayName": "my_displayName",
10302
+ * // "geotargetArea": {},
10303
+ * // "name": "my_name",
10304
+ * // "postalCodeArea": {},
10305
+ * // "regionalInventoryEligible": false,
10306
+ * // "shippingEligible": false
10307
+ * // }
10308
+ * }
10309
+ *
10310
+ * main().catch(e => {
10311
+ * console.error(e);
10312
+ * throw e;
10313
+ * });
10314
+ *
10315
+ * ```
10316
+ *
10317
+ * @param params - Parameters for request
10318
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
10319
+ * @param callback - Optional callback that handles the response.
10320
+ * @returns A promise if used with async/await, or void if used with a callback.
10321
+ */
10322
+ create(
10323
+ params: Params$Resource$Accounts$Regions$Create,
10324
+ options: StreamMethodOptions
10325
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
10326
+ create(
10327
+ params?: Params$Resource$Accounts$Regions$Create,
10328
+ options?: MethodOptions
10329
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Region>>;
10330
+ create(
10331
+ params: Params$Resource$Accounts$Regions$Create,
10332
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
10333
+ callback: BodyResponseCallback<Readable>
10334
+ ): void;
10335
+ create(
10336
+ params: Params$Resource$Accounts$Regions$Create,
10337
+ options: MethodOptions | BodyResponseCallback<Schema$Region>,
10338
+ callback: BodyResponseCallback<Schema$Region>
10339
+ ): void;
10340
+ create(
10341
+ params: Params$Resource$Accounts$Regions$Create,
10342
+ callback: BodyResponseCallback<Schema$Region>
10343
+ ): void;
10344
+ create(callback: BodyResponseCallback<Schema$Region>): void;
10345
+ create(
10346
+ paramsOrCallback?:
10347
+ | Params$Resource$Accounts$Regions$Create
10348
+ | BodyResponseCallback<Schema$Region>
10349
+ | BodyResponseCallback<Readable>,
10350
+ optionsOrCallback?:
10351
+ | MethodOptions
10352
+ | StreamMethodOptions
10353
+ | BodyResponseCallback<Schema$Region>
10354
+ | BodyResponseCallback<Readable>,
10355
+ callback?:
10356
+ | BodyResponseCallback<Schema$Region>
10357
+ | BodyResponseCallback<Readable>
10358
+ ):
10359
+ | void
10360
+ | Promise<GaxiosResponseWithHTTP2<Schema$Region>>
10361
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
10362
+ let params = (paramsOrCallback ||
10363
+ {}) as Params$Resource$Accounts$Regions$Create;
10364
+ let options = (optionsOrCallback || {}) as MethodOptions;
10365
+
10366
+ if (typeof paramsOrCallback === 'function') {
10367
+ callback = paramsOrCallback;
10368
+ params = {} as Params$Resource$Accounts$Regions$Create;
10369
+ options = {};
10370
+ }
10371
+
10372
+ if (typeof optionsOrCallback === 'function') {
10373
+ callback = optionsOrCallback;
10374
+ options = {};
10375
+ }
10376
+
10377
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
10378
+ const parameters = {
10379
+ options: Object.assign(
10380
+ {
10381
+ url: (rootUrl + '/accounts/v1/{+parent}/regions').replace(
10382
+ /([^:]\/)\/+/g,
10383
+ '$1'
10384
+ ),
10385
+ method: 'POST',
10386
+ apiVersion: '',
10387
+ },
10388
+ options
10389
+ ),
10390
+ params,
10391
+ requiredParams: ['parent'],
10392
+ pathParams: ['parent'],
10393
+ context: this.context,
10394
+ };
10395
+ if (callback) {
10396
+ createAPIRequest<Schema$Region>(
10397
+ parameters,
10398
+ callback as BodyResponseCallback<unknown>
10399
+ );
10400
+ } else {
10401
+ return createAPIRequest<Schema$Region>(parameters);
10402
+ }
10403
+ }
10404
+
10405
+ /**
10406
+ * Deletes a region definition from your Merchant Center account. Executing this method requires admin access.
10407
+ * @example
10408
+ * ```js
10409
+ * // Before running the sample:
10410
+ * // - Enable the API at:
10411
+ * // https://console.developers.google.com/apis/api/merchantapi.googleapis.com
10412
+ * // - Login into gcloud by running:
10413
+ * // ```sh
10414
+ * // $ gcloud auth application-default login
10415
+ * // ```
10416
+ * // - Install the npm module by running:
10417
+ * // ```sh
10418
+ * // $ npm install googleapis
10419
+ * // ```
10420
+ *
10421
+ * const {google} = require('googleapis');
10422
+ * const merchantapi = google.merchantapi('accounts_v1');
10423
+ *
10424
+ * async function main() {
10425
+ * const auth = new google.auth.GoogleAuth({
10426
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
10427
+ * scopes: ['https://www.googleapis.com/auth/content'],
10428
+ * });
10429
+ *
10430
+ * // Acquire an auth client, and bind it to all future calls
10431
+ * const authClient = await auth.getClient();
10432
+ * google.options({auth: authClient});
10433
+ *
10434
+ * // Do the magic
10435
+ * const res = await merchantapi.accounts.regions.delete({
10436
+ * // Required. The name of the region to delete. Format: `accounts/{account\}/regions/{region\}`
10437
+ * name: 'accounts/my-account/regions/my-region',
10438
+ * });
10439
+ * console.log(res.data);
10440
+ *
10441
+ * // Example response
10442
+ * // {}
10443
+ * }
10444
+ *
10445
+ * main().catch(e => {
10446
+ * console.error(e);
10447
+ * throw e;
10448
+ * });
10449
+ *
10450
+ * ```
10451
+ *
10452
+ * @param params - Parameters for request
10453
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
10454
+ * @param callback - Optional callback that handles the response.
10455
+ * @returns A promise if used with async/await, or void if used with a callback.
10456
+ */
10457
+ delete(
10458
+ params: Params$Resource$Accounts$Regions$Delete,
10459
+ options: StreamMethodOptions
10460
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
10461
+ delete(
10462
+ params?: Params$Resource$Accounts$Regions$Delete,
10463
+ options?: MethodOptions
10464
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
10465
+ delete(
10466
+ params: Params$Resource$Accounts$Regions$Delete,
10467
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
10468
+ callback: BodyResponseCallback<Readable>
10469
+ ): void;
10470
+ delete(
10471
+ params: Params$Resource$Accounts$Regions$Delete,
10472
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
10473
+ callback: BodyResponseCallback<Schema$Empty>
10474
+ ): void;
10475
+ delete(
10476
+ params: Params$Resource$Accounts$Regions$Delete,
10477
+ callback: BodyResponseCallback<Schema$Empty>
10478
+ ): void;
10479
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
10480
+ delete(
10481
+ paramsOrCallback?:
10482
+ | Params$Resource$Accounts$Regions$Delete
10483
+ | BodyResponseCallback<Schema$Empty>
10484
+ | BodyResponseCallback<Readable>,
10485
+ optionsOrCallback?:
10486
+ | MethodOptions
10487
+ | StreamMethodOptions
10488
+ | BodyResponseCallback<Schema$Empty>
10489
+ | BodyResponseCallback<Readable>,
10490
+ callback?:
10491
+ | BodyResponseCallback<Schema$Empty>
10492
+ | BodyResponseCallback<Readable>
10493
+ ):
10494
+ | void
10495
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
10496
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
10497
+ let params = (paramsOrCallback ||
10498
+ {}) as Params$Resource$Accounts$Regions$Delete;
10499
+ let options = (optionsOrCallback || {}) as MethodOptions;
10500
+
10501
+ if (typeof paramsOrCallback === 'function') {
10502
+ callback = paramsOrCallback;
10503
+ params = {} as Params$Resource$Accounts$Regions$Delete;
10504
+ options = {};
10505
+ }
10506
+
10507
+ if (typeof optionsOrCallback === 'function') {
10508
+ callback = optionsOrCallback;
10509
+ options = {};
10510
+ }
10511
+
10512
+ const rootUrl = options.rootUrl || 'https://merchantapi.googleapis.com/';
10513
+ const parameters = {
10514
+ options: Object.assign(
10515
+ {
10516
+ url: (rootUrl + '/accounts/v1/{+name}').replace(
10517
+ /([^:]\/)\/+/g,
10518
+ '$1'
10519
+ ),
9844
10520
  method: 'DELETE',
9845
10521
  apiVersion: '',
9846
10522
  },
@@ -10303,6 +10979,42 @@ export namespace merchantapi_accounts_v1 {
10303
10979
  }
10304
10980
  }
10305
10981
 
10982
+ export interface Params$Resource$Accounts$Regions$Batchcreate
10983
+ extends StandardParameters {
10984
+ /**
10985
+ * Required. The account to create one or more regions for. Format: `accounts/{account\}`
10986
+ */
10987
+ parent?: string;
10988
+
10989
+ /**
10990
+ * Request body metadata
10991
+ */
10992
+ requestBody?: Schema$BatchCreateRegionsRequest;
10993
+ }
10994
+ export interface Params$Resource$Accounts$Regions$Batchdelete
10995
+ extends StandardParameters {
10996
+ /**
10997
+ * Required. The account to delete one or more regions from. Format: `accounts/{account\}`
10998
+ */
10999
+ parent?: string;
11000
+
11001
+ /**
11002
+ * Request body metadata
11003
+ */
11004
+ requestBody?: Schema$BatchDeleteRegionsRequest;
11005
+ }
11006
+ export interface Params$Resource$Accounts$Regions$Batchupdate
11007
+ extends StandardParameters {
11008
+ /**
11009
+ * Required. The account to update one or more regions for. Format: `accounts/{account\}`
11010
+ */
11011
+ parent?: string;
11012
+
11013
+ /**
11014
+ * Request body metadata
11015
+ */
11016
+ requestBody?: Schema$BatchUpdateRegionsRequest;
11017
+ }
10306
11018
  export interface Params$Resource$Accounts$Regions$Create
10307
11019
  extends StandardParameters {
10308
11020
  /**