@googleapis/serviceusage 16.0.1 → 17.1.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
  */
@@ -2294,6 +2365,59 @@ export namespace serviceusage_v1 {
2294
2365
 
2295
2366
  /**
2296
2367
  * 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`.
2368
+ * @example
2369
+ * ```js
2370
+ * // Before running the sample:
2371
+ * // - Enable the API at:
2372
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2373
+ * // - Login into gcloud by running:
2374
+ * // ```sh
2375
+ * // $ gcloud auth application-default login
2376
+ * // ```
2377
+ * // - Install the npm module by running:
2378
+ * // ```sh
2379
+ * // $ npm install googleapis
2380
+ * // ```
2381
+ *
2382
+ * const {google} = require('googleapis');
2383
+ * const serviceusage = google.serviceusage('v1');
2384
+ *
2385
+ * async function main() {
2386
+ * const auth = new google.auth.GoogleAuth({
2387
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2388
+ * scopes: [
2389
+ * 'https://www.googleapis.com/auth/cloud-platform',
2390
+ * 'https://www.googleapis.com/auth/service.management',
2391
+ * ],
2392
+ * });
2393
+ *
2394
+ * // Acquire an auth client, and bind it to all future calls
2395
+ * const authClient = await auth.getClient();
2396
+ * google.options({auth: authClient});
2397
+ *
2398
+ * // Do the magic
2399
+ * const res = await serviceusage.operations.cancel({
2400
+ * // The name of the operation resource to be cancelled.
2401
+ * name: 'operations/.*',
2402
+ *
2403
+ * // Request body metadata
2404
+ * requestBody: {
2405
+ * // request body parameters
2406
+ * // {}
2407
+ * },
2408
+ * });
2409
+ * console.log(res.data);
2410
+ *
2411
+ * // Example response
2412
+ * // {}
2413
+ * }
2414
+ *
2415
+ * main().catch(e => {
2416
+ * console.error(e);
2417
+ * throw e;
2418
+ * });
2419
+ *
2420
+ * ```
2297
2421
  *
2298
2422
  * @param params - Parameters for request
2299
2423
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2382,6 +2506,53 @@ export namespace serviceusage_v1 {
2382
2506
 
2383
2507
  /**
2384
2508
  * 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`.
2509
+ * @example
2510
+ * ```js
2511
+ * // Before running the sample:
2512
+ * // - Enable the API at:
2513
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2514
+ * // - Login into gcloud by running:
2515
+ * // ```sh
2516
+ * // $ gcloud auth application-default login
2517
+ * // ```
2518
+ * // - Install the npm module by running:
2519
+ * // ```sh
2520
+ * // $ npm install googleapis
2521
+ * // ```
2522
+ *
2523
+ * const {google} = require('googleapis');
2524
+ * const serviceusage = google.serviceusage('v1');
2525
+ *
2526
+ * async function main() {
2527
+ * const auth = new google.auth.GoogleAuth({
2528
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2529
+ * scopes: [
2530
+ * 'https://www.googleapis.com/auth/cloud-platform',
2531
+ * 'https://www.googleapis.com/auth/service.management',
2532
+ * ],
2533
+ * });
2534
+ *
2535
+ * // Acquire an auth client, and bind it to all future calls
2536
+ * const authClient = await auth.getClient();
2537
+ * google.options({auth: authClient});
2538
+ *
2539
+ * // Do the magic
2540
+ * const res = await serviceusage.operations.delete({
2541
+ * // The name of the operation resource to be deleted.
2542
+ * name: 'operations/.*',
2543
+ * });
2544
+ * console.log(res.data);
2545
+ *
2546
+ * // Example response
2547
+ * // {}
2548
+ * }
2549
+ *
2550
+ * main().catch(e => {
2551
+ * console.error(e);
2552
+ * throw e;
2553
+ * });
2554
+ *
2555
+ * ```
2385
2556
  *
2386
2557
  * @param params - Parameters for request
2387
2558
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2470,6 +2641,59 @@ export namespace serviceusage_v1 {
2470
2641
 
2471
2642
  /**
2472
2643
  * 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.
2644
+ * @example
2645
+ * ```js
2646
+ * // Before running the sample:
2647
+ * // - Enable the API at:
2648
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2649
+ * // - Login into gcloud by running:
2650
+ * // ```sh
2651
+ * // $ gcloud auth application-default login
2652
+ * // ```
2653
+ * // - Install the npm module by running:
2654
+ * // ```sh
2655
+ * // $ npm install googleapis
2656
+ * // ```
2657
+ *
2658
+ * const {google} = require('googleapis');
2659
+ * const serviceusage = google.serviceusage('v1');
2660
+ *
2661
+ * async function main() {
2662
+ * const auth = new google.auth.GoogleAuth({
2663
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2664
+ * scopes: [
2665
+ * 'https://www.googleapis.com/auth/cloud-platform',
2666
+ * 'https://www.googleapis.com/auth/service.management',
2667
+ * ],
2668
+ * });
2669
+ *
2670
+ * // Acquire an auth client, and bind it to all future calls
2671
+ * const authClient = await auth.getClient();
2672
+ * google.options({auth: authClient});
2673
+ *
2674
+ * // Do the magic
2675
+ * const res = await serviceusage.operations.get({
2676
+ * // The name of the operation resource.
2677
+ * name: 'operations/my-operation',
2678
+ * });
2679
+ * console.log(res.data);
2680
+ *
2681
+ * // Example response
2682
+ * // {
2683
+ * // "done": false,
2684
+ * // "error": {},
2685
+ * // "metadata": {},
2686
+ * // "name": "my_name",
2687
+ * // "response": {}
2688
+ * // }
2689
+ * }
2690
+ *
2691
+ * main().catch(e => {
2692
+ * console.error(e);
2693
+ * throw e;
2694
+ * });
2695
+ *
2696
+ * ```
2473
2697
  *
2474
2698
  * @param params - Parameters for request
2475
2699
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2557,6 +2781,62 @@ export namespace serviceusage_v1 {
2557
2781
 
2558
2782
  /**
2559
2783
  * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
2784
+ * @example
2785
+ * ```js
2786
+ * // Before running the sample:
2787
+ * // - Enable the API at:
2788
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2789
+ * // - Login into gcloud by running:
2790
+ * // ```sh
2791
+ * // $ gcloud auth application-default login
2792
+ * // ```
2793
+ * // - Install the npm module by running:
2794
+ * // ```sh
2795
+ * // $ npm install googleapis
2796
+ * // ```
2797
+ *
2798
+ * const {google} = require('googleapis');
2799
+ * const serviceusage = google.serviceusage('v1');
2800
+ *
2801
+ * async function main() {
2802
+ * const auth = new google.auth.GoogleAuth({
2803
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2804
+ * scopes: [
2805
+ * 'https://www.googleapis.com/auth/cloud-platform',
2806
+ * 'https://www.googleapis.com/auth/service.management',
2807
+ * ],
2808
+ * });
2809
+ *
2810
+ * // Acquire an auth client, and bind it to all future calls
2811
+ * const authClient = await auth.getClient();
2812
+ * google.options({auth: authClient});
2813
+ *
2814
+ * // Do the magic
2815
+ * const res = await serviceusage.operations.list({
2816
+ * // The standard list filter.
2817
+ * filter: 'placeholder-value',
2818
+ * // The name of the operation's parent resource.
2819
+ * name: 'placeholder-value',
2820
+ * // The standard list page size.
2821
+ * pageSize: 'placeholder-value',
2822
+ * // The standard list page token.
2823
+ * pageToken: 'placeholder-value',
2824
+ * });
2825
+ * console.log(res.data);
2826
+ *
2827
+ * // Example response
2828
+ * // {
2829
+ * // "nextPageToken": "my_nextPageToken",
2830
+ * // "operations": []
2831
+ * // }
2832
+ * }
2833
+ *
2834
+ * main().catch(e => {
2835
+ * console.error(e);
2836
+ * throw e;
2837
+ * });
2838
+ *
2839
+ * ```
2560
2840
  *
2561
2841
  * @param params - Parameters for request
2562
2842
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2697,6 +2977,67 @@ export namespace serviceusage_v1 {
2697
2977
 
2698
2978
  /**
2699
2979
  * 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.
2980
+ * @example
2981
+ * ```js
2982
+ * // Before running the sample:
2983
+ * // - Enable the API at:
2984
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2985
+ * // - Login into gcloud by running:
2986
+ * // ```sh
2987
+ * // $ gcloud auth application-default login
2988
+ * // ```
2989
+ * // - Install the npm module by running:
2990
+ * // ```sh
2991
+ * // $ npm install googleapis
2992
+ * // ```
2993
+ *
2994
+ * const {google} = require('googleapis');
2995
+ * const serviceusage = google.serviceusage('v1');
2996
+ *
2997
+ * async function main() {
2998
+ * const auth = new google.auth.GoogleAuth({
2999
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3000
+ * scopes: [
3001
+ * 'https://www.googleapis.com/auth/cloud-platform',
3002
+ * 'https://www.googleapis.com/auth/service.management',
3003
+ * ],
3004
+ * });
3005
+ *
3006
+ * // Acquire an auth client, and bind it to all future calls
3007
+ * const authClient = await auth.getClient();
3008
+ * google.options({auth: authClient});
3009
+ *
3010
+ * // Do the magic
3011
+ * const res = await serviceusage.services.batchEnable({
3012
+ * // 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.
3013
+ * parent: '[^/]+/[^/]+',
3014
+ *
3015
+ * // Request body metadata
3016
+ * requestBody: {
3017
+ * // request body parameters
3018
+ * // {
3019
+ * // "serviceIds": []
3020
+ * // }
3021
+ * },
3022
+ * });
3023
+ * console.log(res.data);
3024
+ *
3025
+ * // Example response
3026
+ * // {
3027
+ * // "done": false,
3028
+ * // "error": {},
3029
+ * // "metadata": {},
3030
+ * // "name": "my_name",
3031
+ * // "response": {}
3032
+ * // }
3033
+ * }
3034
+ *
3035
+ * main().catch(e => {
3036
+ * console.error(e);
3037
+ * throw e;
3038
+ * });
3039
+ *
3040
+ * ```
2700
3041
  *
2701
3042
  * @param params - Parameters for request
2702
3043
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2788,6 +3129,57 @@ export namespace serviceusage_v1 {
2788
3129
 
2789
3130
  /**
2790
3131
  * Returns the service configurations and enabled states for a given list of services.
3132
+ * @example
3133
+ * ```js
3134
+ * // Before running the sample:
3135
+ * // - Enable the API at:
3136
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
3137
+ * // - Login into gcloud by running:
3138
+ * // ```sh
3139
+ * // $ gcloud auth application-default login
3140
+ * // ```
3141
+ * // - Install the npm module by running:
3142
+ * // ```sh
3143
+ * // $ npm install googleapis
3144
+ * // ```
3145
+ *
3146
+ * const {google} = require('googleapis');
3147
+ * const serviceusage = google.serviceusage('v1');
3148
+ *
3149
+ * async function main() {
3150
+ * const auth = new google.auth.GoogleAuth({
3151
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3152
+ * scopes: [
3153
+ * 'https://www.googleapis.com/auth/cloud-platform',
3154
+ * 'https://www.googleapis.com/auth/cloud-platform.read-only',
3155
+ * ],
3156
+ * });
3157
+ *
3158
+ * // Acquire an auth client, and bind it to all future calls
3159
+ * const authClient = await auth.getClient();
3160
+ * google.options({auth: authClient});
3161
+ *
3162
+ * // Do the magic
3163
+ * const res = await serviceusage.services.batchGet({
3164
+ * // 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.
3165
+ * names: 'placeholder-value',
3166
+ * // 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.
3167
+ * parent: '[^/]+/[^/]+',
3168
+ * });
3169
+ * console.log(res.data);
3170
+ *
3171
+ * // Example response
3172
+ * // {
3173
+ * // "services": []
3174
+ * // }
3175
+ * }
3176
+ *
3177
+ * main().catch(e => {
3178
+ * console.error(e);
3179
+ * throw e;
3180
+ * });
3181
+ *
3182
+ * ```
2791
3183
  *
2792
3184
  * @param params - Parameters for request
2793
3185
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2883,6 +3275,68 @@ export namespace serviceusage_v1 {
2883
3275
 
2884
3276
  /**
2885
3277
  * 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.
3278
+ * @example
3279
+ * ```js
3280
+ * // Before running the sample:
3281
+ * // - Enable the API at:
3282
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
3283
+ * // - Login into gcloud by running:
3284
+ * // ```sh
3285
+ * // $ gcloud auth application-default login
3286
+ * // ```
3287
+ * // - Install the npm module by running:
3288
+ * // ```sh
3289
+ * // $ npm install googleapis
3290
+ * // ```
3291
+ *
3292
+ * const {google} = require('googleapis');
3293
+ * const serviceusage = google.serviceusage('v1');
3294
+ *
3295
+ * async function main() {
3296
+ * const auth = new google.auth.GoogleAuth({
3297
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3298
+ * scopes: [
3299
+ * 'https://www.googleapis.com/auth/cloud-platform',
3300
+ * 'https://www.googleapis.com/auth/service.management',
3301
+ * ],
3302
+ * });
3303
+ *
3304
+ * // Acquire an auth client, and bind it to all future calls
3305
+ * const authClient = await auth.getClient();
3306
+ * google.options({auth: authClient});
3307
+ *
3308
+ * // Do the magic
3309
+ * const res = await serviceusage.services.disable({
3310
+ * // 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.
3311
+ * name: '[^/]+/[^/]+/services/my-service',
3312
+ *
3313
+ * // Request body metadata
3314
+ * requestBody: {
3315
+ * // request body parameters
3316
+ * // {
3317
+ * // "checkIfServiceHasUsage": "my_checkIfServiceHasUsage",
3318
+ * // "disableDependentServices": false
3319
+ * // }
3320
+ * },
3321
+ * });
3322
+ * console.log(res.data);
3323
+ *
3324
+ * // Example response
3325
+ * // {
3326
+ * // "done": false,
3327
+ * // "error": {},
3328
+ * // "metadata": {},
3329
+ * // "name": "my_name",
3330
+ * // "response": {}
3331
+ * // }
3332
+ * }
3333
+ *
3334
+ * main().catch(e => {
3335
+ * console.error(e);
3336
+ * throw e;
3337
+ * });
3338
+ *
3339
+ * ```
2886
3340
  *
2887
3341
  * @param params - Parameters for request
2888
3342
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2973,6 +3427,65 @@ export namespace serviceusage_v1 {
2973
3427
 
2974
3428
  /**
2975
3429
  * Enable a service so that it can be used with a project.
3430
+ * @example
3431
+ * ```js
3432
+ * // Before running the sample:
3433
+ * // - Enable the API at:
3434
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
3435
+ * // - Login into gcloud by running:
3436
+ * // ```sh
3437
+ * // $ gcloud auth application-default login
3438
+ * // ```
3439
+ * // - Install the npm module by running:
3440
+ * // ```sh
3441
+ * // $ npm install googleapis
3442
+ * // ```
3443
+ *
3444
+ * const {google} = require('googleapis');
3445
+ * const serviceusage = google.serviceusage('v1');
3446
+ *
3447
+ * async function main() {
3448
+ * const auth = new google.auth.GoogleAuth({
3449
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3450
+ * scopes: [
3451
+ * 'https://www.googleapis.com/auth/cloud-platform',
3452
+ * 'https://www.googleapis.com/auth/service.management',
3453
+ * ],
3454
+ * });
3455
+ *
3456
+ * // Acquire an auth client, and bind it to all future calls
3457
+ * const authClient = await auth.getClient();
3458
+ * google.options({auth: authClient});
3459
+ *
3460
+ * // Do the magic
3461
+ * const res = await serviceusage.services.enable({
3462
+ * // 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.
3463
+ * name: '[^/]+/[^/]+/services/my-service',
3464
+ *
3465
+ * // Request body metadata
3466
+ * requestBody: {
3467
+ * // request body parameters
3468
+ * // {}
3469
+ * },
3470
+ * });
3471
+ * console.log(res.data);
3472
+ *
3473
+ * // Example response
3474
+ * // {
3475
+ * // "done": false,
3476
+ * // "error": {},
3477
+ * // "metadata": {},
3478
+ * // "name": "my_name",
3479
+ * // "response": {}
3480
+ * // }
3481
+ * }
3482
+ *
3483
+ * main().catch(e => {
3484
+ * console.error(e);
3485
+ * throw e;
3486
+ * });
3487
+ *
3488
+ * ```
2976
3489
  *
2977
3490
  * @param params - Parameters for request
2978
3491
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3060,6 +3573,58 @@ export namespace serviceusage_v1 {
3060
3573
 
3061
3574
  /**
3062
3575
  * Returns the service configuration and enabled state for a given service.
3576
+ * @example
3577
+ * ```js
3578
+ * // Before running the sample:
3579
+ * // - Enable the API at:
3580
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
3581
+ * // - Login into gcloud by running:
3582
+ * // ```sh
3583
+ * // $ gcloud auth application-default login
3584
+ * // ```
3585
+ * // - Install the npm module by running:
3586
+ * // ```sh
3587
+ * // $ npm install googleapis
3588
+ * // ```
3589
+ *
3590
+ * const {google} = require('googleapis');
3591
+ * const serviceusage = google.serviceusage('v1');
3592
+ *
3593
+ * async function main() {
3594
+ * const auth = new google.auth.GoogleAuth({
3595
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3596
+ * scopes: [
3597
+ * 'https://www.googleapis.com/auth/cloud-platform',
3598
+ * 'https://www.googleapis.com/auth/cloud-platform.read-only',
3599
+ * ],
3600
+ * });
3601
+ *
3602
+ * // Acquire an auth client, and bind it to all future calls
3603
+ * const authClient = await auth.getClient();
3604
+ * google.options({auth: authClient});
3605
+ *
3606
+ * // Do the magic
3607
+ * const res = await serviceusage.services.get({
3608
+ * // 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.
3609
+ * name: '[^/]+/[^/]+/services/my-service',
3610
+ * });
3611
+ * console.log(res.data);
3612
+ *
3613
+ * // Example response
3614
+ * // {
3615
+ * // "config": {},
3616
+ * // "name": "my_name",
3617
+ * // "parent": "my_parent",
3618
+ * // "state": "my_state"
3619
+ * // }
3620
+ * }
3621
+ *
3622
+ * main().catch(e => {
3623
+ * console.error(e);
3624
+ * throw e;
3625
+ * });
3626
+ *
3627
+ * ```
3063
3628
  *
3064
3629
  * @param params - Parameters for request
3065
3630
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3153,6 +3718,62 @@ export namespace serviceusage_v1 {
3153
3718
 
3154
3719
  /**
3155
3720
  * 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.
3721
+ * @example
3722
+ * ```js
3723
+ * // Before running the sample:
3724
+ * // - Enable the API at:
3725
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
3726
+ * // - Login into gcloud by running:
3727
+ * // ```sh
3728
+ * // $ gcloud auth application-default login
3729
+ * // ```
3730
+ * // - Install the npm module by running:
3731
+ * // ```sh
3732
+ * // $ npm install googleapis
3733
+ * // ```
3734
+ *
3735
+ * const {google} = require('googleapis');
3736
+ * const serviceusage = google.serviceusage('v1');
3737
+ *
3738
+ * async function main() {
3739
+ * const auth = new google.auth.GoogleAuth({
3740
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3741
+ * scopes: [
3742
+ * 'https://www.googleapis.com/auth/cloud-platform',
3743
+ * 'https://www.googleapis.com/auth/cloud-platform.read-only',
3744
+ * ],
3745
+ * });
3746
+ *
3747
+ * // Acquire an auth client, and bind it to all future calls
3748
+ * const authClient = await auth.getClient();
3749
+ * google.options({auth: authClient});
3750
+ *
3751
+ * // Do the magic
3752
+ * const res = await serviceusage.services.list({
3753
+ * // Only list services that conform to the given filter. The allowed filter strings are `state:ENABLED` and `state:DISABLED`.
3754
+ * filter: 'placeholder-value',
3755
+ * // Requested size of the next page of data. Requested page size cannot exceed 200. If not set, the default page size is 50.
3756
+ * pageSize: 'placeholder-value',
3757
+ * // Token identifying which result to start with, which is returned by a previous list call.
3758
+ * pageToken: 'placeholder-value',
3759
+ * // Parent to search for services on. An example name would be: `projects/123` where `123` is the project number.
3760
+ * parent: '[^/]+/[^/]+',
3761
+ * });
3762
+ * console.log(res.data);
3763
+ *
3764
+ * // Example response
3765
+ * // {
3766
+ * // "nextPageToken": "my_nextPageToken",
3767
+ * // "services": []
3768
+ * // }
3769
+ * }
3770
+ *
3771
+ * main().catch(e => {
3772
+ * console.error(e);
3773
+ * throw e;
3774
+ * });
3775
+ *
3776
+ * ```
3156
3777
  *
3157
3778
  * @param params - Parameters for request
3158
3779
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.