@googleapis/serviceusage 15.0.2 → 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/build/v1.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosPromise, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
2
+ import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
3
3
  import { Readable } from 'stream';
4
4
  export declare namespace serviceusage_v1 {
5
5
  export interface Options extends GlobalOptions {
@@ -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
  */
@@ -2289,56 +2360,265 @@ export declare namespace serviceusage_v1 {
2289
2360
  constructor(context: APIRequestContext);
2290
2361
  /**
2291
2362
  * 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`.
2363
+ * @example
2364
+ * ```js
2365
+ * // Before running the sample:
2366
+ * // - Enable the API at:
2367
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2368
+ * // - Login into gcloud by running:
2369
+ * // ```sh
2370
+ * // $ gcloud auth application-default login
2371
+ * // ```
2372
+ * // - Install the npm module by running:
2373
+ * // ```sh
2374
+ * // $ npm install googleapis
2375
+ * // ```
2376
+ *
2377
+ * const {google} = require('googleapis');
2378
+ * const serviceusage = google.serviceusage('v1');
2379
+ *
2380
+ * async function main() {
2381
+ * const auth = new google.auth.GoogleAuth({
2382
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2383
+ * scopes: [
2384
+ * 'https://www.googleapis.com/auth/cloud-platform',
2385
+ * 'https://www.googleapis.com/auth/service.management',
2386
+ * ],
2387
+ * });
2388
+ *
2389
+ * // Acquire an auth client, and bind it to all future calls
2390
+ * const authClient = await auth.getClient();
2391
+ * google.options({auth: authClient});
2392
+ *
2393
+ * // Do the magic
2394
+ * const res = await serviceusage.operations.cancel({
2395
+ * // The name of the operation resource to be cancelled.
2396
+ * name: 'operations/.*',
2397
+ *
2398
+ * // Request body metadata
2399
+ * requestBody: {
2400
+ * // request body parameters
2401
+ * // {}
2402
+ * },
2403
+ * });
2404
+ * console.log(res.data);
2405
+ *
2406
+ * // Example response
2407
+ * // {}
2408
+ * }
2409
+ *
2410
+ * main().catch(e => {
2411
+ * console.error(e);
2412
+ * throw e;
2413
+ * });
2414
+ *
2415
+ * ```
2292
2416
  *
2293
2417
  * @param params - Parameters for request
2294
2418
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2295
2419
  * @param callback - Optional callback that handles the response.
2296
2420
  * @returns A promise if used with async/await, or void if used with a callback.
2297
2421
  */
2298
- cancel(params: Params$Resource$Operations$Cancel, options: StreamMethodOptions): GaxiosPromise<Readable>;
2299
- cancel(params?: Params$Resource$Operations$Cancel, options?: MethodOptions): GaxiosPromise<Schema$Empty>;
2422
+ cancel(params: Params$Resource$Operations$Cancel, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
2423
+ cancel(params?: Params$Resource$Operations$Cancel, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
2300
2424
  cancel(params: Params$Resource$Operations$Cancel, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
2301
2425
  cancel(params: Params$Resource$Operations$Cancel, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
2302
2426
  cancel(params: Params$Resource$Operations$Cancel, callback: BodyResponseCallback<Schema$Empty>): void;
2303
2427
  cancel(callback: BodyResponseCallback<Schema$Empty>): void;
2304
2428
  /**
2305
2429
  * 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`.
2430
+ * @example
2431
+ * ```js
2432
+ * // Before running the sample:
2433
+ * // - Enable the API at:
2434
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2435
+ * // - Login into gcloud by running:
2436
+ * // ```sh
2437
+ * // $ gcloud auth application-default login
2438
+ * // ```
2439
+ * // - Install the npm module by running:
2440
+ * // ```sh
2441
+ * // $ npm install googleapis
2442
+ * // ```
2443
+ *
2444
+ * const {google} = require('googleapis');
2445
+ * const serviceusage = google.serviceusage('v1');
2446
+ *
2447
+ * async function main() {
2448
+ * const auth = new google.auth.GoogleAuth({
2449
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2450
+ * scopes: [
2451
+ * 'https://www.googleapis.com/auth/cloud-platform',
2452
+ * 'https://www.googleapis.com/auth/service.management',
2453
+ * ],
2454
+ * });
2455
+ *
2456
+ * // Acquire an auth client, and bind it to all future calls
2457
+ * const authClient = await auth.getClient();
2458
+ * google.options({auth: authClient});
2459
+ *
2460
+ * // Do the magic
2461
+ * const res = await serviceusage.operations.delete({
2462
+ * // The name of the operation resource to be deleted.
2463
+ * name: 'operations/.*',
2464
+ * });
2465
+ * console.log(res.data);
2466
+ *
2467
+ * // Example response
2468
+ * // {}
2469
+ * }
2470
+ *
2471
+ * main().catch(e => {
2472
+ * console.error(e);
2473
+ * throw e;
2474
+ * });
2475
+ *
2476
+ * ```
2306
2477
  *
2307
2478
  * @param params - Parameters for request
2308
2479
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2309
2480
  * @param callback - Optional callback that handles the response.
2310
2481
  * @returns A promise if used with async/await, or void if used with a callback.
2311
2482
  */
2312
- delete(params: Params$Resource$Operations$Delete, options: StreamMethodOptions): GaxiosPromise<Readable>;
2313
- delete(params?: Params$Resource$Operations$Delete, options?: MethodOptions): GaxiosPromise<Schema$Empty>;
2483
+ delete(params: Params$Resource$Operations$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
2484
+ delete(params?: Params$Resource$Operations$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
2314
2485
  delete(params: Params$Resource$Operations$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
2315
2486
  delete(params: Params$Resource$Operations$Delete, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
2316
2487
  delete(params: Params$Resource$Operations$Delete, callback: BodyResponseCallback<Schema$Empty>): void;
2317
2488
  delete(callback: BodyResponseCallback<Schema$Empty>): void;
2318
2489
  /**
2319
2490
  * 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.
2491
+ * @example
2492
+ * ```js
2493
+ * // Before running the sample:
2494
+ * // - Enable the API at:
2495
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2496
+ * // - Login into gcloud by running:
2497
+ * // ```sh
2498
+ * // $ gcloud auth application-default login
2499
+ * // ```
2500
+ * // - Install the npm module by running:
2501
+ * // ```sh
2502
+ * // $ npm install googleapis
2503
+ * // ```
2504
+ *
2505
+ * const {google} = require('googleapis');
2506
+ * const serviceusage = google.serviceusage('v1');
2507
+ *
2508
+ * async function main() {
2509
+ * const auth = new google.auth.GoogleAuth({
2510
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2511
+ * scopes: [
2512
+ * 'https://www.googleapis.com/auth/cloud-platform',
2513
+ * 'https://www.googleapis.com/auth/service.management',
2514
+ * ],
2515
+ * });
2516
+ *
2517
+ * // Acquire an auth client, and bind it to all future calls
2518
+ * const authClient = await auth.getClient();
2519
+ * google.options({auth: authClient});
2520
+ *
2521
+ * // Do the magic
2522
+ * const res = await serviceusage.operations.get({
2523
+ * // The name of the operation resource.
2524
+ * name: 'operations/my-operation',
2525
+ * });
2526
+ * console.log(res.data);
2527
+ *
2528
+ * // Example response
2529
+ * // {
2530
+ * // "done": false,
2531
+ * // "error": {},
2532
+ * // "metadata": {},
2533
+ * // "name": "my_name",
2534
+ * // "response": {}
2535
+ * // }
2536
+ * }
2537
+ *
2538
+ * main().catch(e => {
2539
+ * console.error(e);
2540
+ * throw e;
2541
+ * });
2542
+ *
2543
+ * ```
2320
2544
  *
2321
2545
  * @param params - Parameters for request
2322
2546
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2323
2547
  * @param callback - Optional callback that handles the response.
2324
2548
  * @returns A promise if used with async/await, or void if used with a callback.
2325
2549
  */
2326
- get(params: Params$Resource$Operations$Get, options: StreamMethodOptions): GaxiosPromise<Readable>;
2327
- get(params?: Params$Resource$Operations$Get, options?: MethodOptions): GaxiosPromise<Schema$Operation>;
2550
+ get(params: Params$Resource$Operations$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
2551
+ get(params?: Params$Resource$Operations$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
2328
2552
  get(params: Params$Resource$Operations$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
2329
2553
  get(params: Params$Resource$Operations$Get, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
2330
2554
  get(params: Params$Resource$Operations$Get, callback: BodyResponseCallback<Schema$Operation>): void;
2331
2555
  get(callback: BodyResponseCallback<Schema$Operation>): void;
2332
2556
  /**
2333
2557
  * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
2558
+ * @example
2559
+ * ```js
2560
+ * // Before running the sample:
2561
+ * // - Enable the API at:
2562
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2563
+ * // - Login into gcloud by running:
2564
+ * // ```sh
2565
+ * // $ gcloud auth application-default login
2566
+ * // ```
2567
+ * // - Install the npm module by running:
2568
+ * // ```sh
2569
+ * // $ npm install googleapis
2570
+ * // ```
2571
+ *
2572
+ * const {google} = require('googleapis');
2573
+ * const serviceusage = google.serviceusage('v1');
2574
+ *
2575
+ * async function main() {
2576
+ * const auth = new google.auth.GoogleAuth({
2577
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2578
+ * scopes: [
2579
+ * 'https://www.googleapis.com/auth/cloud-platform',
2580
+ * 'https://www.googleapis.com/auth/service.management',
2581
+ * ],
2582
+ * });
2583
+ *
2584
+ * // Acquire an auth client, and bind it to all future calls
2585
+ * const authClient = await auth.getClient();
2586
+ * google.options({auth: authClient});
2587
+ *
2588
+ * // Do the magic
2589
+ * const res = await serviceusage.operations.list({
2590
+ * // The standard list filter.
2591
+ * filter: 'placeholder-value',
2592
+ * // The name of the operation's parent resource.
2593
+ * name: 'placeholder-value',
2594
+ * // The standard list page size.
2595
+ * pageSize: 'placeholder-value',
2596
+ * // The standard list page token.
2597
+ * pageToken: 'placeholder-value',
2598
+ * });
2599
+ * console.log(res.data);
2600
+ *
2601
+ * // Example response
2602
+ * // {
2603
+ * // "nextPageToken": "my_nextPageToken",
2604
+ * // "operations": []
2605
+ * // }
2606
+ * }
2607
+ *
2608
+ * main().catch(e => {
2609
+ * console.error(e);
2610
+ * throw e;
2611
+ * });
2612
+ *
2613
+ * ```
2334
2614
  *
2335
2615
  * @param params - Parameters for request
2336
2616
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2337
2617
  * @param callback - Optional callback that handles the response.
2338
2618
  * @returns A promise if used with async/await, or void if used with a callback.
2339
2619
  */
2340
- list(params: Params$Resource$Operations$List, options: StreamMethodOptions): GaxiosPromise<Readable>;
2341
- list(params?: Params$Resource$Operations$List, options?: MethodOptions): GaxiosPromise<Schema$ListOperationsResponse>;
2620
+ list(params: Params$Resource$Operations$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
2621
+ list(params?: Params$Resource$Operations$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListOperationsResponse>>;
2342
2622
  list(params: Params$Resource$Operations$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
2343
2623
  list(params: Params$Resource$Operations$List, options: MethodOptions | BodyResponseCallback<Schema$ListOperationsResponse>, callback: BodyResponseCallback<Schema$ListOperationsResponse>): void;
2344
2624
  list(params: Params$Resource$Operations$List, callback: BodyResponseCallback<Schema$ListOperationsResponse>): void;
@@ -2389,84 +2669,425 @@ export declare namespace serviceusage_v1 {
2389
2669
  constructor(context: APIRequestContext);
2390
2670
  /**
2391
2671
  * 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.
2672
+ * @example
2673
+ * ```js
2674
+ * // Before running the sample:
2675
+ * // - Enable the API at:
2676
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2677
+ * // - Login into gcloud by running:
2678
+ * // ```sh
2679
+ * // $ gcloud auth application-default login
2680
+ * // ```
2681
+ * // - Install the npm module by running:
2682
+ * // ```sh
2683
+ * // $ npm install googleapis
2684
+ * // ```
2685
+ *
2686
+ * const {google} = require('googleapis');
2687
+ * const serviceusage = google.serviceusage('v1');
2688
+ *
2689
+ * async function main() {
2690
+ * const auth = new google.auth.GoogleAuth({
2691
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2692
+ * scopes: [
2693
+ * 'https://www.googleapis.com/auth/cloud-platform',
2694
+ * 'https://www.googleapis.com/auth/service.management',
2695
+ * ],
2696
+ * });
2697
+ *
2698
+ * // Acquire an auth client, and bind it to all future calls
2699
+ * const authClient = await auth.getClient();
2700
+ * google.options({auth: authClient});
2701
+ *
2702
+ * // Do the magic
2703
+ * const res = await serviceusage.services.batchEnable({
2704
+ * // 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.
2705
+ * parent: '[^/]+/[^/]+',
2706
+ *
2707
+ * // Request body metadata
2708
+ * requestBody: {
2709
+ * // request body parameters
2710
+ * // {
2711
+ * // "serviceIds": []
2712
+ * // }
2713
+ * },
2714
+ * });
2715
+ * console.log(res.data);
2716
+ *
2717
+ * // Example response
2718
+ * // {
2719
+ * // "done": false,
2720
+ * // "error": {},
2721
+ * // "metadata": {},
2722
+ * // "name": "my_name",
2723
+ * // "response": {}
2724
+ * // }
2725
+ * }
2726
+ *
2727
+ * main().catch(e => {
2728
+ * console.error(e);
2729
+ * throw e;
2730
+ * });
2731
+ *
2732
+ * ```
2392
2733
  *
2393
2734
  * @param params - Parameters for request
2394
2735
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2395
2736
  * @param callback - Optional callback that handles the response.
2396
2737
  * @returns A promise if used with async/await, or void if used with a callback.
2397
2738
  */
2398
- batchEnable(params: Params$Resource$Services$Batchenable, options: StreamMethodOptions): GaxiosPromise<Readable>;
2399
- batchEnable(params?: Params$Resource$Services$Batchenable, options?: MethodOptions): GaxiosPromise<Schema$Operation>;
2739
+ batchEnable(params: Params$Resource$Services$Batchenable, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
2740
+ batchEnable(params?: Params$Resource$Services$Batchenable, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
2400
2741
  batchEnable(params: Params$Resource$Services$Batchenable, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
2401
2742
  batchEnable(params: Params$Resource$Services$Batchenable, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
2402
2743
  batchEnable(params: Params$Resource$Services$Batchenable, callback: BodyResponseCallback<Schema$Operation>): void;
2403
2744
  batchEnable(callback: BodyResponseCallback<Schema$Operation>): void;
2404
2745
  /**
2405
2746
  * Returns the service configurations and enabled states for a given list of services.
2747
+ * @example
2748
+ * ```js
2749
+ * // Before running the sample:
2750
+ * // - Enable the API at:
2751
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2752
+ * // - Login into gcloud by running:
2753
+ * // ```sh
2754
+ * // $ gcloud auth application-default login
2755
+ * // ```
2756
+ * // - Install the npm module by running:
2757
+ * // ```sh
2758
+ * // $ npm install googleapis
2759
+ * // ```
2760
+ *
2761
+ * const {google} = require('googleapis');
2762
+ * const serviceusage = google.serviceusage('v1');
2763
+ *
2764
+ * async function main() {
2765
+ * const auth = new google.auth.GoogleAuth({
2766
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2767
+ * scopes: [
2768
+ * 'https://www.googleapis.com/auth/cloud-platform',
2769
+ * 'https://www.googleapis.com/auth/cloud-platform.read-only',
2770
+ * ],
2771
+ * });
2772
+ *
2773
+ * // Acquire an auth client, and bind it to all future calls
2774
+ * const authClient = await auth.getClient();
2775
+ * google.options({auth: authClient});
2776
+ *
2777
+ * // Do the magic
2778
+ * const res = await serviceusage.services.batchGet({
2779
+ * // 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.
2780
+ * names: 'placeholder-value',
2781
+ * // 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.
2782
+ * parent: '[^/]+/[^/]+',
2783
+ * });
2784
+ * console.log(res.data);
2785
+ *
2786
+ * // Example response
2787
+ * // {
2788
+ * // "services": []
2789
+ * // }
2790
+ * }
2791
+ *
2792
+ * main().catch(e => {
2793
+ * console.error(e);
2794
+ * throw e;
2795
+ * });
2796
+ *
2797
+ * ```
2406
2798
  *
2407
2799
  * @param params - Parameters for request
2408
2800
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2409
2801
  * @param callback - Optional callback that handles the response.
2410
2802
  * @returns A promise if used with async/await, or void if used with a callback.
2411
2803
  */
2412
- batchGet(params: Params$Resource$Services$Batchget, options: StreamMethodOptions): GaxiosPromise<Readable>;
2413
- batchGet(params?: Params$Resource$Services$Batchget, options?: MethodOptions): GaxiosPromise<Schema$BatchGetServicesResponse>;
2804
+ batchGet(params: Params$Resource$Services$Batchget, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
2805
+ batchGet(params?: Params$Resource$Services$Batchget, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$BatchGetServicesResponse>>;
2414
2806
  batchGet(params: Params$Resource$Services$Batchget, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
2415
2807
  batchGet(params: Params$Resource$Services$Batchget, options: MethodOptions | BodyResponseCallback<Schema$BatchGetServicesResponse>, callback: BodyResponseCallback<Schema$BatchGetServicesResponse>): void;
2416
2808
  batchGet(params: Params$Resource$Services$Batchget, callback: BodyResponseCallback<Schema$BatchGetServicesResponse>): void;
2417
2809
  batchGet(callback: BodyResponseCallback<Schema$BatchGetServicesResponse>): void;
2418
2810
  /**
2419
2811
  * 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.
2812
+ * @example
2813
+ * ```js
2814
+ * // Before running the sample:
2815
+ * // - Enable the API at:
2816
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2817
+ * // - Login into gcloud by running:
2818
+ * // ```sh
2819
+ * // $ gcloud auth application-default login
2820
+ * // ```
2821
+ * // - Install the npm module by running:
2822
+ * // ```sh
2823
+ * // $ npm install googleapis
2824
+ * // ```
2825
+ *
2826
+ * const {google} = require('googleapis');
2827
+ * const serviceusage = google.serviceusage('v1');
2828
+ *
2829
+ * async function main() {
2830
+ * const auth = new google.auth.GoogleAuth({
2831
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2832
+ * scopes: [
2833
+ * 'https://www.googleapis.com/auth/cloud-platform',
2834
+ * 'https://www.googleapis.com/auth/service.management',
2835
+ * ],
2836
+ * });
2837
+ *
2838
+ * // Acquire an auth client, and bind it to all future calls
2839
+ * const authClient = await auth.getClient();
2840
+ * google.options({auth: authClient});
2841
+ *
2842
+ * // Do the magic
2843
+ * const res = await serviceusage.services.disable({
2844
+ * // 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.
2845
+ * name: '[^/]+/[^/]+/services/my-service',
2846
+ *
2847
+ * // Request body metadata
2848
+ * requestBody: {
2849
+ * // request body parameters
2850
+ * // {
2851
+ * // "checkIfServiceHasUsage": "my_checkIfServiceHasUsage",
2852
+ * // "disableDependentServices": false
2853
+ * // }
2854
+ * },
2855
+ * });
2856
+ * console.log(res.data);
2857
+ *
2858
+ * // Example response
2859
+ * // {
2860
+ * // "done": false,
2861
+ * // "error": {},
2862
+ * // "metadata": {},
2863
+ * // "name": "my_name",
2864
+ * // "response": {}
2865
+ * // }
2866
+ * }
2867
+ *
2868
+ * main().catch(e => {
2869
+ * console.error(e);
2870
+ * throw e;
2871
+ * });
2872
+ *
2873
+ * ```
2420
2874
  *
2421
2875
  * @param params - Parameters for request
2422
2876
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2423
2877
  * @param callback - Optional callback that handles the response.
2424
2878
  * @returns A promise if used with async/await, or void if used with a callback.
2425
2879
  */
2426
- disable(params: Params$Resource$Services$Disable, options: StreamMethodOptions): GaxiosPromise<Readable>;
2427
- disable(params?: Params$Resource$Services$Disable, options?: MethodOptions): GaxiosPromise<Schema$Operation>;
2880
+ disable(params: Params$Resource$Services$Disable, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
2881
+ disable(params?: Params$Resource$Services$Disable, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
2428
2882
  disable(params: Params$Resource$Services$Disable, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
2429
2883
  disable(params: Params$Resource$Services$Disable, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
2430
2884
  disable(params: Params$Resource$Services$Disable, callback: BodyResponseCallback<Schema$Operation>): void;
2431
2885
  disable(callback: BodyResponseCallback<Schema$Operation>): void;
2432
2886
  /**
2433
2887
  * Enable a service so that it can be used with a project.
2888
+ * @example
2889
+ * ```js
2890
+ * // Before running the sample:
2891
+ * // - Enable the API at:
2892
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2893
+ * // - Login into gcloud by running:
2894
+ * // ```sh
2895
+ * // $ gcloud auth application-default login
2896
+ * // ```
2897
+ * // - Install the npm module by running:
2898
+ * // ```sh
2899
+ * // $ npm install googleapis
2900
+ * // ```
2901
+ *
2902
+ * const {google} = require('googleapis');
2903
+ * const serviceusage = google.serviceusage('v1');
2904
+ *
2905
+ * async function main() {
2906
+ * const auth = new google.auth.GoogleAuth({
2907
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2908
+ * scopes: [
2909
+ * 'https://www.googleapis.com/auth/cloud-platform',
2910
+ * 'https://www.googleapis.com/auth/service.management',
2911
+ * ],
2912
+ * });
2913
+ *
2914
+ * // Acquire an auth client, and bind it to all future calls
2915
+ * const authClient = await auth.getClient();
2916
+ * google.options({auth: authClient});
2917
+ *
2918
+ * // Do the magic
2919
+ * const res = await serviceusage.services.enable({
2920
+ * // 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.
2921
+ * name: '[^/]+/[^/]+/services/my-service',
2922
+ *
2923
+ * // Request body metadata
2924
+ * requestBody: {
2925
+ * // request body parameters
2926
+ * // {}
2927
+ * },
2928
+ * });
2929
+ * console.log(res.data);
2930
+ *
2931
+ * // Example response
2932
+ * // {
2933
+ * // "done": false,
2934
+ * // "error": {},
2935
+ * // "metadata": {},
2936
+ * // "name": "my_name",
2937
+ * // "response": {}
2938
+ * // }
2939
+ * }
2940
+ *
2941
+ * main().catch(e => {
2942
+ * console.error(e);
2943
+ * throw e;
2944
+ * });
2945
+ *
2946
+ * ```
2434
2947
  *
2435
2948
  * @param params - Parameters for request
2436
2949
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2437
2950
  * @param callback - Optional callback that handles the response.
2438
2951
  * @returns A promise if used with async/await, or void if used with a callback.
2439
2952
  */
2440
- enable(params: Params$Resource$Services$Enable, options: StreamMethodOptions): GaxiosPromise<Readable>;
2441
- enable(params?: Params$Resource$Services$Enable, options?: MethodOptions): GaxiosPromise<Schema$Operation>;
2953
+ enable(params: Params$Resource$Services$Enable, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
2954
+ enable(params?: Params$Resource$Services$Enable, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
2442
2955
  enable(params: Params$Resource$Services$Enable, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
2443
2956
  enable(params: Params$Resource$Services$Enable, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
2444
2957
  enable(params: Params$Resource$Services$Enable, callback: BodyResponseCallback<Schema$Operation>): void;
2445
2958
  enable(callback: BodyResponseCallback<Schema$Operation>): void;
2446
2959
  /**
2447
2960
  * Returns the service configuration and enabled state for a given service.
2961
+ * @example
2962
+ * ```js
2963
+ * // Before running the sample:
2964
+ * // - Enable the API at:
2965
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
2966
+ * // - Login into gcloud by running:
2967
+ * // ```sh
2968
+ * // $ gcloud auth application-default login
2969
+ * // ```
2970
+ * // - Install the npm module by running:
2971
+ * // ```sh
2972
+ * // $ npm install googleapis
2973
+ * // ```
2974
+ *
2975
+ * const {google} = require('googleapis');
2976
+ * const serviceusage = google.serviceusage('v1');
2977
+ *
2978
+ * async function main() {
2979
+ * const auth = new google.auth.GoogleAuth({
2980
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2981
+ * scopes: [
2982
+ * 'https://www.googleapis.com/auth/cloud-platform',
2983
+ * 'https://www.googleapis.com/auth/cloud-platform.read-only',
2984
+ * ],
2985
+ * });
2986
+ *
2987
+ * // Acquire an auth client, and bind it to all future calls
2988
+ * const authClient = await auth.getClient();
2989
+ * google.options({auth: authClient});
2990
+ *
2991
+ * // Do the magic
2992
+ * const res = await serviceusage.services.get({
2993
+ * // 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.
2994
+ * name: '[^/]+/[^/]+/services/my-service',
2995
+ * });
2996
+ * console.log(res.data);
2997
+ *
2998
+ * // Example response
2999
+ * // {
3000
+ * // "config": {},
3001
+ * // "name": "my_name",
3002
+ * // "parent": "my_parent",
3003
+ * // "state": "my_state"
3004
+ * // }
3005
+ * }
3006
+ *
3007
+ * main().catch(e => {
3008
+ * console.error(e);
3009
+ * throw e;
3010
+ * });
3011
+ *
3012
+ * ```
2448
3013
  *
2449
3014
  * @param params - Parameters for request
2450
3015
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2451
3016
  * @param callback - Optional callback that handles the response.
2452
3017
  * @returns A promise if used with async/await, or void if used with a callback.
2453
3018
  */
2454
- get(params: Params$Resource$Services$Get, options: StreamMethodOptions): GaxiosPromise<Readable>;
2455
- get(params?: Params$Resource$Services$Get, options?: MethodOptions): GaxiosPromise<Schema$GoogleApiServiceusageV1Service>;
3019
+ get(params: Params$Resource$Services$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
3020
+ get(params?: Params$Resource$Services$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$GoogleApiServiceusageV1Service>>;
2456
3021
  get(params: Params$Resource$Services$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
2457
3022
  get(params: Params$Resource$Services$Get, options: MethodOptions | BodyResponseCallback<Schema$GoogleApiServiceusageV1Service>, callback: BodyResponseCallback<Schema$GoogleApiServiceusageV1Service>): void;
2458
3023
  get(params: Params$Resource$Services$Get, callback: BodyResponseCallback<Schema$GoogleApiServiceusageV1Service>): void;
2459
3024
  get(callback: BodyResponseCallback<Schema$GoogleApiServiceusageV1Service>): void;
2460
3025
  /**
2461
3026
  * 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.
3027
+ * @example
3028
+ * ```js
3029
+ * // Before running the sample:
3030
+ * // - Enable the API at:
3031
+ * // https://console.developers.google.com/apis/api/serviceusage.googleapis.com
3032
+ * // - Login into gcloud by running:
3033
+ * // ```sh
3034
+ * // $ gcloud auth application-default login
3035
+ * // ```
3036
+ * // - Install the npm module by running:
3037
+ * // ```sh
3038
+ * // $ npm install googleapis
3039
+ * // ```
3040
+ *
3041
+ * const {google} = require('googleapis');
3042
+ * const serviceusage = google.serviceusage('v1');
3043
+ *
3044
+ * async function main() {
3045
+ * const auth = new google.auth.GoogleAuth({
3046
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3047
+ * scopes: [
3048
+ * 'https://www.googleapis.com/auth/cloud-platform',
3049
+ * 'https://www.googleapis.com/auth/cloud-platform.read-only',
3050
+ * ],
3051
+ * });
3052
+ *
3053
+ * // Acquire an auth client, and bind it to all future calls
3054
+ * const authClient = await auth.getClient();
3055
+ * google.options({auth: authClient});
3056
+ *
3057
+ * // Do the magic
3058
+ * const res = await serviceusage.services.list({
3059
+ * // Only list services that conform to the given filter. The allowed filter strings are `state:ENABLED` and `state:DISABLED`.
3060
+ * filter: 'placeholder-value',
3061
+ * // Requested size of the next page of data. Requested page size cannot exceed 200. If not set, the default page size is 50.
3062
+ * pageSize: 'placeholder-value',
3063
+ * // Token identifying which result to start with, which is returned by a previous list call.
3064
+ * pageToken: 'placeholder-value',
3065
+ * // Parent to search for services on. An example name would be: `projects/123` where `123` is the project number.
3066
+ * parent: '[^/]+/[^/]+',
3067
+ * });
3068
+ * console.log(res.data);
3069
+ *
3070
+ * // Example response
3071
+ * // {
3072
+ * // "nextPageToken": "my_nextPageToken",
3073
+ * // "services": []
3074
+ * // }
3075
+ * }
3076
+ *
3077
+ * main().catch(e => {
3078
+ * console.error(e);
3079
+ * throw e;
3080
+ * });
3081
+ *
3082
+ * ```
2462
3083
  *
2463
3084
  * @param params - Parameters for request
2464
3085
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2465
3086
  * @param callback - Optional callback that handles the response.
2466
3087
  * @returns A promise if used with async/await, or void if used with a callback.
2467
3088
  */
2468
- list(params: Params$Resource$Services$List, options: StreamMethodOptions): GaxiosPromise<Readable>;
2469
- list(params?: Params$Resource$Services$List, options?: MethodOptions): GaxiosPromise<Schema$ListServicesResponse>;
3089
+ list(params: Params$Resource$Services$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
3090
+ list(params?: Params$Resource$Services$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListServicesResponse>>;
2470
3091
  list(params: Params$Resource$Services$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
2471
3092
  list(params: Params$Resource$Services$List, options: MethodOptions | BodyResponseCallback<Schema$ListServicesResponse>, callback: BodyResponseCallback<Schema$ListServicesResponse>): void;
2472
3093
  list(params: Params$Resource$Services$List, callback: BodyResponseCallback<Schema$ListServicesResponse>): void;