@googleapis/serviceusage 16.0.1 → 17.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/v1.ts CHANGED
@@ -261,7 +261,7 @@ export namespace serviceusage_v1 {
261
261
  */
262
262
  kind?: string | null;
263
263
  /**
264
- * Content of the configuration. The underlying schema should be defined by Aspect owners as protobuf message under `apiserving/configaspects/proto`.
264
+ * Content of the configuration. The underlying schema should be defined by Aspect owners as protobuf message under `google/api/configaspects/proto`.
265
265
  */
266
266
  spec?: {[key: string]: any} | null;
267
267
  }
@@ -445,6 +445,73 @@ export namespace serviceusage_v1 {
445
445
  */
446
446
  services?: Schema$GoogleApiServiceusageV1Service[];
447
447
  }
448
+ /**
449
+ * `BatchingConfigProto` defines the batching configuration for an API method.
450
+ */
451
+ export interface Schema$BatchingConfigProto {
452
+ /**
453
+ * The request and response fields used in batching.
454
+ */
455
+ batchDescriptor?: Schema$BatchingDescriptorProto;
456
+ /**
457
+ * The thresholds which trigger a batched request to be sent.
458
+ */
459
+ thresholds?: Schema$BatchingSettingsProto;
460
+ }
461
+ /**
462
+ * `BatchingDescriptorProto` specifies the fields of the request message to be used for batching, and, optionally, the fields of the response message to be used for demultiplexing.
463
+ */
464
+ export interface Schema$BatchingDescriptorProto {
465
+ /**
466
+ * The repeated field in the request message to be aggregated by batching.
467
+ */
468
+ batchedField?: string | null;
469
+ /**
470
+ * A list of the fields in the request message. Two requests will be batched together only if the values of every field specified in `request_discriminator_fields` is equal between the two requests.
471
+ */
472
+ discriminatorFields?: string[] | null;
473
+ /**
474
+ * Optional. When present, indicates the field in the response message to be used to demultiplex the response into multiple response messages, in correspondence with the multiple request messages originally batched together.
475
+ */
476
+ subresponseField?: string | null;
477
+ }
478
+ /**
479
+ * `BatchingSettingsProto` specifies a set of batching thresholds, each of which acts as a trigger to send a batch of messages as a request. At least one threshold must be positive nonzero.
480
+ */
481
+ export interface Schema$BatchingSettingsProto {
482
+ /**
483
+ * The duration after which a batch should be sent, starting from the addition of the first message to that batch.
484
+ */
485
+ delayThreshold?: string | null;
486
+ /**
487
+ * The maximum number of elements collected in a batch that could be accepted by server.
488
+ */
489
+ elementCountLimit?: number | null;
490
+ /**
491
+ * The number of elements of a field collected into a batch which, if exceeded, causes the batch to be sent.
492
+ */
493
+ elementCountThreshold?: number | null;
494
+ /**
495
+ * The maximum size of data allowed by flow control.
496
+ */
497
+ flowControlByteLimit?: number | null;
498
+ /**
499
+ * The maximum number of elements allowed by flow control.
500
+ */
501
+ flowControlElementLimit?: number | null;
502
+ /**
503
+ * The behavior to take when the flow control limit is exceeded.
504
+ */
505
+ flowControlLimitExceededBehavior?: string | null;
506
+ /**
507
+ * The maximum size of the request that could be accepted by server.
508
+ */
509
+ requestByteLimit?: number | null;
510
+ /**
511
+ * The aggregated size of the batched field which, if exceeded, causes the batch to be sent. This size is computed by aggregating the sizes of the request field to be batched, not of the entire request message.
512
+ */
513
+ requestByteThreshold?: string | null;
514
+ }
448
515
  /**
449
516
  * Billing related configuration of the service. The following example shows how to configure monitored resources and metrics for billing, `consumer_destinations` is the only supported destination and the monitored resources need at least one label key `cloud.googleapis.com/location` to indicate the location of the billing usage, using different monitored resources between monitoring and billing is recommended so they can be evolved independently: monitored_resources: - type: library.googleapis.com/billing_branch labels: - key: cloud.googleapis.com/location description: | Predefined label to support billing location restriction. - key: city description: | Custom label to define the city where the library branch is located in. - key: name description: Custom label to define the name of the library branch. metrics: - name: library.googleapis.com/book/borrowed_count metric_kind: DELTA value_type: INT64 unit: "1" billing: consumer_destinations: - monitored_resource: library.googleapis.com/billing_branch metrics: - library.googleapis.com/book/borrowed_count
450
517
  */
