@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/build/v1.d.ts CHANGED
@@ -211,7 +211,7 @@ export declare namespace serviceusage_v1 {
211
211
  */
212
212
  kind?: string | null;
213
213
  /**
214
- * Content of the configuration. The underlying schema should be defined by Aspect owners as protobuf message under `apiserving/configaspects/proto`.
214
+ * Content of the configuration. The underlying schema should be defined by Aspect owners as protobuf message under `google/api/configaspects/proto`.
215
215
  */
216
216
  spec?: {
217
217
  [key: string]: any;
@@ -399,6 +399,73 @@ export declare namespace serviceusage_v1 {
399
399
  */
400
400
  services?: Schema$GoogleApiServiceusageV1Service[];
401
401
  }
402
+ /**
403
+ * `BatchingConfigProto` defines the batching configuration for an API method.
404
+ */
405
+ export interface Schema$BatchingConfigProto {
406
+ /**
407
+ * The request and response fields used in batching.
408
+ */
409
+ batchDescriptor?: Schema$BatchingDescriptorProto;
410
+ /**
411
+ * The thresholds which trigger a batched request to be sent.
412
+ */
413
+ thresholds?: Schema$BatchingSettingsProto;
414
+ }
415
+ /**
416
+ * `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.
417
+ */
418
+ export interface Schema$BatchingDescriptorProto {
419
+ /**
420
+ * The repeated field in the request message to be aggregated by batching.
421
+ */
422
+ batchedField?: string | null;
423
+ /**
424
+ * 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.
425
+ */
426
+ discriminatorFields?: string[] | null;
427
+ /**
428
+ * 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.
429
+ */
430
+ subresponseField?: string | null;
431
+ }
432
+ /**
433
+ * `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.
434
+ */
435
+ export interface Schema$BatchingSettingsProto {
436
+ /**
437
+ * The duration after which a batch should be sent, starting from the addition of the first message to that batch.
438
+ */
439
+ delayThreshold?: string | null;
440
+ /**
441
+ * The maximum number of elements collected in a batch that could be accepted by server.
442
+ */
443
+ elementCountLimit?: number | null;
444
+ /**
445
+ * The number of elements of a field collected into a batch which, if exceeded, causes the batch to be sent.
446
+ */
447
+ elementCountThreshold?: number | null;
448
+ /**
449
+ * The maximum size of data allowed by flow control.
450
+ */
451
+ flowControlByteLimit?: number | null;
452
+ /**
453
+ * The maximum number of elements allowed by flow control.
454
+ */
455
+ flowControlElementLimit?: number | null;
456
+ /**
457
+ * The behavior to take when the flow control limit is exceeded.
458
+ */
459
+ flowControlLimitExceededBehavior?: string | null;
460
+ /**
461
+ * The maximum size of the request that could be accepted by server.
462
+ */
463
+ requestByteLimit?: number | null;
464
+ /**
465
+ * 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.
466
+ */
467
+ requestByteThreshold?: string | null;
468
+ }
402
469
  /**
403
470
  * 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
404
471
  */
@@ -1664,6 +1731,10 @@ export declare namespace serviceusage_v1 {
1664
1731
  * 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
1665
1732
  */
1666
1733
  autoPopulatedFields?: string[] | null;
1734
+ /**
1735
+ * 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
1736
+ */
1737
+ batching?: Schema$BatchingConfigProto;
1667
1738
  /**
1668
1739
  * 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
1669
1740
  */
@@ -1922,6 +1993,10 @@ export declare namespace serviceusage_v1 {
1922
1993
  * Some settings.
1923
1994
  */
1924
1995
  common?: Schema$CommonLanguageSettings;
1996
+ /**
1997
+ * 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
1998
+ */
1999
+ libraryPackage?: string | null;
1925
2000
  }
1926
2001
  /**
1927
2002
  * 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.
@@ -2289,6 +2364,59 @@ export declare namespace serviceusage_v1 {
2289
2364
  constructor(context: APIRequestContext);
2290
2365
  /**
2291
2366
  * 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`.
2367
+ * @example
2368
+ * ```js
2369
+ * // Before running the sample:
2370
+ * // - Enable the API at:
2371
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2372
+ * // - Login into gcloud by running:
2373
+ * // ```sh
2374
+ * // $ gcloud auth application-default login
2375
+ * // ```
2376
+ * // - Install the npm module by running:
2377
+ * // ```sh
2378
+ * // $ npm install googleapis
2379
+ * // ```
2380
+ *
2381
+ * const {google} = require('googleapis');
2382
+ * const serviceusage = google.serviceusage('v1');
2383
+ *
2384
+ * async function main() {
2385
+ * const auth = new google.auth.GoogleAuth({
2386
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2387
+ * scopes: [
2388
+ * 'https://www.googleapis.com/auth/cloud-platform',
2389
+ * 'https://www.googleapis.com/auth/service.management',
2390
+ * ],
2391
+ * });
2392
+ *
2393
+ * // Acquire an auth client, and bind it to all future calls
2394
+ * const authClient = await auth.getClient();
2395
+ * google.options({auth: authClient});
2396
+ *
2397
+ * // Do the magic
2398
+ * const res = await serviceusage.operations.cancel({
2399
+ * // The name of the operation resource to be cancelled.
2400
+ * name: 'operations/.*',
2401
+ *
2402
+ * // Request body metadata
2403
+ * requestBody: {
2404
+ * // request body parameters
2405
+ * // {}
2406
+ * },
2407
+ * });
2408
+ * console.log(res.data);
2409
+ *
2410
+ * // Example response
2411
+ * // {}
2412
+ * }
2413
+ *
2414
+ * main().catch(e => {
2415
+ * console.error(e);
2416
+ * throw e;
2417
+ * });
2418
+ *
2419
+ * ```
2292
2420
  *
2293
2421
  * @param params - Parameters for request
2294
2422
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2303,6 +2431,53 @@ export declare namespace serviceusage_v1 {
2303
2431
  cancel(callback: BodyResponseCallback<Schema$Empty>): void;
2304
2432
  /**
2305
2433
  * 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`.
2434
+ * @example
2435
+ * ```js
2436
+ * // Before running the sample:
2437
+ * // - Enable the API at:
2438
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2439
+ * // - Login into gcloud by running:
2440
+ * // ```sh
2441
+ * // $ gcloud auth application-default login
2442
+ * // ```
2443
+ * // - Install the npm module by running:
2444
+ * // ```sh
2445
+ * // $ npm install googleapis
2446
+ * // ```
2447
+ *
2448
+ * const {google} = require('googleapis');
2449
+ * const serviceusage = google.serviceusage('v1');
2450
+ *
2451
+ * async function main() {
2452
+ * const auth = new google.auth.GoogleAuth({
2453
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2454
+ * scopes: [
2455
+ * 'https://www.googleapis.com/auth/cloud-platform',
2456
+ * 'https://www.googleapis.com/auth/service.management',
2457
+ * ],
2458
+ * });
2459
+ *
2460
+ * // Acquire an auth client, and bind it to all future calls
2461
+ * const authClient = await auth.getClient();
2462
+ * google.options({auth: authClient});
2463
+ *
2464
+ * // Do the magic
2465
+ * const res = await serviceusage.operations.delete({
2466
+ * // The name of the operation resource to be deleted.
2467
+ * name: 'operations/.*',
2468
+ * });
2469
+ * console.log(res.data);
2470
+ *
2471
+ * // Example response
2472
+ * // {}
2473
+ * }
2474
+ *
2475
+ * main().catch(e => {
2476
+ * console.error(e);
2477
+ * throw e;
2478
+ * });
2479
+ *
2480
+ * ```
2306
2481
  *
2307
2482
  * @param params - Parameters for request
2308
2483
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2317,6 +2492,59 @@ export declare namespace serviceusage_v1 {
2317
2492
  delete(callback: BodyResponseCallback<Schema$Empty>): void;
2318
2493
  /**
2319
2494
  * 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.
2495
+ * @example
2496
+ * ```js
2497
+ * // Before running the sample:
2498
+ * // - Enable the API at:
2499
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2500
+ * // - Login into gcloud by running:
2501
+ * // ```sh
2502
+ * // $ gcloud auth application-default login
2503
+ * // ```
2504
+ * // - Install the npm module by running:
2505
+ * // ```sh
2506
+ * // $ npm install googleapis
2507
+ * // ```
2508
+ *
2509
+ * const {google} = require('googleapis');
2510
+ * const serviceusage = google.serviceusage('v1');
2511
+ *
2512
+ * async function main() {
2513
+ * const auth = new google.auth.GoogleAuth({
2514
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2515
+ * scopes: [
2516
+ * 'https://www.googleapis.com/auth/cloud-platform',
2517
+ * 'https://www.googleapis.com/auth/service.management',
2518
+ * ],
2519
+ * });
2520
+ *
2521
+ * // Acquire an auth client, and bind it to all future calls
2522
+ * const authClient = await auth.getClient();
2523
+ * google.options({auth: authClient});
2524
+ *
2525
+ * // Do the magic
2526
+ * const res = await serviceusage.operations.get({
2527
+ * // The name of the operation resource.
2528
+ * name: 'operations/my-operation',
2529
+ * });
2530
+ * console.log(res.data);
2531
+ *
2532
+ * // Example response
2533
+ * // {
2534
+ * // "done": false,
2535
+ * // "error": {},
2536
+ * // "metadata": {},
2537
+ * // "name": "my_name",
2538
+ * // "response": {}
2539
+ * // }
2540
+ * }
2541
+ *
2542
+ * main().catch(e => {
2543
+ * console.error(e);
2544
+ * throw e;
2545
+ * });
2546
+ *
2547
+ * ```
2320
2548
  *
2321
2549
  * @param params - Parameters for request
2322
2550
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2331,6 +2559,62 @@ export declare namespace serviceusage_v1 {
2331
2559
  get(callback: BodyResponseCallback<Schema$Operation>): void;
2332
2560
  /**
2333
2561
  * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
2562
+ * @example
2563
+ * ```js
2564
+ * // Before running the sample:
2565
+ * // - Enable the API at:
2566
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2567
+ * // - Login into gcloud by running:
2568
+ * // ```sh
2569
+ * // $ gcloud auth application-default login
2570
+ * // ```
2571
+ * // - Install the npm module by running:
2572
+ * // ```sh
2573
+ * // $ npm install googleapis
2574
+ * // ```
2575
+ *
2576
+ * const {google} = require('googleapis');
2577
+ * const serviceusage = google.serviceusage('v1');
2578
+ *
2579
+ * async function main() {
2580
+ * const auth = new google.auth.GoogleAuth({
2581
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2582
+ * scopes: [
2583
+ * 'https://www.googleapis.com/auth/cloud-platform',
2584
+ * 'https://www.googleapis.com/auth/service.management',
2585
+ * ],
2586
+ * });
2587
+ *
2588
+ * // Acquire an auth client, and bind it to all future calls
2589
+ * const authClient = await auth.getClient();
2590
+ * google.options({auth: authClient});
2591
+ *
2592
+ * // Do the magic
2593
+ * const res = await serviceusage.operations.list({
2594
+ * // The standard list filter.
2595
+ * filter: 'placeholder-value',
2596
+ * // The name of the operation's parent resource.
2597
+ * name: 'placeholder-value',
2598
+ * // The standard list page size.
2599
+ * pageSize: 'placeholder-value',
2600
+ * // The standard list page token.
2601
+ * pageToken: 'placeholder-value',
2602
+ * });
2603
+ * console.log(res.data);
2604
+ *
2605
+ * // Example response
2606
+ * // {
2607
+ * // "nextPageToken": "my_nextPageToken",
2608
+ * // "operations": []
2609
+ * // }
2610
+ * }
2611
+ *
2612
+ * main().catch(e => {
2613
+ * console.error(e);
2614
+ * throw e;
2615
+ * });
2616
+ *
2617
+ * ```
2334
2618
  *
2335
2619
  * @param params - Parameters for request
2336
2620
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2389,6 +2673,67 @@ export declare namespace serviceusage_v1 {
2389
2673
  constructor(context: APIRequestContext);
2390
2674
  /**
2391
2675
  * 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.
2676
+ * @example
2677
+ * ```js
2678
+ * // Before running the sample:
2679
+ * // - Enable the API at:
2680
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2681
+ * // - Login into gcloud by running:
2682
+ * // ```sh
2683
+ * // $ gcloud auth application-default login
2684
+ * // ```
2685
+ * // - Install the npm module by running:
2686
+ * // ```sh
2687
+ * // $ npm install googleapis
2688
+ * // ```
2689
+ *
2690
+ * const {google} = require('googleapis');
2691
+ * const serviceusage = google.serviceusage('v1');
2692
+ *
2693
+ * async function main() {
2694
+ * const auth = new google.auth.GoogleAuth({
2695
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2696
+ * scopes: [
2697
+ * 'https://www.googleapis.com/auth/cloud-platform',
2698
+ * 'https://www.googleapis.com/auth/service.management',
2699
+ * ],
2700
+ * });
2701
+ *
2702
+ * // Acquire an auth client, and bind it to all future calls
2703
+ * const authClient = await auth.getClient();
2704
+ * google.options({auth: authClient});
2705
+ *
2706
+ * // Do the magic
2707
+ * const res = await serviceusage.services.batchEnable({
2708
+ * // 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.
2709
+ * parent: '[^/]+/[^/]+',
2710
+ *
2711
+ * // Request body metadata
2712
+ * requestBody: {
2713
+ * // request body parameters
2714
+ * // {
2715
+ * // "serviceIds": []
2716
+ * // }
2717
+ * },
2718
+ * });
2719
+ * console.log(res.data);
2720
+ *
2721
+ * // Example response
2722
+ * // {
2723
+ * // "done": false,
2724
+ * // "error": {},
2725
+ * // "metadata": {},
2726
+ * // "name": "my_name",
2727
+ * // "response": {}
2728
+ * // }
2729
+ * }
2730
+ *
2731
+ * main().catch(e => {
2732
+ * console.error(e);
2733
+ * throw e;
2734
+ * });
2735
+ *
2736
+ * ```
2392
2737
  *
2393
2738
  * @param params - Parameters for request
2394
2739
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2403,6 +2748,57 @@ export declare namespace serviceusage_v1 {
2403
2748
  batchEnable(callback: BodyResponseCallback<Schema$Operation>): void;
2404
2749
  /**
2405
2750
  * Returns the service configurations and enabled states for a given list of services.
2751
+ * @example
2752
+ * ```js
2753
+ * // Before running the sample:
2754
+ * // - Enable the API at:
2755
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2756
+ * // - Login into gcloud by running:
2757
+ * // ```sh
2758
+ * // $ gcloud auth application-default login
2759
+ * // ```
2760
+ * // - Install the npm module by running:
2761
+ * // ```sh
2762
+ * // $ npm install googleapis
2763
+ * // ```
2764
+ *
2765
+ * const {google} = require('googleapis');
2766
+ * const serviceusage = google.serviceusage('v1');
2767
+ *
2768
+ * async function main() {
2769
+ * const auth = new google.auth.GoogleAuth({
2770
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2771
+ * scopes: [
2772
+ * 'https://www.googleapis.com/auth/cloud-platform',
2773
+ * 'https://www.googleapis.com/auth/cloud-platform.read-only',
2774
+ * ],
2775
+ * });
2776
+ *
2777
+ * // Acquire an auth client, and bind it to all future calls
2778
+ * const authClient = await auth.getClient();
2779
+ * google.options({auth: authClient});
2780
+ *
2781
+ * // Do the magic
2782
+ * const res = await serviceusage.services.batchGet({
2783
+ * // 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.
2784
+ * names: 'placeholder-value',
2785
+ * // 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.
2786
+ * parent: '[^/]+/[^/]+',
2787
+ * });
2788
+ * console.log(res.data);
2789
+ *
2790
+ * // Example response
2791
+ * // {
2792
+ * // "services": []
2793
+ * // }
2794
+ * }
2795
+ *
2796
+ * main().catch(e => {
2797
+ * console.error(e);
2798
+ * throw e;
2799
+ * });
2800
+ *
2801
+ * ```
2406
2802
  *
2407
2803
  * @param params - Parameters for request
2408
2804
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2417,6 +2813,68 @@ export declare namespace serviceusage_v1 {
2417
2813
  batchGet(callback: BodyResponseCallback<Schema$BatchGetServicesResponse>): void;
2418
2814
  /**
2419
2815
  * 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.
2816
+ * @example
2817
+ * ```js
2818
+ * // Before running the sample:
2819
+ * // - Enable the API at:
2820
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2821
+ * // - Login into gcloud by running:
2822
+ * // ```sh
2823
+ * // $ gcloud auth application-default login
2824
+ * // ```
2825
+ * // - Install the npm module by running:
2826
+ * // ```sh
2827
+ * // $ npm install googleapis
2828
+ * // ```
2829
+ *
2830
+ * const {google} = require('googleapis');
2831
+ * const serviceusage = google.serviceusage('v1');
2832
+ *
2833
+ * async function main() {
2834
+ * const auth = new google.auth.GoogleAuth({
2835
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2836
+ * scopes: [
2837
+ * 'https://www.googleapis.com/auth/cloud-platform',
2838
+ * 'https://www.googleapis.com/auth/service.management',
2839
+ * ],
2840
+ * });
2841
+ *
2842
+ * // Acquire an auth client, and bind it to all future calls
2843
+ * const authClient = await auth.getClient();
2844
+ * google.options({auth: authClient});
2845
+ *
2846
+ * // Do the magic
2847
+ * const res = await serviceusage.services.disable({
2848
+ * // 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.
2849
+ * name: '[^/]+/[^/]+/services/my-service',
2850
+ *
2851
+ * // Request body metadata
2852
+ * requestBody: {
2853
+ * // request body parameters
2854
+ * // {
2855
+ * // "checkIfServiceHasUsage": "my_checkIfServiceHasUsage",
2856
+ * // "disableDependentServices": false
2857
+ * // }
2858
+ * },
2859
+ * });
2860
+ * console.log(res.data);
2861
+ *
2862
+ * // Example response
2863
+ * // {
2864
+ * // "done": false,
2865
+ * // "error": {},
2866
+ * // "metadata": {},
2867
+ * // "name": "my_name",
2868
+ * // "response": {}
2869
+ * // }
2870
+ * }
2871
+ *
2872
+ * main().catch(e => {
2873
+ * console.error(e);
2874
+ * throw e;
2875
+ * });
2876
+ *
2877
+ * ```
2420
2878
  *
2421
2879
  * @param params - Parameters for request
2422
2880
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2431,6 +2889,65 @@ export declare namespace serviceusage_v1 {
2431
2889
  disable(callback: BodyResponseCallback<Schema$Operation>): void;
2432
2890
  /**
2433
2891
  * Enable a service so that it can be used with a project.
2892
+ * @example
2893
+ * ```js
2894
+ * // Before running the sample:
2895
+ * // - Enable the API at:
2896
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2897
+ * // - Login into gcloud by running:
2898
+ * // ```sh
2899
+ * // $ gcloud auth application-default login
2900
+ * // ```
2901
+ * // - Install the npm module by running:
2902
+ * // ```sh
2903
+ * // $ npm install googleapis
2904
+ * // ```
2905
+ *
2906
+ * const {google} = require('googleapis');
2907
+ * const serviceusage = google.serviceusage('v1');
2908
+ *
2909
+ * async function main() {
2910
+ * const auth = new google.auth.GoogleAuth({
2911
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2912
+ * scopes: [
2913
+ * 'https://www.googleapis.com/auth/cloud-platform',
2914
+ * 'https://www.googleapis.com/auth/service.management',
2915
+ * ],
2916
+ * });
2917
+ *
2918
+ * // Acquire an auth client, and bind it to all future calls
2919
+ * const authClient = await auth.getClient();
2920
+ * google.options({auth: authClient});
2921
+ *
2922
+ * // Do the magic
2923
+ * const res = await serviceusage.services.enable({
2924
+ * // 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.
2925
+ * name: '[^/]+/[^/]+/services/my-service',
2926
+ *
2927
+ * // Request body metadata
2928
+ * requestBody: {
2929
+ * // request body parameters
2930
+ * // {}
2931
+ * },
2932
+ * });
2933
+ * console.log(res.data);
2934
+ *
2935
+ * // Example response
2936
+ * // {
2937
+ * // "done": false,
2938
+ * // "error": {},
2939
+ * // "metadata": {},
2940
+ * // "name": "my_name",
2941
+ * // "response": {}
2942
+ * // }
2943
+ * }
2944
+ *
2945
+ * main().catch(e => {
2946
+ * console.error(e);
2947
+ * throw e;
2948
+ * });
2949
+ *
2950
+ * ```
2434
2951
  *
2435
2952
  * @param params - Parameters for request
2436
2953
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2445,6 +2962,58 @@ export declare namespace serviceusage_v1 {
2445
2962
  enable(callback: BodyResponseCallback<Schema$Operation>): void;
2446
2963
  /**
2447
2964
  * Returns the service configuration and enabled state for a given service.
2965
+ * @example
2966
+ * ```js
2967
+ * // Before running the sample:
2968
+ * // - Enable the API at:
2969
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2970
+ * // - Login into gcloud by running:
2971
+ * // ```sh
2972
+ * // $ gcloud auth application-default login
2973
+ * // ```
2974
+ * // - Install the npm module by running:
2975
+ * // ```sh
2976
+ * // $ npm install googleapis
2977
+ * // ```
2978
+ *
2979
+ * const {google} = require('googleapis');
2980
+ * const serviceusage = google.serviceusage('v1');
2981
+ *
2982
+ * async function main() {
2983
+ * const auth = new google.auth.GoogleAuth({
2984
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2985
+ * scopes: [
2986
+ * 'https://www.googleapis.com/auth/cloud-platform',
2987
+ * 'https://www.googleapis.com/auth/cloud-platform.read-only',
2988
+ * ],
2989
+ * });
2990
+ *
2991
+ * // Acquire an auth client, and bind it to all future calls
2992
+ * const authClient = await auth.getClient();
2993
+ * google.options({auth: authClient});
2994
+ *
2995
+ * // Do the magic
2996
+ * const res = await serviceusage.services.get({
2997
+ * // 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.
2998
+ * name: '[^/]+/[^/]+/services/my-service',
2999
+ * });
3000
+ * console.log(res.data);
3001
+ *
3002
+ * // Example response
3003
+ * // {
3004
+ * // "config": {},
3005
+ * // "name": "my_name",
3006
+ * // "parent": "my_parent",
3007
+ * // "state": "my_state"
3008
+ * // }
3009
+ * }
3010
+ *
3011
+ * main().catch(e => {
3012
+ * console.error(e);
3013
+ * throw e;
3014
+ * });
3015
+ *
3016
+ * ```
2448
3017
  *
2449
3018
  * @param params - Parameters for request
2450
3019
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2459,6 +3028,62 @@ export declare namespace serviceusage_v1 {
2459
3028
  get(callback: BodyResponseCallback<Schema$GoogleApiServiceusageV1Service>): void;
2460
3029
  /**
2461
3030
  * 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.
3031
+ * @example
3032
+ * ```js
3033
+ * // Before running the sample:
3034
+ * // - Enable the API at:
3035
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
3036
+ * // - Login into gcloud by running:
3037
+ * // ```sh
3038
+ * // $ gcloud auth application-default login
3039
+ * // ```
3040
+ * // - Install the npm module by running:
3041
+ * // ```sh
3042
+ * // $ npm install googleapis
3043
+ * // ```
3044
+ *
3045
+ * const {google} = require('googleapis');
3046
+ * const serviceusage = google.serviceusage('v1');
3047
+ *
3048
+ * async function main() {
3049
+ * const auth = new google.auth.GoogleAuth({
3050
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3051
+ * scopes: [
3052
+ * 'https://www.googleapis.com/auth/cloud-platform',
3053
+ * 'https://www.googleapis.com/auth/cloud-platform.read-only',
3054
+ * ],
3055
+ * });
3056
+ *
3057
+ * // Acquire an auth client, and bind it to all future calls
3058
+ * const authClient = await auth.getClient();
3059
+ * google.options({auth: authClient});
3060
+ *
3061
+ * // Do the magic
3062
+ * const res = await serviceusage.services.list({
3063
+ * // Only list services that conform to the given filter. The allowed filter strings are `state:ENABLED` and `state:DISABLED`.
3064
+ * filter: 'placeholder-value',
3065
+ * // Requested size of the next page of data. Requested page size cannot exceed 200. If not set, the default page size is 50.
3066
+ * pageSize: 'placeholder-value',
3067
+ * // Token identifying which result to start with, which is returned by a previous list call.
3068
+ * pageToken: 'placeholder-value',
3069
+ * // Parent to search for services on. An example name would be: `projects/123` where `123` is the project number.
3070
+ * parent: '[^/]+/[^/]+',
3071
+ * });
3072
+ * console.log(res.data);
3073
+ *
3074
+ * // Example response
3075
+ * // {
3076
+ * // "nextPageToken": "my_nextPageToken",
3077
+ * // "services": []
3078
+ * // }
3079
+ * }
3080
+ *
3081
+ * main().catch(e => {
3082
+ * console.error(e);
3083
+ * throw e;
3084
+ * });
3085
+ *
3086
+ * ```
2462
3087
  *
2463
3088
  * @param params - Parameters for request
2464
3089
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.