@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/build/v1.d.ts CHANGED
@@ -360,6 +360,56 @@ export declare namespace servicedirectory_v1 {
360
360
  constructor(context: APIRequestContext);
361
361
  /**
362
362
  * Gets information about a location.
363
+ * @example
364
+ * ```js
365
+ * // Before running the sample:
366
+ * // - Enable the API at:
367
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
368
+ * // - Login into gcloud by running:
369
+ * // ```sh
370
+ * // $ gcloud auth application-default login
371
+ * // ```
372
+ * // - Install the npm module by running:
373
+ * // ```sh
374
+ * // $ npm install googleapis
375
+ * // ```
376
+ *
377
+ * const {google} = require('googleapis');
378
+ * const servicedirectory = google.servicedirectory('v1');
379
+ *
380
+ * async function main() {
381
+ * const auth = new google.auth.GoogleAuth({
382
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
383
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
384
+ * });
385
+ *
386
+ * // Acquire an auth client, and bind it to all future calls
387
+ * const authClient = await auth.getClient();
388
+ * google.options({auth: authClient});
389
+ *
390
+ * // Do the magic
391
+ * const res = await servicedirectory.projects.locations.get({
392
+ * // Resource name for the location.
393
+ * name: 'projects/my-project/locations/my-location',
394
+ * });
395
+ * console.log(res.data);
396
+ *
397
+ * // Example response
398
+ * // {
399
+ * // "displayName": "my_displayName",
400
+ * // "labels": {},
401
+ * // "locationId": "my_locationId",
402
+ * // "metadata": {},
403
+ * // "name": "my_name"
404
+ * // }
405
+ * }
406
+ *
407
+ * main().catch(e => {
408
+ * console.error(e);
409
+ * throw e;
410
+ * });
411
+ *
412
+ * ```
363
413
  *
364
414
  * @param params - Parameters for request
365
415
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -374,6 +424,61 @@ export declare namespace servicedirectory_v1 {
374
424
  get(callback: BodyResponseCallback<Schema$Location>): void;
375
425
  /**
376
426
  * Lists information about the supported locations for this service.
427
+ * @example
428
+ * ```js
429
+ * // Before running the sample:
430
+ * // - Enable the API at:
431
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
432
+ * // - Login into gcloud by running:
433
+ * // ```sh
434
+ * // $ gcloud auth application-default login
435
+ * // ```
436
+ * // - Install the npm module by running:
437
+ * // ```sh
438
+ * // $ npm install googleapis
439
+ * // ```
440
+ *
441
+ * const {google} = require('googleapis');
442
+ * const servicedirectory = google.servicedirectory('v1');
443
+ *
444
+ * async function main() {
445
+ * const auth = new google.auth.GoogleAuth({
446
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
447
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
448
+ * });
449
+ *
450
+ * // Acquire an auth client, and bind it to all future calls
451
+ * const authClient = await auth.getClient();
452
+ * google.options({auth: authClient});
453
+ *
454
+ * // Do the magic
455
+ * const res = await servicedirectory.projects.locations.list({
456
+ * // Optional. A list of extra location types that should be used as conditions for controlling the visibility of the locations.
457
+ * extraLocationTypes: 'placeholder-value',
458
+ * // 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).
459
+ * filter: 'placeholder-value',
460
+ * // The resource that owns the locations collection, if applicable.
461
+ * name: 'projects/my-project',
462
+ * // The maximum number of results to return. If not set, the service selects a default.
463
+ * pageSize: 'placeholder-value',
464
+ * // A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
465
+ * pageToken: 'placeholder-value',
466
+ * });
467
+ * console.log(res.data);
468
+ *
469
+ * // Example response
470
+ * // {
471
+ * // "locations": [],
472
+ * // "nextPageToken": "my_nextPageToken"
473
+ * // }
474
+ * }
475
+ *
476
+ * main().catch(e => {
477
+ * console.error(e);
478
+ * throw e;
479
+ * });
480
+ *
481
+ * ```
377
482
  *
378
483
  * @param params - Parameters for request
379
484
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -421,6 +526,66 @@ export declare namespace servicedirectory_v1 {
421
526
  constructor(context: APIRequestContext);
422
527
  /**
423
528
  * Creates a namespace, and returns the new namespace.
529
+ * @example
530
+ * ```js
531
+ * // Before running the sample:
532
+ * // - Enable the API at:
533
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
534
+ * // - Login into gcloud by running:
535
+ * // ```sh
536
+ * // $ gcloud auth application-default login
537
+ * // ```
538
+ * // - Install the npm module by running:
539
+ * // ```sh
540
+ * // $ npm install googleapis
541
+ * // ```
542
+ *
543
+ * const {google} = require('googleapis');
544
+ * const servicedirectory = google.servicedirectory('v1');
545
+ *
546
+ * async function main() {
547
+ * const auth = new google.auth.GoogleAuth({
548
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
549
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
550
+ * });
551
+ *
552
+ * // Acquire an auth client, and bind it to all future calls
553
+ * const authClient = await auth.getClient();
554
+ * google.options({auth: authClient});
555
+ *
556
+ * // Do the magic
557
+ * const res = await servicedirectory.projects.locations.namespaces.create({
558
+ * // 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.
559
+ * namespaceId: 'placeholder-value',
560
+ * // Required. The resource name of the project and location the namespace will be created in.
561
+ * parent: 'projects/my-project/locations/my-location',
562
+ *
563
+ * // Request body metadata
564
+ * requestBody: {
565
+ * // request body parameters
566
+ * // {
567
+ * // "labels": {},
568
+ * // "name": "my_name",
569
+ * // "uid": "my_uid"
570
+ * // }
571
+ * },
572
+ * });
573
+ * console.log(res.data);
574
+ *
575
+ * // Example response
576
+ * // {
577
+ * // "labels": {},
578
+ * // "name": "my_name",
579
+ * // "uid": "my_uid"
580
+ * // }
581
+ * }
582
+ *
583
+ * main().catch(e => {
584
+ * console.error(e);
585
+ * throw e;
586
+ * });
587
+ *
588
+ * ```
424
589
  *
425
590
  * @param params - Parameters for request
426
591
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -435,6 +600,50 @@ export declare namespace servicedirectory_v1 {
435
600
  create(callback: BodyResponseCallback<Schema$Namespace>): void;
436
601
  /**
437
602
  * Deletes a namespace. This also deletes all services and endpoints in the namespace.
603
+ * @example
604
+ * ```js
605
+ * // Before running the sample:
606
+ * // - Enable the API at:
607
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
608
+ * // - Login into gcloud by running:
609
+ * // ```sh
610
+ * // $ gcloud auth application-default login
611
+ * // ```
612
+ * // - Install the npm module by running:
613
+ * // ```sh
614
+ * // $ npm install googleapis
615
+ * // ```
616
+ *
617
+ * const {google} = require('googleapis');
618
+ * const servicedirectory = google.servicedirectory('v1');
619
+ *
620
+ * async function main() {
621
+ * const auth = new google.auth.GoogleAuth({
622
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
623
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
624
+ * });
625
+ *
626
+ * // Acquire an auth client, and bind it to all future calls
627
+ * const authClient = await auth.getClient();
628
+ * google.options({auth: authClient});
629
+ *
630
+ * // Do the magic
631
+ * const res = await servicedirectory.projects.locations.namespaces.delete({
632
+ * // Required. The name of the namespace to delete.
633
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace',
634
+ * });
635
+ * console.log(res.data);
636
+ *
637
+ * // Example response
638
+ * // {}
639
+ * }
640
+ *
641
+ * main().catch(e => {
642
+ * console.error(e);
643
+ * throw e;
644
+ * });
645
+ *
646
+ * ```
438
647
  *
439
648
  * @param params - Parameters for request
440
649
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -449,6 +658,54 @@ export declare namespace servicedirectory_v1 {
449
658
  delete(callback: BodyResponseCallback<Schema$Empty>): void;
450
659
  /**
451
660
  * Gets a namespace.
661
+ * @example
662
+ * ```js
663
+ * // Before running the sample:
664
+ * // - Enable the API at:
665
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
666
+ * // - Login into gcloud by running:
667
+ * // ```sh
668
+ * // $ gcloud auth application-default login
669
+ * // ```
670
+ * // - Install the npm module by running:
671
+ * // ```sh
672
+ * // $ npm install googleapis
673
+ * // ```
674
+ *
675
+ * const {google} = require('googleapis');
676
+ * const servicedirectory = google.servicedirectory('v1');
677
+ *
678
+ * async function main() {
679
+ * const auth = new google.auth.GoogleAuth({
680
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
681
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
682
+ * });
683
+ *
684
+ * // Acquire an auth client, and bind it to all future calls
685
+ * const authClient = await auth.getClient();
686
+ * google.options({auth: authClient});
687
+ *
688
+ * // Do the magic
689
+ * const res = await servicedirectory.projects.locations.namespaces.get({
690
+ * // Required. The name of the namespace to retrieve.
691
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace',
692
+ * });
693
+ * console.log(res.data);
694
+ *
695
+ * // Example response
696
+ * // {
697
+ * // "labels": {},
698
+ * // "name": "my_name",
699
+ * // "uid": "my_uid"
700
+ * // }
701
+ * }
702
+ *
703
+ * main().catch(e => {
704
+ * console.error(e);
705
+ * throw e;
706
+ * });
707
+ *
708
+ * ```
452
709
  *
453
710
  * @param params - Parameters for request
454
711
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -463,6 +720,65 @@ export declare namespace servicedirectory_v1 {
463
720
  get(callback: BodyResponseCallback<Schema$Namespace>): void;
464
721
  /**
465
722
  * Gets the IAM Policy for a resource (namespace or service only).
723
+ * @example
724
+ * ```js
725
+ * // Before running the sample:
726
+ * // - Enable the API at:
727
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
728
+ * // - Login into gcloud by running:
729
+ * // ```sh
730
+ * // $ gcloud auth application-default login
731
+ * // ```
732
+ * // - Install the npm module by running:
733
+ * // ```sh
734
+ * // $ npm install googleapis
735
+ * // ```
736
+ *
737
+ * const {google} = require('googleapis');
738
+ * const servicedirectory = google.servicedirectory('v1');
739
+ *
740
+ * async function main() {
741
+ * const auth = new google.auth.GoogleAuth({
742
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
743
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
744
+ * });
745
+ *
746
+ * // Acquire an auth client, and bind it to all future calls
747
+ * const authClient = await auth.getClient();
748
+ * google.options({auth: authClient});
749
+ *
750
+ * // Do the magic
751
+ * const res = await servicedirectory.projects.locations.namespaces.getIamPolicy(
752
+ * {
753
+ * // 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.
754
+ * resource:
755
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
756
+ *
757
+ * // Request body metadata
758
+ * requestBody: {
759
+ * // request body parameters
760
+ * // {
761
+ * // "options": {}
762
+ * // }
763
+ * },
764
+ * },
765
+ * );
766
+ * console.log(res.data);
767
+ *
768
+ * // Example response
769
+ * // {
770
+ * // "bindings": [],
771
+ * // "etag": "my_etag",
772
+ * // "version": 0
773
+ * // }
774
+ * }
775
+ *
776
+ * main().catch(e => {
777
+ * console.error(e);
778
+ * throw e;
779
+ * });
780
+ *
781
+ * ```
466
782
  *
467
783
  * @param params - Parameters for request
468
784
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -477,6 +793,61 @@ export declare namespace servicedirectory_v1 {
477
793
  getIamPolicy(callback: BodyResponseCallback<Schema$Policy>): void;
478
794
  /**
479
795
  * Lists all namespaces.
796
+ * @example
797
+ * ```js
798
+ * // Before running the sample:
799
+ * // - Enable the API at:
800
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
801
+ * // - Login into gcloud by running:
802
+ * // ```sh
803
+ * // $ gcloud auth application-default login
804
+ * // ```
805
+ * // - Install the npm module by running:
806
+ * // ```sh
807
+ * // $ npm install googleapis
808
+ * // ```
809
+ *
810
+ * const {google} = require('googleapis');
811
+ * const servicedirectory = google.servicedirectory('v1');
812
+ *
813
+ * async function main() {
814
+ * const auth = new google.auth.GoogleAuth({
815
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
816
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
817
+ * });
818
+ *
819
+ * // Acquire an auth client, and bind it to all future calls
820
+ * const authClient = await auth.getClient();
821
+ * google.options({auth: authClient});
822
+ *
823
+ * // Do the magic
824
+ * const res = await servicedirectory.projects.locations.namespaces.list({
825
+ * // 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).
826
+ * filter: 'placeholder-value',
827
+ * // 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.
828
+ * orderBy: 'placeholder-value',
829
+ * // Optional. The maximum number of items to return.
830
+ * pageSize: 'placeholder-value',
831
+ * // Optional. The next_page_token value returned from a previous List request, if any.
832
+ * pageToken: 'placeholder-value',
833
+ * // Required. The resource name of the project and location whose namespaces you'd like to list.
834
+ * parent: 'projects/my-project/locations/my-location',
835
+ * });
836
+ * console.log(res.data);
837
+ *
838
+ * // Example response
839
+ * // {
840
+ * // "namespaces": [],
841
+ * // "nextPageToken": "my_nextPageToken"
842
+ * // }
843
+ * }
844
+ *
845
+ * main().catch(e => {
846
+ * console.error(e);
847
+ * throw e;
848
+ * });
849
+ *
850
+ * ```
480
851
  *
481
852
  * @param params - Parameters for request
482
853
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -491,6 +862,66 @@ export declare namespace servicedirectory_v1 {
491
862
  list(callback: BodyResponseCallback<Schema$ListNamespacesResponse>): void;
492
863
  /**
493
864
  * Updates a namespace.
865
+ * @example
866
+ * ```js
867
+ * // Before running the sample:
868
+ * // - Enable the API at:
869
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
870
+ * // - Login into gcloud by running:
871
+ * // ```sh
872
+ * // $ gcloud auth application-default login
873
+ * // ```
874
+ * // - Install the npm module by running:
875
+ * // ```sh
876
+ * // $ npm install googleapis
877
+ * // ```
878
+ *
879
+ * const {google} = require('googleapis');
880
+ * const servicedirectory = google.servicedirectory('v1');
881
+ *
882
+ * async function main() {
883
+ * const auth = new google.auth.GoogleAuth({
884
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
885
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
886
+ * });
887
+ *
888
+ * // Acquire an auth client, and bind it to all future calls
889
+ * const authClient = await auth.getClient();
890
+ * google.options({auth: authClient});
891
+ *
892
+ * // Do the magic
893
+ * const res = await servicedirectory.projects.locations.namespaces.patch({
894
+ * // Immutable. The resource name for the namespace in the format `projects/x/locations/x/namespaces/x`.
895
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace',
896
+ * // Required. List of fields to be updated in this request.
897
+ * updateMask: 'placeholder-value',
898
+ *
899
+ * // Request body metadata
900
+ * requestBody: {
901
+ * // request body parameters
902
+ * // {
903
+ * // "labels": {},
904
+ * // "name": "my_name",
905
+ * // "uid": "my_uid"
906
+ * // }
907
+ * },
908
+ * });
909
+ * console.log(res.data);
910
+ *
911
+ * // Example response
912
+ * // {
913
+ * // "labels": {},
914
+ * // "name": "my_name",
915
+ * // "uid": "my_uid"
916
+ * // }
917
+ * }
918
+ *
919
+ * main().catch(e => {
920
+ * console.error(e);
921
+ * throw e;
922
+ * });
923
+ *
924
+ * ```
494
925
  *
495
926
  * @param params - Parameters for request
496
927
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -505,6 +936,65 @@ export declare namespace servicedirectory_v1 {
505
936
  patch(callback: BodyResponseCallback<Schema$Namespace>): void;
506
937
  /**
507
938
  * Sets the IAM Policy for a resource (namespace or service only).
939
+ * @example
940
+ * ```js
941
+ * // Before running the sample:
942
+ * // - Enable the API at:
943
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
944
+ * // - Login into gcloud by running:
945
+ * // ```sh
946
+ * // $ gcloud auth application-default login
947
+ * // ```
948
+ * // - Install the npm module by running:
949
+ * // ```sh
950
+ * // $ npm install googleapis
951
+ * // ```
952
+ *
953
+ * const {google} = require('googleapis');
954
+ * const servicedirectory = google.servicedirectory('v1');
955
+ *
956
+ * async function main() {
957
+ * const auth = new google.auth.GoogleAuth({
958
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
959
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
960
+ * });
961
+ *
962
+ * // Acquire an auth client, and bind it to all future calls
963
+ * const authClient = await auth.getClient();
964
+ * google.options({auth: authClient});
965
+ *
966
+ * // Do the magic
967
+ * const res = await servicedirectory.projects.locations.namespaces.setIamPolicy(
968
+ * {
969
+ * // 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.
970
+ * resource:
971
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
972
+ *
973
+ * // Request body metadata
974
+ * requestBody: {
975
+ * // request body parameters
976
+ * // {
977
+ * // "policy": {}
978
+ * // }
979
+ * },
980
+ * },
981
+ * );
982
+ * console.log(res.data);
983
+ *
984
+ * // Example response
985
+ * // {
986
+ * // "bindings": [],
987
+ * // "etag": "my_etag",
988
+ * // "version": 0
989
+ * // }
990
+ * }
991
+ *
992
+ * main().catch(e => {
993
+ * console.error(e);
994
+ * throw e;
995
+ * });
996
+ *
997
+ * ```
508
998
  *
509
999
  * @param params - Parameters for request
510
1000
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -519,6 +1009,62 @@ export declare namespace servicedirectory_v1 {
519
1009
  setIamPolicy(callback: BodyResponseCallback<Schema$Policy>): void;
520
1010
  /**
521
1011
  * Tests IAM permissions for a resource (namespace or service only).
1012
+ * @example
1013
+ * ```js
1014
+ * // Before running the sample:
1015
+ * // - Enable the API at:
1016
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1017
+ * // - Login into gcloud by running:
1018
+ * // ```sh
1019
+ * // $ gcloud auth application-default login
1020
+ * // ```
1021
+ * // - Install the npm module by running:
1022
+ * // ```sh
1023
+ * // $ npm install googleapis
1024
+ * // ```
1025
+ *
1026
+ * const {google} = require('googleapis');
1027
+ * const servicedirectory = google.servicedirectory('v1');
1028
+ *
1029
+ * async function main() {
1030
+ * const auth = new google.auth.GoogleAuth({
1031
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1032
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1033
+ * });
1034
+ *
1035
+ * // Acquire an auth client, and bind it to all future calls
1036
+ * const authClient = await auth.getClient();
1037
+ * google.options({auth: authClient});
1038
+ *
1039
+ * // Do the magic
1040
+ * const res =
1041
+ * await servicedirectory.projects.locations.namespaces.testIamPermissions({
1042
+ * // 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.
1043
+ * resource:
1044
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
1045
+ *
1046
+ * // Request body metadata
1047
+ * requestBody: {
1048
+ * // request body parameters
1049
+ * // {
1050
+ * // "permissions": []
1051
+ * // }
1052
+ * },
1053
+ * });
1054
+ * console.log(res.data);
1055
+ *
1056
+ * // Example response
1057
+ * // {
1058
+ * // "permissions": []
1059
+ * // }
1060
+ * }
1061
+ *
1062
+ * main().catch(e => {
1063
+ * console.error(e);
1064
+ * throw e;
1065
+ * });
1066
+ *
1067
+ * ```
522
1068
  *
523
1069
  * @param params - Parameters for request
524
1070
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -630,6 +1176,70 @@ export declare namespace servicedirectory_v1 {
630
1176
  constructor(context: APIRequestContext);
631
1177
  /**
632
1178
  * Creates a service, and returns the new service.
1179
+ * @example
1180
+ * ```js
1181
+ * // Before running the sample:
1182
+ * // - Enable the API at:
1183
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1184
+ * // - Login into gcloud by running:
1185
+ * // ```sh
1186
+ * // $ gcloud auth application-default login
1187
+ * // ```
1188
+ * // - Install the npm module by running:
1189
+ * // ```sh
1190
+ * // $ npm install googleapis
1191
+ * // ```
1192
+ *
1193
+ * const {google} = require('googleapis');
1194
+ * const servicedirectory = google.servicedirectory('v1');
1195
+ *
1196
+ * async function main() {
1197
+ * const auth = new google.auth.GoogleAuth({
1198
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1199
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1200
+ * });
1201
+ *
1202
+ * // Acquire an auth client, and bind it to all future calls
1203
+ * const authClient = await auth.getClient();
1204
+ * google.options({auth: authClient});
1205
+ *
1206
+ * // Do the magic
1207
+ * const res =
1208
+ * await servicedirectory.projects.locations.namespaces.services.create({
1209
+ * // Required. The resource name of the namespace this service will belong to.
1210
+ * parent:
1211
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
1212
+ * // 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.
1213
+ * serviceId: 'placeholder-value',
1214
+ *
1215
+ * // Request body metadata
1216
+ * requestBody: {
1217
+ * // request body parameters
1218
+ * // {
1219
+ * // "annotations": {},
1220
+ * // "endpoints": [],
1221
+ * // "name": "my_name",
1222
+ * // "uid": "my_uid"
1223
+ * // }
1224
+ * },
1225
+ * });
1226
+ * console.log(res.data);
1227
+ *
1228
+ * // Example response
1229
+ * // {
1230
+ * // "annotations": {},
1231
+ * // "endpoints": [],
1232
+ * // "name": "my_name",
1233
+ * // "uid": "my_uid"
1234
+ * // }
1235
+ * }
1236
+ *
1237
+ * main().catch(e => {
1238
+ * console.error(e);
1239
+ * throw e;
1240
+ * });
1241
+ *
1242
+ * ```
633
1243
  *
634
1244
  * @param params - Parameters for request
635
1245
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -644,6 +1254,51 @@ export declare namespace servicedirectory_v1 {
644
1254
  create(callback: BodyResponseCallback<Schema$Service>): void;
645
1255
  /**
646
1256
  * Deletes a service. This also deletes all endpoints associated with the service.
1257
+ * @example
1258
+ * ```js
1259
+ * // Before running the sample:
1260
+ * // - Enable the API at:
1261
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1262
+ * // - Login into gcloud by running:
1263
+ * // ```sh
1264
+ * // $ gcloud auth application-default login
1265
+ * // ```
1266
+ * // - Install the npm module by running:
1267
+ * // ```sh
1268
+ * // $ npm install googleapis
1269
+ * // ```
1270
+ *
1271
+ * const {google} = require('googleapis');
1272
+ * const servicedirectory = google.servicedirectory('v1');
1273
+ *
1274
+ * async function main() {
1275
+ * const auth = new google.auth.GoogleAuth({
1276
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1277
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1278
+ * });
1279
+ *
1280
+ * // Acquire an auth client, and bind it to all future calls
1281
+ * const authClient = await auth.getClient();
1282
+ * google.options({auth: authClient});
1283
+ *
1284
+ * // Do the magic
1285
+ * const res =
1286
+ * await servicedirectory.projects.locations.namespaces.services.delete({
1287
+ * // Required. The name of the service to delete.
1288
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
1289
+ * });
1290
+ * console.log(res.data);
1291
+ *
1292
+ * // Example response
1293
+ * // {}
1294
+ * }
1295
+ *
1296
+ * main().catch(e => {
1297
+ * console.error(e);
1298
+ * throw e;
1299
+ * });
1300
+ *
1301
+ * ```
647
1302
  *
648
1303
  * @param params - Parameters for request
649
1304
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -658,6 +1313,57 @@ export declare namespace servicedirectory_v1 {
658
1313
  delete(callback: BodyResponseCallback<Schema$Empty>): void;
659
1314
  /**
660
1315
  * Gets a service.
1316
+ * @example
1317
+ * ```js
1318
+ * // Before running the sample:
1319
+ * // - Enable the API at:
1320
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1321
+ * // - Login into gcloud by running:
1322
+ * // ```sh
1323
+ * // $ gcloud auth application-default login
1324
+ * // ```
1325
+ * // - Install the npm module by running:
1326
+ * // ```sh
1327
+ * // $ npm install googleapis
1328
+ * // ```
1329
+ *
1330
+ * const {google} = require('googleapis');
1331
+ * const servicedirectory = google.servicedirectory('v1');
1332
+ *
1333
+ * async function main() {
1334
+ * const auth = new google.auth.GoogleAuth({
1335
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1336
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1337
+ * });
1338
+ *
1339
+ * // Acquire an auth client, and bind it to all future calls
1340
+ * const authClient = await auth.getClient();
1341
+ * google.options({auth: authClient});
1342
+ *
1343
+ * // Do the magic
1344
+ * const res = await servicedirectory.projects.locations.namespaces.services.get(
1345
+ * {
1346
+ * // Required. The name of the service to get.
1347
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
1348
+ * },
1349
+ * );
1350
+ * console.log(res.data);
1351
+ *
1352
+ * // Example response
1353
+ * // {
1354
+ * // "annotations": {},
1355
+ * // "endpoints": [],
1356
+ * // "name": "my_name",
1357
+ * // "uid": "my_uid"
1358
+ * // }
1359
+ * }
1360
+ *
1361
+ * main().catch(e => {
1362
+ * console.error(e);
1363
+ * throw e;
1364
+ * });
1365
+ *
1366
+ * ```
661
1367
  *
662
1368
  * @param params - Parameters for request
663
1369
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -672,6 +1378,64 @@ export declare namespace servicedirectory_v1 {
672
1378
  get(callback: BodyResponseCallback<Schema$Service>): void;
673
1379
  /**
674
1380
  * Gets the IAM Policy for a resource (namespace or service only).
1381
+ * @example
1382
+ * ```js
1383
+ * // Before running the sample:
1384
+ * // - Enable the API at:
1385
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1386
+ * // - Login into gcloud by running:
1387
+ * // ```sh
1388
+ * // $ gcloud auth application-default login
1389
+ * // ```
1390
+ * // - Install the npm module by running:
1391
+ * // ```sh
1392
+ * // $ npm install googleapis
1393
+ * // ```
1394
+ *
1395
+ * const {google} = require('googleapis');
1396
+ * const servicedirectory = google.servicedirectory('v1');
1397
+ *
1398
+ * async function main() {
1399
+ * const auth = new google.auth.GoogleAuth({
1400
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1401
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1402
+ * });
1403
+ *
1404
+ * // Acquire an auth client, and bind it to all future calls
1405
+ * const authClient = await auth.getClient();
1406
+ * google.options({auth: authClient});
1407
+ *
1408
+ * // Do the magic
1409
+ * const res =
1410
+ * await servicedirectory.projects.locations.namespaces.services.getIamPolicy({
1411
+ * // 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.
1412
+ * resource:
1413
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
1414
+ *
1415
+ * // Request body metadata
1416
+ * requestBody: {
1417
+ * // request body parameters
1418
+ * // {
1419
+ * // "options": {}
1420
+ * // }
1421
+ * },
1422
+ * });
1423
+ * console.log(res.data);
1424
+ *
1425
+ * // Example response
1426
+ * // {
1427
+ * // "bindings": [],
1428
+ * // "etag": "my_etag",
1429
+ * // "version": 0
1430
+ * // }
1431
+ * }
1432
+ *
1433
+ * main().catch(e => {
1434
+ * console.error(e);
1435
+ * throw e;
1436
+ * });
1437
+ *
1438
+ * ```
675
1439
  *
676
1440
  * @param params - Parameters for request
677
1441
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -686,6 +1450,63 @@ export declare namespace servicedirectory_v1 {
686
1450
  getIamPolicy(callback: BodyResponseCallback<Schema$Policy>): void;
687
1451
  /**
688
1452
  * Lists all services belonging to a namespace.
1453
+ * @example
1454
+ * ```js
1455
+ * // Before running the sample:
1456
+ * // - Enable the API at:
1457
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1458
+ * // - Login into gcloud by running:
1459
+ * // ```sh
1460
+ * // $ gcloud auth application-default login
1461
+ * // ```
1462
+ * // - Install the npm module by running:
1463
+ * // ```sh
1464
+ * // $ npm install googleapis
1465
+ * // ```
1466
+ *
1467
+ * const {google} = require('googleapis');
1468
+ * const servicedirectory = google.servicedirectory('v1');
1469
+ *
1470
+ * async function main() {
1471
+ * const auth = new google.auth.GoogleAuth({
1472
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1473
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1474
+ * });
1475
+ *
1476
+ * // Acquire an auth client, and bind it to all future calls
1477
+ * const authClient = await auth.getClient();
1478
+ * google.options({auth: authClient});
1479
+ *
1480
+ * // Do the magic
1481
+ * const res =
1482
+ * await servicedirectory.projects.locations.namespaces.services.list({
1483
+ * // 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).
1484
+ * filter: 'placeholder-value',
1485
+ * // 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.
1486
+ * orderBy: 'placeholder-value',
1487
+ * // Optional. The maximum number of items to return.
1488
+ * pageSize: 'placeholder-value',
1489
+ * // Optional. The next_page_token value returned from a previous List request, if any.
1490
+ * pageToken: 'placeholder-value',
1491
+ * // Required. The resource name of the namespace whose services you'd like to list.
1492
+ * parent:
1493
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace',
1494
+ * });
1495
+ * console.log(res.data);
1496
+ *
1497
+ * // Example response
1498
+ * // {
1499
+ * // "nextPageToken": "my_nextPageToken",
1500
+ * // "services": []
1501
+ * // }
1502
+ * }
1503
+ *
1504
+ * main().catch(e => {
1505
+ * console.error(e);
1506
+ * throw e;
1507
+ * });
1508
+ *
1509
+ * ```
689
1510
  *
690
1511
  * @param params - Parameters for request
691
1512
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -700,6 +1521,69 @@ export declare namespace servicedirectory_v1 {
700
1521
  list(callback: BodyResponseCallback<Schema$ListServicesResponse>): void;
701
1522
  /**
702
1523
  * Updates a service.
1524
+ * @example
1525
+ * ```js
1526
+ * // Before running the sample:
1527
+ * // - Enable the API at:
1528
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1529
+ * // - Login into gcloud by running:
1530
+ * // ```sh
1531
+ * // $ gcloud auth application-default login
1532
+ * // ```
1533
+ * // - Install the npm module by running:
1534
+ * // ```sh
1535
+ * // $ npm install googleapis
1536
+ * // ```
1537
+ *
1538
+ * const {google} = require('googleapis');
1539
+ * const servicedirectory = google.servicedirectory('v1');
1540
+ *
1541
+ * async function main() {
1542
+ * const auth = new google.auth.GoogleAuth({
1543
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1544
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1545
+ * });
1546
+ *
1547
+ * // Acquire an auth client, and bind it to all future calls
1548
+ * const authClient = await auth.getClient();
1549
+ * google.options({auth: authClient});
1550
+ *
1551
+ * // Do the magic
1552
+ * const res =
1553
+ * await servicedirectory.projects.locations.namespaces.services.patch({
1554
+ * // Immutable. The resource name for the service in the format `projects/x/locations/x/namespaces/x/services/x`.
1555
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
1556
+ * // Required. List of fields to be updated in this request.
1557
+ * updateMask: 'placeholder-value',
1558
+ *
1559
+ * // Request body metadata
1560
+ * requestBody: {
1561
+ * // request body parameters
1562
+ * // {
1563
+ * // "annotations": {},
1564
+ * // "endpoints": [],
1565
+ * // "name": "my_name",
1566
+ * // "uid": "my_uid"
1567
+ * // }
1568
+ * },
1569
+ * });
1570
+ * console.log(res.data);
1571
+ *
1572
+ * // Example response
1573
+ * // {
1574
+ * // "annotations": {},
1575
+ * // "endpoints": [],
1576
+ * // "name": "my_name",
1577
+ * // "uid": "my_uid"
1578
+ * // }
1579
+ * }
1580
+ *
1581
+ * main().catch(e => {
1582
+ * console.error(e);
1583
+ * throw e;
1584
+ * });
1585
+ *
1586
+ * ```
703
1587
  *
704
1588
  * @param params - Parameters for request
705
1589
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -714,6 +1598,62 @@ export declare namespace servicedirectory_v1 {
714
1598
  patch(callback: BodyResponseCallback<Schema$Service>): void;
715
1599
  /**
716
1600
  * Returns a service and its associated endpoints. Resolving a service is not considered an active developer method.
1601
+ * @example
1602
+ * ```js
1603
+ * // Before running the sample:
1604
+ * // - Enable the API at:
1605
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1606
+ * // - Login into gcloud by running:
1607
+ * // ```sh
1608
+ * // $ gcloud auth application-default login
1609
+ * // ```
1610
+ * // - Install the npm module by running:
1611
+ * // ```sh
1612
+ * // $ npm install googleapis
1613
+ * // ```
1614
+ *
1615
+ * const {google} = require('googleapis');
1616
+ * const servicedirectory = google.servicedirectory('v1');
1617
+ *
1618
+ * async function main() {
1619
+ * const auth = new google.auth.GoogleAuth({
1620
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1621
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1622
+ * });
1623
+ *
1624
+ * // Acquire an auth client, and bind it to all future calls
1625
+ * const authClient = await auth.getClient();
1626
+ * google.options({auth: authClient});
1627
+ *
1628
+ * // Do the magic
1629
+ * const res =
1630
+ * await servicedirectory.projects.locations.namespaces.services.resolve({
1631
+ * // Required. The name of the service to resolve.
1632
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
1633
+ *
1634
+ * // Request body metadata
1635
+ * requestBody: {
1636
+ * // request body parameters
1637
+ * // {
1638
+ * // "endpointFilter": "my_endpointFilter",
1639
+ * // "maxEndpoints": 0
1640
+ * // }
1641
+ * },
1642
+ * });
1643
+ * console.log(res.data);
1644
+ *
1645
+ * // Example response
1646
+ * // {
1647
+ * // "service": {}
1648
+ * // }
1649
+ * }
1650
+ *
1651
+ * main().catch(e => {
1652
+ * console.error(e);
1653
+ * throw e;
1654
+ * });
1655
+ *
1656
+ * ```
717
1657
  *
718
1658
  * @param params - Parameters for request
719
1659
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -728,6 +1668,64 @@ export declare namespace servicedirectory_v1 {
728
1668
  resolve(callback: BodyResponseCallback<Schema$ResolveServiceResponse>): void;
729
1669
  /**
730
1670
  * Sets the IAM Policy for a resource (namespace or service only).
1671
+ * @example
1672
+ * ```js
1673
+ * // Before running the sample:
1674
+ * // - Enable the API at:
1675
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1676
+ * // - Login into gcloud by running:
1677
+ * // ```sh
1678
+ * // $ gcloud auth application-default login
1679
+ * // ```
1680
+ * // - Install the npm module by running:
1681
+ * // ```sh
1682
+ * // $ npm install googleapis
1683
+ * // ```
1684
+ *
1685
+ * const {google} = require('googleapis');
1686
+ * const servicedirectory = google.servicedirectory('v1');
1687
+ *
1688
+ * async function main() {
1689
+ * const auth = new google.auth.GoogleAuth({
1690
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1691
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1692
+ * });
1693
+ *
1694
+ * // Acquire an auth client, and bind it to all future calls
1695
+ * const authClient = await auth.getClient();
1696
+ * google.options({auth: authClient});
1697
+ *
1698
+ * // Do the magic
1699
+ * const res =
1700
+ * await servicedirectory.projects.locations.namespaces.services.setIamPolicy({
1701
+ * // 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.
1702
+ * resource:
1703
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
1704
+ *
1705
+ * // Request body metadata
1706
+ * requestBody: {
1707
+ * // request body parameters
1708
+ * // {
1709
+ * // "policy": {}
1710
+ * // }
1711
+ * },
1712
+ * });
1713
+ * console.log(res.data);
1714
+ *
1715
+ * // Example response
1716
+ * // {
1717
+ * // "bindings": [],
1718
+ * // "etag": "my_etag",
1719
+ * // "version": 0
1720
+ * // }
1721
+ * }
1722
+ *
1723
+ * main().catch(e => {
1724
+ * console.error(e);
1725
+ * throw e;
1726
+ * });
1727
+ *
1728
+ * ```
731
1729
  *
732
1730
  * @param params - Parameters for request
733
1731
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -742,6 +1740,64 @@ export declare namespace servicedirectory_v1 {
742
1740
  setIamPolicy(callback: BodyResponseCallback<Schema$Policy>): void;
743
1741
  /**
744
1742
  * Tests IAM permissions for a resource (namespace or service only).
1743
+ * @example
1744
+ * ```js
1745
+ * // Before running the sample:
1746
+ * // - Enable the API at:
1747
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1748
+ * // - Login into gcloud by running:
1749
+ * // ```sh
1750
+ * // $ gcloud auth application-default login
1751
+ * // ```
1752
+ * // - Install the npm module by running:
1753
+ * // ```sh
1754
+ * // $ npm install googleapis
1755
+ * // ```
1756
+ *
1757
+ * const {google} = require('googleapis');
1758
+ * const servicedirectory = google.servicedirectory('v1');
1759
+ *
1760
+ * async function main() {
1761
+ * const auth = new google.auth.GoogleAuth({
1762
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1763
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1764
+ * });
1765
+ *
1766
+ * // Acquire an auth client, and bind it to all future calls
1767
+ * const authClient = await auth.getClient();
1768
+ * google.options({auth: authClient});
1769
+ *
1770
+ * // Do the magic
1771
+ * const res =
1772
+ * await servicedirectory.projects.locations.namespaces.services.testIamPermissions(
1773
+ * {
1774
+ * // 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.
1775
+ * resource:
1776
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
1777
+ *
1778
+ * // Request body metadata
1779
+ * requestBody: {
1780
+ * // request body parameters
1781
+ * // {
1782
+ * // "permissions": []
1783
+ * // }
1784
+ * },
1785
+ * },
1786
+ * );
1787
+ * console.log(res.data);
1788
+ *
1789
+ * // Example response
1790
+ * // {
1791
+ * // "permissions": []
1792
+ * // }
1793
+ * }
1794
+ *
1795
+ * main().catch(e => {
1796
+ * console.error(e);
1797
+ * throw e;
1798
+ * });
1799
+ *
1800
+ * ```
745
1801
  *
746
1802
  * @param params - Parameters for request
747
1803
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -862,6 +1918,76 @@ export declare namespace servicedirectory_v1 {
862
1918
  constructor(context: APIRequestContext);
863
1919
  /**
864
1920
  * Creates an endpoint, and returns the new endpoint.
1921
+ * @example
1922
+ * ```js
1923
+ * // Before running the sample:
1924
+ * // - Enable the API at:
1925
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
1926
+ * // - Login into gcloud by running:
1927
+ * // ```sh
1928
+ * // $ gcloud auth application-default login
1929
+ * // ```
1930
+ * // - Install the npm module by running:
1931
+ * // ```sh
1932
+ * // $ npm install googleapis
1933
+ * // ```
1934
+ *
1935
+ * const {google} = require('googleapis');
1936
+ * const servicedirectory = google.servicedirectory('v1');
1937
+ *
1938
+ * async function main() {
1939
+ * const auth = new google.auth.GoogleAuth({
1940
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1941
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1942
+ * });
1943
+ *
1944
+ * // Acquire an auth client, and bind it to all future calls
1945
+ * const authClient = await auth.getClient();
1946
+ * google.options({auth: authClient});
1947
+ *
1948
+ * // Do the magic
1949
+ * const res =
1950
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.create(
1951
+ * {
1952
+ * // 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.
1953
+ * endpointId: 'placeholder-value',
1954
+ * // Required. The resource name of the service that this endpoint provides.
1955
+ * parent:
1956
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
1957
+ *
1958
+ * // Request body metadata
1959
+ * requestBody: {
1960
+ * // request body parameters
1961
+ * // {
1962
+ * // "address": "my_address",
1963
+ * // "annotations": {},
1964
+ * // "name": "my_name",
1965
+ * // "network": "my_network",
1966
+ * // "port": 0,
1967
+ * // "uid": "my_uid"
1968
+ * // }
1969
+ * },
1970
+ * },
1971
+ * );
1972
+ * console.log(res.data);
1973
+ *
1974
+ * // Example response
1975
+ * // {
1976
+ * // "address": "my_address",
1977
+ * // "annotations": {},
1978
+ * // "name": "my_name",
1979
+ * // "network": "my_network",
1980
+ * // "port": 0,
1981
+ * // "uid": "my_uid"
1982
+ * // }
1983
+ * }
1984
+ *
1985
+ * main().catch(e => {
1986
+ * console.error(e);
1987
+ * throw e;
1988
+ * });
1989
+ *
1990
+ * ```
865
1991
  *
866
1992
  * @param params - Parameters for request
867
1993
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -876,6 +2002,53 @@ export declare namespace servicedirectory_v1 {
876
2002
  create(callback: BodyResponseCallback<Schema$Endpoint>): void;
877
2003
  /**
878
2004
  * Deletes an endpoint.
2005
+ * @example
2006
+ * ```js
2007
+ * // Before running the sample:
2008
+ * // - Enable the API at:
2009
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2010
+ * // - Login into gcloud by running:
2011
+ * // ```sh
2012
+ * // $ gcloud auth application-default login
2013
+ * // ```
2014
+ * // - Install the npm module by running:
2015
+ * // ```sh
2016
+ * // $ npm install googleapis
2017
+ * // ```
2018
+ *
2019
+ * const {google} = require('googleapis');
2020
+ * const servicedirectory = google.servicedirectory('v1');
2021
+ *
2022
+ * async function main() {
2023
+ * const auth = new google.auth.GoogleAuth({
2024
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2025
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2026
+ * });
2027
+ *
2028
+ * // Acquire an auth client, and bind it to all future calls
2029
+ * const authClient = await auth.getClient();
2030
+ * google.options({auth: authClient});
2031
+ *
2032
+ * // Do the magic
2033
+ * const res =
2034
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.delete(
2035
+ * {
2036
+ * // Required. The name of the endpoint to delete.
2037
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service/endpoints/my-endpoint',
2038
+ * },
2039
+ * );
2040
+ * console.log(res.data);
2041
+ *
2042
+ * // Example response
2043
+ * // {}
2044
+ * }
2045
+ *
2046
+ * main().catch(e => {
2047
+ * console.error(e);
2048
+ * throw e;
2049
+ * });
2050
+ *
2051
+ * ```
879
2052
  *
880
2053
  * @param params - Parameters for request
881
2054
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -890,6 +2063,60 @@ export declare namespace servicedirectory_v1 {
890
2063
  delete(callback: BodyResponseCallback<Schema$Empty>): void;
891
2064
  /**
892
2065
  * Gets an endpoint.
2066
+ * @example
2067
+ * ```js
2068
+ * // Before running the sample:
2069
+ * // - Enable the API at:
2070
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2071
+ * // - Login into gcloud by running:
2072
+ * // ```sh
2073
+ * // $ gcloud auth application-default login
2074
+ * // ```
2075
+ * // - Install the npm module by running:
2076
+ * // ```sh
2077
+ * // $ npm install googleapis
2078
+ * // ```
2079
+ *
2080
+ * const {google} = require('googleapis');
2081
+ * const servicedirectory = google.servicedirectory('v1');
2082
+ *
2083
+ * async function main() {
2084
+ * const auth = new google.auth.GoogleAuth({
2085
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2086
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2087
+ * });
2088
+ *
2089
+ * // Acquire an auth client, and bind it to all future calls
2090
+ * const authClient = await auth.getClient();
2091
+ * google.options({auth: authClient});
2092
+ *
2093
+ * // Do the magic
2094
+ * const res =
2095
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.get(
2096
+ * {
2097
+ * // Required. The name of the endpoint to get.
2098
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service/endpoints/my-endpoint',
2099
+ * },
2100
+ * );
2101
+ * console.log(res.data);
2102
+ *
2103
+ * // Example response
2104
+ * // {
2105
+ * // "address": "my_address",
2106
+ * // "annotations": {},
2107
+ * // "name": "my_name",
2108
+ * // "network": "my_network",
2109
+ * // "port": 0,
2110
+ * // "uid": "my_uid"
2111
+ * // }
2112
+ * }
2113
+ *
2114
+ * main().catch(e => {
2115
+ * console.error(e);
2116
+ * throw e;
2117
+ * });
2118
+ *
2119
+ * ```
893
2120
  *
894
2121
  * @param params - Parameters for request
895
2122
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -904,6 +2131,65 @@ export declare namespace servicedirectory_v1 {
904
2131
  get(callback: BodyResponseCallback<Schema$Endpoint>): void;
905
2132
  /**
906
2133
  * Lists all endpoints.
2134
+ * @example
2135
+ * ```js
2136
+ * // Before running the sample:
2137
+ * // - Enable the API at:
2138
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2139
+ * // - Login into gcloud by running:
2140
+ * // ```sh
2141
+ * // $ gcloud auth application-default login
2142
+ * // ```
2143
+ * // - Install the npm module by running:
2144
+ * // ```sh
2145
+ * // $ npm install googleapis
2146
+ * // ```
2147
+ *
2148
+ * const {google} = require('googleapis');
2149
+ * const servicedirectory = google.servicedirectory('v1');
2150
+ *
2151
+ * async function main() {
2152
+ * const auth = new google.auth.GoogleAuth({
2153
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2154
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2155
+ * });
2156
+ *
2157
+ * // Acquire an auth client, and bind it to all future calls
2158
+ * const authClient = await auth.getClient();
2159
+ * google.options({auth: authClient});
2160
+ *
2161
+ * // Do the magic
2162
+ * const res =
2163
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.list(
2164
+ * {
2165
+ * // 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).
2166
+ * filter: 'placeholder-value',
2167
+ * // 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.
2168
+ * orderBy: 'placeholder-value',
2169
+ * // Optional. The maximum number of items to return.
2170
+ * pageSize: 'placeholder-value',
2171
+ * // Optional. The next_page_token value returned from a previous List request, if any.
2172
+ * pageToken: 'placeholder-value',
2173
+ * // Required. The resource name of the service whose endpoints you'd like to list.
2174
+ * parent:
2175
+ * 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service',
2176
+ * },
2177
+ * );
2178
+ * console.log(res.data);
2179
+ *
2180
+ * // Example response
2181
+ * // {
2182
+ * // "endpoints": [],
2183
+ * // "nextPageToken": "my_nextPageToken"
2184
+ * // }
2185
+ * }
2186
+ *
2187
+ * main().catch(e => {
2188
+ * console.error(e);
2189
+ * throw e;
2190
+ * });
2191
+ *
2192
+ * ```
907
2193
  *
908
2194
  * @param params - Parameters for request
909
2195
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -918,6 +2204,75 @@ export declare namespace servicedirectory_v1 {
918
2204
  list(callback: BodyResponseCallback<Schema$ListEndpointsResponse>): void;
919
2205
  /**
920
2206
  * Updates an endpoint.
2207
+ * @example
2208
+ * ```js
2209
+ * // Before running the sample:
2210
+ * // - Enable the API at:
2211
+ * // https://console.developers.google.com/apis/api/servicedirectory.googleapis.com
2212
+ * // - Login into gcloud by running:
2213
+ * // ```sh
2214
+ * // $ gcloud auth application-default login
2215
+ * // ```
2216
+ * // - Install the npm module by running:
2217
+ * // ```sh
2218
+ * // $ npm install googleapis
2219
+ * // ```
2220
+ *
2221
+ * const {google} = require('googleapis');
2222
+ * const servicedirectory = google.servicedirectory('v1');
2223
+ *
2224
+ * async function main() {
2225
+ * const auth = new google.auth.GoogleAuth({
2226
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2227
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2228
+ * });
2229
+ *
2230
+ * // Acquire an auth client, and bind it to all future calls
2231
+ * const authClient = await auth.getClient();
2232
+ * google.options({auth: authClient});
2233
+ *
2234
+ * // Do the magic
2235
+ * const res =
2236
+ * await servicedirectory.projects.locations.namespaces.services.endpoints.patch(
2237
+ * {
2238
+ * // Immutable. The resource name for the endpoint in the format `projects/x/locations/x/namespaces/x/services/x/endpoints/x`.
2239
+ * name: 'projects/my-project/locations/my-location/namespaces/my-namespace/services/my-service/endpoints/my-endpoint',
2240
+ * // Required. List of fields to be updated in this request.
2241
+ * updateMask: 'placeholder-value',
2242
+ *
2243
+ * // Request body metadata
2244
+ * requestBody: {
2245
+ * // request body parameters
2246
+ * // {
2247
+ * // "address": "my_address",
2248
+ * // "annotations": {},
2249
+ * // "name": "my_name",
2250
+ * // "network": "my_network",
2251
+ * // "port": 0,
2252
+ * // "uid": "my_uid"
2253
+ * // }
2254
+ * },
2255
+ * },
2256
+ * );
2257
+ * console.log(res.data);
2258
+ *
2259
+ * // Example response
2260
+ * // {
2261
+ * // "address": "my_address",
2262
+ * // "annotations": {},
2263
+ * // "name": "my_name",
2264
+ * // "network": "my_network",
2265
+ * // "port": 0,
2266
+ * // "uid": "my_uid"
2267
+ * // }
2268
+ * }
2269
+ *
2270
+ * main().catch(e => {
2271
+ * console.error(e);
2272
+ * throw e;
2273
+ * });
2274
+ *
2275
+ * ```
921
2276
  *
922
2277
  * @param params - Parameters for request
923
2278
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.