Skip to content

Commit

Permalink
fix: duplicate resource name (#333)
Browse files Browse the repository at this point in the history
* update baseline

* lint

* readable name

* resonable name

* lint

* comments

* feedback

* special handling =**

* move function to helper

* lint

* one more special use case
  • Loading branch information
xiaozhenliu-gg5 committed Mar 17, 2020
1 parent 6dc67d4 commit 6170ffc
Show file tree
Hide file tree
Showing 11 changed files with 192 additions and 114 deletions.
28 changes: 14 additions & 14 deletions baselines/disable-packing-test/src/v1beta1/echo_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class EchoClient {
userPathTemplate: new this._gaxModule.PathTemplate(
'users/{user_id}'
),
userIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate(
userIdProfileBlurbIdPathTemplate: new this._gaxModule.PathTemplate(
'user/{user_id}/profile/blurbs/{blurb_id}'
),
};
Expand Down Expand Up @@ -893,39 +893,39 @@ export class EchoClient {
}

/**
* Return a fully-qualified userIdBlurbId resource name string.
* Return a fully-qualified userIdProfileBlurbId resource name string.
*
* @param {string} user_id
* @param {string} blurb_id
* @returns {string} Resource name string.
*/
userIdBlurbIdPath(userId:string,blurbId:string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.render({
userIdProfileBlurbIdPath(userId:string,blurbId:string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.render({
user_id: userId,
blurb_id: blurbId,
});
}

/**
* Parse the user_id from UserIdBlurbId resource.
* Parse the user_id from UserIdProfileBlurbId resource.
*
* @param {string} userIdBlurbIdName
* A fully-qualified path representing user_id_blurb_id resource.
* @param {string} userIdProfileBlurbIdName
* A fully-qualified path representing user_id_profile_blurb_id resource.
* @returns {string} A string representing the user_id.
*/
matchUserIdFromUserIdBlurbIdName(userIdBlurbIdName: string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.match(userIdBlurbIdName).user_id;
matchUserIdFromUserIdProfileBlurbIdName(userIdProfileBlurbIdName: string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).user_id;
}

/**
* Parse the blurb_id from UserIdBlurbId resource.
* Parse the blurb_id from UserIdProfileBlurbId resource.
*
* @param {string} userIdBlurbIdName
* A fully-qualified path representing user_id_blurb_id resource.
* @param {string} userIdProfileBlurbIdName
* A fully-qualified path representing user_id_profile_blurb_id resource.
* @returns {string} A string representing the blurb_id.
*/
matchBlurbIdFromUserIdBlurbIdName(userIdBlurbIdName: string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.match(userIdBlurbIdName).blurb_id;
matchBlurbIdFromUserIdProfileBlurbIdName(userIdProfileBlurbIdName: string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).blurb_id;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export class IdentityClient {
userPathTemplate: new this._gaxModule.PathTemplate(
'users/{user_id}'
),
userIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate(
userIdProfileBlurbIdPathTemplate: new this._gaxModule.PathTemplate(
'user/{user_id}/profile/blurbs/{blurb_id}'
),
};
Expand Down Expand Up @@ -838,39 +838,39 @@ export class IdentityClient {
}

/**
* Return a fully-qualified userIdBlurbId resource name string.
* Return a fully-qualified userIdProfileBlurbId resource name string.
*
* @param {string} user_id
* @param {string} blurb_id
* @returns {string} Resource name string.
*/
userIdBlurbIdPath(userId:string,blurbId:string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.render({
userIdProfileBlurbIdPath(userId:string,blurbId:string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.render({
user_id: userId,
blurb_id: blurbId,
});
}

/**
* Parse the user_id from UserIdBlurbId resource.
* Parse the user_id from UserIdProfileBlurbId resource.
*
* @param {string} userIdBlurbIdName
* A fully-qualified path representing user_id_blurb_id resource.
* @param {string} userIdProfileBlurbIdName
* A fully-qualified path representing user_id_profile_blurb_id resource.
* @returns {string} A string representing the user_id.
*/
matchUserIdFromUserIdBlurbIdName(userIdBlurbIdName: string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.match(userIdBlurbIdName).user_id;
matchUserIdFromUserIdProfileBlurbIdName(userIdProfileBlurbIdName: string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).user_id;
}

/**
* Parse the blurb_id from UserIdBlurbId resource.
* Parse the blurb_id from UserIdProfileBlurbId resource.
*
* @param {string} userIdBlurbIdName
* A fully-qualified path representing user_id_blurb_id resource.
* @param {string} userIdProfileBlurbIdName
* A fully-qualified path representing user_id_profile_blurb_id resource.
* @returns {string} A string representing the blurb_id.
*/
matchBlurbIdFromUserIdBlurbIdName(userIdBlurbIdName: string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.match(userIdBlurbIdName).blurb_id;
matchBlurbIdFromUserIdProfileBlurbIdName(userIdProfileBlurbIdName: string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).blurb_id;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class MessagingClient {
userPathTemplate: new this._gaxModule.PathTemplate(
'users/{user_id}'
),
userIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate(
userIdProfileBlurbIdPathTemplate: new this._gaxModule.PathTemplate(
'user/{user_id}/profile/blurbs/{blurb_id}'
),
};
Expand Down Expand Up @@ -1423,39 +1423,39 @@ export class MessagingClient {
}

/**
* Return a fully-qualified userIdBlurbId resource name string.
* Return a fully-qualified userIdProfileBlurbId resource name string.
*
* @param {string} user_id
* @param {string} blurb_id
* @returns {string} Resource name string.
*/
userIdBlurbIdPath(userId:string,blurbId:string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.render({
userIdProfileBlurbIdPath(userId:string,blurbId:string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.render({
user_id: userId,
blurb_id: blurbId,
});
}

/**
* Parse the user_id from UserIdBlurbId resource.
* Parse the user_id from UserIdProfileBlurbId resource.
*
* @param {string} userIdBlurbIdName
* A fully-qualified path representing user_id_blurb_id resource.
* @param {string} userIdProfileBlurbIdName
* A fully-qualified path representing user_id_profile_blurb_id resource.
* @returns {string} A string representing the user_id.
*/
matchUserIdFromUserIdBlurbIdName(userIdBlurbIdName: string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.match(userIdBlurbIdName).user_id;
matchUserIdFromUserIdProfileBlurbIdName(userIdProfileBlurbIdName: string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).user_id;
}

/**
* Parse the blurb_id from UserIdBlurbId resource.
* Parse the blurb_id from UserIdProfileBlurbId resource.
*
* @param {string} userIdBlurbIdName
* A fully-qualified path representing user_id_blurb_id resource.
* @param {string} userIdProfileBlurbIdName
* A fully-qualified path representing user_id_profile_blurb_id resource.
* @returns {string} A string representing the blurb_id.
*/
matchBlurbIdFromUserIdBlurbIdName(userIdBlurbIdName: string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.match(userIdBlurbIdName).blurb_id;
matchBlurbIdFromUserIdProfileBlurbIdName(userIdProfileBlurbIdName: string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).blurb_id;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class TestingClient {
userPathTemplate: new this._gaxModule.PathTemplate(
'users/{user_id}'
),
userIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate(
userIdProfileBlurbIdPathTemplate: new this._gaxModule.PathTemplate(
'user/{user_id}/profile/blurbs/{blurb_id}'
),
};
Expand Down Expand Up @@ -1095,39 +1095,39 @@ export class TestingClient {
}

/**
* Return a fully-qualified userIdBlurbId resource name string.
* Return a fully-qualified userIdProfileBlurbId resource name string.
*
* @param {string} user_id
* @param {string} blurb_id
* @returns {string} Resource name string.
*/
userIdBlurbIdPath(userId:string,blurbId:string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.render({
userIdProfileBlurbIdPath(userId:string,blurbId:string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.render({
user_id: userId,
blurb_id: blurbId,
});
}

/**
* Parse the user_id from UserIdBlurbId resource.
* Parse the user_id from UserIdProfileBlurbId resource.
*
* @param {string} userIdBlurbIdName
* A fully-qualified path representing user_id_blurb_id resource.
* @param {string} userIdProfileBlurbIdName
* A fully-qualified path representing user_id_profile_blurb_id resource.
* @returns {string} A string representing the user_id.
*/
matchUserIdFromUserIdBlurbIdName(userIdBlurbIdName: string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.match(userIdBlurbIdName).user_id;
matchUserIdFromUserIdProfileBlurbIdName(userIdProfileBlurbIdName: string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).user_id;
}

/**
* Parse the blurb_id from UserIdBlurbId resource.
* Parse the blurb_id from UserIdProfileBlurbId resource.
*
* @param {string} userIdBlurbIdName
* A fully-qualified path representing user_id_blurb_id resource.
* @param {string} userIdProfileBlurbIdName
* A fully-qualified path representing user_id_profile_blurb_id resource.
* @returns {string} A string representing the blurb_id.
*/
matchBlurbIdFromUserIdBlurbIdName(userIdBlurbIdName: string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.match(userIdBlurbIdName).blurb_id;
matchBlurbIdFromUserIdProfileBlurbIdName(userIdProfileBlurbIdName: string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).blurb_id;
}

/**
Expand Down
28 changes: 14 additions & 14 deletions baselines/showcase/src/v1beta1/echo_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class EchoClient {
userPathTemplate: new this._gaxModule.PathTemplate(
'users/{user_id}'
),
userIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate(
userIdProfileBlurbIdPathTemplate: new this._gaxModule.PathTemplate(
'user/{user_id}/profile/blurbs/{blurb_id}'
),
};
Expand Down Expand Up @@ -893,39 +893,39 @@ export class EchoClient {
}

/**
* Return a fully-qualified userIdBlurbId resource name string.
* Return a fully-qualified userIdProfileBlurbId resource name string.
*
* @param {string} user_id
* @param {string} blurb_id
* @returns {string} Resource name string.
*/
userIdBlurbIdPath(userId:string,blurbId:string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.render({
userIdProfileBlurbIdPath(userId:string,blurbId:string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.render({
user_id: userId,
blurb_id: blurbId,
});
}

/**
* Parse the user_id from UserIdBlurbId resource.
* Parse the user_id from UserIdProfileBlurbId resource.
*
* @param {string} userIdBlurbIdName
* A fully-qualified path representing user_id_blurb_id resource.
* @param {string} userIdProfileBlurbIdName
* A fully-qualified path representing user_id_profile_blurb_id resource.
* @returns {string} A string representing the user_id.
*/
matchUserIdFromUserIdBlurbIdName(userIdBlurbIdName: string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.match(userIdBlurbIdName).user_id;
matchUserIdFromUserIdProfileBlurbIdName(userIdProfileBlurbIdName: string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).user_id;
}

/**
* Parse the blurb_id from UserIdBlurbId resource.
* Parse the blurb_id from UserIdProfileBlurbId resource.
*
* @param {string} userIdBlurbIdName
* A fully-qualified path representing user_id_blurb_id resource.
* @param {string} userIdProfileBlurbIdName
* A fully-qualified path representing user_id_profile_blurb_id resource.
* @returns {string} A string representing the blurb_id.
*/
matchBlurbIdFromUserIdBlurbIdName(userIdBlurbIdName: string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.match(userIdBlurbIdName).blurb_id;
matchBlurbIdFromUserIdProfileBlurbIdName(userIdProfileBlurbIdName: string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).blurb_id;
}

/**
Expand Down
28 changes: 14 additions & 14 deletions baselines/showcase/src/v1beta1/identity_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export class IdentityClient {
userPathTemplate: new this._gaxModule.PathTemplate(
'users/{user_id}'
),
userIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate(
userIdProfileBlurbIdPathTemplate: new this._gaxModule.PathTemplate(
'user/{user_id}/profile/blurbs/{blurb_id}'
),
};
Expand Down Expand Up @@ -838,39 +838,39 @@ export class IdentityClient {
}

/**
* Return a fully-qualified userIdBlurbId resource name string.
* Return a fully-qualified userIdProfileBlurbId resource name string.
*
* @param {string} user_id
* @param {string} blurb_id
* @returns {string} Resource name string.
*/
userIdBlurbIdPath(userId:string,blurbId:string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.render({
userIdProfileBlurbIdPath(userId:string,blurbId:string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.render({
user_id: userId,
blurb_id: blurbId,
});
}

/**
* Parse the user_id from UserIdBlurbId resource.
* Parse the user_id from UserIdProfileBlurbId resource.
*
* @param {string} userIdBlurbIdName
* A fully-qualified path representing user_id_blurb_id resource.
* @param {string} userIdProfileBlurbIdName
* A fully-qualified path representing user_id_profile_blurb_id resource.
* @returns {string} A string representing the user_id.
*/
matchUserIdFromUserIdBlurbIdName(userIdBlurbIdName: string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.match(userIdBlurbIdName).user_id;
matchUserIdFromUserIdProfileBlurbIdName(userIdProfileBlurbIdName: string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).user_id;
}

/**
* Parse the blurb_id from UserIdBlurbId resource.
* Parse the blurb_id from UserIdProfileBlurbId resource.
*
* @param {string} userIdBlurbIdName
* A fully-qualified path representing user_id_blurb_id resource.
* @param {string} userIdProfileBlurbIdName
* A fully-qualified path representing user_id_profile_blurb_id resource.
* @returns {string} A string representing the blurb_id.
*/
matchBlurbIdFromUserIdBlurbIdName(userIdBlurbIdName: string) {
return this._pathTemplates.userIdBlurbIdPathTemplate.match(userIdBlurbIdName).blurb_id;
matchBlurbIdFromUserIdProfileBlurbIdName(userIdProfileBlurbIdName: string) {
return this._pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).blurb_id;
}

/**
Expand Down
Loading

0 comments on commit 6170ffc

Please sign in to comment.