@googleapis/servicedirectory 4.0.1 → 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
@@ -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`.
@@ -526,6 +576,61 @@ export namespace servicedirectory_v1beta1 {
526
576
 
527
577
  /**
528
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
+ * ```
529
634
  *
530
635
  * @param params - Parameters for request
531
636
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -666,6 +771,70 @@ export namespace servicedirectory_v1beta1 {
666
771
 
667
772
  /**
668
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
+ * ```
669
838
  *
670
839
  * @param params - Parameters for request
671
840
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -758,6 +927,50 @@ export namespace servicedirectory_v1beta1 {
758
927
 
759
928
  /**
760
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
+ * ```
761
974
  *
762
975
  * @param params - Parameters for request
763
976
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -847,6 +1060,56 @@ export namespace servicedirectory_v1beta1 {
847
1060
 
848
1061
  /**
849
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
+ * ```
850
1113
  *
851
1114
  * @param params - Parameters for request
852
1115
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -936,6 +1199,65 @@ export namespace servicedirectory_v1beta1 {
936
1199
 
937
1200
  /**
938
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
+ * ```
939
1261
  *
940
1262
  * @param params - Parameters for request
941
1263
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1029,6 +1351,61 @@ export namespace servicedirectory_v1beta1 {
1029
1351
 
1030
1352
  /**
1031
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
+ * ```
1032
1409
  *
1033
1410
  * @param params - Parameters for request
1034
1411
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1123,6 +1500,70 @@ export namespace servicedirectory_v1beta1 {
1123
1500
 
1124
1501
  /**
1125
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
+ * ```
1126
1567
  *
1127
1568
  * @param params - Parameters for request
1128
1569
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1212,6 +1653,65 @@ export namespace servicedirectory_v1beta1 {
1212
1653
 
1213
1654
  /**
1214
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
+ * ```
1215
1715
  *
1216
1716
  * @param params - Parameters for request
1217
1717
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1305,6 +1805,62 @@ export namespace servicedirectory_v1beta1 {
1305
1805
 
1306
1806
  /**
1307
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
+ * ```
1308
1864
  *
1309
1865
  * @param params - Parameters for request
1310
1866
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1520,6 +2076,74 @@ export namespace servicedirectory_v1beta1 {
1520
2076
 
1521
2077
  /**
1522
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
+ * ```
1523
2147
  *
1524
2148
  * @param params - Parameters for request
1525
2149
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1613,6 +2237,51 @@ export namespace servicedirectory_v1beta1 {
1613
2237
 
1614
2238
  /**
1615
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
+ * ```
1616
2285
  *
1617
2286
  * @param params - Parameters for request
1618
2287
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1703,6 +2372,59 @@ export namespace servicedirectory_v1beta1 {
1703
2372
 
1704
2373
  /**
1705
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
+ * ```
1706
2428
  *
1707
2429
  * @param params - Parameters for request
1708
2430
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1793,6 +2515,64 @@ export namespace servicedirectory_v1beta1 {
1793
2515
 
1794
2516
  /**
1795
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
+ * ```
1796
2576
  *
1797
2577
  * @param params - Parameters for request
1798
2578
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1886,6 +2666,63 @@ export namespace servicedirectory_v1beta1 {
1886
2666
 
1887
2667
  /**
1888
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
+ * ```
1889
2726
  *
1890
2727
  * @param params - Parameters for request
1891
2728
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1981,6 +2818,73 @@ export namespace servicedirectory_v1beta1 {
1981
2818
 
1982
2819
  /**
1983
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
+ * ```
1984
2888
  *
1985
2889
  * @param params - Parameters for request
1986
2890
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2071,6 +2975,62 @@ export namespace servicedirectory_v1beta1 {
2071
2975
 
2072
2976
  /**
2073
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
+ * ```
2074
3034
  *
2075
3035
  * @param params - Parameters for request
2076
3036
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2168,6 +3128,64 @@ export namespace servicedirectory_v1beta1 {
2168
3128
 
2169
3129
  /**
2170
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
+ * ```
2171
3189
  *
2172
3190
  * @param params - Parameters for request
2173
3191
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2261,6 +3279,64 @@ export namespace servicedirectory_v1beta1 {
2261
3279
 
2262
3280
  /**
2263
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
+ * ```
2264
3340
  *
2265
3341
  * @param params - Parameters for request
2266
3342
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2483,6 +3559,80 @@ export namespace servicedirectory_v1beta1 {
2483
3559
 
2484
3560
  /**
2485
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
+ * ```
2486
3636
  *
2487
3637
  * @param params - Parameters for request
2488
3638
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2576,6 +3726,53 @@ export namespace servicedirectory_v1beta1 {
2576
3726
 
2577
3727
  /**
2578
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
+ * ```
2579
3776
  *
2580
3777
  * @param params - Parameters for request
2581
3778
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2666,6 +3863,62 @@ export namespace servicedirectory_v1beta1 {
2666
3863
 
2667
3864
  /**
2668
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
+ * ```
2669
3922
  *
2670
3923
  * @param params - Parameters for request
2671
3924
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2756,6 +4009,65 @@ export namespace servicedirectory_v1beta1 {
2756
4009
 
2757
4010
  /**
2758
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
+ * ```
2759
4071
  *
2760
4072
  * @param params - Parameters for request
2761
4073
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2851,6 +4163,79 @@ export namespace servicedirectory_v1beta1 {
2851
4163
 
2852
4164
  /**
2853
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
+ * ```
2854
4239
  *
2855
4240
  * @param params - Parameters for request
2856
4241
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3018,6 +4403,66 @@ export namespace servicedirectory_v1beta1 {
3018
4403
 
3019
4404
  /**
3020
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
+ * ```
3021
4466
  *
3022
4467
  * @param params - Parameters for request
3023
4468
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3111,6 +4556,66 @@ export namespace servicedirectory_v1beta1 {
3111
4556
 
3112
4557
  /**
3113
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
+ * ```
3114
4619
  *
3115
4620
  * @param params - Parameters for request
3116
4621
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3204,6 +4709,64 @@ export namespace servicedirectory_v1beta1 {
3204
4709
 
3205
4710
  /**
3206
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
+ * ```
3207
4770
  *
3208
4771
  * @param params - Parameters for request
3209
4772
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.