From 18b0ff9c85f9a93de834f696f517e5e3691b4197 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 00:14:28 +0000 Subject: [PATCH] fix: better support for fallback mode (#165) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468790263 Source-Link: https://github.com/googleapis/googleapis/commit/873ab456273d105245df0fb82a6c17a814553b80 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cb6f37aeff2a3472e40a7bbace8c67d75e24bee5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I2ZjM3YWVmZjJhMzQ3MmU0MGE3YmJhY2U4YzY3ZDc1ZTI0YmVlNSJ9 --- .../reservation_service.create_assignment.js | 3 + ...tion_service.create_capacity_commitment.js | 3 + .../reservation_service.create_reservation.js | 3 + .../reservation_service.delete_assignment.js | 3 + ...tion_service.delete_capacity_commitment.js | 3 + .../reservation_service.delete_reservation.js | 3 + .../reservation_service.get_bi_reservation.js | 3 + ...rvation_service.get_capacity_commitment.js | 3 + .../v1/reservation_service.get_reservation.js | 3 + .../reservation_service.list_assignments.js | 3 + ...ation_service.list_capacity_commitments.js | 3 + .../reservation_service.list_reservations.js | 3 + ...tion_service.merge_capacity_commitments.js | 3 + .../v1/reservation_service.move_assignment.js | 3 + ...ervation_service.search_all_assignments.js | 3 + .../reservation_service.search_assignments.js | 3 + ...ation_service.split_capacity_commitment.js | 3 + .../reservation_service.update_assignment.js | 3 + ...servation_service.update_bi_reservation.js | 3 + ...tion_service.update_capacity_commitment.js | 3 + .../reservation_service.update_reservation.js | 3 + ....google.cloud.bigquery.reservation.v1.json | 42 ++--- .../src/v1/reservation_service_client.ts | 24 +-- .../test/gapic_reservation_service_v1.ts | 160 +++++++++--------- 24 files changed, 177 insertions(+), 112 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js index 7bff16973d0..2b732b3dbba 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_CreateAssignment_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js index 80e138385c7..64c0a140024 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js index 9c3e52b1135..c549cf1ff90 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_CreateReservation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js index 8041b70dffd..7cc025dca1f 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js index 4f5f5ef9149..e4cff5a4d7b 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js index 2b5a58ed8d6..abd52b3b07f 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_DeleteReservation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js index 22e54a8fe68..8544ae823cd 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_GetBiReservation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js index e85980e6470..8d06a67bfe0 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js index 0c53c8e83af..e97f8a2ec7d 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_GetReservation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js index 3a4a8e4683a..d90a7238eba 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_ListAssignments_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js index 3244c692013..27757e405ef 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js index da742ed916a..135ca136f1b 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_ListReservations_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js index 79e22d60b40..1f6d5f84696 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js @@ -23,6 +23,9 @@ function main() { // [START bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js index b336287cc25..4955768ebb4 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_MoveAssignment_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js index 7c82ad7420d..64dbdbfb045 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js index a10d6d416ca..6ff7affa339 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_SearchAssignments_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js index 273bce062bb..be3934c919b 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js index bf5b485586d..2eb24b71228 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js @@ -23,6 +23,9 @@ function main() { // [START bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js index f43ccc9c74e..57eef5697cd 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js @@ -23,6 +23,9 @@ function main() { // [START bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js index ae6d3777bae..e14a513cf26 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js @@ -23,6 +23,9 @@ function main() { // [START bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js index 939b67c84f3..292640e8f09 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js @@ -23,6 +23,9 @@ function main() { // [START bigqueryreservation_v1_generated_ReservationService_UpdateReservation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json index f81ff764423..d6a719244a9 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -70,7 +70,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -118,7 +118,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -158,7 +158,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -198,7 +198,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -242,7 +242,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -294,7 +294,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -342,7 +342,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -382,7 +382,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -426,7 +426,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -470,7 +470,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -514,7 +514,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -558,7 +558,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -606,7 +606,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -654,7 +654,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -694,7 +694,7 @@ "segments": [ { "start": 25, - "end": 70, + "end": 73, "type": "FULL" } ], @@ -746,7 +746,7 @@ "segments": [ { "start": 25, - "end": 70, + "end": 73, "type": "FULL" } ], @@ -798,7 +798,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -842,7 +842,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -886,7 +886,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -926,7 +926,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 67cbaf314c9..ed1b80d8cbb 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -28,7 +28,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -320,7 +319,8 @@ export class ReservationServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -2241,7 +2241,7 @@ export class ReservationServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listReservations.createStream( - this.innerApiCalls.listReservations as gax.GaxCall, + this.innerApiCalls.listReservations as GaxCall, request, callSettings ); @@ -2290,7 +2290,7 @@ export class ReservationServiceClient { this.initialize(); return this.descriptors.page.listReservations.asyncIterate( this.innerApiCalls['listReservations'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2437,7 +2437,7 @@ export class ReservationServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listCapacityCommitments.createStream( - this.innerApiCalls.listCapacityCommitments as gax.GaxCall, + this.innerApiCalls.listCapacityCommitments as GaxCall, request, callSettings ); @@ -2486,7 +2486,7 @@ export class ReservationServiceClient { this.initialize(); return this.descriptors.page.listCapacityCommitments.asyncIterate( this.innerApiCalls['listCapacityCommitments'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2659,7 +2659,7 @@ export class ReservationServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssignments.createStream( - this.innerApiCalls.listAssignments as gax.GaxCall, + this.innerApiCalls.listAssignments as GaxCall, request, callSettings ); @@ -2713,7 +2713,7 @@ export class ReservationServiceClient { this.initialize(); return this.descriptors.page.listAssignments.asyncIterate( this.innerApiCalls['listAssignments'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2908,7 +2908,7 @@ export class ReservationServiceClient { 'DeprecationWarning' ); return this.descriptors.page.searchAssignments.createStream( - this.innerApiCalls.searchAssignments as gax.GaxCall, + this.innerApiCalls.searchAssignments as GaxCall, request, callSettings ); @@ -2972,7 +2972,7 @@ export class ReservationServiceClient { ); return this.descriptors.page.searchAssignments.asyncIterate( this.innerApiCalls['searchAssignments'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3152,7 +3152,7 @@ export class ReservationServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllAssignments.createStream( - this.innerApiCalls.searchAllAssignments as gax.GaxCall, + this.innerApiCalls.searchAllAssignments as GaxCall, request, callSettings ); @@ -3210,7 +3210,7 @@ export class ReservationServiceClient { this.initialize(); return this.descriptors.page.searchAllAssignments.asyncIterate( this.innerApiCalls['searchAllAssignments'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts index c4b66a79743..f2ab622b0e5 100644 --- a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts +++ b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts @@ -113,101 +113,103 @@ function stubAsyncIterationCall( } describe('v1.ReservationServiceClient', () => { - it('has servicePath', () => { - const servicePath = - reservationserviceModule.v1.ReservationServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - reservationserviceModule.v1.ReservationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = reservationserviceModule.v1.ReservationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new reservationserviceModule.v1.ReservationServiceClient(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + reservationserviceModule.v1.ReservationServiceClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new reservationserviceModule.v1.ReservationServiceClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + reservationserviceModule.v1.ReservationServiceClient.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new reservationserviceModule.v1.ReservationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = reservationserviceModule.v1.ReservationServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.reservationServiceStub, undefined); - await client.initialize(); - assert(client.reservationServiceStub); - }); - it('has close method for the initialized client', done => { - const client = new reservationserviceModule.v1.ReservationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new reservationserviceModule.v1.ReservationServiceClient(); + assert(client); }); - client.initialize(); - assert(client.reservationServiceStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new reservationserviceModule.v1.ReservationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.reservationServiceStub, undefined); + await client.initialize(); + assert(client.reservationServiceStub); }); - assert.strictEqual(client.reservationServiceStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.reservationServiceStub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new reservationserviceModule.v1.ReservationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.reservationServiceStub, undefined); + client.close().then(() => { + done(); + }); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new reservationserviceModule.v1.ReservationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('createReservation', () => {