@googleapis/servicedirectory 3.1.0 → 5.0.1

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/v1beta1.ts CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  Compute,
24
24
  UserRefreshClient,
25
25
  BaseExternalAccountClient,
26
- GaxiosPromise,
26
+ GaxiosResponseWithHTTP2,
27
27
  GoogleConfigurable,
28
28
  createAPIRequest,
29
29
  MethodOptions,
@@ -437,6 +437,56 @@ export namespace servicedirectory_v1beta1 {
437
437
 
438
438
  /**
439
439
  * Gets information about a location.
440
+ * @example
441
+ * ```js
442
+ * // Before running the sample:
443
+ * // - Enable the API at:
444
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
445
+ * // - Login into gcloud by running:
446
+ * // ```sh
447
+ * // $ gcloud auth application-default login
448
+ * // ```
449
+ * // - Install the npm module by running:
450
+ * // ```sh
451
+ * // $ npm install googleapis
452
+ * // ```
453
+ *
454
+ * const {google} = require('googleapis');
455
+ * const servicedirectory = google.servicedirectory('v1beta1');
456
+ *
457
+ * async function main() {
458
+ * const auth = new google.auth.GoogleAuth({
459
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
460
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
461
+ * });
462
+ *
463
+ * // Acquire an auth client, and bind it to all future calls
464
+ * const authClient = await auth.getClient();
465
+ * google.options({auth: authClient});
466
+ *
467
+ * // Do the magic
468
+ * const res = await servicedirectory.projects.locations.get({
469
+ * // Resource name for the location.
470
+ * name: 'projects/my-project/locations/my-location',
471
+ * });
472
+ * console.log(res.data);
473
+ *
474
+ * // Example response
475
+ * // {
476
+ * // "displayName": "my_displayName",
477
+ * // "labels": {},
478
+ * // "locationId": "my_locationId",
479
+ * // "metadata": {},
480
+ * // "name": "my_name"
481
+ * // }
482
+ * }
483
+ *
484
+ * main().catch(e => {
485
+ * console.error(e);
486
+ * throw e;
487
+ * });
488
+ *
489
+ * ```
440
490
  *
441
491
  * @param params - Parameters for request
442
492
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -446,11 +496,11 @@ export namespace servicedirectory_v1beta1 {
446
496
  get(
447
497
  params: Params$Resource$Projects$Locations$Get,
448
498
  options: StreamMethodOptions
449
- ): GaxiosPromise<Readable>;
499
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
450
500
  get(
451
501
  params?: Params$Resource$Projects$Locations$Get,
452
502
  options?: MethodOptions
453
- ): GaxiosPromise<Schema$Location>;
503
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Location>>;
454
504
  get(
455
505
  params: Params$Resource$Projects$Locations$Get,
456
506
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -479,7 +529,10 @@ export namespace servicedirectory_v1beta1 {
479
529
  callback?:
480
530
  | BodyResponseCallback<Schema$Location>
481
531
  | BodyResponseCallback<Readable>
482
- ): void | GaxiosPromise<Schema$Location> | GaxiosPromise<Readable> {
532
+ ):
533
+ | void
534
+ | Promise<GaxiosResponseWithHTTP2<Schema$Location>>
535
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
483
536
  let params = (paramsOrCallback ||
484
537
  {}) as Params$Resource$Projects$Locations$Get;
485
538
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -523,6 +576,61 @@ export namespace servicedirectory_v1beta1 {
523
576
 
524
577
  /**
525
578
  * Lists information about the supported locations for this service.
579
+ * @example
580
+ * ```js
581
+ * // Before running the sample:
582
+ * // - Enable the API at:
583
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
584
+ * // - Login into gcloud by running:
585
+ * // ```sh
586
+ * // $ gcloud auth application-default login
587
+ * // ```
588
+ * // - Install the npm module by running:
589
+ * // ```sh
590
+ * // $ npm install googleapis
591
+ * // ```
592
+ *
593
+ * const {google} = require('googleapis');
594
+ * const servicedirectory = google.servicedirectory('v1beta1');
595
+ *
596
+ * async function main() {
597
+ * const auth = new google.auth.GoogleAuth({
598
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
599
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
600
+ * });
601
+ *
602
+ * // Acquire an auth client, and bind it to all future calls
603
+ * const authClient = await auth.getClient();
604
+ * google.options({auth: authClient});
605
+ *
606
+ * // Do the magic
607
+ * const res = await servicedirectory.projects.locations.list({
608
+ * // Optional. A list of extra location types that should be used as conditions for controlling the visibility of the locations.
609
+ * extraLocationTypes: 'placeholder-value',
610
+ * // A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).
611
+ * filter: 'placeholder-value',
612
+ * // The resource that owns the locations collection, if applicable.
613
+ * name: 'projects/my-project',
614
+ * // The maximum number of results to return. If not set, the service selects a default.
615
+ * pageSize: 'placeholder-value',
616
+ * // A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
617
+ * pageToken: 'placeholder-value',
618
+ * });
619
+ * console.log(res.data);
620
+ *
621
+ * // Example response
622
+ * // {
623
+ * // "locations": [],
624
+ * // "nextPageToken": "my_nextPageToken"
625
+ * // }
626
+ * }
627
+ *
628
+ * main().catch(e => {
629
+ * console.error(e);
630
+ * throw e;
631
+ * });
632
+ *
633
+ * ```
526
634
  *
527
635
  * @param params - Parameters for request
528
636
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -532,11 +640,11 @@ export namespace servicedirectory_v1beta1 {
532
640
  list(
533
641
  params: Params$Resource$Projects$Locations$List,
534
642
  options: StreamMethodOptions
535
- ): GaxiosPromise<Readable>;
643
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
536
644
  list(
537
645
  params?: Params$Resource$Projects$Locations$List,
538
646
  options?: MethodOptions
539
- ): GaxiosPromise<Schema$ListLocationsResponse>;
647
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListLocationsResponse>>;
540
648
  list(
541
649
  params: Params$Resource$Projects$Locations$List,
542
650
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -569,8 +677,8 @@ export namespace servicedirectory_v1beta1 {
569
677
  | BodyResponseCallback<Readable>
570
678
  ):
571
679
  | void
572
- | GaxiosPromise<Schema$ListLocationsResponse>
573
- | GaxiosPromise<Readable> {
680
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListLocationsResponse>>
681
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
574
682
  let params = (paramsOrCallback ||
575
683
  {}) as Params$Resource$Projects$Locations$List;
576
684
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -663,6 +771,70 @@ export namespace servicedirectory_v1beta1 {
663
771
 
664
772
  /**
665
773
  * Creates a namespace, and returns the new namespace.
774
+ * @example
775
+ * ```js
776
+ * // Before running the sample:
777
+ * // - Enable the API at:
778
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
779
+ * // - Login into gcloud by running:
780
+ * // ```sh
781
+ * // $ gcloud auth application-default login
782
+ * // ```
783
+ * // - Install the npm module by running:
784
+ * // ```sh
785
+ * // $ npm install googleapis
786
+ * // ```
787
+ *
788
+ * const {google} = require('googleapis');
789
+ * const servicedirectory = google.servicedirectory('v1beta1');
790
+ *
791
+ * async function main() {
792
+ * const auth = new google.auth.GoogleAuth({
793
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
794
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
795
+ * });
796
+ *
797
+ * // Acquire an auth client, and bind it to all future calls
798
+ * const authClient = await auth.getClient();
799
+ * google.options({auth: authClient});
800
+ *
801
+ * // Do the magic
802
+ * const res = await servicedirectory.projects.locations.namespaces.create({
803
+ * // Required. The Resource ID must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z](?:[-a-z0-9]{0,61\}[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
804
+ * namespaceId: 'placeholder-value',
805
+ * // Required. The resource name of the project and location the namespace will be created in.
806
+ * parent: 'projects/my-project/locations/my-location',
807
+ *
808
+ * // Request body metadata
809
+ * requestBody: {
810
+ * // request body parameters
811
+ * // {
812
+ * // "createTime": "my_createTime",
813
+ * // "labels": {},
814
+ * // "name": "my_name",
815
+ * // "uid": "my_uid",
816
+ * // "updateTime": "my_updateTime"
817
+ * // }
818
+ * },
819
+ * });
820
+ * console.log(res.data);
821
+ *
822
+ * // Example response
823
+ * // {
824
+ * // "createTime": "my_createTime",
825
+ * // "labels": {},
826
+ * // "name": "my_name",
827
+ * // "uid": "my_uid",
828
+ * // "updateTime": "my_updateTime"
829
+ * // }
830
+ * }
831
+ *
832
+ * main().catch(e => {
833
+ * console.error(e);
834
+ * throw e;
835
+ * });
836
+ *
837
+ * ```
666
838
  *
667
839
  * @param params - Parameters for request
668
840
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -672,11 +844,11 @@ export namespace servicedirectory_v1beta1 {
672
844
  create(
673
845
  params: Params$Resource$Projects$Locations$Namespaces$Create,
674
846
  options: StreamMethodOptions
675
- ): GaxiosPromise<Readable>;
847
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
676
848
  create(
677
849
  params?: Params$Resource$Projects$Locations$Namespaces$Create,
678
850
  options?: MethodOptions
679
- ): GaxiosPromise<Schema$Namespace>;
851
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Namespace>>;
680
852
  create(
681
853
  params: Params$Resource$Projects$Locations$Namespaces$Create,
682
854
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -705,7 +877,10 @@ export namespace servicedirectory_v1beta1 {
705
877
  callback?:
706
878
  | BodyResponseCallback<Schema$Namespace>
707
879
  | BodyResponseCallback<Readable>
708
- ): void | GaxiosPromise<Schema$Namespace> | GaxiosPromise<Readable> {
880
+ ):
881
+ | void
882
+ | Promise<GaxiosResponseWithHTTP2<Schema$Namespace>>
883
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
709
884
  let params = (paramsOrCallback ||
710
885
  {}) as Params$Resource$Projects$Locations$Namespaces$Create;
711
886
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -752,6 +927,50 @@ export namespace servicedirectory_v1beta1 {
752
927
 
753
928
  /**
754
929
  * Deletes a namespace. This also deletes all services and endpoints in the namespace.
930
+ * @example
931
+ * ```js
932
+ * // Before running the sample:
933
+ * // - Enable the API at:
934
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
935
+ * // - Login into gcloud by running:
936
+ * // ```sh
937
+ * // $ gcloud auth application-default login
938
+ * // ```
939
+ * // - Install the npm module by running:
940
+ * // ```sh
941
+ * // $ npm install googleapis
942
+ * // ```
943
+ *
944
+ * const {google} = require('googleapis');
945
+ * const servicedirectory = google.servicedirectory('v1beta1');
946
+ *
947
+ * async function main() {
948
+ * const auth = new google.auth.GoogleAuth({
949
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
950
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
951
+ * });
952
+ *
953
+ * // Acquire an auth client, and bind it to all future calls
954
+ * const authClient = await auth.getClient();
955
+ * google.options({auth: authClient});
956
+ *
957
+ * // Do the magic
958
+ * const res = await servicedirectory.projects.locations.namespaces.delete({
959
+ * // Required. The name of the namespace to delete.
960
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace',
961
+ * });
962
+ * console.log(res.data);
963
+ *
964
+ * // Example response
965
+ * // {}
966
+ * }
967
+ *
968
+ * main().catch(e => {
969
+ * console.error(e);
970
+ * throw e;
971
+ * });
972
+ *
973
+ * ```
755
974
  *
756
975
  * @param params - Parameters for request
757
976
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -761,11 +980,11 @@ export namespace servicedirectory_v1beta1 {
761
980
  delete(
762
981
  params: Params$Resource$Projects$Locations$Namespaces$Delete,
763
982
  options: StreamMethodOptions
764
- ): GaxiosPromise<Readable>;
983
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
765
984
  delete(
766
985
  params?: Params$Resource$Projects$Locations$Namespaces$Delete,
767
986
  options?: MethodOptions
768
- ): GaxiosPromise<Schema$Empty>;
987
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
769
988
  delete(
770
989
  params: Params$Resource$Projects$Locations$Namespaces$Delete,
771
990
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -794,7 +1013,10 @@ export namespace servicedirectory_v1beta1 {
794
1013
  callback?:
795
1014
  | BodyResponseCallback<Schema$Empty>
796
1015
  | BodyResponseCallback<Readable>
797
- ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
1016
+ ):
1017
+ | void
1018
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
1019
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
798
1020
  let params = (paramsOrCallback ||
799
1021
  {}) as Params$Resource$Projects$Locations$Namespaces$Delete;
800
1022
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -838,6 +1060,56 @@ export namespace servicedirectory_v1beta1 {
838
1060
 
839
1061
  /**
840
1062
  * Gets a namespace.
1063
+ * @example
1064
+ * ```js
1065
+ * // Before running the sample:
1066
+ * // - Enable the API at:
1067
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1068
+ * // - Login into gcloud by running:
1069
+ * // ```sh
1070
+ * // $ gcloud auth application-default login
1071
+ * // ```
1072
+ * // - Install the npm module by running:
1073
+ * // ```sh
1074
+ * // $ npm install googleapis
1075
+ * // ```
1076
+ *
1077
+ * const {google} = require('googleapis');
1078
+ * const servicedirectory = google.servicedirectory('v1beta1');
1079
+ *
1080
+ * async function main() {
1081
+ * const auth = new google.auth.GoogleAuth({
1082
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1083
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1084
+ * });
1085
+ *
1086
+ * // Acquire an auth client, and bind it to all future calls
1087
+ * const authClient = await auth.getClient();
1088
+ * google.options({auth: authClient});
1089
+ *
1090
+ * // Do the magic
1091
+ * const res = await servicedirectory.projects.locations.namespaces.get({
1092
+ * // Required. The name of the namespace to retrieve.
1093
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace',
1094
+ * });
1095
+ * console.log(res.data);
1096
+ *
1097
+ * // Example response
1098
+ * // {
1099
+ * // "createTime": "my_createTime",
1100
+ * // "labels": {},
1101
+ * // "name": "my_name",
1102
+ * // "uid": "my_uid",
1103
+ * // "updateTime": "my_updateTime"
1104
+ * // }
1105
+ * }
1106
+ *
1107
+ * main().catch(e => {
1108
+ * console.error(e);
1109
+ * throw e;
1110
+ * });
1111
+ *
1112
+ * ```
841
1113
  *
842
1114
  * @param params - Parameters for request
843
1115
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -847,11 +1119,11 @@ export namespace servicedirectory_v1beta1 {
847
1119
  get(
848
1120
  params: Params$Resource$Projects$Locations$Namespaces$Get,
849
1121
  options: StreamMethodOptions
850
- ): GaxiosPromise<Readable>;
1122
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
851
1123
  get(
852
1124
  params?: Params$Resource$Projects$Locations$Namespaces$Get,
853
1125
  options?: MethodOptions
854
- ): GaxiosPromise<Schema$Namespace>;
1126
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Namespace>>;
855
1127
  get(
856
1128
  params: Params$Resource$Projects$Locations$Namespaces$Get,
857
1129
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -880,7 +1152,10 @@ export namespace servicedirectory_v1beta1 {
880
1152
  callback?:
881
1153
  | BodyResponseCallback<Schema$Namespace>
882
1154
  | BodyResponseCallback<Readable>
883
- ): void | GaxiosPromise<Schema$Namespace> | GaxiosPromise<Readable> {
1155
+ ):
1156
+ | void
1157
+ | Promise<GaxiosResponseWithHTTP2<Schema$Namespace>>
1158
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
884
1159
  let params = (paramsOrCallback ||
885
1160
  {}) as Params$Resource$Projects$Locations$Namespaces$Get;
886
1161
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -924,6 +1199,65 @@ export namespace servicedirectory_v1beta1 {
924
1199
 
925
1200
  /**
926
1201
  * Gets the IAM Policy for a resource
1202
+ * @example
1203
+ * ```js
1204
+ * // Before running the sample:
1205
+ * // - Enable the API at:
1206
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1207
+ * // - Login into gcloud by running:
1208
+ * // ```sh
1209
+ * // $ gcloud auth application-default login
1210
+ * // ```
1211
+ * // - Install the npm module by running:
1212
+ * // ```sh
1213
+ * // $ npm install googleapis
1214
+ * // ```
1215
+ *
1216
+ * const {google} = require('googleapis');
1217
+ * const servicedirectory = google.servicedirectory('v1beta1');
1218
+ *
1219
+ * async function main() {
1220
+ * const auth = new google.auth.GoogleAuth({
1221
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1222
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1223
+ * });
1224
+ *
1225
+ * // Acquire an auth client, and bind it to all future calls
1226
+ * const authClient = await auth.getClient();
1227
+ * google.options({auth: authClient});
1228
+ *
1229
+ * // Do the magic
1230
+ * const res = await servicedirectory.projects.locations.namespaces.getIamPolicy(
1231
+ * {
1232
+ * // REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
1233
+ * resource:
1234
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
1235
+ *
1236
+ * // Request body metadata
1237
+ * requestBody: {
1238
+ * // request body parameters
1239
+ * // {
1240
+ * // "options": {}
1241
+ * // }
1242
+ * },
1243
+ * },
1244
+ * );
1245
+ * console.log(res.data);
1246
+ *
1247
+ * // Example response
1248
+ * // {
1249
+ * // "bindings": [],
1250
+ * // "etag": "my_etag",
1251
+ * // "version": 0
1252
+ * // }
1253
+ * }
1254
+ *
1255
+ * main().catch(e => {
1256
+ * console.error(e);
1257
+ * throw e;
1258
+ * });
1259
+ *
1260
+ * ```
927
1261
  *
928
1262
  * @param params - Parameters for request
929
1263
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -933,11 +1267,11 @@ export namespace servicedirectory_v1beta1 {
933
1267
  getIamPolicy(
934
1268
  params: Params$Resource$Projects$Locations$Namespaces$Getiampolicy,
935
1269
  options: StreamMethodOptions
936
- ): GaxiosPromise<Readable>;
1270
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
937
1271
  getIamPolicy(
938
1272
  params?: Params$Resource$Projects$Locations$Namespaces$Getiampolicy,
939
1273
  options?: MethodOptions
940
- ): GaxiosPromise<Schema$Policy>;
1274
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Policy>>;
941
1275
  getIamPolicy(
942
1276
  params: Params$Resource$Projects$Locations$Namespaces$Getiampolicy,
943
1277
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -966,7 +1300,10 @@ export namespace servicedirectory_v1beta1 {
966
1300
  callback?:
967
1301
  | BodyResponseCallback<Schema$Policy>
968
1302
  | BodyResponseCallback<Readable>
969
- ): void | GaxiosPromise<Schema$Policy> | GaxiosPromise<Readable> {
1303
+ ):
1304
+ | void
1305
+ | Promise<GaxiosResponseWithHTTP2<Schema$Policy>>
1306
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
970
1307
  let params = (paramsOrCallback ||
971
1308
  {}) as Params$Resource$Projects$Locations$Namespaces$Getiampolicy;
972
1309
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1014,6 +1351,61 @@ export namespace servicedirectory_v1beta1 {
1014
1351
 
1015
1352
  /**
1016
1353
  * Lists all namespaces.
1354
+ * @example
1355
+ * ```js
1356
+ * // Before running the sample:
1357
+ * // - Enable the API at:
1358
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1359
+ * // - Login into gcloud by running:
1360
+ * // ```sh
1361
+ * // $ gcloud auth application-default login
1362
+ * // ```
1363
+ * // - Install the npm module by running:
1364
+ * // ```sh
1365
+ * // $ npm install googleapis
1366
+ * // ```
1367
+ *
1368
+ * const {google} = require('googleapis');
1369
+ * const servicedirectory = google.servicedirectory('v1beta1');
1370
+ *
1371
+ * async function main() {
1372
+ * const auth = new google.auth.GoogleAuth({
1373
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1374
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1375
+ * });
1376
+ *
1377
+ * // Acquire an auth client, and bind it to all future calls
1378
+ * const authClient = await auth.getClient();
1379
+ * google.options({auth: authClient});
1380
+ *
1381
+ * // Do the magic
1382
+ * const res = await servicedirectory.projects.locations.namespaces.list({
1383
+ * // Optional. The filter to list results by. General `filter` string syntax: ` ()` * `` can be `name`, `labels.` for map field, or `attributes.` for attributes field * `` can be `<`, `\>`, `<=`, `\>=`, `!=`, `=`, `:`. Of which `:` means `HAS`, and is roughly the same as `=` * `` must be the same data type as field * `` can be `AND`, `OR`, `NOT` Examples of valid filters: * `labels.owner` returns namespaces that have a label with the key `owner`, this is the same as `labels:owner` * `labels.owner=sd` returns namespaces that have key/value `owner=sd` * `name\>projects/my-project/locations/us-east1/namespaces/namespace-c` returns namespaces that have name that is alphabetically later than the string, so "namespace-e" is returned but "namespace-a" is not * `labels.owner!=sd AND labels.foo=bar` returns namespaces that have `owner` in label key but value is not `sd` AND have key/value `foo=bar` * `doesnotexist.foo=bar` returns an empty list. Note that namespace doesn't have a field called "doesnotexist". Since the filter does not match any namespaces, it returns no results * `attributes.managed_registration=true` returns namespaces that are managed by a GCP product or service For more information about filtering, see [API Filtering](https://aip.dev/160).
1384
+ * filter: 'placeholder-value',
1385
+ * // Optional. The order to list results by. General `order_by` string syntax: ` () (,)` * `` allows value: `name` * `` ascending or descending order by ``. If this is left blank, `asc` is used Note that an empty `order_by` string results in default order, which is order by `name` in ascending order.
1386
+ * orderBy: 'placeholder-value',
1387
+ * // Optional. The maximum number of items to return. The default value is 100.
1388
+ * pageSize: 'placeholder-value',
1389
+ * // Optional. The next_page_token value returned from a previous List request, if any.
1390
+ * pageToken: 'placeholder-value',
1391
+ * // Required. The resource name of the project and location whose namespaces you'd like to list.
1392
+ * parent: 'projects/my-project/locations/my-location',
1393
+ * });
1394
+ * console.log(res.data);
1395
+ *
1396
+ * // Example response
1397
+ * // {
1398
+ * // "namespaces": [],
1399
+ * // "nextPageToken": "my_nextPageToken"
1400
+ * // }
1401
+ * }
1402
+ *
1403
+ * main().catch(e => {
1404
+ * console.error(e);
1405
+ * throw e;
1406
+ * });
1407
+ *
1408
+ * ```
1017
1409
  *
1018
1410
  * @param params - Parameters for request
1019
1411
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1023,11 +1415,11 @@ export namespace servicedirectory_v1beta1 {
1023
1415
  list(
1024
1416
  params: Params$Resource$Projects$Locations$Namespaces$List,
1025
1417
  options: StreamMethodOptions
1026
- ): GaxiosPromise<Readable>;
1418
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1027
1419
  list(
1028
1420
  params?: Params$Resource$Projects$Locations$Namespaces$List,
1029
1421
  options?: MethodOptions
1030
- ): GaxiosPromise<Schema$ListNamespacesResponse>;
1422
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListNamespacesResponse>>;
1031
1423
  list(
1032
1424
  params: Params$Resource$Projects$Locations$Namespaces$List,
1033
1425
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1060,8 +1452,8 @@ export namespace servicedirectory_v1beta1 {
1060
1452
  | BodyResponseCallback<Readable>
1061
1453
  ):
1062
1454
  | void
1063
- | GaxiosPromise<Schema$ListNamespacesResponse>
1064
- | GaxiosPromise<Readable> {
1455
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListNamespacesResponse>>
1456
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1065
1457
  let params = (paramsOrCallback ||
1066
1458
  {}) as Params$Resource$Projects$Locations$Namespaces$List;
1067
1459
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1108,6 +1500,70 @@ export namespace servicedirectory_v1beta1 {
1108
1500
 
1109
1501
  /**
1110
1502
  * Updates a namespace.
1503
+ * @example
1504
+ * ```js
1505
+ * // Before running the sample:
1506
+ * // - Enable the API at:
1507
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1508
+ * // - Login into gcloud by running:
1509
+ * // ```sh
1510
+ * // $ gcloud auth application-default login
1511
+ * // ```
1512
+ * // - Install the npm module by running:
1513
+ * // ```sh
1514
+ * // $ npm install googleapis
1515
+ * // ```
1516
+ *
1517
+ * const {google} = require('googleapis');
1518
+ * const servicedirectory = google.servicedirectory('v1beta1');
1519
+ *
1520
+ * async function main() {
1521
+ * const auth = new google.auth.GoogleAuth({
1522
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1523
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1524
+ * });
1525
+ *
1526
+ * // Acquire an auth client, and bind it to all future calls
1527
+ * const authClient = await auth.getClient();
1528
+ * google.options({auth: authClient});
1529
+ *
1530
+ * // Do the magic
1531
+ * const res = await servicedirectory.projects.locations.namespaces.patch({
1532
+ * // Immutable. The resource name for the namespace in the format `projects/x/locations/x/namespaces/x`.
1533
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace',
1534
+ * // Required. List of fields to be updated in this request.
1535
+ * updateMask: 'placeholder-value',
1536
+ *
1537
+ * // Request body metadata
1538
+ * requestBody: {
1539
+ * // request body parameters
1540
+ * // {
1541
+ * // "createTime": "my_createTime",
1542
+ * // "labels": {},
1543
+ * // "name": "my_name",
1544
+ * // "uid": "my_uid",
1545
+ * // "updateTime": "my_updateTime"
1546
+ * // }
1547
+ * },
1548
+ * });
1549
+ * console.log(res.data);
1550
+ *
1551
+ * // Example response
1552
+ * // {
1553
+ * // "createTime": "my_createTime",
1554
+ * // "labels": {},
1555
+ * // "name": "my_name",
1556
+ * // "uid": "my_uid",
1557
+ * // "updateTime": "my_updateTime"
1558
+ * // }
1559
+ * }
1560
+ *
1561
+ * main().catch(e => {
1562
+ * console.error(e);
1563
+ * throw e;
1564
+ * });
1565
+ *
1566
+ * ```
1111
1567
  *
1112
1568
  * @param params - Parameters for request
1113
1569
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1117,11 +1573,11 @@ export namespace servicedirectory_v1beta1 {
1117
1573
  patch(
1118
1574
  params: Params$Resource$Projects$Locations$Namespaces$Patch,
1119
1575
  options: StreamMethodOptions
1120
- ): GaxiosPromise<Readable>;
1576
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1121
1577
  patch(
1122
1578
  params?: Params$Resource$Projects$Locations$Namespaces$Patch,
1123
1579
  options?: MethodOptions
1124
- ): GaxiosPromise<Schema$Namespace>;
1580
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Namespace>>;
1125
1581
  patch(
1126
1582
  params: Params$Resource$Projects$Locations$Namespaces$Patch,
1127
1583
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1150,7 +1606,10 @@ export namespace servicedirectory_v1beta1 {
1150
1606
  callback?:
1151
1607
  | BodyResponseCallback<Schema$Namespace>
1152
1608
  | BodyResponseCallback<Readable>
1153
- ): void | GaxiosPromise<Schema$Namespace> | GaxiosPromise<Readable> {
1609
+ ):
1610
+ | void
1611
+ | Promise<GaxiosResponseWithHTTP2<Schema$Namespace>>
1612
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1154
1613
  let params = (paramsOrCallback ||
1155
1614
  {}) as Params$Resource$Projects$Locations$Namespaces$Patch;
1156
1615
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1194,6 +1653,65 @@ export namespace servicedirectory_v1beta1 {
1194
1653
 
1195
1654
  /**
1196
1655
  * Sets the IAM Policy for a resource
1656
+ * @example
1657
+ * ```js
1658
+ * // Before running the sample:
1659
+ * // - Enable the API at:
1660
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1661
+ * // - Login into gcloud by running:
1662
+ * // ```sh
1663
+ * // $ gcloud auth application-default login
1664
+ * // ```
1665
+ * // - Install the npm module by running:
1666
+ * // ```sh
1667
+ * // $ npm install googleapis
1668
+ * // ```
1669
+ *
1670
+ * const {google} = require('googleapis');
1671
+ * const servicedirectory = google.servicedirectory('v1beta1');
1672
+ *
1673
+ * async function main() {
1674
+ * const auth = new google.auth.GoogleAuth({
1675
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1676
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1677
+ * });
1678
+ *
1679
+ * // Acquire an auth client, and bind it to all future calls
1680
+ * const authClient = await auth.getClient();
1681
+ * google.options({auth: authClient});
1682
+ *
1683
+ * // Do the magic
1684
+ * const res = await servicedirectory.projects.locations.namespaces.setIamPolicy(
1685
+ * {
1686
+ * // REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
1687
+ * resource:
1688
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
1689
+ *
1690
+ * // Request body metadata
1691
+ * requestBody: {
1692
+ * // request body parameters
1693
+ * // {
1694
+ * // "policy": {}
1695
+ * // }
1696
+ * },
1697
+ * },
1698
+ * );
1699
+ * console.log(res.data);
1700
+ *
1701
+ * // Example response
1702
+ * // {
1703
+ * // "bindings": [],
1704
+ * // "etag": "my_etag",
1705
+ * // "version": 0
1706
+ * // }
1707
+ * }
1708
+ *
1709
+ * main().catch(e => {
1710
+ * console.error(e);
1711
+ * throw e;
1712
+ * });
1713
+ *
1714
+ * ```
1197
1715
  *
1198
1716
  * @param params - Parameters for request
1199
1717
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1203,11 +1721,11 @@ export namespace servicedirectory_v1beta1 {
1203
1721
  setIamPolicy(
1204
1722
  params: Params$Resource$Projects$Locations$Namespaces$Setiampolicy,
1205
1723
  options: StreamMethodOptions
1206
- ): GaxiosPromise<Readable>;
1724
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1207
1725
  setIamPolicy(
1208
1726
  params?: Params$Resource$Projects$Locations$Namespaces$Setiampolicy,
1209
1727
  options?: MethodOptions
1210
- ): GaxiosPromise<Schema$Policy>;
1728
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Policy>>;
1211
1729
  setIamPolicy(
1212
1730
  params: Params$Resource$Projects$Locations$Namespaces$Setiampolicy,
1213
1731
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1236,7 +1754,10 @@ export namespace servicedirectory_v1beta1 {
1236
1754
  callback?:
1237
1755
  | BodyResponseCallback<Schema$Policy>
1238
1756
  | BodyResponseCallback<Readable>
1239
- ): void | GaxiosPromise<Schema$Policy> | GaxiosPromise<Readable> {
1757
+ ):
1758
+ | void
1759
+ | Promise<GaxiosResponseWithHTTP2<Schema$Policy>>
1760
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1240
1761
  let params = (paramsOrCallback ||
1241
1762
  {}) as Params$Resource$Projects$Locations$Namespaces$Setiampolicy;
1242
1763
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1284,6 +1805,62 @@ export namespace servicedirectory_v1beta1 {
1284
1805
 
1285
1806
  /**
1286
1807
  * Tests IAM permissions for a resource (namespace, service or service workload only).
1808
+ * @example
1809
+ * ```js
1810
+ * // Before running the sample:
1811
+ * // - Enable the API at:
1812
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1813
+ * // - Login into gcloud by running:
1814
+ * // ```sh
1815
+ * // $ gcloud auth application-default login
1816
+ * // ```
1817
+ * // - Install the npm module by running:
1818
+ * // ```sh
1819
+ * // $ npm install googleapis
1820
+ * // ```
1821
+ *
1822
+ * const {google} = require('googleapis');
1823
+ * const servicedirectory = google.servicedirectory('v1beta1');
1824
+ *
1825
+ * async function main() {
1826
+ * const auth = new google.auth.GoogleAuth({
1827
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1828
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1829
+ * });
1830
+ *
1831
+ * // Acquire an auth client, and bind it to all future calls
1832
+ * const authClient = await auth.getClient();
1833
+ * google.options({auth: authClient});
1834
+ *
1835
+ * // Do the magic
1836
+ * const res =
1837
+ * await servicedirectory.projects.locations.namespaces.testIamPermissions({
1838
+ * // REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
1839
+ * resource:
1840
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
1841
+ *
1842
+ * // Request body metadata
1843
+ * requestBody: {
1844
+ * // request body parameters
1845
+ * // {
1846
+ * // "permissions": []
1847
+ * // }
1848
+ * },
1849
+ * });
1850
+ * console.log(res.data);
1851
+ *
1852
+ * // Example response
1853
+ * // {
1854
+ * // "permissions": []
1855
+ * // }
1856
+ * }
1857
+ *
1858
+ * main().catch(e => {
1859
+ * console.error(e);
1860
+ * throw e;
1861
+ * });
1862
+ *
1863
+ * ```
1287
1864
  *
1288
1865
  * @param params - Parameters for request
1289
1866
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1293,11 +1870,11 @@ export namespace servicedirectory_v1beta1 {
1293
1870
  testIamPermissions(
1294
1871
  params: Params$Resource$Projects$Locations$Namespaces$Testiampermissions,
1295
1872
  options: StreamMethodOptions
1296
- ): GaxiosPromise<Readable>;
1873
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1297
1874
  testIamPermissions(
1298
1875
  params?: Params$Resource$Projects$Locations$Namespaces$Testiampermissions,
1299
1876
  options?: MethodOptions
1300
- ): GaxiosPromise<Schema$TestIamPermissionsResponse>;
1877
+ ): Promise<GaxiosResponseWithHTTP2<Schema$TestIamPermissionsResponse>>;
1301
1878
  testIamPermissions(
1302
1879
  params: Params$Resource$Projects$Locations$Namespaces$Testiampermissions,
1303
1880
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1332,8 +1909,8 @@ export namespace servicedirectory_v1beta1 {
1332
1909
  | BodyResponseCallback<Readable>
1333
1910
  ):
1334
1911
  | void
1335
- | GaxiosPromise<Schema$TestIamPermissionsResponse>
1336
- | GaxiosPromise<Readable> {
1912
+ | Promise<GaxiosResponseWithHTTP2<Schema$TestIamPermissionsResponse>>
1913
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1337
1914
  let params = (paramsOrCallback ||
1338
1915
  {}) as Params$Resource$Projects$Locations$Namespaces$Testiampermissions;
1339
1916
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1499,6 +2076,74 @@ export namespace servicedirectory_v1beta1 {
1499
2076
 
1500
2077
  /**
1501
2078
  * Creates a service, and returns the new service.
2079
+ * @example
2080
+ * ```js
2081
+ * // Before running the sample:
2082
+ * // - Enable the API at:
2083
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2084
+ * // - Login into gcloud by running:
2085
+ * // ```sh
2086
+ * // $ gcloud auth application-default login
2087
+ * // ```
2088
+ * // - Install the npm module by running:
2089
+ * // ```sh
2090
+ * // $ npm install googleapis
2091
+ * // ```
2092
+ *
2093
+ * const {google} = require('googleapis');
2094
+ * const servicedirectory = google.servicedirectory('v1beta1');
2095
+ *
2096
+ * async function main() {
2097
+ * const auth = new google.auth.GoogleAuth({
2098
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2099
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2100
+ * });
2101
+ *
2102
+ * // Acquire an auth client, and bind it to all future calls
2103
+ * const authClient = await auth.getClient();
2104
+ * google.options({auth: authClient});
2105
+ *
2106
+ * // Do the magic
2107
+ * const res =
2108
+ * await servicedirectory.projects.locations.namespaces.services.create({
2109
+ * // Required. The resource name of the namespace this service will belong to.
2110
+ * parent:
2111
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
2112
+ * // Required. The Resource ID must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z](?:[-a-z0-9]{0,61\}[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
2113
+ * serviceId: 'placeholder-value',
2114
+ *
2115
+ * // Request body metadata
2116
+ * requestBody: {
2117
+ * // request body parameters
2118
+ * // {
2119
+ * // "createTime": "my_createTime",
2120
+ * // "endpoints": [],
2121
+ * // "metadata": {},
2122
+ * // "name": "my_name",
2123
+ * // "uid": "my_uid",
2124
+ * // "updateTime": "my_updateTime"
2125
+ * // }
2126
+ * },
2127
+ * });
2128
+ * console.log(res.data);
2129
+ *
2130
+ * // Example response
2131
+ * // {
2132
+ * // "createTime": "my_createTime",
2133
+ * // "endpoints": [],
2134
+ * // "metadata": {},
2135
+ * // "name": "my_name",
2136
+ * // "uid": "my_uid",
2137
+ * // "updateTime": "my_updateTime"
2138
+ * // }
2139
+ * }
2140
+ *
2141
+ * main().catch(e => {
2142
+ * console.error(e);
2143
+ * throw e;
2144
+ * });
2145
+ *
2146
+ * ```
1502
2147
  *
1503
2148
  * @param params - Parameters for request
1504
2149
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1508,11 +2153,11 @@ export namespace servicedirectory_v1beta1 {
1508
2153
  create(
1509
2154
  params: Params$Resource$Projects$Locations$Namespaces$Services$Create,
1510
2155
  options: StreamMethodOptions
1511
- ): GaxiosPromise<Readable>;
2156
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1512
2157
  create(
1513
2158
  params?: Params$Resource$Projects$Locations$Namespaces$Services$Create,
1514
2159
  options?: MethodOptions
1515
- ): GaxiosPromise<Schema$Service>;
2160
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Service>>;
1516
2161
  create(
1517
2162
  params: Params$Resource$Projects$Locations$Namespaces$Services$Create,
1518
2163
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1541,7 +2186,10 @@ export namespace servicedirectory_v1beta1 {
1541
2186
  callback?:
1542
2187
  | BodyResponseCallback<Schema$Service>
1543
2188
  | BodyResponseCallback<Readable>
1544
- ): void | GaxiosPromise<Schema$Service> | GaxiosPromise<Readable> {
2189
+ ):
2190
+ | void
2191
+ | Promise<GaxiosResponseWithHTTP2<Schema$Service>>
2192
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1545
2193
  let params = (paramsOrCallback ||
1546
2194
  {}) as Params$Resource$Projects$Locations$Namespaces$Services$Create;
1547
2195
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1589,6 +2237,51 @@ export namespace servicedirectory_v1beta1 {
1589
2237
 
1590
2238
  /**
1591
2239
  * Deletes a service. This also deletes all endpoints associated with the service.
2240
+ * @example
2241
+ * ```js
2242
+ * // Before running the sample:
2243
+ * // - Enable the API at:
2244
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2245
+ * // - Login into gcloud by running:
2246
+ * // ```sh
2247
+ * // $ gcloud auth application-default login
2248
+ * // ```
2249
+ * // - Install the npm module by running:
2250
+ * // ```sh
2251
+ * // $ npm install googleapis
2252
+ * // ```
2253
+ *
2254
+ * const {google} = require('googleapis');
2255
+ * const servicedirectory = google.servicedirectory('v1beta1');
2256
+ *
2257
+ * async function main() {
2258
+ * const auth = new google.auth.GoogleAuth({
2259
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2260
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2261
+ * });
2262
+ *
2263
+ * // Acquire an auth client, and bind it to all future calls
2264
+ * const authClient = await auth.getClient();
2265
+ * google.options({auth: authClient});
2266
+ *
2267
+ * // Do the magic
2268
+ * const res =
2269
+ * await servicedirectory.projects.locations.namespaces.services.delete({
2270
+ * // Required. The name of the service to delete.
2271
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
2272
+ * });
2273
+ * console.log(res.data);
2274
+ *
2275
+ * // Example response
2276
+ * // {}
2277
+ * }
2278
+ *
2279
+ * main().catch(e => {
2280
+ * console.error(e);
2281
+ * throw e;
2282
+ * });
2283
+ *
2284
+ * ```
1592
2285
  *
1593
2286
  * @param params - Parameters for request
1594
2287
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1598,11 +2291,11 @@ export namespace servicedirectory_v1beta1 {
1598
2291
  delete(
1599
2292
  params: Params$Resource$Projects$Locations$Namespaces$Services$Delete,
1600
2293
  options: StreamMethodOptions
1601
- ): GaxiosPromise<Readable>;
2294
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1602
2295
  delete(
1603
2296
  params?: Params$Resource$Projects$Locations$Namespaces$Services$Delete,
1604
2297
  options?: MethodOptions
1605
- ): GaxiosPromise<Schema$Empty>;
2298
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
1606
2299
  delete(
1607
2300
  params: Params$Resource$Projects$Locations$Namespaces$Services$Delete,
1608
2301
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1631,7 +2324,10 @@ export namespace servicedirectory_v1beta1 {
1631
2324
  callback?:
1632
2325
  | BodyResponseCallback<Schema$Empty>
1633
2326
  | BodyResponseCallback<Readable>
1634
- ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
2327
+ ):
2328
+ | void
2329
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
2330
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1635
2331
  let params = (paramsOrCallback ||
1636
2332
  {}) as Params$Resource$Projects$Locations$Namespaces$Services$Delete;
1637
2333
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1676,6 +2372,59 @@ export namespace servicedirectory_v1beta1 {
1676
2372
 
1677
2373
  /**
1678
2374
  * Gets a service.
2375
+ * @example
2376
+ * ```js
2377
+ * // Before running the sample:
2378
+ * // - Enable the API at:
2379
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2380
+ * // - Login into gcloud by running:
2381
+ * // ```sh
2382
+ * // $ gcloud auth application-default login
2383
+ * // ```
2384
+ * // - Install the npm module by running:
2385
+ * // ```sh
2386
+ * // $ npm install googleapis
2387
+ * // ```
2388
+ *
2389
+ * const {google} = require('googleapis');
2390
+ * const servicedirectory = google.servicedirectory('v1beta1');
2391
+ *
2392
+ * async function main() {
2393
+ * const auth = new google.auth.GoogleAuth({
2394
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2395
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2396
+ * });
2397
+ *
2398
+ * // Acquire an auth client, and bind it to all future calls
2399
+ * const authClient = await auth.getClient();
2400
+ * google.options({auth: authClient});
2401
+ *
2402
+ * // Do the magic
2403
+ * const res = await servicedirectory.projects.locations.namespaces.services.get(
2404
+ * {
2405
+ * // Required. The name of the service to get.
2406
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
2407
+ * },
2408
+ * );
2409
+ * console.log(res.data);
2410
+ *
2411
+ * // Example response
2412
+ * // {
2413
+ * // "createTime": "my_createTime",
2414
+ * // "endpoints": [],
2415
+ * // "metadata": {},
2416
+ * // "name": "my_name",
2417
+ * // "uid": "my_uid",
2418
+ * // "updateTime": "my_updateTime"
2419
+ * // }
2420
+ * }
2421
+ *
2422
+ * main().catch(e => {
2423
+ * console.error(e);
2424
+ * throw e;
2425
+ * });
2426
+ *
2427
+ * ```
1679
2428
  *
1680
2429
  * @param params - Parameters for request
1681
2430
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1685,11 +2434,11 @@ export namespace servicedirectory_v1beta1 {
1685
2434
  get(
1686
2435
  params: Params$Resource$Projects$Locations$Namespaces$Services$Get,
1687
2436
  options: StreamMethodOptions
1688
- ): GaxiosPromise<Readable>;
2437
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1689
2438
  get(
1690
2439
  params?: Params$Resource$Projects$Locations$Namespaces$Services$Get,
1691
2440
  options?: MethodOptions
1692
- ): GaxiosPromise<Schema$Service>;
2441
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Service>>;
1693
2442
  get(
1694
2443
  params: Params$Resource$Projects$Locations$Namespaces$Services$Get,
1695
2444
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1718,7 +2467,10 @@ export namespace servicedirectory_v1beta1 {
1718
2467
  callback?:
1719
2468
  | BodyResponseCallback<Schema$Service>
1720
2469
  | BodyResponseCallback<Readable>
1721
- ): void | GaxiosPromise<Schema$Service> | GaxiosPromise<Readable> {
2470
+ ):
2471
+ | void
2472
+ | Promise<GaxiosResponseWithHTTP2<Schema$Service>>
2473
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1722
2474
  let params = (paramsOrCallback ||
1723
2475
  {}) as Params$Resource$Projects$Locations$Namespaces$Services$Get;
1724
2476
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1763,6 +2515,64 @@ export namespace servicedirectory_v1beta1 {
1763
2515
 
1764
2516
  /**
1765
2517
  * Gets the IAM Policy for a resource
2518
+ * @example
2519
+ * ```js
2520
+ * // Before running the sample:
2521
+ * // - Enable the API at:
2522
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2523
+ * // - Login into gcloud by running:
2524
+ * // ```sh
2525
+ * // $ gcloud auth application-default login
2526
+ * // ```
2527
+ * // - Install the npm module by running:
2528
+ * // ```sh
2529
+ * // $ npm install googleapis
2530
+ * // ```
2531
+ *
2532
+ * const {google} = require('googleapis');
2533
+ * const servicedirectory = google.servicedirectory('v1beta1');
2534
+ *
2535
+ * async function main() {
2536
+ * const auth = new google.auth.GoogleAuth({
2537
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2538
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2539
+ * });
2540
+ *
2541
+ * // Acquire an auth client, and bind it to all future calls
2542
+ * const authClient = await auth.getClient();
2543
+ * google.options({auth: authClient});
2544
+ *
2545
+ * // Do the magic
2546
+ * const res =
2547
+ * await servicedirectory.projects.locations.namespaces.services.getIamPolicy({
2548
+ * // REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
2549
+ * resource:
2550
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
2551
+ *
2552
+ * // Request body metadata
2553
+ * requestBody: {
2554
+ * // request body parameters
2555
+ * // {
2556
+ * // "options": {}
2557
+ * // }
2558
+ * },
2559
+ * });
2560
+ * console.log(res.data);
2561
+ *
2562
+ * // Example response
2563
+ * // {
2564
+ * // "bindings": [],
2565
+ * // "etag": "my_etag",
2566
+ * // "version": 0
2567
+ * // }
2568
+ * }
2569
+ *
2570
+ * main().catch(e => {
2571
+ * console.error(e);
2572
+ * throw e;
2573
+ * });
2574
+ *
2575
+ * ```
1766
2576
  *
1767
2577
  * @param params - Parameters for request
1768
2578
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1772,11 +2582,11 @@ export namespace servicedirectory_v1beta1 {
1772
2582
  getIamPolicy(
1773
2583
  params: Params$Resource$Projects$Locations$Namespaces$Services$Getiampolicy,
1774
2584
  options: StreamMethodOptions
1775
- ): GaxiosPromise<Readable>;
2585
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1776
2586
  getIamPolicy(
1777
2587
  params?: Params$Resource$Projects$Locations$Namespaces$Services$Getiampolicy,
1778
2588
  options?: MethodOptions
1779
- ): GaxiosPromise<Schema$Policy>;
2589
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Policy>>;
1780
2590
  getIamPolicy(
1781
2591
  params: Params$Resource$Projects$Locations$Namespaces$Services$Getiampolicy,
1782
2592
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1805,7 +2615,10 @@ export namespace servicedirectory_v1beta1 {
1805
2615
  callback?:
1806
2616
  | BodyResponseCallback<Schema$Policy>
1807
2617
  | BodyResponseCallback<Readable>
1808
- ): void | GaxiosPromise<Schema$Policy> | GaxiosPromise<Readable> {
2618
+ ):
2619
+ | void
2620
+ | Promise<GaxiosResponseWithHTTP2<Schema$Policy>>
2621
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1809
2622
  let params = (paramsOrCallback ||
1810
2623
  {}) as Params$Resource$Projects$Locations$Namespaces$Services$Getiampolicy;
1811
2624
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1853,6 +2666,63 @@ export namespace servicedirectory_v1beta1 {
1853
2666
 
1854
2667
  /**
1855
2668
  * Lists all services belonging to a namespace.
2669
+ * @example
2670
+ * ```js
2671
+ * // Before running the sample:
2672
+ * // - Enable the API at:
2673
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2674
+ * // - Login into gcloud by running:
2675
+ * // ```sh
2676
+ * // $ gcloud auth application-default login
2677
+ * // ```
2678
+ * // - Install the npm module by running:
2679
+ * // ```sh
2680
+ * // $ npm install googleapis
2681
+ * // ```
2682
+ *
2683
+ * const {google} = require('googleapis');
2684
+ * const servicedirectory = google.servicedirectory('v1beta1');
2685
+ *
2686
+ * async function main() {
2687
+ * const auth = new google.auth.GoogleAuth({
2688
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2689
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2690
+ * });
2691
+ *
2692
+ * // Acquire an auth client, and bind it to all future calls
2693
+ * const authClient = await auth.getClient();
2694
+ * google.options({auth: authClient});
2695
+ *
2696
+ * // Do the magic
2697
+ * const res =
2698
+ * await servicedirectory.projects.locations.namespaces.services.list({
2699
+ * // Optional. The filter to list results by. General `filter` string syntax: ` ()` * `` can be `name` or `metadata.` for map field * `` can be `<`, `\>`, `<=`, `\>=`, `!=`, `=`, `:`. Of which `:` means `HAS`, and is roughly the same as `=` * `` must be the same data type as field * `` can be `AND`, `OR`, `NOT` Examples of valid filters: * `metadata.owner` returns services that have a metadata with the key `owner`, this is the same as `metadata:owner` * `metadata.protocol=gRPC` returns services that have key/value `protocol=gRPC` * `name\>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c` returns services that have name that is alphabetically later than the string, so "service-e" is returned but "service-a" is not * `metadata.owner!=sd AND metadata.foo=bar` returns services that have `owner` in metadata key but value is not `sd` AND have key/value `foo=bar` * `doesnotexist.foo=bar` returns an empty list. Note that service doesn't have a field called "doesnotexist". Since the filter does not match any services, it returns no results * `attributes.managed_registration=true` returns services that are managed by a GCP product or service For more information about filtering, see [API Filtering](https://aip.dev/160).
2700
+ * filter: 'placeholder-value',
2701
+ * // Optional. The order to list results by. General `order_by` string syntax: ` () (,)` * `` allows value: `name` * `` ascending or descending order by ``. If this is left blank, `asc` is used Note that an empty `order_by` string results in default order, which is order by `name` in ascending order.
2702
+ * orderBy: 'placeholder-value',
2703
+ * // Optional. The maximum number of items to return. The default value is 100.
2704
+ * pageSize: 'placeholder-value',
2705
+ * // Optional. The next_page_token value returned from a previous List request, if any.
2706
+ * pageToken: 'placeholder-value',
2707
+ * // Required. The resource name of the namespace whose services you'd like to list.
2708
+ * parent:
2709
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
2710
+ * });
2711
+ * console.log(res.data);
2712
+ *
2713
+ * // Example response
2714
+ * // {
2715
+ * // "nextPageToken": "my_nextPageToken",
2716
+ * // "services": []
2717
+ * // }
2718
+ * }
2719
+ *
2720
+ * main().catch(e => {
2721
+ * console.error(e);
2722
+ * throw e;
2723
+ * });
2724
+ *
2725
+ * ```
1856
2726
  *
1857
2727
  * @param params - Parameters for request
1858
2728
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1862,11 +2732,11 @@ export namespace servicedirectory_v1beta1 {
1862
2732
  list(
1863
2733
  params: Params$Resource$Projects$Locations$Namespaces$Services$List,
1864
2734
  options: StreamMethodOptions
1865
- ): GaxiosPromise<Readable>;
2735
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1866
2736
  list(
1867
2737
  params?: Params$Resource$Projects$Locations$Namespaces$Services$List,
1868
2738
  options?: MethodOptions
1869
- ): GaxiosPromise<Schema$ListServicesResponse>;
2739
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListServicesResponse>>;
1870
2740
  list(
1871
2741
  params: Params$Resource$Projects$Locations$Namespaces$Services$List,
1872
2742
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1899,8 +2769,8 @@ export namespace servicedirectory_v1beta1 {
1899
2769
  | BodyResponseCallback<Readable>
1900
2770
  ):
1901
2771
  | void
1902
- | GaxiosPromise<Schema$ListServicesResponse>
1903
- | GaxiosPromise<Readable> {
2772
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListServicesResponse>>
2773
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1904
2774
  let params = (paramsOrCallback ||
1905
2775
  {}) as Params$Resource$Projects$Locations$Namespaces$Services$List;
1906
2776
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1948,6 +2818,73 @@ export namespace servicedirectory_v1beta1 {
1948
2818
 
1949
2819
  /**
1950
2820
  * Updates a service.
2821
+ * @example
2822
+ * ```js
2823
+ * // Before running the sample:
2824
+ * // - Enable the API at:
2825
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2826
+ * // - Login into gcloud by running:
2827
+ * // ```sh
2828
+ * // $ gcloud auth application-default login
2829
+ * // ```
2830
+ * // - Install the npm module by running:
2831
+ * // ```sh
2832
+ * // $ npm install googleapis
2833
+ * // ```
2834
+ *
2835
+ * const {google} = require('googleapis');
2836
+ * const servicedirectory = google.servicedirectory('v1beta1');
2837
+ *
2838
+ * async function main() {
2839
+ * const auth = new google.auth.GoogleAuth({
2840
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2841
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2842
+ * });
2843
+ *
2844
+ * // Acquire an auth client, and bind it to all future calls
2845
+ * const authClient = await auth.getClient();
2846
+ * google.options({auth: authClient});
2847
+ *
2848
+ * // Do the magic
2849
+ * const res =
2850
+ * await servicedirectory.projects.locations.namespaces.services.patch({
2851
+ * // Immutable. The resource name for the service in the format `projects/x/locations/x/namespaces/x/services/x`.
2852
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
2853
+ * // Required. List of fields to be updated in this request.
2854
+ * updateMask: 'placeholder-value',
2855
+ *
2856
+ * // Request body metadata
2857
+ * requestBody: {
2858
+ * // request body parameters
2859
+ * // {
2860
+ * // "createTime": "my_createTime",
2861
+ * // "endpoints": [],
2862
+ * // "metadata": {},
2863
+ * // "name": "my_name",
2864
+ * // "uid": "my_uid",
2865
+ * // "updateTime": "my_updateTime"
2866
+ * // }
2867
+ * },
2868
+ * });
2869
+ * console.log(res.data);
2870
+ *
2871
+ * // Example response
2872
+ * // {
2873
+ * // "createTime": "my_createTime",
2874
+ * // "endpoints": [],
2875
+ * // "metadata": {},
2876
+ * // "name": "my_name",
2877
+ * // "uid": "my_uid",
2878
+ * // "updateTime": "my_updateTime"
2879
+ * // }
2880
+ * }
2881
+ *
2882
+ * main().catch(e => {
2883
+ * console.error(e);
2884
+ * throw e;
2885
+ * });
2886
+ *
2887
+ * ```
1951
2888
  *
1952
2889
  * @param params - Parameters for request
1953
2890
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1957,11 +2894,11 @@ export namespace servicedirectory_v1beta1 {
1957
2894
  patch(
1958
2895
  params: Params$Resource$Projects$Locations$Namespaces$Services$Patch,
1959
2896
  options: StreamMethodOptions
1960
- ): GaxiosPromise<Readable>;
2897
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1961
2898
  patch(
1962
2899
  params?: Params$Resource$Projects$Locations$Namespaces$Services$Patch,
1963
2900
  options?: MethodOptions
1964
- ): GaxiosPromise<Schema$Service>;
2901
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Service>>;
1965
2902
  patch(
1966
2903
  params: Params$Resource$Projects$Locations$Namespaces$Services$Patch,
1967
2904
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1990,7 +2927,10 @@ export namespace servicedirectory_v1beta1 {
1990
2927
  callback?:
1991
2928
  | BodyResponseCallback<Schema$Service>
1992
2929
  | BodyResponseCallback<Readable>
1993
- ): void | GaxiosPromise<Schema$Service> | GaxiosPromise<Readable> {
2930
+ ):
2931
+ | void
2932
+ | Promise<GaxiosResponseWithHTTP2<Schema$Service>>
2933
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1994
2934
  let params = (paramsOrCallback ||
1995
2935
  {}) as Params$Resource$Projects$Locations$Namespaces$Services$Patch;
1996
2936
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2035,6 +2975,62 @@ export namespace servicedirectory_v1beta1 {
2035
2975
 
2036
2976
  /**
2037
2977
  * Returns a service and its associated endpoints. Resolving a service is not considered an active developer method.
2978
+ * @example
2979
+ * ```js
2980
+ * // Before running the sample:
2981
+ * // - Enable the API at:
2982
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2983
+ * // - Login into gcloud by running:
2984
+ * // ```sh
2985
+ * // $ gcloud auth application-default login
2986
+ * // ```
2987
+ * // - Install the npm module by running:
2988
+ * // ```sh
2989
+ * // $ npm install googleapis
2990
+ * // ```
2991
+ *
2992
+ * const {google} = require('googleapis');
2993
+ * const servicedirectory = google.servicedirectory('v1beta1');
2994
+ *
2995
+ * async function main() {
2996
+ * const auth = new google.auth.GoogleAuth({
2997
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2998
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2999
+ * });
3000
+ *
3001
+ * // Acquire an auth client, and bind it to all future calls
3002
+ * const authClient = await auth.getClient();
3003
+ * google.options({auth: authClient});
3004
+ *
3005
+ * // Do the magic
3006
+ * const res =
3007
+ * await servicedirectory.projects.locations.namespaces.services.resolve({
3008
+ * // Required. The name of the service to resolve.
3009
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
3010
+ *
3011
+ * // Request body metadata
3012
+ * requestBody: {
3013
+ * // request body parameters
3014
+ * // {
3015
+ * // "endpointFilter": "my_endpointFilter",
3016
+ * // "maxEndpoints": 0
3017
+ * // }
3018
+ * },
3019
+ * });
3020
+ * console.log(res.data);
3021
+ *
3022
+ * // Example response
3023
+ * // {
3024
+ * // "service": {}
3025
+ * // }
3026
+ * }
3027
+ *
3028
+ * main().catch(e => {
3029
+ * console.error(e);
3030
+ * throw e;
3031
+ * });
3032
+ *
3033
+ * ```
2038
3034
  *
2039
3035
  * @param params - Parameters for request
2040
3036
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2044,11 +3040,11 @@ export namespace servicedirectory_v1beta1 {
2044
3040
  resolve(
2045
3041
  params: Params$Resource$Projects$Locations$Namespaces$Services$Resolve,
2046
3042
  options: StreamMethodOptions
2047
- ): GaxiosPromise<Readable>;
3043
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2048
3044
  resolve(
2049
3045
  params?: Params$Resource$Projects$Locations$Namespaces$Services$Resolve,
2050
3046
  options?: MethodOptions
2051
- ): GaxiosPromise<Schema$ResolveServiceResponse>;
3047
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ResolveServiceResponse>>;
2052
3048
  resolve(
2053
3049
  params: Params$Resource$Projects$Locations$Namespaces$Services$Resolve,
2054
3050
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2083,8 +3079,8 @@ export namespace servicedirectory_v1beta1 {
2083
3079
  | BodyResponseCallback<Readable>
2084
3080
  ):
2085
3081
  | void
2086
- | GaxiosPromise<Schema$ResolveServiceResponse>
2087
- | GaxiosPromise<Readable> {
3082
+ | Promise<GaxiosResponseWithHTTP2<Schema$ResolveServiceResponse>>
3083
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2088
3084
  let params = (paramsOrCallback ||
2089
3085
  {}) as Params$Resource$Projects$Locations$Namespaces$Services$Resolve;
2090
3086
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2132,6 +3128,64 @@ export namespace servicedirectory_v1beta1 {
2132
3128
 
2133
3129
  /**
2134
3130
  * Sets the IAM Policy for a resource
3131
+ * @example
3132
+ * ```js
3133
+ * // Before running the sample:
3134
+ * // - Enable the API at:
3135
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
3136
+ * // - Login into gcloud by running:
3137
+ * // ```sh
3138
+ * // $ gcloud auth application-default login
3139
+ * // ```
3140
+ * // - Install the npm module by running:
3141
+ * // ```sh
3142
+ * // $ npm install googleapis
3143
+ * // ```
3144
+ *
3145
+ * const {google} = require('googleapis');
3146
+ * const servicedirectory = google.servicedirectory('v1beta1');
3147
+ *
3148
+ * async function main() {
3149
+ * const auth = new google.auth.GoogleAuth({
3150
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3151
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3152
+ * });
3153
+ *
3154
+ * // Acquire an auth client, and bind it to all future calls
3155
+ * const authClient = await auth.getClient();
3156
+ * google.options({auth: authClient});
3157
+ *
3158
+ * // Do the magic
3159
+ * const res =
3160
+ * await servicedirectory.projects.locations.namespaces.services.setIamPolicy({
3161
+ * // REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
3162
+ * resource:
3163
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
3164
+ *
3165
+ * // Request body metadata
3166
+ * requestBody: {
3167
+ * // request body parameters
3168
+ * // {
3169
+ * // "policy": {}
3170
+ * // }
3171
+ * },
3172
+ * });
3173
+ * console.log(res.data);
3174
+ *
3175
+ * // Example response
3176
+ * // {
3177
+ * // "bindings": [],
3178
+ * // "etag": "my_etag",
3179
+ * // "version": 0
3180
+ * // }
3181
+ * }
3182
+ *
3183
+ * main().catch(e => {
3184
+ * console.error(e);
3185
+ * throw e;
3186
+ * });
3187
+ *
3188
+ * ```
2135
3189
  *
2136
3190
  * @param params - Parameters for request
2137
3191
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2141,11 +3195,11 @@ export namespace servicedirectory_v1beta1 {
2141
3195
  setIamPolicy(
2142
3196
  params: Params$Resource$Projects$Locations$Namespaces$Services$Setiampolicy,
2143
3197
  options: StreamMethodOptions
2144
- ): GaxiosPromise<Readable>;
3198
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2145
3199
  setIamPolicy(
2146
3200
  params?: Params$Resource$Projects$Locations$Namespaces$Services$Setiampolicy,
2147
3201
  options?: MethodOptions
2148
- ): GaxiosPromise<Schema$Policy>;
3202
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Policy>>;
2149
3203
  setIamPolicy(
2150
3204
  params: Params$Resource$Projects$Locations$Namespaces$Services$Setiampolicy,
2151
3205
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2174,7 +3228,10 @@ export namespace servicedirectory_v1beta1 {
2174
3228
  callback?:
2175
3229
  | BodyResponseCallback<Schema$Policy>
2176
3230
  | BodyResponseCallback<Readable>
2177
- ): void | GaxiosPromise<Schema$Policy> | GaxiosPromise<Readable> {
3231
+ ):
3232
+ | void
3233
+ | Promise<GaxiosResponseWithHTTP2<Schema$Policy>>
3234
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2178
3235
  let params = (paramsOrCallback ||
2179
3236
  {}) as Params$Resource$Projects$Locations$Namespaces$Services$Setiampolicy;
2180
3237
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2222,6 +3279,64 @@ export namespace servicedirectory_v1beta1 {
2222
3279
 
2223
3280
  /**
2224
3281
  * Tests IAM permissions for a resource (namespace, service or service workload only).
3282
+ * @example
3283
+ * ```js
3284
+ * // Before running the sample:
3285
+ * // - Enable the API at:
3286
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
3287
+ * // - Login into gcloud by running:
3288
+ * // ```sh
3289
+ * // $ gcloud auth application-default login
3290
+ * // ```
3291
+ * // - Install the npm module by running:
3292
+ * // ```sh
3293
+ * // $ npm install googleapis
3294
+ * // ```
3295
+ *
3296
+ * const {google} = require('googleapis');
3297
+ * const servicedirectory = google.servicedirectory('v1beta1');
3298
+ *
3299
+ * async function main() {
3300
+ * const auth = new google.auth.GoogleAuth({
3301
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3302
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3303
+ * });
3304
+ *
3305
+ * // Acquire an auth client, and bind it to all future calls
3306
+ * const authClient = await auth.getClient();
3307
+ * google.options({auth: authClient});
3308
+ *
3309
+ * // Do the magic
3310
+ * const res =
3311
+ * await servicedirectory.projects.locations.namespaces.services.testIamPermissions(
3312
+ * {
3313
+ * // REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
3314
+ * resource:
3315
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
3316
+ *
3317
+ * // Request body metadata
3318
+ * requestBody: {
3319
+ * // request body parameters
3320
+ * // {
3321
+ * // "permissions": []
3322
+ * // }
3323
+ * },
3324
+ * },
3325
+ * );
3326
+ * console.log(res.data);
3327
+ *
3328
+ * // Example response
3329
+ * // {
3330
+ * // "permissions": []
3331
+ * // }
3332
+ * }
3333
+ *
3334
+ * main().catch(e => {
3335
+ * console.error(e);
3336
+ * throw e;
3337
+ * });
3338
+ *
3339
+ * ```
2225
3340
  *
2226
3341
  * @param params - Parameters for request
2227
3342
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2231,11 +3346,11 @@ export namespace servicedirectory_v1beta1 {
2231
3346
  testIamPermissions(
2232
3347
  params: Params$Resource$Projects$Locations$Namespaces$Services$Testiampermissions,
2233
3348
  options: StreamMethodOptions
2234
- ): GaxiosPromise<Readable>;
3349
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2235
3350
  testIamPermissions(
2236
3351
  params?: Params$Resource$Projects$Locations$Namespaces$Services$Testiampermissions,
2237
3352
  options?: MethodOptions
2238
- ): GaxiosPromise<Schema$TestIamPermissionsResponse>;
3353
+ ): Promise<GaxiosResponseWithHTTP2<Schema$TestIamPermissionsResponse>>;
2239
3354
  testIamPermissions(
2240
3355
  params: Params$Resource$Projects$Locations$Namespaces$Services$Testiampermissions,
2241
3356
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2270,8 +3385,8 @@ export namespace servicedirectory_v1beta1 {
2270
3385
  | BodyResponseCallback<Readable>
2271
3386
  ):
2272
3387
  | void
2273
- | GaxiosPromise<Schema$TestIamPermissionsResponse>
2274
- | GaxiosPromise<Readable> {
3388
+ | Promise<GaxiosResponseWithHTTP2<Schema$TestIamPermissionsResponse>>
3389
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2275
3390
  let params = (paramsOrCallback ||
2276
3391
  {}) as Params$Resource$Projects$Locations$Namespaces$Services$Testiampermissions;
2277
3392
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2444,6 +3559,80 @@ export namespace servicedirectory_v1beta1 {
2444
3559
 
2445
3560
  /**
2446
3561
  * Creates an endpoint, and returns the new endpoint.
3562
+ * @example
3563
+ * ```js
3564
+ * // Before running the sample:
3565
+ * // - Enable the API at:
3566
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
3567
+ * // - Login into gcloud by running:
3568
+ * // ```sh
3569
+ * // $ gcloud auth application-default login
3570
+ * // ```
3571
+ * // - Install the npm module by running:
3572
+ * // ```sh
3573
+ * // $ npm install googleapis
3574
+ * // ```
3575
+ *
3576
+ * const {google} = require('googleapis');
3577
+ * const servicedirectory = google.servicedirectory('v1beta1');
3578
+ *
3579
+ * async function main() {
3580
+ * const auth = new google.auth.GoogleAuth({
3581
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3582
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3583
+ * });
3584
+ *
3585
+ * // Acquire an auth client, and bind it to all future calls
3586
+ * const authClient = await auth.getClient();
3587
+ * google.options({auth: authClient});
3588
+ *
3589
+ * // Do the magic
3590
+ * const res =
3591
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.create(
3592
+ * {
3593
+ * // Required. The Resource ID must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z](?:[-a-z0-9]{0,61\}[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
3594
+ * endpointId: 'placeholder-value',
3595
+ * // Required. The resource name of the service that this endpoint provides.
3596
+ * parent:
3597
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
3598
+ *
3599
+ * // Request body metadata
3600
+ * requestBody: {
3601
+ * // request body parameters
3602
+ * // {
3603
+ * // "address": "my_address",
3604
+ * // "createTime": "my_createTime",
3605
+ * // "metadata": {},
3606
+ * // "name": "my_name",
3607
+ * // "network": "my_network",
3608
+ * // "port": 0,
3609
+ * // "uid": "my_uid",
3610
+ * // "updateTime": "my_updateTime"
3611
+ * // }
3612
+ * },
3613
+ * },
3614
+ * );
3615
+ * console.log(res.data);
3616
+ *
3617
+ * // Example response
3618
+ * // {
3619
+ * // "address": "my_address",
3620
+ * // "createTime": "my_createTime",
3621
+ * // "metadata": {},
3622
+ * // "name": "my_name",
3623
+ * // "network": "my_network",
3624
+ * // "port": 0,
3625
+ * // "uid": "my_uid",
3626
+ * // "updateTime": "my_updateTime"
3627
+ * // }
3628
+ * }
3629
+ *
3630
+ * main().catch(e => {
3631
+ * console.error(e);
3632
+ * throw e;
3633
+ * });
3634
+ *
3635
+ * ```
2447
3636
  *
2448
3637
  * @param params - Parameters for request
2449
3638
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2453,11 +3642,11 @@ export namespace servicedirectory_v1beta1 {
2453
3642
  create(
2454
3643
  params: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Create,
2455
3644
  options: StreamMethodOptions
2456
- ): GaxiosPromise<Readable>;
3645
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2457
3646
  create(
2458
3647
  params?: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Create,
2459
3648
  options?: MethodOptions
2460
- ): GaxiosPromise<Schema$Endpoint>;
3649
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Endpoint>>;
2461
3650
  create(
2462
3651
  params: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Create,
2463
3652
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2486,7 +3675,10 @@ export namespace servicedirectory_v1beta1 {
2486
3675
  callback?:
2487
3676
  | BodyResponseCallback<Schema$Endpoint>
2488
3677
  | BodyResponseCallback<Readable>
2489
- ): void | GaxiosPromise<Schema$Endpoint> | GaxiosPromise<Readable> {
3678
+ ):
3679
+ | void
3680
+ | Promise<GaxiosResponseWithHTTP2<Schema$Endpoint>>
3681
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2490
3682
  let params = (paramsOrCallback ||
2491
3683
  {}) as Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Create;
2492
3684
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2534,6 +3726,53 @@ export namespace servicedirectory_v1beta1 {
2534
3726
 
2535
3727
  /**
2536
3728
  * Deletes an endpoint.
3729
+ * @example
3730
+ * ```js
3731
+ * // Before running the sample:
3732
+ * // - Enable the API at:
3733
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
3734
+ * // - Login into gcloud by running:
3735
+ * // ```sh
3736
+ * // $ gcloud auth application-default login
3737
+ * // ```
3738
+ * // - Install the npm module by running:
3739
+ * // ```sh
3740
+ * // $ npm install googleapis
3741
+ * // ```
3742
+ *
3743
+ * const {google} = require('googleapis');
3744
+ * const servicedirectory = google.servicedirectory('v1beta1');
3745
+ *
3746
+ * async function main() {
3747
+ * const auth = new google.auth.GoogleAuth({
3748
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3749
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3750
+ * });
3751
+ *
3752
+ * // Acquire an auth client, and bind it to all future calls
3753
+ * const authClient = await auth.getClient();
3754
+ * google.options({auth: authClient});
3755
+ *
3756
+ * // Do the magic
3757
+ * const res =
3758
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.delete(
3759
+ * {
3760
+ * // Required. The name of the endpoint to delete.
3761
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service/endpoints/my-endpoint',
3762
+ * },
3763
+ * );
3764
+ * console.log(res.data);
3765
+ *
3766
+ * // Example response
3767
+ * // {}
3768
+ * }
3769
+ *
3770
+ * main().catch(e => {
3771
+ * console.error(e);
3772
+ * throw e;
3773
+ * });
3774
+ *
3775
+ * ```
2537
3776
  *
2538
3777
  * @param params - Parameters for request
2539
3778
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2543,11 +3782,11 @@ export namespace servicedirectory_v1beta1 {
2543
3782
  delete(
2544
3783
  params: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Delete,
2545
3784
  options: StreamMethodOptions
2546
- ): GaxiosPromise<Readable>;
3785
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2547
3786
  delete(
2548
3787
  params?: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Delete,
2549
3788
  options?: MethodOptions
2550
- ): GaxiosPromise<Schema$Empty>;
3789
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
2551
3790
  delete(
2552
3791
  params: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Delete,
2553
3792
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2576,7 +3815,10 @@ export namespace servicedirectory_v1beta1 {
2576
3815
  callback?:
2577
3816
  | BodyResponseCallback<Schema$Empty>
2578
3817
  | BodyResponseCallback<Readable>
2579
- ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
3818
+ ):
3819
+ | void
3820
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
3821
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2580
3822
  let params = (paramsOrCallback ||
2581
3823
  {}) as Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Delete;
2582
3824
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2621,6 +3863,62 @@ export namespace servicedirectory_v1beta1 {
2621
3863
 
2622
3864
  /**
2623
3865
  * Gets an endpoint.
3866
+ * @example
3867
+ * ```js
3868
+ * // Before running the sample:
3869
+ * // - Enable the API at:
3870
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
3871
+ * // - Login into gcloud by running:
3872
+ * // ```sh
3873
+ * // $ gcloud auth application-default login
3874
+ * // ```
3875
+ * // - Install the npm module by running:
3876
+ * // ```sh
3877
+ * // $ npm install googleapis
3878
+ * // ```
3879
+ *
3880
+ * const {google} = require('googleapis');
3881
+ * const servicedirectory = google.servicedirectory('v1beta1');
3882
+ *
3883
+ * async function main() {
3884
+ * const auth = new google.auth.GoogleAuth({
3885
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3886
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3887
+ * });
3888
+ *
3889
+ * // Acquire an auth client, and bind it to all future calls
3890
+ * const authClient = await auth.getClient();
3891
+ * google.options({auth: authClient});
3892
+ *
3893
+ * // Do the magic
3894
+ * const res =
3895
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.get(
3896
+ * {
3897
+ * // Required. The name of the endpoint to get.
3898
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service/endpoints/my-endpoint',
3899
+ * },
3900
+ * );
3901
+ * console.log(res.data);
3902
+ *
3903
+ * // Example response
3904
+ * // {
3905
+ * // "address": "my_address",
3906
+ * // "createTime": "my_createTime",
3907
+ * // "metadata": {},
3908
+ * // "name": "my_name",
3909
+ * // "network": "my_network",
3910
+ * // "port": 0,
3911
+ * // "uid": "my_uid",
3912
+ * // "updateTime": "my_updateTime"
3913
+ * // }
3914
+ * }
3915
+ *
3916
+ * main().catch(e => {
3917
+ * console.error(e);
3918
+ * throw e;
3919
+ * });
3920
+ *
3921
+ * ```
2624
3922
  *
2625
3923
  * @param params - Parameters for request
2626
3924
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2630,11 +3928,11 @@ export namespace servicedirectory_v1beta1 {
2630
3928
  get(
2631
3929
  params: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Get,
2632
3930
  options: StreamMethodOptions
2633
- ): GaxiosPromise<Readable>;
3931
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2634
3932
  get(
2635
3933
  params?: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Get,
2636
3934
  options?: MethodOptions
2637
- ): GaxiosPromise<Schema$Endpoint>;
3935
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Endpoint>>;
2638
3936
  get(
2639
3937
  params: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Get,
2640
3938
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2663,7 +3961,10 @@ export namespace servicedirectory_v1beta1 {
2663
3961
  callback?:
2664
3962
  | BodyResponseCallback<Schema$Endpoint>
2665
3963
  | BodyResponseCallback<Readable>
2666
- ): void | GaxiosPromise<Schema$Endpoint> | GaxiosPromise<Readable> {
3964
+ ):
3965
+ | void
3966
+ | Promise<GaxiosResponseWithHTTP2<Schema$Endpoint>>
3967
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2667
3968
  let params = (paramsOrCallback ||
2668
3969
  {}) as Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Get;
2669
3970
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2708,6 +4009,65 @@ export namespace servicedirectory_v1beta1 {
2708
4009
 
2709
4010
  /**
2710
4011
  * Lists all endpoints.
4012
+ * @example
4013
+ * ```js
4014
+ * // Before running the sample:
4015
+ * // - Enable the API at:
4016
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
4017
+ * // - Login into gcloud by running:
4018
+ * // ```sh
4019
+ * // $ gcloud auth application-default login
4020
+ * // ```
4021
+ * // - Install the npm module by running:
4022
+ * // ```sh
4023
+ * // $ npm install googleapis
4024
+ * // ```
4025
+ *
4026
+ * const {google} = require('googleapis');
4027
+ * const servicedirectory = google.servicedirectory('v1beta1');
4028
+ *
4029
+ * async function main() {
4030
+ * const auth = new google.auth.GoogleAuth({
4031
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
4032
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
4033
+ * });
4034
+ *
4035
+ * // Acquire an auth client, and bind it to all future calls
4036
+ * const authClient = await auth.getClient();
4037
+ * google.options({auth: authClient});
4038
+ *
4039
+ * // Do the magic
4040
+ * const res =
4041
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.list(
4042
+ * {
4043
+ * // Optional. The filter to list results by. General `filter` string syntax: ` ()` * `` can be `name`, `address`, `port`, `metadata.` for map field, or `attributes.` for attributes field * `` can be `<`, `\>`, `<=`, `\>=`, `!=`, `=`, `:`. Of which `:` means `HAS`, and is roughly the same as `=` * `` must be the same data type as field * `` can be `AND`, `OR`, `NOT` Examples of valid filters: * `metadata.owner` returns endpoints that have a metadata with the key `owner`, this is the same as `metadata:owner` * `metadata.protocol=gRPC` returns endpoints that have key/value `protocol=gRPC` * `address=192.108.1.105` returns endpoints that have this address * `port\>8080` returns endpoints that have port number larger than 8080 * `name\>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` returns endpoints that have name that is alphabetically later than the string, so "endpoint-e" is returned but "endpoint-a" is not * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have `owner` in metadata key but value is not `sd` AND have key/value `foo=bar` * `doesnotexist.foo=bar` returns an empty list. Note that endpoint doesn't have a field called "doesnotexist". Since the filter does not match any endpoints, it returns no results * `attributes.kubernetes_resource_type=KUBERNETES_RESOURCE_TYPE_CLUSTER_ IP` returns endpoints with the corresponding kubernetes_resource_type For more information about filtering, see [API Filtering](https://aip.dev/160).
4044
+ * filter: 'placeholder-value',
4045
+ * // Optional. The order to list results by. General `order_by` string syntax: ` () (,)` * `` allows values: `name`, `address`, `port` * `` ascending or descending order by ``. If this is left blank, `asc` is used Note that an empty `order_by` string results in default order, which is order by `name` in ascending order.
4046
+ * orderBy: 'placeholder-value',
4047
+ * // Optional. The maximum number of items to return. The default value is 100.
4048
+ * pageSize: 'placeholder-value',
4049
+ * // Optional. The next_page_token value returned from a previous List request, if any.
4050
+ * pageToken: 'placeholder-value',
4051
+ * // Required. The resource name of the service whose endpoints you'd like to list.
4052
+ * parent:
4053
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
4054
+ * },
4055
+ * );
4056
+ * console.log(res.data);
4057
+ *
4058
+ * // Example response
4059
+ * // {
4060
+ * // "endpoints": [],
4061
+ * // "nextPageToken": "my_nextPageToken"
4062
+ * // }
4063
+ * }
4064
+ *
4065
+ * main().catch(e => {
4066
+ * console.error(e);
4067
+ * throw e;
4068
+ * });
4069
+ *
4070
+ * ```
2711
4071
  *
2712
4072
  * @param params - Parameters for request
2713
4073
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2717,11 +4077,11 @@ export namespace servicedirectory_v1beta1 {
2717
4077
  list(
2718
4078
  params: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$List,
2719
4079
  options: StreamMethodOptions
2720
- ): GaxiosPromise<Readable>;
4080
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2721
4081
  list(
2722
4082
  params?: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$List,
2723
4083
  options?: MethodOptions
2724
- ): GaxiosPromise<Schema$ListEndpointsResponse>;
4084
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListEndpointsResponse>>;
2725
4085
  list(
2726
4086
  params: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$List,
2727
4087
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2754,8 +4114,8 @@ export namespace servicedirectory_v1beta1 {
2754
4114
  | BodyResponseCallback<Readable>
2755
4115
  ):
2756
4116
  | void
2757
- | GaxiosPromise<Schema$ListEndpointsResponse>
2758
- | GaxiosPromise<Readable> {
4117
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListEndpointsResponse>>
4118
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2759
4119
  let params = (paramsOrCallback ||
2760
4120
  {}) as Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$List;
2761
4121
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2803,6 +4163,79 @@ export namespace servicedirectory_v1beta1 {
2803
4163
 
2804
4164
  /**
2805
4165
  * Updates an endpoint.
4166
+ * @example
4167
+ * ```js
4168
+ * // Before running the sample:
4169
+ * // - Enable the API at:
4170
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
4171
+ * // - Login into gcloud by running:
4172
+ * // ```sh
4173
+ * // $ gcloud auth application-default login
4174
+ * // ```
4175
+ * // - Install the npm module by running:
4176
+ * // ```sh
4177
+ * // $ npm install googleapis
4178
+ * // ```
4179
+ *
4180
+ * const {google} = require('googleapis');
4181
+ * const servicedirectory = google.servicedirectory('v1beta1');
4182
+ *
4183
+ * async function main() {
4184
+ * const auth = new google.auth.GoogleAuth({
4185
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
4186
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
4187
+ * });
4188
+ *
4189
+ * // Acquire an auth client, and bind it to all future calls
4190
+ * const authClient = await auth.getClient();
4191
+ * google.options({auth: authClient});
4192
+ *
4193
+ * // Do the magic
4194
+ * const res =
4195
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.patch(
4196
+ * {
4197
+ * // Immutable. The resource name for the endpoint in the format `projects/x/locations/x/namespaces/x/services/x/endpoints/x`.
4198
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service/endpoints/my-endpoint',
4199
+ * // Required. List of fields to be updated in this request.
4200
+ * updateMask: 'placeholder-value',
4201
+ *
4202
+ * // Request body metadata
4203
+ * requestBody: {
4204
+ * // request body parameters
4205
+ * // {
4206
+ * // "address": "my_address",
4207
+ * // "createTime": "my_createTime",
4208
+ * // "metadata": {},
4209
+ * // "name": "my_name",
4210
+ * // "network": "my_network",
4211
+ * // "port": 0,
4212
+ * // "uid": "my_uid",
4213
+ * // "updateTime": "my_updateTime"
4214
+ * // }
4215
+ * },
4216
+ * },
4217
+ * );
4218
+ * console.log(res.data);
4219
+ *
4220
+ * // Example response
4221
+ * // {
4222
+ * // "address": "my_address",
4223
+ * // "createTime": "my_createTime",
4224
+ * // "metadata": {},
4225
+ * // "name": "my_name",
4226
+ * // "network": "my_network",
4227
+ * // "port": 0,
4228
+ * // "uid": "my_uid",
4229
+ * // "updateTime": "my_updateTime"
4230
+ * // }
4231
+ * }
4232
+ *
4233
+ * main().catch(e => {
4234
+ * console.error(e);
4235
+ * throw e;
4236
+ * });
4237
+ *
4238
+ * ```
2806
4239
  *
2807
4240
  * @param params - Parameters for request
2808
4241
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2812,11 +4245,11 @@ export namespace servicedirectory_v1beta1 {
2812
4245
  patch(
2813
4246
  params: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Patch,
2814
4247
  options: StreamMethodOptions
2815
- ): GaxiosPromise<Readable>;
4248
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2816
4249
  patch(
2817
4250
  params?: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Patch,
2818
4251
  options?: MethodOptions
2819
- ): GaxiosPromise<Schema$Endpoint>;
4252
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Endpoint>>;
2820
4253
  patch(
2821
4254
  params: Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Patch,
2822
4255
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2845,7 +4278,10 @@ export namespace servicedirectory_v1beta1 {
2845
4278
  callback?:
2846
4279
  | BodyResponseCallback<Schema$Endpoint>
2847
4280
  | BodyResponseCallback<Readable>
2848
- ): void | GaxiosPromise<Schema$Endpoint> | GaxiosPromise<Readable> {
4281
+ ):
4282
+ | void
4283
+ | Promise<GaxiosResponseWithHTTP2<Schema$Endpoint>>
4284
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2849
4285
  let params = (paramsOrCallback ||
2850
4286
  {}) as Params$Resource$Projects$Locations$Namespaces$Services$Endpoints$Patch;
2851
4287
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2967,6 +4403,66 @@ export namespace servicedirectory_v1beta1 {
2967
4403
 
2968
4404
  /**
2969
4405
  * Gets the IAM Policy for a resource
4406
+ * @example
4407
+ * ```js
4408
+ * // Before running the sample:
4409
+ * // - Enable the API at:
4410
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
4411
+ * // - Login into gcloud by running:
4412
+ * // ```sh
4413
+ * // $ gcloud auth application-default login
4414
+ * // ```
4415
+ * // - Install the npm module by running:
4416
+ * // ```sh
4417
+ * // $ npm install googleapis
4418
+ * // ```
4419
+ *
4420
+ * const {google} = require('googleapis');
4421
+ * const servicedirectory = google.servicedirectory('v1beta1');
4422
+ *
4423
+ * async function main() {
4424
+ * const auth = new google.auth.GoogleAuth({
4425
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
4426
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
4427
+ * });
4428
+ *
4429
+ * // Acquire an auth client, and bind it to all future calls
4430
+ * const authClient = await auth.getClient();
4431
+ * google.options({auth: authClient});
4432
+ *
4433
+ * // Do the magic
4434
+ * const res =
4435
+ * await servicedirectory.projects.locations.namespaces.workloads.getIamPolicy(
4436
+ * {
4437
+ * // REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
4438
+ * resource:
4439
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/workloads/my-workload',
4440
+ *
4441
+ * // Request body metadata
4442
+ * requestBody: {
4443
+ * // request body parameters
4444
+ * // {
4445
+ * // "options": {}
4446
+ * // }
4447
+ * },
4448
+ * },
4449
+ * );
4450
+ * console.log(res.data);
4451
+ *
4452
+ * // Example response
4453
+ * // {
4454
+ * // "bindings": [],
4455
+ * // "etag": "my_etag",
4456
+ * // "version": 0
4457
+ * // }
4458
+ * }
4459
+ *
4460
+ * main().catch(e => {
4461
+ * console.error(e);
4462
+ * throw e;
4463
+ * });
4464
+ *
4465
+ * ```
2970
4466
  *
2971
4467
  * @param params - Parameters for request
2972
4468
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2976,11 +4472,11 @@ export namespace servicedirectory_v1beta1 {
2976
4472
  getIamPolicy(
2977
4473
  params: Params$Resource$Projects$Locations$Namespaces$Workloads$Getiampolicy,
2978
4474
  options: StreamMethodOptions
2979
- ): GaxiosPromise<Readable>;
4475
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2980
4476
  getIamPolicy(
2981
4477
  params?: Params$Resource$Projects$Locations$Namespaces$Workloads$Getiampolicy,
2982
4478
  options?: MethodOptions
2983
- ): GaxiosPromise<Schema$Policy>;
4479
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Policy>>;
2984
4480
  getIamPolicy(
2985
4481
  params: Params$Resource$Projects$Locations$Namespaces$Workloads$Getiampolicy,
2986
4482
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -3009,7 +4505,10 @@ export namespace servicedirectory_v1beta1 {
3009
4505
  callback?:
3010
4506
  | BodyResponseCallback<Schema$Policy>
3011
4507
  | BodyResponseCallback<Readable>
3012
- ): void | GaxiosPromise<Schema$Policy> | GaxiosPromise<Readable> {
4508
+ ):
4509
+ | void
4510
+ | Promise<GaxiosResponseWithHTTP2<Schema$Policy>>
4511
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
3013
4512
  let params = (paramsOrCallback ||
3014
4513
  {}) as Params$Resource$Projects$Locations$Namespaces$Workloads$Getiampolicy;
3015
4514
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -3057,6 +4556,66 @@ export namespace servicedirectory_v1beta1 {
3057
4556
 
3058
4557
  /**
3059
4558
  * Sets the IAM Policy for a resource
4559
+ * @example
4560
+ * ```js
4561
+ * // Before running the sample:
4562
+ * // - Enable the API at:
4563
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
4564
+ * // - Login into gcloud by running:
4565
+ * // ```sh
4566
+ * // $ gcloud auth application-default login
4567
+ * // ```
4568
+ * // - Install the npm module by running:
4569
+ * // ```sh
4570
+ * // $ npm install googleapis
4571
+ * // ```
4572
+ *
4573
+ * const {google} = require('googleapis');
4574
+ * const servicedirectory = google.servicedirectory('v1beta1');
4575
+ *
4576
+ * async function main() {
4577
+ * const auth = new google.auth.GoogleAuth({
4578
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
4579
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
4580
+ * });
4581
+ *
4582
+ * // Acquire an auth client, and bind it to all future calls
4583
+ * const authClient = await auth.getClient();
4584
+ * google.options({auth: authClient});
4585
+ *
4586
+ * // Do the magic
4587
+ * const res =
4588
+ * await servicedirectory.projects.locations.namespaces.workloads.setIamPolicy(
4589
+ * {
4590
+ * // REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
4591
+ * resource:
4592
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/workloads/my-workload',
4593
+ *
4594
+ * // Request body metadata
4595
+ * requestBody: {
4596
+ * // request body parameters
4597
+ * // {
4598
+ * // "policy": {}
4599
+ * // }
4600
+ * },
4601
+ * },
4602
+ * );
4603
+ * console.log(res.data);
4604
+ *
4605
+ * // Example response
4606
+ * // {
4607
+ * // "bindings": [],
4608
+ * // "etag": "my_etag",
4609
+ * // "version": 0
4610
+ * // }
4611
+ * }
4612
+ *
4613
+ * main().catch(e => {
4614
+ * console.error(e);
4615
+ * throw e;
4616
+ * });
4617
+ *
4618
+ * ```
3060
4619
  *
3061
4620
  * @param params - Parameters for request
3062
4621
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3066,11 +4625,11 @@ export namespace servicedirectory_v1beta1 {
3066
4625
  setIamPolicy(
3067
4626
  params: Params$Resource$Projects$Locations$Namespaces$Workloads$Setiampolicy,
3068
4627
  options: StreamMethodOptions
3069
- ): GaxiosPromise<Readable>;
4628
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
3070
4629
  setIamPolicy(
3071
4630
  params?: Params$Resource$Projects$Locations$Namespaces$Workloads$Setiampolicy,
3072
4631
  options?: MethodOptions
3073
- ): GaxiosPromise<Schema$Policy>;
4632
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Policy>>;
3074
4633
  setIamPolicy(
3075
4634
  params: Params$Resource$Projects$Locations$Namespaces$Workloads$Setiampolicy,
3076
4635
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -3099,7 +4658,10 @@ export namespace servicedirectory_v1beta1 {
3099
4658
  callback?:
3100
4659
  | BodyResponseCallback<Schema$Policy>
3101
4660
  | BodyResponseCallback<Readable>
3102
- ): void | GaxiosPromise<Schema$Policy> | GaxiosPromise<Readable> {
4661
+ ):
4662
+ | void
4663
+ | Promise<GaxiosResponseWithHTTP2<Schema$Policy>>
4664
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
3103
4665
  let params = (paramsOrCallback ||
3104
4666
  {}) as Params$Resource$Projects$Locations$Namespaces$Workloads$Setiampolicy;
3105
4667
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -3147,6 +4709,64 @@ export namespace servicedirectory_v1beta1 {
3147
4709
 
3148
4710
  /**
3149
4711
  * Tests IAM permissions for a resource (namespace, service or service workload only).
4712
+ * @example
4713
+ * ```js
4714
+ * // Before running the sample:
4715
+ * // - Enable the API at:
4716
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
4717
+ * // - Login into gcloud by running:
4718
+ * // ```sh
4719
+ * // $ gcloud auth application-default login
4720
+ * // ```
4721
+ * // - Install the npm module by running:
4722
+ * // ```sh
4723
+ * // $ npm install googleapis
4724
+ * // ```
4725
+ *
4726
+ * const {google} = require('googleapis');
4727
+ * const servicedirectory = google.servicedirectory('v1beta1');
4728
+ *
4729
+ * async function main() {
4730
+ * const auth = new google.auth.GoogleAuth({
4731
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
4732
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
4733
+ * });
4734
+ *
4735
+ * // Acquire an auth client, and bind it to all future calls
4736
+ * const authClient = await auth.getClient();
4737
+ * google.options({auth: authClient});
4738
+ *
4739
+ * // Do the magic
4740
+ * const res =
4741
+ * await servicedirectory.projects.locations.namespaces.workloads.testIamPermissions(
4742
+ * {
4743
+ * // REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
4744
+ * resource:
4745
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/workloads/my-workload',
4746
+ *
4747
+ * // Request body metadata
4748
+ * requestBody: {
4749
+ * // request body parameters
4750
+ * // {
4751
+ * // "permissions": []
4752
+ * // }
4753
+ * },
4754
+ * },
4755
+ * );
4756
+ * console.log(res.data);
4757
+ *
4758
+ * // Example response
4759
+ * // {
4760
+ * // "permissions": []
4761
+ * // }
4762
+ * }
4763
+ *
4764
+ * main().catch(e => {
4765
+ * console.error(e);
4766
+ * throw e;
4767
+ * });
4768
+ *
4769
+ * ```
3150
4770
  *
3151
4771
  * @param params - Parameters for request
3152
4772
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3156,11 +4776,11 @@ export namespace servicedirectory_v1beta1 {
3156
4776
  testIamPermissions(
3157
4777
  params: Params$Resource$Projects$Locations$Namespaces$Workloads$Testiampermissions,
3158
4778
  options: StreamMethodOptions
3159
- ): GaxiosPromise<Readable>;
4779
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
3160
4780
  testIamPermissions(
3161
4781
  params?: Params$Resource$Projects$Locations$Namespaces$Workloads$Testiampermissions,
3162
4782
  options?: MethodOptions
3163
- ): GaxiosPromise<Schema$TestIamPermissionsResponse>;
4783
+ ): Promise<GaxiosResponseWithHTTP2<Schema$TestIamPermissionsResponse>>;
3164
4784
  testIamPermissions(
3165
4785
  params: Params$Resource$Projects$Locations$Namespaces$Workloads$Testiampermissions,
3166
4786
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -3195,8 +4815,8 @@ export namespace servicedirectory_v1beta1 {
3195
4815
  | BodyResponseCallback<Readable>
3196
4816
  ):
3197
4817
  | void
3198
- | GaxiosPromise<Schema$TestIamPermissionsResponse>
3199
- | GaxiosPromise<Readable> {
4818
+ | Promise<GaxiosResponseWithHTTP2<Schema$TestIamPermissionsResponse>>
4819
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
3200
4820
  let params = (paramsOrCallback ||
3201
4821
  {}) as Params$Resource$Projects$Locations$Namespaces$Workloads$Testiampermissions;
3202
4822
  let options = (optionsOrCallback || {}) as MethodOptions;