Skip to content

Commit

Permalink
fix: [cloudquotas] remove unneeded dependency on common Cloud resourc…
Browse files Browse the repository at this point in the history
…es (#6023)

* fix!: remove unneeded dependency on common Cloud resources

BREAKING CHANGE: This is a breaking change for Node, but on a v1beta surface.

PiperOrigin-RevId: 724375483

Source-Link: googleapis/googleapis@54fc426

Source-Link: googleapis/googleapis-gen@e379eb2
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFwaS1jbG91ZHF1b3Rhcy8uT3dsQm90LnlhbWwiLCJoIjoiZTM3OWViMjE1YTBlYmRhOGIxNTMwZjc0Mzk0NWMzNWNiYWViNjU5OCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Feb 14, 2025
1 parent 67f3fe0 commit c525ede
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 170 deletions.
4 changes: 2 additions & 2 deletions packages/google-api-cloudquotas/src/v1/cloud_quotas_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ export class CloudQuotasClient {
}

/**
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* Equivalent to `listQuotaInfos`, but returns a NodeJS Stream object.
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
Expand Down Expand Up @@ -1155,7 +1155,7 @@ export class CloudQuotasClient {
}

/**
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* Equivalent to `listQuotaPreferences`, but returns a NodeJS Stream object.
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
Expand Down
80 changes: 29 additions & 51 deletions packages/google-api-cloudquotas/src/v1beta/cloud_quotas_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ export class CloudQuotasClient {
new this._gaxModule.PathTemplate(
'folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info}'
),
locationPathTemplate: new this._gaxModule.PathTemplate(
'projects/{project}/locations/{location}'
),
organizationLocationQuotaPreferencePathTemplate:
new this._gaxModule.PathTemplate(
'organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference}'
Expand All @@ -224,8 +221,8 @@ export class CloudQuotasClient {
new this._gaxModule.PathTemplate(
'organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info}'
),
projectPathTemplate: new this._gaxModule.PathTemplate(
'projects/{project}'
projectLocationPathTemplate: new this._gaxModule.PathTemplate(
'projects/{project}/locations/{location}'
),
projectLocationQuotaPreferencePathTemplate:
new this._gaxModule.PathTemplate(
Expand Down Expand Up @@ -947,7 +944,7 @@ export class CloudQuotasClient {
}

/**
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* Equivalent to `listQuotaInfos`, but returns a NodeJS Stream object.
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
Expand Down Expand Up @@ -1173,7 +1170,7 @@ export class CloudQuotasClient {
}

/**
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* Equivalent to `listQuotaPreferences`, but returns a NodeJS Stream object.
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
Expand Down Expand Up @@ -1462,42 +1459,6 @@ export class CloudQuotasClient {
).quota_info;
}

/**
* Return a fully-qualified location resource name string.
*
* @param {string} project
* @param {string} location
* @returns {string} Resource name string.
*/
locationPath(project: string, location: string) {
return this.pathTemplates.locationPathTemplate.render({
project: project,
location: location,
});
}

/**
* Parse the project from Location resource.
*
* @param {string} locationName
* A fully-qualified path representing Location resource.
* @returns {string} A string representing the project.
*/
matchProjectFromLocationName(locationName: string) {
return this.pathTemplates.locationPathTemplate.match(locationName).project;
}

/**
* Parse the location from Location resource.
*
* @param {string} locationName
* A fully-qualified path representing Location resource.
* @returns {string} A string representing the location.
*/
matchLocationFromLocationName(locationName: string) {
return this.pathTemplates.locationPathTemplate.match(locationName).location;
}

/**
* Return a fully-qualified organizationLocationQuotaPreference resource name string.
*
Expand Down Expand Up @@ -1651,26 +1612,43 @@ export class CloudQuotasClient {
}

/**
* Return a fully-qualified project resource name string.
* Return a fully-qualified projectLocation resource name string.
*
* @param {string} project
* @param {string} location
* @returns {string} Resource name string.
*/
projectPath(project: string) {
return this.pathTemplates.projectPathTemplate.render({
projectLocationPath(project: string, location: string) {
return this.pathTemplates.projectLocationPathTemplate.render({
project: project,
location: location,
});
}

/**
* Parse the project from Project resource.
* Parse the project from ProjectLocation resource.
*
* @param {string} projectName
* A fully-qualified path representing Project resource.
* @param {string} projectLocationName
* A fully-qualified path representing project_location resource.
* @returns {string} A string representing the project.
*/
matchProjectFromProjectName(projectName: string) {
return this.pathTemplates.projectPathTemplate.match(projectName).project;
matchProjectFromProjectLocationName(projectLocationName: string) {
return this.pathTemplates.projectLocationPathTemplate.match(
projectLocationName
).project;
}

/**
* Parse the location from ProjectLocation resource.
*
* @param {string} projectLocationName
* A fully-qualified path representing project_location resource.
* @returns {string} A string representing the location.
*/
matchLocationFromProjectLocationName(projectLocationName: string) {
return this.pathTemplates.projectLocationPathTemplate.match(
projectLocationName
).location;
}

/**
Expand Down
52 changes: 26 additions & 26 deletions packages/google-api-cloudquotas/test/gapic_cloud_quotas_v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ describe('v1.CloudQuotasClient', () => {
['name']
);
request.name = defaultValue1;
const expectedHeaderRequestParams = `name=${defaultValue1}`;
const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`;
const expectedResponse = generateSampleMessage(
new protos.google.api.cloudquotas.v1.QuotaInfo()
);
Expand Down Expand Up @@ -349,7 +349,7 @@ describe('v1.CloudQuotasClient', () => {
['name']
);
request.name = defaultValue1;
const expectedHeaderRequestParams = `name=${defaultValue1}`;
const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`;
const expectedResponse = generateSampleMessage(
new protos.google.api.cloudquotas.v1.QuotaInfo()
);
Expand Down Expand Up @@ -396,7 +396,7 @@ describe('v1.CloudQuotasClient', () => {
['name']
);
request.name = defaultValue1;
const expectedHeaderRequestParams = `name=${defaultValue1}`;
const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`;
const expectedError = new Error('expected');
client.innerApiCalls.getQuotaInfo = stubSimpleCall(
undefined,
Expand Down Expand Up @@ -448,7 +448,7 @@ describe('v1.CloudQuotasClient', () => {
['name']
);
request.name = defaultValue1;
const expectedHeaderRequestParams = `name=${defaultValue1}`;
const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`;
const expectedResponse = generateSampleMessage(
new protos.google.api.cloudquotas.v1.QuotaPreference()
);
Expand Down Expand Up @@ -480,7 +480,7 @@ describe('v1.CloudQuotasClient', () => {
['name']
);
request.name = defaultValue1;
const expectedHeaderRequestParams = `name=${defaultValue1}`;
const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`;
const expectedResponse = generateSampleMessage(
new protos.google.api.cloudquotas.v1.QuotaPreference()
);
Expand Down Expand Up @@ -527,7 +527,7 @@ describe('v1.CloudQuotasClient', () => {
['name']
);
request.name = defaultValue1;
const expectedHeaderRequestParams = `name=${defaultValue1}`;
const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`;
const expectedError = new Error('expected');
client.innerApiCalls.getQuotaPreference = stubSimpleCall(
undefined,
Expand Down Expand Up @@ -579,7 +579,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedResponse = generateSampleMessage(
new protos.google.api.cloudquotas.v1.QuotaPreference()
);
Expand Down Expand Up @@ -611,7 +611,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedResponse = generateSampleMessage(
new protos.google.api.cloudquotas.v1.QuotaPreference()
);
Expand Down Expand Up @@ -658,7 +658,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedError = new Error('expected');
client.innerApiCalls.createQuotaPreference = stubSimpleCall(
undefined,
Expand Down Expand Up @@ -717,7 +717,7 @@ describe('v1.CloudQuotasClient', () => {
['quotaPreference', 'name']
);
request.quotaPreference.name = defaultValue1;
const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1}`;
const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1 ?? ''}`;
const expectedResponse = generateSampleMessage(
new protos.google.api.cloudquotas.v1.QuotaPreference()
);
Expand Down Expand Up @@ -750,7 +750,7 @@ describe('v1.CloudQuotasClient', () => {
['quotaPreference', 'name']
);
request.quotaPreference.name = defaultValue1;
const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1}`;
const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1 ?? ''}`;
const expectedResponse = generateSampleMessage(
new protos.google.api.cloudquotas.v1.QuotaPreference()
);
Expand Down Expand Up @@ -798,7 +798,7 @@ describe('v1.CloudQuotasClient', () => {
['quotaPreference', 'name']
);
request.quotaPreference.name = defaultValue1;
const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1}`;
const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1 ?? ''}`;
const expectedError = new Error('expected');
client.innerApiCalls.updateQuotaPreference = stubSimpleCall(
undefined,
Expand Down Expand Up @@ -857,7 +857,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedResponse = [
generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()),
generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()),
Expand Down Expand Up @@ -890,7 +890,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedResponse = [
generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()),
generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()),
Expand Down Expand Up @@ -939,7 +939,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedError = new Error('expected');
client.innerApiCalls.listQuotaInfos = stubSimpleCall(
undefined,
Expand Down Expand Up @@ -970,7 +970,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedResponse = [
generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()),
generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()),
Expand Down Expand Up @@ -1024,7 +1024,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedError = new Error('expected');
client.descriptors.page.listQuotaInfos.createStream =
stubPageStreamingCall(undefined, expectedError);
Expand Down Expand Up @@ -1073,7 +1073,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedResponse = [
generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()),
generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()),
Expand Down Expand Up @@ -1116,7 +1116,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedError = new Error('expected');
client.descriptors.page.listQuotaInfos.asyncIterate =
stubAsyncIterationCall(undefined, expectedError);
Expand Down Expand Up @@ -1158,7 +1158,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedResponse = [
generateSampleMessage(
new protos.google.api.cloudquotas.v1.QuotaPreference()
Expand Down Expand Up @@ -1198,7 +1198,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedResponse = [
generateSampleMessage(
new protos.google.api.cloudquotas.v1.QuotaPreference()
Expand Down Expand Up @@ -1253,7 +1253,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedError = new Error('expected');
client.innerApiCalls.listQuotaPreferences = stubSimpleCall(
undefined,
Expand Down Expand Up @@ -1284,7 +1284,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedResponse = [
generateSampleMessage(
new protos.google.api.cloudquotas.v1.QuotaPreference()
Expand Down Expand Up @@ -1345,7 +1345,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedError = new Error('expected');
client.descriptors.page.listQuotaPreferences.createStream =
stubPageStreamingCall(undefined, expectedError);
Expand Down Expand Up @@ -1395,7 +1395,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedResponse = [
generateSampleMessage(
new protos.google.api.cloudquotas.v1.QuotaPreference()
Expand Down Expand Up @@ -1444,7 +1444,7 @@ describe('v1.CloudQuotasClient', () => {
['parent']
);
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`;
const expectedError = new Error('expected');
client.descriptors.page.listQuotaPreferences.asyncIterate =
stubAsyncIterationCall(undefined, expectedError);
Expand Down
Loading

0 comments on commit c525ede

Please sign in to comment.