@@ -1684,6 +1751,10 @@ export namespace serviceusage_v1 {
1684
1751
  * List of top-level fields of the request message, that should be automatically populated by the client libraries based on their (google.api.field_info).format. Currently supported format: UUID4. Example of a YAML configuration: publishing: method_settings: - selector: google.example.v1.ExampleService.CreateExample auto_populated_fields: - request_id
1685
1752
  */
1686
1753
  autoPopulatedFields?: string[] | null;
1754
+ /**
1755
+ * Batching configuration for an API method in client libraries. Example of a YAML configuration: publishing: method_settings: - selector: google.example.v1.ExampleService.BatchCreateExample batching: element_count_threshold: 1000 request_byte_threshold: 100000000 delay_threshold_millis: 10
1756
+ */
1757
+ batching?: Schema$BatchingConfigProto;
1687
1758
  /**
1688
1759
  * Describes settings to use for long-running operations when generating API methods for RPCs. Complements RPCs that use the annotations in google/longrunning/operations.proto. Example of a YAML configuration:: publishing: method_settings: - selector: google.cloud.speech.v2.Speech.BatchRecognize long_running: initial_poll_delay: 60s # 1 minute poll_delay_multiplier: 1.5 max_poll_delay: 360s # 6 minutes total_poll_timeout: 54000s # 90 minutes
1689
1760
  */
@@ -1934,6 +2005,10 @@ export namespace serviceusage_v1 {
1934
2005
  * Some settings.
1935
2006
  */
1936
2007
  common?: Schema$CommonLanguageSettings;
2008
+ /**
2009
+ * The package name to use in Php. Clobbers the php_namespace option set in the protobuf. This should be used **only** by APIs who have already set the language_settings.php.package_name" field in gapic.yaml. API teams should use the protobuf php_namespace option where possible. Example of a YAML configuration:: publishing: library_settings: php_settings: library_package: Google\Cloud\PubSub\V1
2010
+ */
2011
+ libraryPackage?: string | null;
1937
2012
  }
1938
2013
  /**
1939
2014
  * This message configures the settings for publishing [Google Cloud Client libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) generated from the service config.
@@ -2294,6 +2369,59 @@ export namespace serviceusage_v1 {
2294
2369
 
2295
2370
  /**
2296
2371
  * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.
2372
+ * @example
2373
+ * ```js
2374
+ * // Before running the sample:
2375
+ * // - Enable the API at:
2376
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2377
+ * // - Login into gcloud by running:
2378
+ * // ```sh
2379
+ * // $ gcloud auth application-default login
2380
+ * // ```
2381
+ * // - Install the npm module by running:
2382
+ * // ```sh
2383
+ * // $ npm install googleapis
2384
+ * // ```
2385
+ *
2386
+ * const {google} = require('googleapis');
2387
+ * const serviceusage = google.serviceusage('v1');
2388
+ *
2389
+ * async function main() {
2390
+ * const auth = new google.auth.GoogleAuth({
2391
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2392
+ * scopes: [
2393
+ * 'https://www.googleapis.com/auth/cloud-platform',
2394
+ * 'https://www.googleapis.com/auth/service.management',
2395
+ * ],
2396
+ * });
2397
+ *
2398
+ * // Acquire an auth client, and bind it to all future calls
2399
+ * const authClient = await auth.getClient();
2400
+ * google.options({auth: authClient});
2401
+ *
2402
+ * // Do the magic
2403
+ * const res = await serviceusage.operations.cancel({
2404
+ * // The name of the operation resource to be cancelled.
2405
+ * name: 'operations/.*',
2406
+ *
2407
+ * // Request body metadata
2408
+ * requestBody: {
2409
+ * // request body parameters
2410
+ * // {}
2411
+ * },
2412
+ * });
2413
+ * console.log(res.data);
2414
+ *
2415
+ * // Example response
2416
+ * // {}
2417
+ * }
2418
+ *
2419
+ * main().catch(e => {
2420
+ * console.error(e);
2421
+ * throw e;
2422
+ * });
2423
+ *
2424
+ * ```
2297
2425
  *
2298
2426
  * @param params - Parameters for request
2299
2427
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2382,6 +2510,53 @@ export namespace serviceusage_v1 {
2382
2510
 
2383
2511
  /**
2384
2512
  * Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
2513
+ * @example
2514
+ * ```js
2515
+ * // Before running the sample:
2516
+ * // - Enable the API at:
2517
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2518
+ * // - Login into gcloud by running:
2519
+ * // ```sh
2520
+ * // $ gcloud auth application-default login
2521
+ * // ```
2522
+ * // - Install the npm module by running:
2523
+ * // ```sh
2524
+ * // $ npm install googleapis
2525
+ * // ```
2526
+ *
2527
+ * const {google} = require('googleapis');
2528
+ * const serviceusage = google.serviceusage('v1');
2529
+ *
2530
+ * async function main() {
2531
+ * const auth = new google.auth.GoogleAuth({
2532
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2533
+ * scopes: [
2534
+ * 'https://www.googleapis.com/auth/cloud-platform',
2535
+ * 'https://www.googleapis.com/auth/service.management',
2536
+ * ],
2537
+ * });
2538
+ *
2539
+ * // Acquire an auth client, and bind it to all future calls
2540
+ * const authClient = await auth.getClient();
2541
+ * google.options({auth: authClient});
2542
+ *
2543
+ * // Do the magic
2544
+ * const res = await serviceusage.operations.delete({
2545
+ * // The name of the operation resource to be deleted.
2546
+ * name: 'operations/.*',
2547
+ * });
2548
+ * console.log(res.data);
2549
+ *
2550
+ * // Example response
2551
+ * // {}
2552
+ * }
2553
+ *
2554
+ * main().catch(e => {
2555
+ * console.error(e);
2556
+ * throw e;
2557
+ * });
2558
+ *
2559
+ * ```
2385
2560
  *
2386
2561
  * @param params - Parameters for request
2387
2562
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2470,6 +2645,59 @@ export namespace serviceusage_v1 {
2470
2645
 
2471
2646
  /**
2472
2647
  * Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
2648
+ * @example
2649
+ * ```js
2650
+ * // Before running the sample:
2651
+ * // - Enable the API at:
2652
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2653
+ * // - Login into gcloud by running:
2654
+ * // ```sh
2655
+ * // $ gcloud auth application-default login
2656
+ * // ```
2657
+ * // - Install the npm module by running:
2658
+ * // ```sh
2659
+ * // $ npm install googleapis
2660
+ * // ```
2661
+ *
2662
+ * const {google} = require('googleapis');
2663
+ * const serviceusage = google.serviceusage('v1');
2664
+ *
2665
+ * async function main() {
2666
+ * const auth = new google.auth.GoogleAuth({
2667
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2668
+ * scopes: [
2669
+ * 'https://www.googleapis.com/auth/cloud-platform',
2670
+ * 'https://www.googleapis.com/auth/service.management',
2671
+ * ],
2672
+ * });
2673
+ *
2674
+ * // Acquire an auth client, and bind it to all future calls
2675
+ * const authClient = await auth.getClient();
2676
+ * google.options({auth: authClient});
2677
+ *
2678
+ * // Do the magic
2679
+ * const res = await serviceusage.operations.get({
2680
+ * // The name of the operation resource.
2681
+ * name: 'operations/my-operation',
2682
+ * });
2683
+ * console.log(res.data);
2684
+ *
2685
+ * // Example response
2686
+ * // {
2687
+ * // "done": false,
2688
+ * // "error": {},
2689
+ * // "metadata": {},
2690
+ * // "name": "my_name",
2691
+ * // "response": {}
2692
+ * // }
2693
+ * }
2694
+ *
2695
+ * main().catch(e => {
2696
+ * console.error(e);
2697
+ * throw e;
2698
+ * });
2699
+ *
2700
+ * ```
2473
2701
  *
2474
2702
  * @param params - Parameters for request
2475
2703
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2557,6 +2785,62 @@ export namespace serviceusage_v1 {
2557
2785
 
2558
2786
  /**
2559
2787
  * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
2788
+ * @example
2789
+ * ```js
2790
+ * // Before running the sample:
2791
+ * // - Enable the API at:
2792
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2793
+ * // - Login into gcloud by running:
2794
+ * // ```sh
2795
+ * // $ gcloud auth application-default login
2796
+ * // ```
2797
+ * // - Install the npm module by running:
2798
+ * // ```sh
2799
+ * // $ npm install googleapis
2800
+ * // ```
2801
+ *
2802
+ * const {google} = require('googleapis');
2803
+ * const serviceusage = google.serviceusage('v1');
2804
+ *
2805
+ * async function main() {
2806
+ * const auth = new google.auth.GoogleAuth({
2807
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2808
+ * scopes: [
2809
+ * 'https://www.googleapis.com/auth/cloud-platform',
2810
+ * 'https://www.googleapis.com/auth/service.management',
2811
+ * ],
2812
+ * });
2813
+ *
2814
+ * // Acquire an auth client, and bind it to all future calls
2815
+ * const authClient = await auth.getClient();
2816
+ * google.options({auth: authClient});
2817
+ *
2818
+ * // Do the magic
2819
+ * const res = await serviceusage.operations.list({
2820
+ * // The standard list filter.
2821
+ * filter: 'placeholder-value',
2822
+ * // The name of the operation's parent resource.
2823
+ * name: 'placeholder-value',
2824
+ * // The standard list page size.
2825
+ * pageSize: 'placeholder-value',
2826
+ * // The standard list page token.
2827
+ * pageToken: 'placeholder-value',
2828
+ * });
2829
+ * console.log(res.data);
2830
+ *
2831
+ * // Example response
2832
+ * // {
2833
+ * // "nextPageToken": "my_nextPageToken",
2834
+ * // "operations": []
2835
+ * // }
2836
+ * }
2837
+ *
2838
+ * main().catch(e => {
2839
+ * console.error(e);
2840
+ * throw e;
2841
+ * });
2842
+ *
2843
+ * ```
2560
2844
  *
2561
2845
  * @param params - Parameters for request
2562
2846
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2697,6 +2981,67 @@ export namespace serviceusage_v1 {
2697
2981
 
2698
2982
  /**
2699
2983
  * Enable multiple services on a project. The operation is atomic: if enabling any service fails, then the entire batch fails, and no state changes occur. To enable a single service, use the `EnableService` method instead.
2984
+ * @example
2985
+ * ```js
2986
+ * // Before running the sample:
2987
+ * // - Enable the API at:
2988
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2989
+ * // - Login into gcloud by running:
2990
+ * // ```sh
2991
+ * // $ gcloud auth application-default login
2992
+ * // ```
2993
+ * // - Install the npm module by running:
2994
+ * // ```sh
2995
+ * // $ npm install googleapis
2996
+ * // ```
2997
+ *
2998
+ * const {google} = require('googleapis');
2999
+ * const serviceusage = google.serviceusage('v1');
3000
+ *
3001
+ * async function main() {
3002
+ * const auth = new google.auth.GoogleAuth({
3003
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3004
+ * scopes: [
3005
+ * 'https://www.googleapis.com/auth/cloud-platform',
3006
+ * 'https://www.googleapis.com/auth/service.management',
3007
+ * ],
3008
+ * });
3009
+ *
3010
+ * // Acquire an auth client, and bind it to all future calls
3011
+ * const authClient = await auth.getClient();
3012
+ * google.options({auth: authClient});
3013
+ *
3014
+ * // Do the magic
3015
+ * const res = await serviceusage.services.batchEnable({
3016
+ * // Parent to enable services on. An example name would be: `projects/123` where `123` is the project number. The `BatchEnableServices` method currently only supports projects.
3017
+ * parent: '[^/]+/[^/]+',
3018
+ *
3019
+ * // Request body metadata
3020
+ * requestBody: {
3021
+ * // request body parameters
3022
+ * // {
3023
+ * // "serviceIds": []
3024
+ * // }
3025
+ * },
3026
+ * });
3027
+ * console.log(res.data);
3028
+ *
3029
+ * // Example response
3030
+ * // {
3031
+ * // "done": false,
3032
+ * // "error": {},
3033
+ * // "metadata": {},
3034
+ * // "name": "my_name",
3035
+ * // "response": {}
3036
+ * // }
3037
+ * }
3038
+ *
3039
+ * main().catch(e => {
3040
+ * console.error(e);
3041
+ * throw e;
3042
+ * });
3043
+ *
3044
+ * ```
2700
3045
  *
2701
3046
  * @param params - Parameters for request
2702
3047
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2788,6 +3133,57 @@ export namespace serviceusage_v1 {
2788
3133
 
2789
3134
  /**
2790
3135
  * Returns the service configurations and enabled states for a given list of services.
3136
+ * @example
3137
+ * ```js
3138
+ * // Before running the sample:
3139
+ * // - Enable the API at:
3140
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
3141
+ * // - Login into gcloud by running:
3142
+ * // ```sh
3143
+ * // $ gcloud auth application-default login
3144
+ * // ```
3145
+ * // - Install the npm module by running:
3146
+ * // ```sh
3147
+ * // $ npm install googleapis
3148
+ * // ```
3149
+ *
3150
+ * const {google} = require('googleapis');
3151
+ * const serviceusage = google.serviceusage('v1');
3152
+ *
3153
+ * async function main() {
3154
+ * const auth = new google.auth.GoogleAuth({
3155
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3156
+ * scopes: [
3157
+ * 'https://www.googleapis.com/auth/cloud-platform',
3158
+ * 'https://www.googleapis.com/auth/cloud-platform.read-only',
3159
+ * ],
3160
+ * });
3161
+ *
3162
+ * // Acquire an auth client, and bind it to all future calls
3163
+ * const authClient = await auth.getClient();
3164
+ * google.options({auth: authClient});
3165
+ *
3166
+ * // Do the magic
3167
+ * const res = await serviceusage.services.batchGet({
3168
+ * // Names of the services to retrieve. An example name would be: `projects/123/services/serviceusage.googleapis.com` where `123` is the project number. A single request can get a maximum of 30 services at a time.
3169
+ * names: 'placeholder-value',
3170
+ * // Parent to retrieve services from. If this is set, the parent of all of the services specified in `names` must match this field. An example name would be: `projects/123` where `123` is the project number. The `BatchGetServices` method currently only supports projects.
3171
+ * parent: '[^/]+/[^/]+',
3172
+ * });
3173
+ * console.log(res.data);
3174
+ *
3175
+ * // Example response
3176
+ * // {
3177
+ * // "services": []
3178
+ * // }
3179
+ * }
3180
+ *
3181
+ * main().catch(e => {
3182
+ * console.error(e);
3183
+ * throw e;
3184
+ * });
3185
+ *
3186
+ * ```
2791
3187
  *
2792
3188
  * @param params - Parameters for request
2793
3189
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2883,6 +3279,68 @@ export namespace serviceusage_v1 {
2883
3279
 
2884
3280
  /**
2885
3281
  * Disable a service so that it can no longer be used with a project. This prevents unintended usage that may cause unexpected billing charges or security leaks. It is not valid to call the disable method on a service that is not currently enabled. Callers will receive a `FAILED_PRECONDITION` status if the target service is not currently enabled.
3282
+ * @example
3283
+ * ```js
3284
+ * // Before running the sample:
3285
+ * // - Enable the API at:
3286
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
3287
+ * // - Login into gcloud by running:
3288
+ * // ```sh
3289
+ * // $ gcloud auth application-default login
3290
+ * // ```
3291
+ * // - Install the npm module by running:
3292
+ * // ```sh
3293
+ * // $ npm install googleapis
3294
+ * // ```
3295
+ *
3296
+ * const {google} = require('googleapis');
3297
+ * const serviceusage = google.serviceusage('v1');
3298
+ *
3299
+ * async function main() {
3300
+ * const auth = new google.auth.GoogleAuth({
3301
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3302
+ * scopes: [
3303
+ * 'https://www.googleapis.com/auth/cloud-platform',
3304
+ * 'https://www.googleapis.com/auth/service.management',
3305
+ * ],
3306
+ * });
3307
+ *
3308
+ * // Acquire an auth client, and bind it to all future calls
3309
+ * const authClient = await auth.getClient();
3310
+ * google.options({auth: authClient});
3311
+ *
3312
+ * // Do the magic
3313
+ * const res = await serviceusage.services.disable({
3314
+ * // Name of the consumer and service to disable the service on. The enable and disable methods currently only support projects. An example name would be: `projects/123/services/serviceusage.googleapis.com` where `123` is the project number.
3315
+ * name: '[^/]+/[^/]+/services/my-service',
3316
+ *
3317
+ * // Request body metadata
3318
+ * requestBody: {
3319
+ * // request body parameters
3320
+ * // {
3321
+ * // "checkIfServiceHasUsage": "my_checkIfServiceHasUsage",
3322
+ * // "disableDependentServices": false
3323
+ * // }
3324
+ * },
3325
+ * });
3326
+ * console.log(res.data);
3327
+ *
3328
+ * // Example response
3329
+ * // {
3330
+ * // "done": false,
3331
+ * // "error": {},
3332
+ * // "metadata": {},
3333
+ * // "name": "my_name",
3334
+ * // "response": {}
3335
+ * // }
3336
+ * }
3337
+ *
3338
+ * main().catch(e => {
3339
+ * console.error(e);
3340
+ * throw e;
3341
+ * });
3342
+ *
3343
+ * ```
2886
3344
  *
2887
3345
  * @param params - Parameters for request
2888
3346
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2973,6 +3431,65 @@ export namespace serviceusage_v1 {
2973
3431
 
2974
3432
  /**
2975
3433
  * Enable a service so that it can be used with a project.
3434
+ * @example
3435
+ * ```js
3436
+ * // Before running the sample:
3437
+ * // - Enable the API at:
3438
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
3439
+ * // - Login into gcloud by running:
3440
+ * // ```sh
3441
+ * // $ gcloud auth application-default login
3442
+ * // ```
3443
+ * // - Install the npm module by running:
3444
+ * // ```sh
3445
+ * // $ npm install googleapis
3446
+ * // ```
3447
+ *
3448
+ * const {google} = require('googleapis');
3449
+ * const serviceusage = google.serviceusage('v1');
3450
+ *
3451
+ * async function main() {
3452
+ * const auth = new google.auth.GoogleAuth({
3453
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3454
+ * scopes: [
3455
+ * 'https://www.googleapis.com/auth/cloud-platform',
3456
+ * 'https://www.googleapis.com/auth/service.management',
3457
+ * ],
3458
+ * });
3459
+ *
3460
+ * // Acquire an auth client, and bind it to all future calls
3461
+ * const authClient = await auth.getClient();
3462
+ * google.options({auth: authClient});
3463
+ *
3464
+ * // Do the magic
3465
+ * const res = await serviceusage.services.enable({
3466
+ * // Name of the consumer and service to enable the service on. The `EnableService` and `DisableService` methods currently only support projects. Enabling a service requires that the service is public or is shared with the user enabling the service. An example name would be: `projects/123/services/serviceusage.googleapis.com` where `123` is the project number.
3467
+ * name: '[^/]+/[^/]+/services/my-service',
3468
+ *
3469
+ * // Request body metadata
3470
+ * requestBody: {
3471
+ * // request body parameters
3472
+ * // {}
3473
+ * },
3474
+ * });
3475
+ * console.log(res.data);
3476
+ *
3477
+ * // Example response
3478
+ * // {
3479
+ * // "done": false,
3480
+ * // "error": {},
3481
+ * // "metadata": {},
3482
+ * // "name": "my_name",
3483
+ * // "response": {}
3484
+ * // }
3485
+ * }
3486
+ *
3487
+ * main().catch(e => {
3488
+ * console.error(e);
3489
+ * throw e;
3490
+ * });
3491
+ *
3492
+ * ```
2976
3493
  *
2977
3494
  * @param params - Parameters for request
2978
3495
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3060,6 +3577,58 @@ export namespace serviceusage_v1 {
3060
3577
 
3061
3578
  /**
3062
3579
  * Returns the service configuration and enabled state for a given service.
3580
+ * @example
3581
+ * ```js
3582
+ * // Before running the sample:
3583
+ * // - Enable the API at:
3584
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
3585
+ * // - Login into gcloud by running:
3586
+ * // ```sh
3587
+ * // $ gcloud auth application-default login
3588
+ * // ```
3589
+ * // - Install the npm module by running:
3590
+ * // ```sh
3591
+ * // $ npm install googleapis
3592
+ * // ```
3593
+ *
3594
+ * const {google} = require('googleapis');
3595
+ * const serviceusage = google.serviceusage('v1');
3596
+ *
3597
+ * async function main() {
3598
+ * const auth = new google.auth.GoogleAuth({
3599
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3600
+ * scopes: [
3601
+ * 'https://www.googleapis.com/auth/cloud-platform',
3602
+ * 'https://www.googleapis.com/auth/cloud-platform.read-only',
3603
+ * ],
3604
+ * });
3605
+ *
3606
+ * // Acquire an auth client, and bind it to all future calls
3607
+ * const authClient = await auth.getClient();
3608
+ * google.options({auth: authClient});
3609
+ *
3610
+ * // Do the magic
3611
+ * const res = await serviceusage.services.get({
3612
+ * // Name of the consumer and service to get the `ConsumerState` for. An example name would be: `projects/123/services/serviceusage.googleapis.com` where `123` is the project number.
3613
+ * name: '[^/]+/[^/]+/services/my-service',
3614
+ * });
3615
+ * console.log(res.data);
3616
+ *
3617
+ * // Example response
3618
+ * // {
3619
+ * // "config": {},
3620
+ * // "name": "my_name",
3621
+ * // "parent": "my_parent",
3622
+ * // "state": "my_state"
3623
+ * // }
3624
+ * }
3625
+ *
3626
+ * main().catch(e => {
3627
+ * console.error(e);
3628
+ * throw e;
3629
+ * });
3630
+ *
3631
+ * ```
3063
3632
  *
3064
3633
  * @param params - Parameters for request
3065
3634
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3153,6 +3722,62 @@ export namespace serviceusage_v1 {
3153
3722
 
3154
3723
  /**
3155
3724
  * List all services available to the specified project, and the current state of those services with respect to the project. The list includes all public services, all services for which the calling user has the `servicemanagement.services.bind` permission, and all services that have already been enabled on the project. The list can be filtered to only include services in a specific state, for example to only include services enabled on the project. WARNING: If you need to query enabled services frequently or across an organization, you should use [Cloud Asset Inventory API](https://cloud.google.com/asset-inventory/docs/apis), which provides higher throughput and richer filtering capability.
3725
+ * @example
3726
+ * ```js
3727
+ * // Before running the sample:
3728
+ * // - Enable the API at:
3729
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
3730
+ * // - Login into gcloud by running:
3731
+ * // ```sh
3732
+ * // $ gcloud auth application-default login
3733
+ * // ```
3734
+ * // - Install the npm module by running:
3735
+ * // ```sh
3736
+ * // $ npm install googleapis
3737
+ * // ```
3738
+ *
3739
+ * const {google} = require('googleapis');
3740
+ * const serviceusage = google.serviceusage('v1');
3741
+ *
3742
+ * async function main() {
3743
+ * const auth = new google.auth.GoogleAuth({
3744
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3745
+ * scopes: [
3746
+ * 'https://www.googleapis.com/auth/cloud-platform',
3747
+ * 'https://www.googleapis.com/auth/cloud-platform.read-only',
3748
+ * ],
3749
+ * });
3750
+ *
3751
+ * // Acquire an auth client, and bind it to all future calls
3752
+ * const authClient = await auth.getClient();
3753
+ * google.options({auth: authClient});
3754
+ *
3755
+ * // Do the magic
3756
+ * const res = await serviceusage.services.list({
3757
+ * // Only list services that conform to the given filter. The allowed filter strings are `state:ENABLED` and `state:DISABLED`.
3758
+ * filter: 'placeholder-value',
3759
+ * // Requested size of the next page of data. Requested page size cannot exceed 200. If not set, the default page size is 50.
3760
+ * pageSize: 'placeholder-value',
3761
+ * // Token identifying which result to start with, which is returned by a previous list call.
3762
+ * pageToken: 'placeholder-value',
3763
+ * // Parent to search for services on. An example name would be: `projects/123` where `123` is the project number.
3764
+ * parent: '[^/]+/[^/]+',
3765
+ * });
3766
+ * console.log(res.data);
3767
+ *
3768
+ * // Example response
3769
+ * // {
3770
+ * // "nextPageToken": "my_nextPageToken",
3771
+ * // "services": []
3772
+ * // }
3773
+ * }
3774
+ *
3775
+ * main().catch(e => {
3776
+ * console.error(e);
3777
+ * throw e;
3778
+ * });
3779
+ *
3780
+ * ```
3156
3781
  *
3157
3782
  * @param params - Parameters for request
3158
3783
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.