Skip to content

Commit

Permalink
fix: better support for fallback mode (#240)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 468790263

Source-Link: googleapis/googleapis@873ab45

Source-Link: googleapis/googleapis-gen@cb6f37a
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I2ZjM3YWVmZjJhMzQ3MmU0MGE3YmJhY2U4YzY3ZDc1ZTI0YmVlNSJ9
  • Loading branch information
gcf-owl-bot[bot] authored Aug 23, 2022
1 parent 7b2b670 commit 0a16b90
Show file tree
Hide file tree
Showing 17 changed files with 218 additions and 178 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
function main(billingAccount) {
// [START cloudbilling_v1_generated_CloudBilling_CreateBillingAccount_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.
*/
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
function main(name) {
// [START cloudbilling_v1_generated_CloudBilling_GetBillingAccount_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.
*/
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
function main(resource) {
// [START cloudbilling_v1_generated_CloudBilling_GetIamPolicy_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.
*/
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
function main(name) {
// [START cloudbilling_v1_generated_CloudBilling_GetProjectBillingInfo_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.
*/
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
function main() {
// [START cloudbilling_v1_generated_CloudBilling_ListBillingAccounts_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.
*/
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
function main(name) {
// [START cloudbilling_v1_generated_CloudBilling_ListProjectBillingInfo_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.
*/
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
function main(resource, policy) {
// [START cloudbilling_v1_generated_CloudBilling_SetIamPolicy_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.
*/
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
function main(resource, permissions) {
// [START cloudbilling_v1_generated_CloudBilling_TestIamPermissions_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.
*/
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
function main(name, account) {
// [START cloudbilling_v1_generated_CloudBilling_UpdateBillingAccount_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.
*/
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
function main(name) {
// [START cloudbilling_v1_generated_CloudBilling_UpdateProjectBillingInfo_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.
*/
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
function main() {
// [START cloudbilling_v1_generated_CloudCatalog_ListServices_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.
*/
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
function main(parent) {
// [START cloudbilling_v1_generated_CloudCatalog_ListSkus_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.
*/
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"segments": [
{
"start": 25,
"end": 51,
"end": 54,
"type": "FULL"
}
],
Expand Down Expand Up @@ -62,7 +62,7 @@
"segments": [
{
"start": 25,
"end": 67,
"end": 70,
"type": "FULL"
}
],
Expand Down Expand Up @@ -110,7 +110,7 @@
"segments": [
{
"start": 25,
"end": 60,
"end": 63,
"type": "FULL"
}
],
Expand Down Expand Up @@ -158,7 +158,7 @@
"segments": [
{
"start": 25,
"end": 53,
"end": 56,
"type": "FULL"
}
],
Expand Down Expand Up @@ -198,7 +198,7 @@
"segments": [
{
"start": 25,
"end": 64,
"end": 67,
"type": "FULL"
}
],
Expand Down Expand Up @@ -246,7 +246,7 @@
"segments": [
{
"start": 25,
"end": 51,
"end": 54,
"type": "FULL"
}
],
Expand Down Expand Up @@ -286,7 +286,7 @@
"segments": [
{
"start": 25,
"end": 56,
"end": 59,
"type": "FULL"
}
],
Expand Down Expand Up @@ -330,7 +330,7 @@
"segments": [
{
"start": 25,
"end": 56,
"end": 59,
"type": "FULL"
}
],
Expand Down Expand Up @@ -374,7 +374,7 @@
"segments": [
{
"start": 25,
"end": 66,
"end": 69,
"type": "FULL"
}
],
Expand Down Expand Up @@ -422,7 +422,7 @@
"segments": [
{
"start": 25,
"end": 59,
"end": 62,
"type": "FULL"
}
],
Expand Down Expand Up @@ -466,7 +466,7 @@
"segments": [
{
"start": 25,
"end": 57,
"end": 60,
"type": "FULL"
}
],
Expand Down Expand Up @@ -510,7 +510,7 @@
"segments": [
{
"start": 25,
"end": 87,
"end": 90,
"type": "FULL"
}
],
Expand Down
12 changes: 6 additions & 6 deletions packages/google-cloud-billing/src/v1/cloud_billing_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
/**
Expand Down Expand Up @@ -270,7 +269,8 @@ export class CloudBillingClient {
const apiCall = this._gaxModule.createApiCall(
callPromise,
this._defaults[methodName],
descriptor
descriptor,
this._opts.fallback
);

this.innerApiCalls[methodName] = apiCall;
Expand Down Expand Up @@ -1284,7 +1284,7 @@ export class CloudBillingClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.listBillingAccounts.createStream(
this.innerApiCalls.listBillingAccounts as gax.GaxCall,
this.innerApiCalls.listBillingAccounts as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -1336,7 +1336,7 @@ export class CloudBillingClient {
this.initialize();
return this.descriptors.page.listBillingAccounts.asyncIterate(
this.innerApiCalls['listBillingAccounts'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.cloud.billing.v1.IBillingAccount>;
}
Expand Down Expand Up @@ -1492,7 +1492,7 @@ export class CloudBillingClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.listProjectBillingInfo.createStream(
this.innerApiCalls.listProjectBillingInfo as gax.GaxCall,
this.innerApiCalls.listProjectBillingInfo as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -1544,7 +1544,7 @@ export class CloudBillingClient {
this.initialize();
return this.descriptors.page.listProjectBillingInfo.asyncIterate(
this.innerApiCalls['listProjectBillingInfo'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.cloud.billing.v1.IProjectBillingInfo>;
}
Expand Down
12 changes: 6 additions & 6 deletions packages/google-cloud-billing/src/v1/cloud_catalog_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
/**
Expand Down Expand Up @@ -258,7 +257,8 @@ export class CloudCatalogClient {
const apiCall = this._gaxModule.createApiCall(
callPromise,
this._defaults[methodName],
descriptor
descriptor,
this._opts.fallback
);

this.innerApiCalls[methodName] = apiCall;
Expand Down Expand Up @@ -444,7 +444,7 @@ export class CloudCatalogClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.listServices.createStream(
this.innerApiCalls.listServices as gax.GaxCall,
this.innerApiCalls.listServices as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -488,7 +488,7 @@ export class CloudCatalogClient {
this.initialize();
return this.descriptors.page.listServices.asyncIterate(
this.innerApiCalls['listServices'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.cloud.billing.v1.IService>;
}
Expand Down Expand Up @@ -663,7 +663,7 @@ export class CloudCatalogClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.listSkus.createStream(
this.innerApiCalls.listSkus as gax.GaxCall,
this.innerApiCalls.listSkus as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -732,7 +732,7 @@ export class CloudCatalogClient {
this.initialize();
return this.descriptors.page.listSkus.asyncIterate(
this.innerApiCalls['listSkus'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.cloud.billing.v1.ISku>;
}
Expand Down
Loading

0 comments on commit 0a16b90

Please sign in to comment.