@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/v1.ts CHANGED
@@ -413,6 +413,56 @@ export namespace servicedirectory_v1 {
413
413
 
414
414
  /**
415
415
  * Gets information about a location.
416
+ * @example
417
+ * ```js
418
+ * // Before running the sample:
419
+ * // - Enable the API at:
420
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
421
+ * // - Login into gcloud by running:
422
+ * // ```sh
423
+ * // $ gcloud auth application-default login
424
+ * // ```
425
+ * // - Install the npm module by running:
426
+ * // ```sh
427
+ * // $ npm install googleapis
428
+ * // ```
429
+ *
430
+ * const {google} = require('googleapis');
431
+ * const servicedirectory = google.servicedirectory('v1');
432
+ *
433
+ * async function main() {
434
+ * const auth = new google.auth.GoogleAuth({
435
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
436
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
437
+ * });
438
+ *
439
+ * // Acquire an auth client, and bind it to all future calls
440
+ * const authClient = await auth.getClient();
441
+ * google.options({auth: authClient});
442
+ *
443
+ * // Do the magic
444
+ * const res = await servicedirectory.projects.locations.get({
445
+ * // Resource name for the location.
446
+ * name: 'projects/my-project/locations/my-location',
447
+ * });
448
+ * console.log(res.data);
449
+ *
450
+ * // Example response
451
+ * // {
452
+ * // "displayName": "my_displayName",
453
+ * // "labels": {},
454
+ * // "locationId": "my_locationId",
455
+ * // "metadata": {},
456
+ * // "name": "my_name"
457
+ * // }
458
+ * }
459
+ *
460
+ * main().catch(e => {
461
+ * console.error(e);
462
+ * throw e;
463
+ * });
464
+ *
465
+ * ```
416
466
  *
417
467
  * @param params - Parameters for request
418
468
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -502,6 +552,61 @@ export namespace servicedirectory_v1 {
502
552
 
503
553
  /**
504
554
  * Lists information about the supported locations for this service.
555
+ * @example
556
+ * ```js
557
+ * // Before running the sample:
558
+ * // - Enable the API at:
559
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
560
+ * // - Login into gcloud by running:
561
+ * // ```sh
562
+ * // $ gcloud auth application-default login
563
+ * // ```
564
+ * // - Install the npm module by running:
565
+ * // ```sh
566
+ * // $ npm install googleapis
567
+ * // ```
568
+ *
569
+ * const {google} = require('googleapis');
570
+ * const servicedirectory = google.servicedirectory('v1');
571
+ *
572
+ * async function main() {
573
+ * const auth = new google.auth.GoogleAuth({
574
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
575
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
576
+ * });
577
+ *
578
+ * // Acquire an auth client, and bind it to all future calls
579
+ * const authClient = await auth.getClient();
580
+ * google.options({auth: authClient});
581
+ *
582
+ * // Do the magic
583
+ * const res = await servicedirectory.projects.locations.list({
584
+ * // Optional. A list of extra location types that should be used as conditions for controlling the visibility of the locations.
585
+ * extraLocationTypes: 'placeholder-value',
586
+ * // 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).
587
+ * filter: 'placeholder-value',
588
+ * // The resource that owns the locations collection, if applicable.
589
+ * name: 'projects/my-project',
590
+ * // The maximum number of results to return. If not set, the service selects a default.
591
+ * pageSize: 'placeholder-value',
592
+ * // A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
593
+ * pageToken: 'placeholder-value',
594
+ * });
595
+ * console.log(res.data);
596
+ *
597
+ * // Example response
598
+ * // {
599
+ * // "locations": [],
600
+ * // "nextPageToken": "my_nextPageToken"
601
+ * // }
602
+ * }
603
+ *
604
+ * main().catch(e => {
605
+ * console.error(e);
606
+ * throw e;
607
+ * });
608
+ *
609
+ * ```
505
610
  *
506
611
  * @param params - Parameters for request
507
612
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -638,6 +743,66 @@ export namespace servicedirectory_v1 {
638
743
 
639
744
  /**
640
745
  * Creates a namespace, and returns the new namespace.
746
+ * @example
747
+ * ```js
748
+ * // Before running the sample:
749
+ * // - Enable the API at:
750
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
751
+ * // - Login into gcloud by running:
752
+ * // ```sh
753
+ * // $ gcloud auth application-default login
754
+ * // ```
755
+ * // - Install the npm module by running:
756
+ * // ```sh
757
+ * // $ npm install googleapis
758
+ * // ```
759
+ *
760
+ * const {google} = require('googleapis');
761
+ * const servicedirectory = google.servicedirectory('v1');
762
+ *
763
+ * async function main() {
764
+ * const auth = new google.auth.GoogleAuth({
765
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
766
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
767
+ * });
768
+ *
769
+ * // Acquire an auth client, and bind it to all future calls
770
+ * const authClient = await auth.getClient();
771
+ * google.options({auth: authClient});
772
+ *
773
+ * // Do the magic
774
+ * const res = await servicedirectory.projects.locations.namespaces.create({
775
+ * // 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.
776
+ * namespaceId: 'placeholder-value',
777
+ * // Required. The resource name of the project and location the namespace will be created in.
778
+ * parent: 'projects/my-project/locations/my-location',
779
+ *
780
+ * // Request body metadata
781
+ * requestBody: {
782
+ * // request body parameters
783
+ * // {
784
+ * // "labels": {},
785
+ * // "name": "my_name",
786
+ * // "uid": "my_uid"
787
+ * // }
788
+ * },
789
+ * });
790
+ * console.log(res.data);
791
+ *
792
+ * // Example response
793
+ * // {
794
+ * // "labels": {},
795
+ * // "name": "my_name",
796
+ * // "uid": "my_uid"
797
+ * // }
798
+ * }
799
+ *
800
+ * main().catch(e => {
801
+ * console.error(e);
802
+ * throw e;
803
+ * });
804
+ *
805
+ * ```
641
806
  *
642
807
  * @param params - Parameters for request
643
808
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -730,6 +895,50 @@ export namespace servicedirectory_v1 {
730
895
 
731
896
  /**
732
897
  * Deletes a namespace. This also deletes all services and endpoints in the namespace.
898
+ * @example
899
+ * ```js
900
+ * // Before running the sample:
901
+ * // - Enable the API at:
902
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
903
+ * // - Login into gcloud by running:
904
+ * // ```sh
905
+ * // $ gcloud auth application-default login
906
+ * // ```
907
+ * // - Install the npm module by running:
908
+ * // ```sh
909
+ * // $ npm install googleapis
910
+ * // ```
911
+ *
912
+ * const {google} = require('googleapis');
913
+ * const servicedirectory = google.servicedirectory('v1');
914
+ *
915
+ * async function main() {
916
+ * const auth = new google.auth.GoogleAuth({
917
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
918
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
919
+ * });
920
+ *
921
+ * // Acquire an auth client, and bind it to all future calls
922
+ * const authClient = await auth.getClient();
923
+ * google.options({auth: authClient});
924
+ *
925
+ * // Do the magic
926
+ * const res = await servicedirectory.projects.locations.namespaces.delete({
927
+ * // Required. The name of the namespace to delete.
928
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace',
929
+ * });
930
+ * console.log(res.data);
931
+ *
932
+ * // Example response
933
+ * // {}
934
+ * }
935
+ *
936
+ * main().catch(e => {
937
+ * console.error(e);
938
+ * throw e;
939
+ * });
940
+ *
941
+ * ```
733
942
  *
734
943
  * @param params - Parameters for request
735
944
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -819,6 +1028,54 @@ export namespace servicedirectory_v1 {
819
1028
 
820
1029
  /**
821
1030
  * Gets a namespace.
1031
+ * @example
1032
+ * ```js
1033
+ * // Before running the sample:
1034
+ * // - Enable the API at:
1035
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1036
+ * // - Login into gcloud by running:
1037
+ * // ```sh
1038
+ * // $ gcloud auth application-default login
1039
+ * // ```
1040
+ * // - Install the npm module by running:
1041
+ * // ```sh
1042
+ * // $ npm install googleapis
1043
+ * // ```
1044
+ *
1045
+ * const {google} = require('googleapis');
1046
+ * const servicedirectory = google.servicedirectory('v1');
1047
+ *
1048
+ * async function main() {
1049
+ * const auth = new google.auth.GoogleAuth({
1050
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1051
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1052
+ * });
1053
+ *
1054
+ * // Acquire an auth client, and bind it to all future calls
1055
+ * const authClient = await auth.getClient();
1056
+ * google.options({auth: authClient});
1057
+ *
1058
+ * // Do the magic
1059
+ * const res = await servicedirectory.projects.locations.namespaces.get({
1060
+ * // Required. The name of the namespace to retrieve.
1061
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace',
1062
+ * });
1063
+ * console.log(res.data);
1064
+ *
1065
+ * // Example response
1066
+ * // {
1067
+ * // "labels": {},
1068
+ * // "name": "my_name",
1069
+ * // "uid": "my_uid"
1070
+ * // }
1071
+ * }
1072
+ *
1073
+ * main().catch(e => {
1074
+ * console.error(e);
1075
+ * throw e;
1076
+ * });
1077
+ *
1078
+ * ```
822
1079
  *
823
1080
  * @param params - Parameters for request
824
1081
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -908,6 +1165,65 @@ export namespace servicedirectory_v1 {
908
1165
 
909
1166
  /**
910
1167
  * Gets the IAM Policy for a resource (namespace or service only).
1168
+ * @example
1169
+ * ```js
1170
+ * // Before running the sample:
1171
+ * // - Enable the API at:
1172
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1173
+ * // - Login into gcloud by running:
1174
+ * // ```sh
1175
+ * // $ gcloud auth application-default login
1176
+ * // ```
1177
+ * // - Install the npm module by running:
1178
+ * // ```sh
1179
+ * // $ npm install googleapis
1180
+ * // ```
1181
+ *
1182
+ * const {google} = require('googleapis');
1183
+ * const servicedirectory = google.servicedirectory('v1');
1184
+ *
1185
+ * async function main() {
1186
+ * const auth = new google.auth.GoogleAuth({
1187
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1188
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1189
+ * });
1190
+ *
1191
+ * // Acquire an auth client, and bind it to all future calls
1192
+ * const authClient = await auth.getClient();
1193
+ * google.options({auth: authClient});
1194
+ *
1195
+ * // Do the magic
1196
+ * const res = await servicedirectory.projects.locations.namespaces.getIamPolicy(
1197
+ * {
1198
+ * // 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.
1199
+ * resource:
1200
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
1201
+ *
1202
+ * // Request body metadata
1203
+ * requestBody: {
1204
+ * // request body parameters
1205
+ * // {
1206
+ * // "options": {}
1207
+ * // }
1208
+ * },
1209
+ * },
1210
+ * );
1211
+ * console.log(res.data);
1212
+ *
1213
+ * // Example response
1214
+ * // {
1215
+ * // "bindings": [],
1216
+ * // "etag": "my_etag",
1217
+ * // "version": 0
1218
+ * // }
1219
+ * }
1220
+ *
1221
+ * main().catch(e => {
1222
+ * console.error(e);
1223
+ * throw e;
1224
+ * });
1225
+ *
1226
+ * ```
911
1227
  *
912
1228
  * @param params - Parameters for request
913
1229
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1001,6 +1317,61 @@ export namespace servicedirectory_v1 {
1001
1317
 
1002
1318
  /**
1003
1319
  * Lists all namespaces.
1320
+ * @example
1321
+ * ```js
1322
+ * // Before running the sample:
1323
+ * // - Enable the API at:
1324
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1325
+ * // - Login into gcloud by running:
1326
+ * // ```sh
1327
+ * // $ gcloud auth application-default login
1328
+ * // ```
1329
+ * // - Install the npm module by running:
1330
+ * // ```sh
1331
+ * // $ npm install googleapis
1332
+ * // ```
1333
+ *
1334
+ * const {google} = require('googleapis');
1335
+ * const servicedirectory = google.servicedirectory('v1');
1336
+ *
1337
+ * async function main() {
1338
+ * const auth = new google.auth.GoogleAuth({
1339
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1340
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1341
+ * });
1342
+ *
1343
+ * // Acquire an auth client, and bind it to all future calls
1344
+ * const authClient = await auth.getClient();
1345
+ * google.options({auth: authClient});
1346
+ *
1347
+ * // Do the magic
1348
+ * const res = await servicedirectory.projects.locations.namespaces.list({
1349
+ * // Optional. The filter to list results by. General `filter` string syntax: ` ()` * `` can be `name` or `labels.` 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: * `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 For more information about filtering, see [API Filtering](https://aip.dev/160).
1350
+ * filter: 'placeholder-value',
1351
+ * // 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.
1352
+ * orderBy: 'placeholder-value',
1353
+ * // Optional. The maximum number of items to return.
1354
+ * pageSize: 'placeholder-value',
1355
+ * // Optional. The next_page_token value returned from a previous List request, if any.
1356
+ * pageToken: 'placeholder-value',
1357
+ * // Required. The resource name of the project and location whose namespaces you'd like to list.
1358
+ * parent: 'projects/my-project/locations/my-location',
1359
+ * });
1360
+ * console.log(res.data);
1361
+ *
1362
+ * // Example response
1363
+ * // {
1364
+ * // "namespaces": [],
1365
+ * // "nextPageToken": "my_nextPageToken"
1366
+ * // }
1367
+ * }
1368
+ *
1369
+ * main().catch(e => {
1370
+ * console.error(e);
1371
+ * throw e;
1372
+ * });
1373
+ *
1374
+ * ```
1004
1375
  *
1005
1376
  * @param params - Parameters for request
1006
1377
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1095,6 +1466,66 @@ export namespace servicedirectory_v1 {
1095
1466
 
1096
1467
  /**
1097
1468
  * Updates a namespace.
1469
+ * @example
1470
+ * ```js
1471
+ * // Before running the sample:
1472
+ * // - Enable the API at:
1473
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1474
+ * // - Login into gcloud by running:
1475
+ * // ```sh
1476
+ * // $ gcloud auth application-default login
1477
+ * // ```
1478
+ * // - Install the npm module by running:
1479
+ * // ```sh
1480
+ * // $ npm install googleapis
1481
+ * // ```
1482
+ *
1483
+ * const {google} = require('googleapis');
1484
+ * const servicedirectory = google.servicedirectory('v1');
1485
+ *
1486
+ * async function main() {
1487
+ * const auth = new google.auth.GoogleAuth({
1488
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1489
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1490
+ * });
1491
+ *
1492
+ * // Acquire an auth client, and bind it to all future calls
1493
+ * const authClient = await auth.getClient();
1494
+ * google.options({auth: authClient});
1495
+ *
1496
+ * // Do the magic
1497
+ * const res = await servicedirectory.projects.locations.namespaces.patch({
1498
+ * // Immutable. The resource name for the namespace in the format `projects/x/locations/x/namespaces/x`.
1499
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace',
1500
+ * // Required. List of fields to be updated in this request.
1501
+ * updateMask: 'placeholder-value',
1502
+ *
1503
+ * // Request body metadata
1504
+ * requestBody: {
1505
+ * // request body parameters
1506
+ * // {
1507
+ * // "labels": {},
1508
+ * // "name": "my_name",
1509
+ * // "uid": "my_uid"
1510
+ * // }
1511
+ * },
1512
+ * });
1513
+ * console.log(res.data);
1514
+ *
1515
+ * // Example response
1516
+ * // {
1517
+ * // "labels": {},
1518
+ * // "name": "my_name",
1519
+ * // "uid": "my_uid"
1520
+ * // }
1521
+ * }
1522
+ *
1523
+ * main().catch(e => {
1524
+ * console.error(e);
1525
+ * throw e;
1526
+ * });
1527
+ *
1528
+ * ```
1098
1529
  *
1099
1530
  * @param params - Parameters for request
1100
1531
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1184,6 +1615,65 @@ export namespace servicedirectory_v1 {
1184
1615
 
1185
1616
  /**
1186
1617
  * Sets the IAM Policy for a resource (namespace or service only).
1618
+ * @example
1619
+ * ```js
1620
+ * // Before running the sample:
1621
+ * // - Enable the API at:
1622
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1623
+ * // - Login into gcloud by running:
1624
+ * // ```sh
1625
+ * // $ gcloud auth application-default login
1626
+ * // ```
1627
+ * // - Install the npm module by running:
1628
+ * // ```sh
1629
+ * // $ npm install googleapis
1630
+ * // ```
1631
+ *
1632
+ * const {google} = require('googleapis');
1633
+ * const servicedirectory = google.servicedirectory('v1');
1634
+ *
1635
+ * async function main() {
1636
+ * const auth = new google.auth.GoogleAuth({
1637
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1638
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1639
+ * });
1640
+ *
1641
+ * // Acquire an auth client, and bind it to all future calls
1642
+ * const authClient = await auth.getClient();
1643
+ * google.options({auth: authClient});
1644
+ *
1645
+ * // Do the magic
1646
+ * const res = await servicedirectory.projects.locations.namespaces.setIamPolicy(
1647
+ * {
1648
+ * // 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.
1649
+ * resource:
1650
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
1651
+ *
1652
+ * // Request body metadata
1653
+ * requestBody: {
1654
+ * // request body parameters
1655
+ * // {
1656
+ * // "policy": {}
1657
+ * // }
1658
+ * },
1659
+ * },
1660
+ * );
1661
+ * console.log(res.data);
1662
+ *
1663
+ * // Example response
1664
+ * // {
1665
+ * // "bindings": [],
1666
+ * // "etag": "my_etag",
1667
+ * // "version": 0
1668
+ * // }
1669
+ * }
1670
+ *
1671
+ * main().catch(e => {
1672
+ * console.error(e);
1673
+ * throw e;
1674
+ * });
1675
+ *
1676
+ * ```
1187
1677
  *
1188
1678
  * @param params - Parameters for request
1189
1679
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1277,6 +1767,62 @@ export namespace servicedirectory_v1 {
1277
1767
 
1278
1768
  /**
1279
1769
  * Tests IAM permissions for a resource (namespace or service only).
1770
+ * @example
1771
+ * ```js
1772
+ * // Before running the sample:
1773
+ * // - Enable the API at:
1774
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1775
+ * // - Login into gcloud by running:
1776
+ * // ```sh
1777
+ * // $ gcloud auth application-default login
1778
+ * // ```
1779
+ * // - Install the npm module by running:
1780
+ * // ```sh
1781
+ * // $ npm install googleapis
1782
+ * // ```
1783
+ *
1784
+ * const {google} = require('googleapis');
1785
+ * const servicedirectory = google.servicedirectory('v1');
1786
+ *
1787
+ * async function main() {
1788
+ * const auth = new google.auth.GoogleAuth({
1789
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1790
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1791
+ * });
1792
+ *
1793
+ * // Acquire an auth client, and bind it to all future calls
1794
+ * const authClient = await auth.getClient();
1795
+ * google.options({auth: authClient});
1796
+ *
1797
+ * // Do the magic
1798
+ * const res =
1799
+ * await servicedirectory.projects.locations.namespaces.testIamPermissions({
1800
+ * // 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.
1801
+ * resource:
1802
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
1803
+ *
1804
+ * // Request body metadata
1805
+ * requestBody: {
1806
+ * // request body parameters
1807
+ * // {
1808
+ * // "permissions": []
1809
+ * // }
1810
+ * },
1811
+ * });
1812
+ * console.log(res.data);
1813
+ *
1814
+ * // Example response
1815
+ * // {
1816
+ * // "permissions": []
1817
+ * // }
1818
+ * }
1819
+ *
1820
+ * main().catch(e => {
1821
+ * console.error(e);
1822
+ * throw e;
1823
+ * });
1824
+ *
1825
+ * ```
1280
1826
  *
1281
1827
  * @param params - Parameters for request
1282
1828
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1492,6 +2038,70 @@ export namespace servicedirectory_v1 {
1492
2038
 
1493
2039
  /**
1494
2040
  * Creates a service, and returns the new service.
2041
+ * @example
2042
+ * ```js
2043
+ * // Before running the sample:
2044
+ * // - Enable the API at:
2045
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2046
+ * // - Login into gcloud by running:
2047
+ * // ```sh
2048
+ * // $ gcloud auth application-default login
2049
+ * // ```
2050
+ * // - Install the npm module by running:
2051
+ * // ```sh
2052
+ * // $ npm install googleapis
2053
+ * // ```
2054
+ *
2055
+ * const {google} = require('googleapis');
2056
+ * const servicedirectory = google.servicedirectory('v1');
2057
+ *
2058
+ * async function main() {
2059
+ * const auth = new google.auth.GoogleAuth({
2060
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2061
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2062
+ * });
2063
+ *
2064
+ * // Acquire an auth client, and bind it to all future calls
2065
+ * const authClient = await auth.getClient();
2066
+ * google.options({auth: authClient});
2067
+ *
2068
+ * // Do the magic
2069
+ * const res =
2070
+ * await servicedirectory.projects.locations.namespaces.services.create({
2071
+ * // Required. The resource name of the namespace this service will belong to.
2072
+ * parent:
2073
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
2074
+ * // 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.
2075
+ * serviceId: 'placeholder-value',
2076
+ *
2077
+ * // Request body metadata
2078
+ * requestBody: {
2079
+ * // request body parameters
2080
+ * // {
2081
+ * // "annotations": {},
2082
+ * // "endpoints": [],
2083
+ * // "name": "my_name",
2084
+ * // "uid": "my_uid"
2085
+ * // }
2086
+ * },
2087
+ * });
2088
+ * console.log(res.data);
2089
+ *
2090
+ * // Example response
2091
+ * // {
2092
+ * // "annotations": {},
2093
+ * // "endpoints": [],
2094
+ * // "name": "my_name",
2095
+ * // "uid": "my_uid"
2096
+ * // }
2097
+ * }
2098
+ *
2099
+ * main().catch(e => {
2100
+ * console.error(e);
2101
+ * throw e;
2102
+ * });
2103
+ *
2104
+ * ```
1495
2105
  *
1496
2106
  * @param params - Parameters for request
1497
2107
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1585,6 +2195,51 @@ export namespace servicedirectory_v1 {
1585
2195
 
1586
2196
  /**
1587
2197
  * Deletes a service. This also deletes all endpoints associated with the service.
2198
+ * @example
2199
+ * ```js
2200
+ * // Before running the sample:
2201
+ * // - Enable the API at:
2202
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2203
+ * // - Login into gcloud by running:
2204
+ * // ```sh
2205
+ * // $ gcloud auth application-default login
2206
+ * // ```
2207
+ * // - Install the npm module by running:
2208
+ * // ```sh
2209
+ * // $ npm install googleapis
2210
+ * // ```
2211
+ *
2212
+ * const {google} = require('googleapis');
2213
+ * const servicedirectory = google.servicedirectory('v1');
2214
+ *
2215
+ * async function main() {
2216
+ * const auth = new google.auth.GoogleAuth({
2217
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2218
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2219
+ * });
2220
+ *
2221
+ * // Acquire an auth client, and bind it to all future calls
2222
+ * const authClient = await auth.getClient();
2223
+ * google.options({auth: authClient});
2224
+ *
2225
+ * // Do the magic
2226
+ * const res =
2227
+ * await servicedirectory.projects.locations.namespaces.services.delete({
2228
+ * // Required. The name of the service to delete.
2229
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
2230
+ * });
2231
+ * console.log(res.data);
2232
+ *
2233
+ * // Example response
2234
+ * // {}
2235
+ * }
2236
+ *
2237
+ * main().catch(e => {
2238
+ * console.error(e);
2239
+ * throw e;
2240
+ * });
2241
+ *
2242
+ * ```
1588
2243
  *
1589
2244
  * @param params - Parameters for request
1590
2245
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1675,6 +2330,57 @@ export namespace servicedirectory_v1 {
1675
2330
 
1676
2331
  /**
1677
2332
  * Gets a service.
2333
+ * @example
2334
+ * ```js
2335
+ * // Before running the sample:
2336
+ * // - Enable the API at:
2337
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2338
+ * // - Login into gcloud by running:
2339
+ * // ```sh
2340
+ * // $ gcloud auth application-default login
2341
+ * // ```
2342
+ * // - Install the npm module by running:
2343
+ * // ```sh
2344
+ * // $ npm install googleapis
2345
+ * // ```
2346
+ *
2347
+ * const {google} = require('googleapis');
2348
+ * const servicedirectory = google.servicedirectory('v1');
2349
+ *
2350
+ * async function main() {
2351
+ * const auth = new google.auth.GoogleAuth({
2352
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2353
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2354
+ * });
2355
+ *
2356
+ * // Acquire an auth client, and bind it to all future calls
2357
+ * const authClient = await auth.getClient();
2358
+ * google.options({auth: authClient});
2359
+ *
2360
+ * // Do the magic
2361
+ * const res = await servicedirectory.projects.locations.namespaces.services.get(
2362
+ * {
2363
+ * // Required. The name of the service to get.
2364
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
2365
+ * },
2366
+ * );
2367
+ * console.log(res.data);
2368
+ *
2369
+ * // Example response
2370
+ * // {
2371
+ * // "annotations": {},
2372
+ * // "endpoints": [],
2373
+ * // "name": "my_name",
2374
+ * // "uid": "my_uid"
2375
+ * // }
2376
+ * }
2377
+ *
2378
+ * main().catch(e => {
2379
+ * console.error(e);
2380
+ * throw e;
2381
+ * });
2382
+ *
2383
+ * ```
1678
2384
  *
1679
2385
  * @param params - Parameters for request
1680
2386
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1765,6 +2471,64 @@ export namespace servicedirectory_v1 {
1765
2471
 
1766
2472
  /**
1767
2473
  * Gets the IAM Policy for a resource (namespace or service only).
2474
+ * @example
2475
+ * ```js
2476
+ * // Before running the sample:
2477
+ * // - Enable the API at:
2478
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2479
+ * // - Login into gcloud by running:
2480
+ * // ```sh
2481
+ * // $ gcloud auth application-default login
2482
+ * // ```
2483
+ * // - Install the npm module by running:
2484
+ * // ```sh
2485
+ * // $ npm install googleapis
2486
+ * // ```
2487
+ *
2488
+ * const {google} = require('googleapis');
2489
+ * const servicedirectory = google.servicedirectory('v1');
2490
+ *
2491
+ * async function main() {
2492
+ * const auth = new google.auth.GoogleAuth({
2493
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2494
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2495
+ * });
2496
+ *
2497
+ * // Acquire an auth client, and bind it to all future calls
2498
+ * const authClient = await auth.getClient();
2499
+ * google.options({auth: authClient});
2500
+ *
2501
+ * // Do the magic
2502
+ * const res =
2503
+ * await servicedirectory.projects.locations.namespaces.services.getIamPolicy({
2504
+ * // 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.
2505
+ * resource:
2506
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
2507
+ *
2508
+ * // Request body metadata
2509
+ * requestBody: {
2510
+ * // request body parameters
2511
+ * // {
2512
+ * // "options": {}
2513
+ * // }
2514
+ * },
2515
+ * });
2516
+ * console.log(res.data);
2517
+ *
2518
+ * // Example response
2519
+ * // {
2520
+ * // "bindings": [],
2521
+ * // "etag": "my_etag",
2522
+ * // "version": 0
2523
+ * // }
2524
+ * }
2525
+ *
2526
+ * main().catch(e => {
2527
+ * console.error(e);
2528
+ * throw e;
2529
+ * });
2530
+ *
2531
+ * ```
1768
2532
  *
1769
2533
  * @param params - Parameters for request
1770
2534
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1858,6 +2622,63 @@ export namespace servicedirectory_v1 {
1858
2622
 
1859
2623
  /**
1860
2624
  * Lists all services belonging to a namespace.
2625
+ * @example
2626
+ * ```js
2627
+ * // Before running the sample:
2628
+ * // - Enable the API at:
2629
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2630
+ * // - Login into gcloud by running:
2631
+ * // ```sh
2632
+ * // $ gcloud auth application-default login
2633
+ * // ```
2634
+ * // - Install the npm module by running:
2635
+ * // ```sh
2636
+ * // $ npm install googleapis
2637
+ * // ```
2638
+ *
2639
+ * const {google} = require('googleapis');
2640
+ * const servicedirectory = google.servicedirectory('v1');
2641
+ *
2642
+ * async function main() {
2643
+ * const auth = new google.auth.GoogleAuth({
2644
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2645
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2646
+ * });
2647
+ *
2648
+ * // Acquire an auth client, and bind it to all future calls
2649
+ * const authClient = await auth.getClient();
2650
+ * google.options({auth: authClient});
2651
+ *
2652
+ * // Do the magic
2653
+ * const res =
2654
+ * await servicedirectory.projects.locations.namespaces.services.list({
2655
+ * // Optional. The filter to list results by. General `filter` string syntax: ` ()` * `` can be `name` or `annotations.` 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: * `annotations.owner` returns services that have a annotation with the key `owner`, this is the same as `annotations:owner` * `annotations.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 * `annotations.owner!=sd AND annotations.foo=bar` returns services that have `owner` in annotation 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 For more information about filtering, see [API Filtering](https://aip.dev/160).
2656
+ * filter: 'placeholder-value',
2657
+ * // 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.
2658
+ * orderBy: 'placeholder-value',
2659
+ * // Optional. The maximum number of items to return.
2660
+ * pageSize: 'placeholder-value',
2661
+ * // Optional. The next_page_token value returned from a previous List request, if any.
2662
+ * pageToken: 'placeholder-value',
2663
+ * // Required. The resource name of the namespace whose services you'd like to list.
2664
+ * parent:
2665
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
2666
+ * });
2667
+ * console.log(res.data);
2668
+ *
2669
+ * // Example response
2670
+ * // {
2671
+ * // "nextPageToken": "my_nextPageToken",
2672
+ * // "services": []
2673
+ * // }
2674
+ * }
2675
+ *
2676
+ * main().catch(e => {
2677
+ * console.error(e);
2678
+ * throw e;
2679
+ * });
2680
+ *
2681
+ * ```
1861
2682
  *
1862
2683
  * @param params - Parameters for request
1863
2684
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1953,6 +2774,69 @@ export namespace servicedirectory_v1 {
1953
2774
 
1954
2775
  /**
1955
2776
  * Updates a service.
2777
+ * @example
2778
+ * ```js
2779
+ * // Before running the sample:
2780
+ * // - Enable the API at:
2781
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2782
+ * // - Login into gcloud by running:
2783
+ * // ```sh
2784
+ * // $ gcloud auth application-default login
2785
+ * // ```
2786
+ * // - Install the npm module by running:
2787
+ * // ```sh
2788
+ * // $ npm install googleapis
2789
+ * // ```
2790
+ *
2791
+ * const {google} = require('googleapis');
2792
+ * const servicedirectory = google.servicedirectory('v1');
2793
+ *
2794
+ * async function main() {
2795
+ * const auth = new google.auth.GoogleAuth({
2796
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2797
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2798
+ * });
2799
+ *
2800
+ * // Acquire an auth client, and bind it to all future calls
2801
+ * const authClient = await auth.getClient();
2802
+ * google.options({auth: authClient});
2803
+ *
2804
+ * // Do the magic
2805
+ * const res =
2806
+ * await servicedirectory.projects.locations.namespaces.services.patch({
2807
+ * // Immutable. The resource name for the service in the format `projects/x/locations/x/namespaces/x/services/x`.
2808
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
2809
+ * // Required. List of fields to be updated in this request.
2810
+ * updateMask: 'placeholder-value',
2811
+ *
2812
+ * // Request body metadata
2813
+ * requestBody: {
2814
+ * // request body parameters
2815
+ * // {
2816
+ * // "annotations": {},
2817
+ * // "endpoints": [],
2818
+ * // "name": "my_name",
2819
+ * // "uid": "my_uid"
2820
+ * // }
2821
+ * },
2822
+ * });
2823
+ * console.log(res.data);
2824
+ *
2825
+ * // Example response
2826
+ * // {
2827
+ * // "annotations": {},
2828
+ * // "endpoints": [],
2829
+ * // "name": "my_name",
2830
+ * // "uid": "my_uid"
2831
+ * // }
2832
+ * }
2833
+ *
2834
+ * main().catch(e => {
2835
+ * console.error(e);
2836
+ * throw e;
2837
+ * });
2838
+ *
2839
+ * ```
1956
2840
  *
1957
2841
  * @param params - Parameters for request
1958
2842
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2043,6 +2927,62 @@ export namespace servicedirectory_v1 {
2043
2927
 
2044
2928
  /**
2045
2929
  * Returns a service and its associated endpoints. Resolving a service is not considered an active developer method.
2930
+ * @example
2931
+ * ```js
2932
+ * // Before running the sample:
2933
+ * // - Enable the API at:
2934
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2935
+ * // - Login into gcloud by running:
2936
+ * // ```sh
2937
+ * // $ gcloud auth application-default login
2938
+ * // ```
2939
+ * // - Install the npm module by running:
2940
+ * // ```sh
2941
+ * // $ npm install googleapis
2942
+ * // ```
2943
+ *
2944
+ * const {google} = require('googleapis');
2945
+ * const servicedirectory = google.servicedirectory('v1');
2946
+ *
2947
+ * async function main() {
2948
+ * const auth = new google.auth.GoogleAuth({
2949
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2950
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2951
+ * });
2952
+ *
2953
+ * // Acquire an auth client, and bind it to all future calls
2954
+ * const authClient = await auth.getClient();
2955
+ * google.options({auth: authClient});
2956
+ *
2957
+ * // Do the magic
2958
+ * const res =
2959
+ * await servicedirectory.projects.locations.namespaces.services.resolve({
2960
+ * // Required. The name of the service to resolve.
2961
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
2962
+ *
2963
+ * // Request body metadata
2964
+ * requestBody: {
2965
+ * // request body parameters
2966
+ * // {
2967
+ * // "endpointFilter": "my_endpointFilter",
2968
+ * // "maxEndpoints": 0
2969
+ * // }
2970
+ * },
2971
+ * });
2972
+ * console.log(res.data);
2973
+ *
2974
+ * // Example response
2975
+ * // {
2976
+ * // "service": {}
2977
+ * // }
2978
+ * }
2979
+ *
2980
+ * main().catch(e => {
2981
+ * console.error(e);
2982
+ * throw e;
2983
+ * });
2984
+ *
2985
+ * ```
2046
2986
  *
2047
2987
  * @param params - Parameters for request
2048
2988
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2140,6 +3080,64 @@ export namespace servicedirectory_v1 {
2140
3080
 
2141
3081
  /**
2142
3082
  * Sets the IAM Policy for a resource (namespace or service only).
3083
+ * @example
3084
+ * ```js
3085
+ * // Before running the sample:
3086
+ * // - Enable the API at:
3087
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
3088
+ * // - Login into gcloud by running:
3089
+ * // ```sh
3090
+ * // $ gcloud auth application-default login
3091
+ * // ```
3092
+ * // - Install the npm module by running:
3093
+ * // ```sh
3094
+ * // $ npm install googleapis
3095
+ * // ```
3096
+ *
3097
+ * const {google} = require('googleapis');
3098
+ * const servicedirectory = google.servicedirectory('v1');
3099
+ *
3100
+ * async function main() {
3101
+ * const auth = new google.auth.GoogleAuth({
3102
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3103
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3104
+ * });
3105
+ *
3106
+ * // Acquire an auth client, and bind it to all future calls
3107
+ * const authClient = await auth.getClient();
3108
+ * google.options({auth: authClient});
3109
+ *
3110
+ * // Do the magic
3111
+ * const res =
3112
+ * await servicedirectory.projects.locations.namespaces.services.setIamPolicy({
3113
+ * // 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.
3114
+ * resource:
3115
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
3116
+ *
3117
+ * // Request body metadata
3118
+ * requestBody: {
3119
+ * // request body parameters
3120
+ * // {
3121
+ * // "policy": {}
3122
+ * // }
3123
+ * },
3124
+ * });
3125
+ * console.log(res.data);
3126
+ *
3127
+ * // Example response
3128
+ * // {
3129
+ * // "bindings": [],
3130
+ * // "etag": "my_etag",
3131
+ * // "version": 0
3132
+ * // }
3133
+ * }
3134
+ *
3135
+ * main().catch(e => {
3136
+ * console.error(e);
3137
+ * throw e;
3138
+ * });
3139
+ *
3140
+ * ```
2143
3141
  *
2144
3142
  * @param params - Parameters for request
2145
3143
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2233,6 +3231,64 @@ export namespace servicedirectory_v1 {
2233
3231
 
2234
3232
  /**
2235
3233
  * Tests IAM permissions for a resource (namespace or service only).
3234
+ * @example
3235
+ * ```js
3236
+ * // Before running the sample:
3237
+ * // - Enable the API at:
3238
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
3239
+ * // - Login into gcloud by running:
3240
+ * // ```sh
3241
+ * // $ gcloud auth application-default login
3242
+ * // ```
3243
+ * // - Install the npm module by running:
3244
+ * // ```sh
3245
+ * // $ npm install googleapis
3246
+ * // ```
3247
+ *
3248
+ * const {google} = require('googleapis');
3249
+ * const servicedirectory = google.servicedirectory('v1');
3250
+ *
3251
+ * async function main() {
3252
+ * const auth = new google.auth.GoogleAuth({
3253
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3254
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3255
+ * });
3256
+ *
3257
+ * // Acquire an auth client, and bind it to all future calls
3258
+ * const authClient = await auth.getClient();
3259
+ * google.options({auth: authClient});
3260
+ *
3261
+ * // Do the magic
3262
+ * const res =
3263
+ * await servicedirectory.projects.locations.namespaces.services.testIamPermissions(
3264
+ * {
3265
+ * // 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.
3266
+ * resource:
3267
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
3268
+ *
3269
+ * // Request body metadata
3270
+ * requestBody: {
3271
+ * // request body parameters
3272
+ * // {
3273
+ * // "permissions": []
3274
+ * // }
3275
+ * },
3276
+ * },
3277
+ * );
3278
+ * console.log(res.data);
3279
+ *
3280
+ * // Example response
3281
+ * // {
3282
+ * // "permissions": []
3283
+ * // }
3284
+ * }
3285
+ *
3286
+ * main().catch(e => {
3287
+ * console.error(e);
3288
+ * throw e;
3289
+ * });
3290
+ *
3291
+ * ```
2236
3292
  *
2237
3293
  * @param params - Parameters for request
2238
3294
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2455,6 +3511,76 @@ export namespace servicedirectory_v1 {
2455
3511
 
2456
3512
  /**
2457
3513
  * Creates an endpoint, and returns the new endpoint.
3514
+ * @example
3515
+ * ```js
3516
+ * // Before running the sample:
3517
+ * // - Enable the API at:
3518
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
3519
+ * // - Login into gcloud by running:
3520
+ * // ```sh
3521
+ * // $ gcloud auth application-default login
3522
+ * // ```
3523
+ * // - Install the npm module by running:
3524
+ * // ```sh
3525
+ * // $ npm install googleapis
3526
+ * // ```
3527
+ *
3528
+ * const {google} = require('googleapis');
3529
+ * const servicedirectory = google.servicedirectory('v1');
3530
+ *
3531
+ * async function main() {
3532
+ * const auth = new google.auth.GoogleAuth({
3533
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3534
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3535
+ * });
3536
+ *
3537
+ * // Acquire an auth client, and bind it to all future calls
3538
+ * const authClient = await auth.getClient();
3539
+ * google.options({auth: authClient});
3540
+ *
3541
+ * // Do the magic
3542
+ * const res =
3543
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.create(
3544
+ * {
3545
+ * // 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.
3546
+ * endpointId: 'placeholder-value',
3547
+ * // Required. The resource name of the service that this endpoint provides.
3548
+ * parent:
3549
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
3550
+ *
3551
+ * // Request body metadata
3552
+ * requestBody: {
3553
+ * // request body parameters
3554
+ * // {
3555
+ * // "address": "my_address",
3556
+ * // "annotations": {},
3557
+ * // "name": "my_name",
3558
+ * // "network": "my_network",
3559
+ * // "port": 0,
3560
+ * // "uid": "my_uid"
3561
+ * // }
3562
+ * },
3563
+ * },
3564
+ * );
3565
+ * console.log(res.data);
3566
+ *
3567
+ * // Example response
3568
+ * // {
3569
+ * // "address": "my_address",
3570
+ * // "annotations": {},
3571
+ * // "name": "my_name",
3572
+ * // "network": "my_network",
3573
+ * // "port": 0,
3574
+ * // "uid": "my_uid"
3575
+ * // }
3576
+ * }
3577
+ *
3578
+ * main().catch(e => {
3579
+ * console.error(e);
3580
+ * throw e;
3581
+ * });
3582
+ *
3583
+ * ```
2458
3584
  *
2459
3585
  * @param params - Parameters for request
2460
3586
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2548,6 +3674,53 @@ export namespace servicedirectory_v1 {
2548
3674
 
2549
3675
  /**
2550
3676
  * Deletes an endpoint.
3677
+ * @example
3678
+ * ```js
3679
+ * // Before running the sample:
3680
+ * // - Enable the API at:
3681
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
3682
+ * // - Login into gcloud by running:
3683
+ * // ```sh
3684
+ * // $ gcloud auth application-default login
3685
+ * // ```
3686
+ * // - Install the npm module by running:
3687
+ * // ```sh
3688
+ * // $ npm install googleapis
3689
+ * // ```
3690
+ *
3691
+ * const {google} = require('googleapis');
3692
+ * const servicedirectory = google.servicedirectory('v1');
3693
+ *
3694
+ * async function main() {
3695
+ * const auth = new google.auth.GoogleAuth({
3696
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3697
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3698
+ * });
3699
+ *
3700
+ * // Acquire an auth client, and bind it to all future calls
3701
+ * const authClient = await auth.getClient();
3702
+ * google.options({auth: authClient});
3703
+ *
3704
+ * // Do the magic
3705
+ * const res =
3706
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.delete(
3707
+ * {
3708
+ * // Required. The name of the endpoint to delete.
3709
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service/endpoints/my-endpoint',
3710
+ * },
3711
+ * );
3712
+ * console.log(res.data);
3713
+ *
3714
+ * // Example response
3715
+ * // {}
3716
+ * }
3717
+ *
3718
+ * main().catch(e => {
3719
+ * console.error(e);
3720
+ * throw e;
3721
+ * });
3722
+ *
3723
+ * ```
2551
3724
  *
2552
3725
  * @param params - Parameters for request
2553
3726
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2638,6 +3811,60 @@ export namespace servicedirectory_v1 {
2638
3811
 
2639
3812
  /**
2640
3813
  * Gets an endpoint.
3814
+ * @example
3815
+ * ```js
3816
+ * // Before running the sample:
3817
+ * // - Enable the API at:
3818
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
3819
+ * // - Login into gcloud by running:
3820
+ * // ```sh
3821
+ * // $ gcloud auth application-default login
3822
+ * // ```
3823
+ * // - Install the npm module by running:
3824
+ * // ```sh
3825
+ * // $ npm install googleapis
3826
+ * // ```
3827
+ *
3828
+ * const {google} = require('googleapis');
3829
+ * const servicedirectory = google.servicedirectory('v1');
3830
+ *
3831
+ * async function main() {
3832
+ * const auth = new google.auth.GoogleAuth({
3833
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3834
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3835
+ * });
3836
+ *
3837
+ * // Acquire an auth client, and bind it to all future calls
3838
+ * const authClient = await auth.getClient();
3839
+ * google.options({auth: authClient});
3840
+ *
3841
+ * // Do the magic
3842
+ * const res =
3843
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.get(
3844
+ * {
3845
+ * // Required. The name of the endpoint to get.
3846
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service/endpoints/my-endpoint',
3847
+ * },
3848
+ * );
3849
+ * console.log(res.data);
3850
+ *
3851
+ * // Example response
3852
+ * // {
3853
+ * // "address": "my_address",
3854
+ * // "annotations": {},
3855
+ * // "name": "my_name",
3856
+ * // "network": "my_network",
3857
+ * // "port": 0,
3858
+ * // "uid": "my_uid"
3859
+ * // }
3860
+ * }
3861
+ *
3862
+ * main().catch(e => {
3863
+ * console.error(e);
3864
+ * throw e;
3865
+ * });
3866
+ *
3867
+ * ```
2641
3868
  *
2642
3869
  * @param params - Parameters for request
2643
3870
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2728,6 +3955,65 @@ export namespace servicedirectory_v1 {
2728
3955
 
2729
3956
  /**
2730
3957
  * Lists all endpoints.
3958
+ * @example
3959
+ * ```js
3960
+ * // Before running the sample:
3961
+ * // - Enable the API at:
3962
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
3963
+ * // - Login into gcloud by running:
3964
+ * // ```sh
3965
+ * // $ gcloud auth application-default login
3966
+ * // ```
3967
+ * // - Install the npm module by running:
3968
+ * // ```sh
3969
+ * // $ npm install googleapis
3970
+ * // ```
3971
+ *
3972
+ * const {google} = require('googleapis');
3973
+ * const servicedirectory = google.servicedirectory('v1');
3974
+ *
3975
+ * async function main() {
3976
+ * const auth = new google.auth.GoogleAuth({
3977
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3978
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3979
+ * });
3980
+ *
3981
+ * // Acquire an auth client, and bind it to all future calls
3982
+ * const authClient = await auth.getClient();
3983
+ * google.options({auth: authClient});
3984
+ *
3985
+ * // Do the magic
3986
+ * const res =
3987
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.list(
3988
+ * {
3989
+ * // Optional. The filter to list results by. General `filter` string syntax: ` ()` * `` can be `name`, `address`, `port`, or `annotations.` 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: * `annotations.owner` returns endpoints that have a annotation with the key `owner`, this is the same as `annotations:owner` * `annotations.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 * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that have `owner` in annotation 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 For more information about filtering, see [API Filtering](https://aip.dev/160).
3990
+ * filter: 'placeholder-value',
3991
+ * // 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.
3992
+ * orderBy: 'placeholder-value',
3993
+ * // Optional. The maximum number of items to return.
3994
+ * pageSize: 'placeholder-value',
3995
+ * // Optional. The next_page_token value returned from a previous List request, if any.
3996
+ * pageToken: 'placeholder-value',
3997
+ * // Required. The resource name of the service whose endpoints you'd like to list.
3998
+ * parent:
3999
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
4000
+ * },
4001
+ * );
4002
+ * console.log(res.data);
4003
+ *
4004
+ * // Example response
4005
+ * // {
4006
+ * // "endpoints": [],
4007
+ * // "nextPageToken": "my_nextPageToken"
4008
+ * // }
4009
+ * }
4010
+ *
4011
+ * main().catch(e => {
4012
+ * console.error(e);
4013
+ * throw e;
4014
+ * });
4015
+ *
4016
+ * ```
2731
4017
  *
2732
4018
  * @param params - Parameters for request
2733
4019
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2823,6 +4109,75 @@ export namespace servicedirectory_v1 {
2823
4109
 
2824
4110
  /**
2825
4111
  * Updates an endpoint.
4112
+ * @example
4113
+ * ```js
4114
+ * // Before running the sample:
4115
+ * // - Enable the API at:
4116
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
4117
+ * // - Login into gcloud by running:
4118
+ * // ```sh
4119
+ * // $ gcloud auth application-default login
4120
+ * // ```
4121
+ * // - Install the npm module by running:
4122
+ * // ```sh
4123
+ * // $ npm install googleapis
4124
+ * // ```
4125
+ *
4126
+ * const {google} = require('googleapis');
4127
+ * const servicedirectory = google.servicedirectory('v1');
4128
+ *
4129
+ * async function main() {
4130
+ * const auth = new google.auth.GoogleAuth({
4131
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
4132
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
4133
+ * });
4134
+ *
4135
+ * // Acquire an auth client, and bind it to all future calls
4136
+ * const authClient = await auth.getClient();
4137
+ * google.options({auth: authClient});
4138
+ *
4139
+ * // Do the magic
4140
+ * const res =
4141
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.patch(
4142
+ * {
4143
+ * // Immutable. The resource name for the endpoint in the format `projects/x/locations/x/namespaces/x/services/x/endpoints/x`.
4144
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service/endpoints/my-endpoint',
4145
+ * // Required. List of fields to be updated in this request.
4146
+ * updateMask: 'placeholder-value',
4147
+ *
4148
+ * // Request body metadata
4149
+ * requestBody: {
4150
+ * // request body parameters
4151
+ * // {
4152
+ * // "address": "my_address",
4153
+ * // "annotations": {},
4154
+ * // "name": "my_name",
4155
+ * // "network": "my_network",
4156
+ * // "port": 0,
4157
+ * // "uid": "my_uid"
4158
+ * // }
4159
+ * },
4160
+ * },
4161
+ * );
4162
+ * console.log(res.data);
4163
+ *
4164
+ * // Example response
4165
+ * // {
4166
+ * // "address": "my_address",
4167
+ * // "annotations": {},
4168
+ * // "name": "my_name",
4169
+ * // "network": "my_network",
4170
+ * // "port": 0,
4171
+ * // "uid": "my_uid"
4172
+ * // }
4173
+ * }
4174
+ *
4175
+ * main().catch(e => {
4176
+ * console.error(e);
4177
+ * throw e;
4178
+ * });
4179
+ *
4180
+ * ```
2826
4181
  *
2827
4182
  * @param params - Parameters for request
2828
4183
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.