diff --git a/baselines/asset/package.json b/baselines/asset/package.json index 52bc18a15..34b8ade76 100644 --- a/baselines/asset/package.json +++ b/baselines/asset/package.json @@ -24,7 +24,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.3.1" + "google-gax": "^2.4.0" }, "devDependencies": { "@types/mocha": "^7.0.2", diff --git a/baselines/bigquery-storage/package.json b/baselines/bigquery-storage/package.json index ce2e49b0f..c2e6f47d6 100644 --- a/baselines/bigquery-storage/package.json +++ b/baselines/bigquery-storage/package.json @@ -24,7 +24,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.3.1" + "google-gax": "^2.4.0" }, "devDependencies": { "@types/mocha": "^7.0.2", diff --git a/baselines/disable-packing-test/package.json b/baselines/disable-packing-test/package.json index c58d0eb97..864ed7a2f 100644 --- a/baselines/disable-packing-test/package.json +++ b/baselines/disable-packing-test/package.json @@ -24,7 +24,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.3.1" + "google-gax": "^2.4.0" }, "devDependencies": { "@types/mocha": "^7.0.2", diff --git a/baselines/disable-packing-test/protos/google/showcase/v1beta1/identity.proto.baseline b/baselines/disable-packing-test/protos/google/showcase/v1beta1/identity.proto.baseline index a723a0f1f..a05d18c4b 100644 --- a/baselines/disable-packing-test/protos/google/showcase/v1beta1/identity.proto.baseline +++ b/baselines/disable-packing-test/protos/google/showcase/v1beta1/identity.proto.baseline @@ -41,6 +41,7 @@ service Identity { body: "*" }; option (google.api.method_signature) = "user.display_name,user.email"; + option (google.api.method_signature) = "user.display_name,user.email,user.age,user.nickname,user.enable_notifications,user.height_feet"; } // Retrieves the User with the given uri. @@ -100,6 +101,25 @@ message User { google.protobuf.Timestamp update_time = 5 [ (google.api.field_behavior) = OUTPUT_ONLY ]; + + // Typescript generator doe not support proto3 optional fields + // The age of the use in years. + // optional int32 age = 6; + + // The height of the user in feet. + // optional double height_feet = 7; + + // The nickname of the user. + // + // (-- aip.dev/not-precedent: An empty string is a valid nickname. + // Ordinarily, proto3_optional should not be used on a `string` field. --) + // optional string nickname = 8; + + // Enables the receiving of notifications. The default is true if unset. + // + // (-- aip.dev/not-precedent: The default for the feature is true. + // Ordinarily, the default for a `bool` field should be false. --) + // optional bool enable_notifications = 9; } // The request message for the google.showcase.v1beta1.Identity\CreateUser diff --git a/baselines/disable-packing-test/protos/google/showcase/v1beta1/messaging.proto.baseline b/baselines/disable-packing-test/protos/google/showcase/v1beta1/messaging.proto.baseline index b94275f16..fb3bf51c5 100644 --- a/baselines/disable-packing-test/protos/google/showcase/v1beta1/messaging.proto.baseline +++ b/baselines/disable-packing-test/protos/google/showcase/v1beta1/messaging.proto.baseline @@ -289,7 +289,10 @@ message Blurb { option (google.api.resource) = { type: "showcase.googleapis.com/Blurb" pattern: "rooms/{room_id}/blurbs/{blurb_id}" + pattern: "rooms/{room_id}/blurbs/legacy/{legacy_room_id}.{blurb_id}" pattern: "user/{user_id}/profile/blurbs/{blurb_id}" + pattern: "user/{user_id}/profile/blurbs/legacy/{legacy_user_id}~{blurb_id}" + }; // The resource name of the chat room. @@ -317,6 +320,18 @@ message Blurb { google.protobuf.Timestamp update_time = 6 [ (google.api.field_behavior) = OUTPUT_ONLY ]; + + // (-- aip.dev/not-precedent: This is designed for testing non-slash + // resource patterns. Ordinarily, non-slash separators are discouraged. --) + oneof legacy_id { + // The legacy id of the room. This field is used to signal + // the use of the compound resource pattern `rooms/{room_id}/blurbs/{legacy_room_id}.{blurb_id}` + string legacy_room_id = 7; + + // The legacy id of the user. This field is used to signal + // the use of the compound resource pattern `rooms/{room_id}/blurbs/{legacy_user_id}~{blurb_id}` + string legacy_user_id = 8; + } } // The request message for the google.showcase.v1beta1.Messaging\CreateBlurb diff --git a/baselines/disable-packing-test/src/v1beta1/echo_client.ts.baseline b/baselines/disable-packing-test/src/v1beta1/echo_client.ts.baseline index f14ab41f9..b8cb84abb 100644 --- a/baselines/disable-packing-test/src/v1beta1/echo_client.ts.baseline +++ b/baselines/disable-packing-test/src/v1beta1/echo_client.ts.baseline @@ -153,6 +153,9 @@ export class EchoClient { roomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'rooms/{room_id}/blurbs/{blurb_id}' ), + roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'rooms/{room_id}/blurbs/legacy/{legacy_room_id}.{blurb_id}' + ), sessionPathTemplate: new this._gaxModule.PathTemplate( 'sessions/{session}' ), @@ -165,6 +168,9 @@ export class EchoClient { userIdProfileBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'user/{user_id}/profile/blurbs/{blurb_id}' ), + userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'user/{user_id}/profile/blurbs/legacy/{legacy_user_id}~{blurb_id}' + ), }; // Some of the methods on this service return "paged" results, @@ -893,6 +899,55 @@ export class EchoClient { return this.pathTemplates.roomIdBlurbIdPathTemplate.match(roomIdBlurbIdName).blurb_id; } + /** + * Return a fully-qualified roomIdBlurbsLegacyRoomIdBlurbId resource name string. + * + * @param {string} room_id + * @param {string} legacy_room_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + roomIdBlurbsLegacyRoomIdBlurbIdPath(roomId:string,legacyRoomId:string,blurbId:string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render({ + room_id: roomId, + legacy_room_id: legacyRoomId, + blurb_id: blurbId, + }); + } + + /** + * Parse the room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the room_id. + */ + matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).room_id; + } + + /** + * Parse the legacy_room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the legacy_room_id. + */ + matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).legacy_room_id; + } + + /** + * Parse the blurb_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).blurb_id; + } + /** * Return a fully-qualified session resource name string. * @@ -1011,6 +1066,55 @@ export class EchoClient { return this.pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).blurb_id; } + /** + * Return a fully-qualified userIdProfileBlurbsLegacyUserIdBlurbId resource name string. + * + * @param {string} user_id + * @param {string} legacy_user_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + userIdProfileBlurbsLegacyUserIdBlurbIdPath(userId:string,legacyUserId:string,blurbId:string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render({ + user_id: userId, + legacy_user_id: legacyUserId, + blurb_id: blurbId, + }); + } + + /** + * Parse the user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the user_id. + */ + matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).user_id; + } + + /** + * Parse the legacy_user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the legacy_user_id. + */ + matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).legacy_user_id; + } + + /** + * Parse the blurb_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).blurb_id; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/baselines/disable-packing-test/src/v1beta1/identity_client.ts.baseline b/baselines/disable-packing-test/src/v1beta1/identity_client.ts.baseline index 3f8e22f3f..23919b984 100644 --- a/baselines/disable-packing-test/src/v1beta1/identity_client.ts.baseline +++ b/baselines/disable-packing-test/src/v1beta1/identity_client.ts.baseline @@ -148,6 +148,9 @@ export class IdentityClient { roomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'rooms/{room_id}/blurbs/{blurb_id}' ), + roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'rooms/{room_id}/blurbs/legacy/{legacy_room_id}.{blurb_id}' + ), sessionPathTemplate: new this._gaxModule.PathTemplate( 'sessions/{session}' ), @@ -160,6 +163,9 @@ export class IdentityClient { userIdProfileBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'user/{user_id}/profile/blurbs/{blurb_id}' ), + userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'user/{user_id}/profile/blurbs/legacy/{legacy_user_id}~{blurb_id}' + ), }; // Some of the methods on this service return "paged" results, @@ -820,6 +826,55 @@ export class IdentityClient { return this.pathTemplates.roomIdBlurbIdPathTemplate.match(roomIdBlurbIdName).blurb_id; } + /** + * Return a fully-qualified roomIdBlurbsLegacyRoomIdBlurbId resource name string. + * + * @param {string} room_id + * @param {string} legacy_room_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + roomIdBlurbsLegacyRoomIdBlurbIdPath(roomId:string,legacyRoomId:string,blurbId:string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render({ + room_id: roomId, + legacy_room_id: legacyRoomId, + blurb_id: blurbId, + }); + } + + /** + * Parse the room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the room_id. + */ + matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).room_id; + } + + /** + * Parse the legacy_room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the legacy_room_id. + */ + matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).legacy_room_id; + } + + /** + * Parse the blurb_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).blurb_id; + } + /** * Return a fully-qualified session resource name string. * @@ -938,6 +993,55 @@ export class IdentityClient { return this.pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).blurb_id; } + /** + * Return a fully-qualified userIdProfileBlurbsLegacyUserIdBlurbId resource name string. + * + * @param {string} user_id + * @param {string} legacy_user_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + userIdProfileBlurbsLegacyUserIdBlurbIdPath(userId:string,legacyUserId:string,blurbId:string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render({ + user_id: userId, + legacy_user_id: legacyUserId, + blurb_id: blurbId, + }); + } + + /** + * Parse the user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the user_id. + */ + matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).user_id; + } + + /** + * Parse the legacy_user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the legacy_user_id. + */ + matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).legacy_user_id; + } + + /** + * Parse the blurb_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).blurb_id; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/baselines/disable-packing-test/src/v1beta1/messaging_client.ts.baseline b/baselines/disable-packing-test/src/v1beta1/messaging_client.ts.baseline index 63ad50167..356de86d4 100644 --- a/baselines/disable-packing-test/src/v1beta1/messaging_client.ts.baseline +++ b/baselines/disable-packing-test/src/v1beta1/messaging_client.ts.baseline @@ -152,6 +152,9 @@ export class MessagingClient { roomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'rooms/{room_id}/blurbs/{blurb_id}' ), + roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'rooms/{room_id}/blurbs/legacy/{legacy_room_id}.{blurb_id}' + ), sessionPathTemplate: new this._gaxModule.PathTemplate( 'sessions/{session}' ), @@ -164,6 +167,9 @@ export class MessagingClient { userIdProfileBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'user/{user_id}/profile/blurbs/{blurb_id}' ), + userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'user/{user_id}/profile/blurbs/legacy/{legacy_user_id}~{blurb_id}' + ), }; // Some of the methods on this service return "paged" results, @@ -1517,6 +1523,55 @@ export class MessagingClient { return this.pathTemplates.roomIdBlurbIdPathTemplate.match(roomIdBlurbIdName).blurb_id; } + /** + * Return a fully-qualified roomIdBlurbsLegacyRoomIdBlurbId resource name string. + * + * @param {string} room_id + * @param {string} legacy_room_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + roomIdBlurbsLegacyRoomIdBlurbIdPath(roomId:string,legacyRoomId:string,blurbId:string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render({ + room_id: roomId, + legacy_room_id: legacyRoomId, + blurb_id: blurbId, + }); + } + + /** + * Parse the room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the room_id. + */ + matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).room_id; + } + + /** + * Parse the legacy_room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the legacy_room_id. + */ + matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).legacy_room_id; + } + + /** + * Parse the blurb_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).blurb_id; + } + /** * Return a fully-qualified session resource name string. * @@ -1635,6 +1690,55 @@ export class MessagingClient { return this.pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).blurb_id; } + /** + * Return a fully-qualified userIdProfileBlurbsLegacyUserIdBlurbId resource name string. + * + * @param {string} user_id + * @param {string} legacy_user_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + userIdProfileBlurbsLegacyUserIdBlurbIdPath(userId:string,legacyUserId:string,blurbId:string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render({ + user_id: userId, + legacy_user_id: legacyUserId, + blurb_id: blurbId, + }); + } + + /** + * Parse the user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the user_id. + */ + matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).user_id; + } + + /** + * Parse the legacy_user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the legacy_user_id. + */ + matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).legacy_user_id; + } + + /** + * Parse the blurb_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).blurb_id; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/baselines/disable-packing-test/src/v1beta1/testing_client.ts.baseline b/baselines/disable-packing-test/src/v1beta1/testing_client.ts.baseline index b487bbb65..d5061ae7b 100644 --- a/baselines/disable-packing-test/src/v1beta1/testing_client.ts.baseline +++ b/baselines/disable-packing-test/src/v1beta1/testing_client.ts.baseline @@ -149,6 +149,9 @@ export class TestingClient { roomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'rooms/{room_id}/blurbs/{blurb_id}' ), + roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'rooms/{room_id}/blurbs/legacy/{legacy_room_id}.{blurb_id}' + ), sessionPathTemplate: new this._gaxModule.PathTemplate( 'sessions/{session}' ), @@ -161,6 +164,9 @@ export class TestingClient { userIdProfileBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'user/{user_id}/profile/blurbs/{blurb_id}' ), + userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'user/{user_id}/profile/blurbs/legacy/{legacy_user_id}~{blurb_id}' + ), }; // Some of the methods on this service return "paged" results, @@ -1135,6 +1141,55 @@ export class TestingClient { return this.pathTemplates.roomIdBlurbIdPathTemplate.match(roomIdBlurbIdName).blurb_id; } + /** + * Return a fully-qualified roomIdBlurbsLegacyRoomIdBlurbId resource name string. + * + * @param {string} room_id + * @param {string} legacy_room_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + roomIdBlurbsLegacyRoomIdBlurbIdPath(roomId:string,legacyRoomId:string,blurbId:string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render({ + room_id: roomId, + legacy_room_id: legacyRoomId, + blurb_id: blurbId, + }); + } + + /** + * Parse the room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the room_id. + */ + matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).room_id; + } + + /** + * Parse the legacy_room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the legacy_room_id. + */ + matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).legacy_room_id; + } + + /** + * Parse the blurb_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).blurb_id; + } + /** * Return a fully-qualified session resource name string. * @@ -1253,6 +1308,55 @@ export class TestingClient { return this.pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).blurb_id; } + /** + * Return a fully-qualified userIdProfileBlurbsLegacyUserIdBlurbId resource name string. + * + * @param {string} user_id + * @param {string} legacy_user_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + userIdProfileBlurbsLegacyUserIdBlurbIdPath(userId:string,legacyUserId:string,blurbId:string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render({ + user_id: userId, + legacy_user_id: legacyUserId, + blurb_id: blurbId, + }); + } + + /** + * Parse the user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the user_id. + */ + matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).user_id; + } + + /** + * Parse the legacy_user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the legacy_user_id. + */ + matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).legacy_user_id; + } + + /** + * Parse the blurb_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).blurb_id; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/baselines/disable-packing-test/test/gapic_echo_v1beta1.ts.baseline b/baselines/disable-packing-test/test/gapic_echo_v1beta1.ts.baseline index 57bf26b3f..d8001209c 100644 --- a/baselines/disable-packing-test/test/gapic_echo_v1beta1.ts.baseline +++ b/baselines/disable-packing-test/test/gapic_echo_v1beta1.ts.baseline @@ -897,6 +897,52 @@ describe('v1beta1.EchoClient', () => { }); }); + describe('roomIdBlurbsLegacyRoomIdBlurbId', () => { + const fakePath = "/rendered/path/roomIdBlurbsLegacyRoomIdBlurbId"; + const expectedParameters = { + room_id: "roomIdValue", + legacy_room_id: "legacyRoomIdValue", + blurb_id: "blurbIdValue", + }; + const client = new echoModule.v1beta1.EchoClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('roomIdBlurbsLegacyRoomIdBlurbIdPath', () => { + const result = client.roomIdBlurbsLegacyRoomIdBlurbIdPath("roomIdValue", "legacyRoomIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "roomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyRoomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('session', () => { const fakePath = "/rendered/path/session"; const expectedParameters = { @@ -1032,5 +1078,51 @@ describe('v1beta1.EchoClient', () => { .getCall(-1).calledWith(fakePath)); }); }); + + describe('userIdProfileBlurbsLegacyUserIdBlurbId', () => { + const fakePath = "/rendered/path/userIdProfileBlurbsLegacyUserIdBlurbId"; + const expectedParameters = { + user_id: "userIdValue", + legacy_user_id: "legacyUserIdValue", + blurb_id: "blurbIdValue", + }; + const client = new echoModule.v1beta1.EchoClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userIdProfileBlurbsLegacyUserIdBlurbIdPath', () => { + const result = client.userIdProfileBlurbsLegacyUserIdBlurbIdPath("userIdValue", "legacyUserIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "userIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyUserIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); }); diff --git a/baselines/disable-packing-test/test/gapic_identity_v1beta1.ts.baseline b/baselines/disable-packing-test/test/gapic_identity_v1beta1.ts.baseline index 03465e87f..3830937f7 100644 --- a/baselines/disable-packing-test/test/gapic_identity_v1beta1.ts.baseline +++ b/baselines/disable-packing-test/test/gapic_identity_v1beta1.ts.baseline @@ -766,6 +766,52 @@ describe('v1beta1.IdentityClient', () => { }); }); + describe('roomIdBlurbsLegacyRoomIdBlurbId', () => { + const fakePath = "/rendered/path/roomIdBlurbsLegacyRoomIdBlurbId"; + const expectedParameters = { + room_id: "roomIdValue", + legacy_room_id: "legacyRoomIdValue", + blurb_id: "blurbIdValue", + }; + const client = new identityModule.v1beta1.IdentityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('roomIdBlurbsLegacyRoomIdBlurbIdPath', () => { + const result = client.roomIdBlurbsLegacyRoomIdBlurbIdPath("roomIdValue", "legacyRoomIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "roomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyRoomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('session', () => { const fakePath = "/rendered/path/session"; const expectedParameters = { @@ -901,5 +947,51 @@ describe('v1beta1.IdentityClient', () => { .getCall(-1).calledWith(fakePath)); }); }); + + describe('userIdProfileBlurbsLegacyUserIdBlurbId', () => { + const fakePath = "/rendered/path/userIdProfileBlurbsLegacyUserIdBlurbId"; + const expectedParameters = { + user_id: "userIdValue", + legacy_user_id: "legacyUserIdValue", + blurb_id: "blurbIdValue", + }; + const client = new identityModule.v1beta1.IdentityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userIdProfileBlurbsLegacyUserIdBlurbIdPath', () => { + const result = client.userIdProfileBlurbsLegacyUserIdBlurbIdPath("userIdValue", "legacyUserIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "userIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyUserIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); }); diff --git a/baselines/disable-packing-test/test/gapic_messaging_v1beta1.ts.baseline b/baselines/disable-packing-test/test/gapic_messaging_v1beta1.ts.baseline index 818088085..6262e061b 100644 --- a/baselines/disable-packing-test/test/gapic_messaging_v1beta1.ts.baseline +++ b/baselines/disable-packing-test/test/gapic_messaging_v1beta1.ts.baseline @@ -1701,6 +1701,52 @@ describe('v1beta1.MessagingClient', () => { }); }); + describe('roomIdBlurbsLegacyRoomIdBlurbId', () => { + const fakePath = "/rendered/path/roomIdBlurbsLegacyRoomIdBlurbId"; + const expectedParameters = { + room_id: "roomIdValue", + legacy_room_id: "legacyRoomIdValue", + blurb_id: "blurbIdValue", + }; + const client = new messagingModule.v1beta1.MessagingClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('roomIdBlurbsLegacyRoomIdBlurbIdPath', () => { + const result = client.roomIdBlurbsLegacyRoomIdBlurbIdPath("roomIdValue", "legacyRoomIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "roomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyRoomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('session', () => { const fakePath = "/rendered/path/session"; const expectedParameters = { @@ -1836,5 +1882,51 @@ describe('v1beta1.MessagingClient', () => { .getCall(-1).calledWith(fakePath)); }); }); + + describe('userIdProfileBlurbsLegacyUserIdBlurbId', () => { + const fakePath = "/rendered/path/userIdProfileBlurbsLegacyUserIdBlurbId"; + const expectedParameters = { + user_id: "userIdValue", + legacy_user_id: "legacyUserIdValue", + blurb_id: "blurbIdValue", + }; + const client = new messagingModule.v1beta1.MessagingClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userIdProfileBlurbsLegacyUserIdBlurbIdPath', () => { + const result = client.userIdProfileBlurbsLegacyUserIdBlurbIdPath("userIdValue", "legacyUserIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "userIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyUserIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); }); diff --git a/baselines/disable-packing-test/test/gapic_testing_v1beta1.ts.baseline b/baselines/disable-packing-test/test/gapic_testing_v1beta1.ts.baseline index a0469bc47..198cb8507 100644 --- a/baselines/disable-packing-test/test/gapic_testing_v1beta1.ts.baseline +++ b/baselines/disable-packing-test/test/gapic_testing_v1beta1.ts.baseline @@ -1153,6 +1153,52 @@ describe('v1beta1.TestingClient', () => { }); }); + describe('roomIdBlurbsLegacyRoomIdBlurbId', () => { + const fakePath = "/rendered/path/roomIdBlurbsLegacyRoomIdBlurbId"; + const expectedParameters = { + room_id: "roomIdValue", + legacy_room_id: "legacyRoomIdValue", + blurb_id: "blurbIdValue", + }; + const client = new testingModule.v1beta1.TestingClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('roomIdBlurbsLegacyRoomIdBlurbIdPath', () => { + const result = client.roomIdBlurbsLegacyRoomIdBlurbIdPath("roomIdValue", "legacyRoomIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "roomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyRoomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('session', () => { const fakePath = "/rendered/path/session"; const expectedParameters = { @@ -1288,5 +1334,51 @@ describe('v1beta1.TestingClient', () => { .getCall(-1).calledWith(fakePath)); }); }); + + describe('userIdProfileBlurbsLegacyUserIdBlurbId', () => { + const fakePath = "/rendered/path/userIdProfileBlurbsLegacyUserIdBlurbId"; + const expectedParameters = { + user_id: "userIdValue", + legacy_user_id: "legacyUserIdValue", + blurb_id: "blurbIdValue", + }; + const client = new testingModule.v1beta1.TestingClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userIdProfileBlurbsLegacyUserIdBlurbIdPath', () => { + const result = client.userIdProfileBlurbsLegacyUserIdBlurbIdPath("userIdValue", "legacyUserIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "userIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyUserIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); }); diff --git a/baselines/dlp/package.json b/baselines/dlp/package.json index 0789b4af5..6154213a9 100644 --- a/baselines/dlp/package.json +++ b/baselines/dlp/package.json @@ -24,7 +24,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.3.1" + "google-gax": "^2.4.0" }, "devDependencies": { "@types/mocha": "^7.0.2", diff --git a/baselines/kms/package.json b/baselines/kms/package.json index 2a907af2b..aecd7ca16 100644 --- a/baselines/kms/package.json +++ b/baselines/kms/package.json @@ -24,7 +24,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.3.1" + "google-gax": "^2.4.0" }, "devDependencies": { "@types/mocha": "^7.0.2", diff --git a/baselines/logging/package.json b/baselines/logging/package.json index cf132bbaf..0c4f1de57 100644 --- a/baselines/logging/package.json +++ b/baselines/logging/package.json @@ -24,7 +24,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.3.1" + "google-gax": "^2.4.0" }, "devDependencies": { "@types/mocha": "^7.0.2", diff --git a/baselines/monitoring/package.json b/baselines/monitoring/package.json index c2c6f9cbf..5cd10a23b 100644 --- a/baselines/monitoring/package.json +++ b/baselines/monitoring/package.json @@ -24,7 +24,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.3.1" + "google-gax": "^2.4.0" }, "devDependencies": { "@types/mocha": "^7.0.2", diff --git a/baselines/redis/package.json b/baselines/redis/package.json index c519c5cdf..0743a4d89 100644 --- a/baselines/redis/package.json +++ b/baselines/redis/package.json @@ -24,7 +24,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.3.1" + "google-gax": "^2.4.0" }, "devDependencies": { "@types/mocha": "^7.0.2", diff --git a/baselines/showcase/package.json b/baselines/showcase/package.json index c58d0eb97..864ed7a2f 100644 --- a/baselines/showcase/package.json +++ b/baselines/showcase/package.json @@ -24,7 +24,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.3.1" + "google-gax": "^2.4.0" }, "devDependencies": { "@types/mocha": "^7.0.2", diff --git a/baselines/showcase/protos/google/showcase/v1beta1/identity.proto.baseline b/baselines/showcase/protos/google/showcase/v1beta1/identity.proto.baseline index a723a0f1f..a05d18c4b 100644 --- a/baselines/showcase/protos/google/showcase/v1beta1/identity.proto.baseline +++ b/baselines/showcase/protos/google/showcase/v1beta1/identity.proto.baseline @@ -41,6 +41,7 @@ service Identity { body: "*" }; option (google.api.method_signature) = "user.display_name,user.email"; + option (google.api.method_signature) = "user.display_name,user.email,user.age,user.nickname,user.enable_notifications,user.height_feet"; } // Retrieves the User with the given uri. @@ -100,6 +101,25 @@ message User { google.protobuf.Timestamp update_time = 5 [ (google.api.field_behavior) = OUTPUT_ONLY ]; + + // Typescript generator doe not support proto3 optional fields + // The age of the use in years. + // optional int32 age = 6; + + // The height of the user in feet. + // optional double height_feet = 7; + + // The nickname of the user. + // + // (-- aip.dev/not-precedent: An empty string is a valid nickname. + // Ordinarily, proto3_optional should not be used on a `string` field. --) + // optional string nickname = 8; + + // Enables the receiving of notifications. The default is true if unset. + // + // (-- aip.dev/not-precedent: The default for the feature is true. + // Ordinarily, the default for a `bool` field should be false. --) + // optional bool enable_notifications = 9; } // The request message for the google.showcase.v1beta1.Identity\CreateUser diff --git a/baselines/showcase/protos/google/showcase/v1beta1/messaging.proto.baseline b/baselines/showcase/protos/google/showcase/v1beta1/messaging.proto.baseline index b94275f16..fb3bf51c5 100644 --- a/baselines/showcase/protos/google/showcase/v1beta1/messaging.proto.baseline +++ b/baselines/showcase/protos/google/showcase/v1beta1/messaging.proto.baseline @@ -289,7 +289,10 @@ message Blurb { option (google.api.resource) = { type: "showcase.googleapis.com/Blurb" pattern: "rooms/{room_id}/blurbs/{blurb_id}" + pattern: "rooms/{room_id}/blurbs/legacy/{legacy_room_id}.{blurb_id}" pattern: "user/{user_id}/profile/blurbs/{blurb_id}" + pattern: "user/{user_id}/profile/blurbs/legacy/{legacy_user_id}~{blurb_id}" + }; // The resource name of the chat room. @@ -317,6 +320,18 @@ message Blurb { google.protobuf.Timestamp update_time = 6 [ (google.api.field_behavior) = OUTPUT_ONLY ]; + + // (-- aip.dev/not-precedent: This is designed for testing non-slash + // resource patterns. Ordinarily, non-slash separators are discouraged. --) + oneof legacy_id { + // The legacy id of the room. This field is used to signal + // the use of the compound resource pattern `rooms/{room_id}/blurbs/{legacy_room_id}.{blurb_id}` + string legacy_room_id = 7; + + // The legacy id of the user. This field is used to signal + // the use of the compound resource pattern `rooms/{room_id}/blurbs/{legacy_user_id}~{blurb_id}` + string legacy_user_id = 8; + } } // The request message for the google.showcase.v1beta1.Messaging\CreateBlurb diff --git a/baselines/showcase/src/v1beta1/echo_client.ts.baseline b/baselines/showcase/src/v1beta1/echo_client.ts.baseline index f14ab41f9..b8cb84abb 100644 --- a/baselines/showcase/src/v1beta1/echo_client.ts.baseline +++ b/baselines/showcase/src/v1beta1/echo_client.ts.baseline @@ -153,6 +153,9 @@ export class EchoClient { roomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'rooms/{room_id}/blurbs/{blurb_id}' ), + roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'rooms/{room_id}/blurbs/legacy/{legacy_room_id}.{blurb_id}' + ), sessionPathTemplate: new this._gaxModule.PathTemplate( 'sessions/{session}' ), @@ -165,6 +168,9 @@ export class EchoClient { userIdProfileBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'user/{user_id}/profile/blurbs/{blurb_id}' ), + userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'user/{user_id}/profile/blurbs/legacy/{legacy_user_id}~{blurb_id}' + ), }; // Some of the methods on this service return "paged" results, @@ -893,6 +899,55 @@ export class EchoClient { return this.pathTemplates.roomIdBlurbIdPathTemplate.match(roomIdBlurbIdName).blurb_id; } + /** + * Return a fully-qualified roomIdBlurbsLegacyRoomIdBlurbId resource name string. + * + * @param {string} room_id + * @param {string} legacy_room_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + roomIdBlurbsLegacyRoomIdBlurbIdPath(roomId:string,legacyRoomId:string,blurbId:string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render({ + room_id: roomId, + legacy_room_id: legacyRoomId, + blurb_id: blurbId, + }); + } + + /** + * Parse the room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the room_id. + */ + matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).room_id; + } + + /** + * Parse the legacy_room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the legacy_room_id. + */ + matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).legacy_room_id; + } + + /** + * Parse the blurb_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).blurb_id; + } + /** * Return a fully-qualified session resource name string. * @@ -1011,6 +1066,55 @@ export class EchoClient { return this.pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).blurb_id; } + /** + * Return a fully-qualified userIdProfileBlurbsLegacyUserIdBlurbId resource name string. + * + * @param {string} user_id + * @param {string} legacy_user_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + userIdProfileBlurbsLegacyUserIdBlurbIdPath(userId:string,legacyUserId:string,blurbId:string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render({ + user_id: userId, + legacy_user_id: legacyUserId, + blurb_id: blurbId, + }); + } + + /** + * Parse the user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the user_id. + */ + matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).user_id; + } + + /** + * Parse the legacy_user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the legacy_user_id. + */ + matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).legacy_user_id; + } + + /** + * Parse the blurb_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).blurb_id; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/baselines/showcase/src/v1beta1/identity_client.ts.baseline b/baselines/showcase/src/v1beta1/identity_client.ts.baseline index 3f8e22f3f..23919b984 100644 --- a/baselines/showcase/src/v1beta1/identity_client.ts.baseline +++ b/baselines/showcase/src/v1beta1/identity_client.ts.baseline @@ -148,6 +148,9 @@ export class IdentityClient { roomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'rooms/{room_id}/blurbs/{blurb_id}' ), + roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'rooms/{room_id}/blurbs/legacy/{legacy_room_id}.{blurb_id}' + ), sessionPathTemplate: new this._gaxModule.PathTemplate( 'sessions/{session}' ), @@ -160,6 +163,9 @@ export class IdentityClient { userIdProfileBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'user/{user_id}/profile/blurbs/{blurb_id}' ), + userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'user/{user_id}/profile/blurbs/legacy/{legacy_user_id}~{blurb_id}' + ), }; // Some of the methods on this service return "paged" results, @@ -820,6 +826,55 @@ export class IdentityClient { return this.pathTemplates.roomIdBlurbIdPathTemplate.match(roomIdBlurbIdName).blurb_id; } + /** + * Return a fully-qualified roomIdBlurbsLegacyRoomIdBlurbId resource name string. + * + * @param {string} room_id + * @param {string} legacy_room_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + roomIdBlurbsLegacyRoomIdBlurbIdPath(roomId:string,legacyRoomId:string,blurbId:string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render({ + room_id: roomId, + legacy_room_id: legacyRoomId, + blurb_id: blurbId, + }); + } + + /** + * Parse the room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the room_id. + */ + matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).room_id; + } + + /** + * Parse the legacy_room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the legacy_room_id. + */ + matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).legacy_room_id; + } + + /** + * Parse the blurb_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).blurb_id; + } + /** * Return a fully-qualified session resource name string. * @@ -938,6 +993,55 @@ export class IdentityClient { return this.pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).blurb_id; } + /** + * Return a fully-qualified userIdProfileBlurbsLegacyUserIdBlurbId resource name string. + * + * @param {string} user_id + * @param {string} legacy_user_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + userIdProfileBlurbsLegacyUserIdBlurbIdPath(userId:string,legacyUserId:string,blurbId:string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render({ + user_id: userId, + legacy_user_id: legacyUserId, + blurb_id: blurbId, + }); + } + + /** + * Parse the user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the user_id. + */ + matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).user_id; + } + + /** + * Parse the legacy_user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the legacy_user_id. + */ + matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).legacy_user_id; + } + + /** + * Parse the blurb_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).blurb_id; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/baselines/showcase/src/v1beta1/messaging_client.ts.baseline b/baselines/showcase/src/v1beta1/messaging_client.ts.baseline index 63ad50167..356de86d4 100644 --- a/baselines/showcase/src/v1beta1/messaging_client.ts.baseline +++ b/baselines/showcase/src/v1beta1/messaging_client.ts.baseline @@ -152,6 +152,9 @@ export class MessagingClient { roomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'rooms/{room_id}/blurbs/{blurb_id}' ), + roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'rooms/{room_id}/blurbs/legacy/{legacy_room_id}.{blurb_id}' + ), sessionPathTemplate: new this._gaxModule.PathTemplate( 'sessions/{session}' ), @@ -164,6 +167,9 @@ export class MessagingClient { userIdProfileBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'user/{user_id}/profile/blurbs/{blurb_id}' ), + userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'user/{user_id}/profile/blurbs/legacy/{legacy_user_id}~{blurb_id}' + ), }; // Some of the methods on this service return "paged" results, @@ -1517,6 +1523,55 @@ export class MessagingClient { return this.pathTemplates.roomIdBlurbIdPathTemplate.match(roomIdBlurbIdName).blurb_id; } + /** + * Return a fully-qualified roomIdBlurbsLegacyRoomIdBlurbId resource name string. + * + * @param {string} room_id + * @param {string} legacy_room_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + roomIdBlurbsLegacyRoomIdBlurbIdPath(roomId:string,legacyRoomId:string,blurbId:string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render({ + room_id: roomId, + legacy_room_id: legacyRoomId, + blurb_id: blurbId, + }); + } + + /** + * Parse the room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the room_id. + */ + matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).room_id; + } + + /** + * Parse the legacy_room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the legacy_room_id. + */ + matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).legacy_room_id; + } + + /** + * Parse the blurb_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).blurb_id; + } + /** * Return a fully-qualified session resource name string. * @@ -1635,6 +1690,55 @@ export class MessagingClient { return this.pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).blurb_id; } + /** + * Return a fully-qualified userIdProfileBlurbsLegacyUserIdBlurbId resource name string. + * + * @param {string} user_id + * @param {string} legacy_user_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + userIdProfileBlurbsLegacyUserIdBlurbIdPath(userId:string,legacyUserId:string,blurbId:string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render({ + user_id: userId, + legacy_user_id: legacyUserId, + blurb_id: blurbId, + }); + } + + /** + * Parse the user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the user_id. + */ + matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).user_id; + } + + /** + * Parse the legacy_user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the legacy_user_id. + */ + matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).legacy_user_id; + } + + /** + * Parse the blurb_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).blurb_id; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/baselines/showcase/src/v1beta1/testing_client.ts.baseline b/baselines/showcase/src/v1beta1/testing_client.ts.baseline index b487bbb65..d5061ae7b 100644 --- a/baselines/showcase/src/v1beta1/testing_client.ts.baseline +++ b/baselines/showcase/src/v1beta1/testing_client.ts.baseline @@ -149,6 +149,9 @@ export class TestingClient { roomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'rooms/{room_id}/blurbs/{blurb_id}' ), + roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'rooms/{room_id}/blurbs/legacy/{legacy_room_id}.{blurb_id}' + ), sessionPathTemplate: new this._gaxModule.PathTemplate( 'sessions/{session}' ), @@ -161,6 +164,9 @@ export class TestingClient { userIdProfileBlurbIdPathTemplate: new this._gaxModule.PathTemplate( 'user/{user_id}/profile/blurbs/{blurb_id}' ), + userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate: new this._gaxModule.PathTemplate( + 'user/{user_id}/profile/blurbs/legacy/{legacy_user_id}~{blurb_id}' + ), }; // Some of the methods on this service return "paged" results, @@ -1135,6 +1141,55 @@ export class TestingClient { return this.pathTemplates.roomIdBlurbIdPathTemplate.match(roomIdBlurbIdName).blurb_id; } + /** + * Return a fully-qualified roomIdBlurbsLegacyRoomIdBlurbId resource name string. + * + * @param {string} room_id + * @param {string} legacy_room_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + roomIdBlurbsLegacyRoomIdBlurbIdPath(roomId:string,legacyRoomId:string,blurbId:string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render({ + room_id: roomId, + legacy_room_id: legacyRoomId, + blurb_id: blurbId, + }); + } + + /** + * Parse the room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the room_id. + */ + matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).room_id; + } + + /** + * Parse the legacy_room_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the legacy_room_id. + */ + matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).legacy_room_id; + } + + /** + * Parse the blurb_id from RoomIdBlurbsLegacyRoomIdBlurbId resource. + * + * @param {string} roomIdBlurbsLegacyRoomIdBlurbIdName + * A fully-qualified path representing room_id_blurbs_legacy_room_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(roomIdBlurbsLegacyRoomIdBlurbIdName: string) { + return this.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match(roomIdBlurbsLegacyRoomIdBlurbIdName).blurb_id; + } + /** * Return a fully-qualified session resource name string. * @@ -1253,6 +1308,55 @@ export class TestingClient { return this.pathTemplates.userIdProfileBlurbIdPathTemplate.match(userIdProfileBlurbIdName).blurb_id; } + /** + * Return a fully-qualified userIdProfileBlurbsLegacyUserIdBlurbId resource name string. + * + * @param {string} user_id + * @param {string} legacy_user_id + * @param {string} blurb_id + * @returns {string} Resource name string. + */ + userIdProfileBlurbsLegacyUserIdBlurbIdPath(userId:string,legacyUserId:string,blurbId:string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render({ + user_id: userId, + legacy_user_id: legacyUserId, + blurb_id: blurbId, + }); + } + + /** + * Parse the user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the user_id. + */ + matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).user_id; + } + + /** + * Parse the legacy_user_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the legacy_user_id. + */ + matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).legacy_user_id; + } + + /** + * Parse the blurb_id from UserIdProfileBlurbsLegacyUserIdBlurbId resource. + * + * @param {string} userIdProfileBlurbsLegacyUserIdBlurbIdName + * A fully-qualified path representing user_id_profile_blurbs_legacy_user_id_blurb_id resource. + * @returns {string} A string representing the blurb_id. + */ + matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(userIdProfileBlurbsLegacyUserIdBlurbIdName: string) { + return this.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match(userIdProfileBlurbsLegacyUserIdBlurbIdName).blurb_id; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/baselines/showcase/test/gapic_echo_v1beta1.ts.baseline b/baselines/showcase/test/gapic_echo_v1beta1.ts.baseline index 57bf26b3f..d8001209c 100644 --- a/baselines/showcase/test/gapic_echo_v1beta1.ts.baseline +++ b/baselines/showcase/test/gapic_echo_v1beta1.ts.baseline @@ -897,6 +897,52 @@ describe('v1beta1.EchoClient', () => { }); }); + describe('roomIdBlurbsLegacyRoomIdBlurbId', () => { + const fakePath = "/rendered/path/roomIdBlurbsLegacyRoomIdBlurbId"; + const expectedParameters = { + room_id: "roomIdValue", + legacy_room_id: "legacyRoomIdValue", + blurb_id: "blurbIdValue", + }; + const client = new echoModule.v1beta1.EchoClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('roomIdBlurbsLegacyRoomIdBlurbIdPath', () => { + const result = client.roomIdBlurbsLegacyRoomIdBlurbIdPath("roomIdValue", "legacyRoomIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "roomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyRoomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('session', () => { const fakePath = "/rendered/path/session"; const expectedParameters = { @@ -1032,5 +1078,51 @@ describe('v1beta1.EchoClient', () => { .getCall(-1).calledWith(fakePath)); }); }); + + describe('userIdProfileBlurbsLegacyUserIdBlurbId', () => { + const fakePath = "/rendered/path/userIdProfileBlurbsLegacyUserIdBlurbId"; + const expectedParameters = { + user_id: "userIdValue", + legacy_user_id: "legacyUserIdValue", + blurb_id: "blurbIdValue", + }; + const client = new echoModule.v1beta1.EchoClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userIdProfileBlurbsLegacyUserIdBlurbIdPath', () => { + const result = client.userIdProfileBlurbsLegacyUserIdBlurbIdPath("userIdValue", "legacyUserIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "userIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyUserIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); }); diff --git a/baselines/showcase/test/gapic_identity_v1beta1.ts.baseline b/baselines/showcase/test/gapic_identity_v1beta1.ts.baseline index 03465e87f..3830937f7 100644 --- a/baselines/showcase/test/gapic_identity_v1beta1.ts.baseline +++ b/baselines/showcase/test/gapic_identity_v1beta1.ts.baseline @@ -766,6 +766,52 @@ describe('v1beta1.IdentityClient', () => { }); }); + describe('roomIdBlurbsLegacyRoomIdBlurbId', () => { + const fakePath = "/rendered/path/roomIdBlurbsLegacyRoomIdBlurbId"; + const expectedParameters = { + room_id: "roomIdValue", + legacy_room_id: "legacyRoomIdValue", + blurb_id: "blurbIdValue", + }; + const client = new identityModule.v1beta1.IdentityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('roomIdBlurbsLegacyRoomIdBlurbIdPath', () => { + const result = client.roomIdBlurbsLegacyRoomIdBlurbIdPath("roomIdValue", "legacyRoomIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "roomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyRoomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('session', () => { const fakePath = "/rendered/path/session"; const expectedParameters = { @@ -901,5 +947,51 @@ describe('v1beta1.IdentityClient', () => { .getCall(-1).calledWith(fakePath)); }); }); + + describe('userIdProfileBlurbsLegacyUserIdBlurbId', () => { + const fakePath = "/rendered/path/userIdProfileBlurbsLegacyUserIdBlurbId"; + const expectedParameters = { + user_id: "userIdValue", + legacy_user_id: "legacyUserIdValue", + blurb_id: "blurbIdValue", + }; + const client = new identityModule.v1beta1.IdentityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userIdProfileBlurbsLegacyUserIdBlurbIdPath', () => { + const result = client.userIdProfileBlurbsLegacyUserIdBlurbIdPath("userIdValue", "legacyUserIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "userIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyUserIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); }); diff --git a/baselines/showcase/test/gapic_messaging_v1beta1.ts.baseline b/baselines/showcase/test/gapic_messaging_v1beta1.ts.baseline index 818088085..6262e061b 100644 --- a/baselines/showcase/test/gapic_messaging_v1beta1.ts.baseline +++ b/baselines/showcase/test/gapic_messaging_v1beta1.ts.baseline @@ -1701,6 +1701,52 @@ describe('v1beta1.MessagingClient', () => { }); }); + describe('roomIdBlurbsLegacyRoomIdBlurbId', () => { + const fakePath = "/rendered/path/roomIdBlurbsLegacyRoomIdBlurbId"; + const expectedParameters = { + room_id: "roomIdValue", + legacy_room_id: "legacyRoomIdValue", + blurb_id: "blurbIdValue", + }; + const client = new messagingModule.v1beta1.MessagingClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('roomIdBlurbsLegacyRoomIdBlurbIdPath', () => { + const result = client.roomIdBlurbsLegacyRoomIdBlurbIdPath("roomIdValue", "legacyRoomIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "roomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyRoomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('session', () => { const fakePath = "/rendered/path/session"; const expectedParameters = { @@ -1836,5 +1882,51 @@ describe('v1beta1.MessagingClient', () => { .getCall(-1).calledWith(fakePath)); }); }); + + describe('userIdProfileBlurbsLegacyUserIdBlurbId', () => { + const fakePath = "/rendered/path/userIdProfileBlurbsLegacyUserIdBlurbId"; + const expectedParameters = { + user_id: "userIdValue", + legacy_user_id: "legacyUserIdValue", + blurb_id: "blurbIdValue", + }; + const client = new messagingModule.v1beta1.MessagingClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userIdProfileBlurbsLegacyUserIdBlurbIdPath', () => { + const result = client.userIdProfileBlurbsLegacyUserIdBlurbIdPath("userIdValue", "legacyUserIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "userIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyUserIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); }); diff --git a/baselines/showcase/test/gapic_testing_v1beta1.ts.baseline b/baselines/showcase/test/gapic_testing_v1beta1.ts.baseline index a0469bc47..198cb8507 100644 --- a/baselines/showcase/test/gapic_testing_v1beta1.ts.baseline +++ b/baselines/showcase/test/gapic_testing_v1beta1.ts.baseline @@ -1153,6 +1153,52 @@ describe('v1beta1.TestingClient', () => { }); }); + describe('roomIdBlurbsLegacyRoomIdBlurbId', () => { + const fakePath = "/rendered/path/roomIdBlurbsLegacyRoomIdBlurbId"; + const expectedParameters = { + room_id: "roomIdValue", + legacy_room_id: "legacyRoomIdValue", + blurb_id: "blurbIdValue", + }; + const client = new testingModule.v1beta1.TestingClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('roomIdBlurbsLegacyRoomIdBlurbIdPath', () => { + const result = client.roomIdBlurbsLegacyRoomIdBlurbIdPath("roomIdValue", "legacyRoomIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "roomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchLegacyRoomIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyRoomIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName', () => { + const result = client.matchBlurbIdFromRoomIdBlurbsLegacyRoomIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.roomIdBlurbsLegacyRoomIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('session', () => { const fakePath = "/rendered/path/session"; const expectedParameters = { @@ -1288,5 +1334,51 @@ describe('v1beta1.TestingClient', () => { .getCall(-1).calledWith(fakePath)); }); }); + + describe('userIdProfileBlurbsLegacyUserIdBlurbId', () => { + const fakePath = "/rendered/path/userIdProfileBlurbsLegacyUserIdBlurbId"; + const expectedParameters = { + user_id: "userIdValue", + legacy_user_id: "legacyUserIdValue", + blurb_id: "blurbIdValue", + }; + const client = new testingModule.v1beta1.TestingClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userIdProfileBlurbsLegacyUserIdBlurbIdPath', () => { + const result = client.userIdProfileBlurbsLegacyUserIdBlurbIdPath("userIdValue", "legacyUserIdValue", "blurbIdValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "userIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchLegacyUserIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "legacyUserIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName', () => { + const result = client.matchBlurbIdFromUserIdProfileBlurbsLegacyUserIdBlurbIdName(fakePath); + assert.strictEqual(result, "blurbIdValue"); + assert((client.pathTemplates.userIdProfileBlurbsLegacyUserIdBlurbIdPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); }); diff --git a/baselines/tasks/package.json b/baselines/tasks/package.json index c7356193f..6292822e9 100644 --- a/baselines/tasks/package.json +++ b/baselines/tasks/package.json @@ -24,7 +24,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.3.1" + "google-gax": "^2.4.0" }, "devDependencies": { "@types/mocha": "^7.0.2", diff --git a/baselines/texttospeech/package.json b/baselines/texttospeech/package.json index 92ec24e94..cb8239407 100644 --- a/baselines/texttospeech/package.json +++ b/baselines/texttospeech/package.json @@ -24,7 +24,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.3.1" + "google-gax": "^2.4.0" }, "devDependencies": { "@types/mocha": "^7.0.2", diff --git a/baselines/translate/package.json b/baselines/translate/package.json index a7d12d2f1..8460b02f1 100644 --- a/baselines/translate/package.json +++ b/baselines/translate/package.json @@ -24,7 +24,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.3.1" + "google-gax": "^2.4.0" }, "devDependencies": { "@types/mocha": "^7.0.2", diff --git a/baselines/videointelligence/package.json b/baselines/videointelligence/package.json index bf68ad045..8b30d878f 100644 --- a/baselines/videointelligence/package.json +++ b/baselines/videointelligence/package.json @@ -24,7 +24,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.3.1" + "google-gax": "^2.4.0" }, "devDependencies": { "@types/mocha": "^7.0.2", diff --git a/package-lock.json b/package-lock.json index 5c31c607d..d7152f071 100644 --- a/package-lock.json +++ b/package-lock.json @@ -113,9 +113,9 @@ }, "dependencies": { "@types/node": { - "version": "10.17.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.21.tgz", - "integrity": "sha512-PQKsydPxYxF1DsAFWmunaxd3sOi3iMt6Zmx/tgaagHYmwJ/9cRH91hQkeJZaUGWbvn0K5HlSVEXkn5U/llWPpQ==", + "version": "10.17.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.24.tgz", + "integrity": "sha512-5SCfvCxV74kzR3uWgTYiGxrd69TbT1I6+cMx1A5kEly/IVveJBimtAMlXiEyVFn5DvUFewQWxOOiJhlxeQwxgA==", "dev": true }, "protobufjs": { @@ -154,10 +154,11 @@ "dev": true }, "@grpc/grpc-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.0.3.tgz", - "integrity": "sha512-JKV3f5Bv2TZxK6eJSB9EarsZrnLxrvcFNwI9goq0YRXa3S6NNoCSnI3cG3lkXVIJ03Wng1WXe76kc2JQtRe7AQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.0.4.tgz", + "integrity": "sha512-Qawt6HUrEmljQMPWnLnIXpcjelmtIAydi3M9awiG02WWJ1CmIvFEx4IOC1EsWUWUlabOGksRbpfvoIeZKFTNXw==", "requires": { + "google-auth-library": "^6.0.0", "semver": "^6.2.0" } }, @@ -237,9 +238,9 @@ "dev": true }, "@sinonjs/commons": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.2.tgz", - "integrity": "sha512-+DUO6pnp3udV/v2VfUWgaY5BIE1IfT7lLfeDzPVeMT1XKkaAp9LgSI9x5RtrFQoZ9Oi0PgXQQHPaoKu7dCjVxw==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.0.tgz", + "integrity": "sha512-wEj54PfsZ5jGSwMX68G8ZXFawcSglQSXqCftWX3ec8MDUzQdHgcKvw97awHbY0efQEL5iKUOAmmVtoYgmrSG4Q==", "dev": true, "requires": { "type-detect": "4.0.8" @@ -372,10 +373,9 @@ "dev": true }, "@types/node": { - "version": "13.13.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.9.tgz", - "integrity": "sha512-EPZBIGed5gNnfWCiwEIwTE2Jdg4813odnG8iNPMQGrqVxrI+wL68SPtPeCX+ZxGBaA6pKAVc6jaKgP/Q0QzfdQ==", - "dev": true + "version": "13.13.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.8.tgz", + "integrity": "sha512-WJoiKALUF5exZo0G3T5coauJR2Tmc6rdE9/kgppZVnV6rlUB2dl3gTu2GTNBKhKF6SZ/WFfpEUIGNC/0qvdMWA==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -1004,6 +1004,14 @@ "dev": true, "requires": { "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } } }, "core-js": { @@ -1992,9 +2000,9 @@ "dev": true }, "fsevents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", - "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", "optional": true }, "function-bind": { @@ -2116,9 +2124,9 @@ } }, "google-gax": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-2.3.1.tgz", - "integrity": "sha512-9dMa/PKMexVpYEGiLFrqupPj4CDorDPk4lqhyefxXblvdkmLIT+cHprNRxqyVknWGoTY0E0a9VuRDKlQQgOE8w==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-2.4.0.tgz", + "integrity": "sha512-//OQX4JcpUD5ke+GdvII22kbR4AerFdBOvEFgiCX3zn74ldY4K6Yiv4vjpX3Ud3M6nP1+6th81ROni1wXyWymQ==", "requires": { "@grpc/grpc-js": "~1.0.0", "@grpc/proto-loader": "^0.5.1", @@ -2897,24 +2905,6 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", "dev": true - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - } - } } } }, @@ -3668,13 +3658,6 @@ "@types/long": "^4.0.1", "@types/node": "^13.7.0", "long": "^4.0.0" - }, - "dependencies": { - "@types/node": { - "version": "13.13.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.5.tgz", - "integrity": "sha512-3ySmiBYJPqgjiHA7oEaIo2Rzz0HrOZ7yrNO5HWyaE5q0lQ3BppDZ3N53Miz8bw2I7gh1/zir2MGVZBvpb1zq9g==" - } } }, "pump": { @@ -3771,6 +3754,13 @@ "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } } }, "readdirp": { @@ -3904,9 +3894,9 @@ } }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, "safer-buffer": { "version": "2.1.2", @@ -4137,6 +4127,13 @@ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } } }, "strip-ansi": { @@ -4695,9 +4692,9 @@ } }, "yargs-parser": { - "version": "18.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.2.tgz", - "integrity": "sha512-hlIPNR3IzC1YuL1c2UwwDKpXlNFBqD1Fswwh1khz5+d8Cq/8yc/Mn0i+rQXduu8hcrFKvO7Eryk+09NecTQAAQ==", + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" diff --git a/package.json b/package.json index 6f3aef5d6..f3f534de4 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "file-system": "^2.2.2", "fs-extra": "^9.0.0", "get-stdin": "^8.0.0", - "google-gax": "^2.3.1", + "google-gax": "^2.4.0", "js-yaml": "^3.13.1", "module-alias": "^2.2.2", "nunjucks": "^3.2.1", diff --git a/src/util.ts b/src/util.ts index db7bdaa2e..5edd6d1b0 100644 --- a/src/util.ts +++ b/src/util.ts @@ -157,14 +157,17 @@ export function getResourceNameByPattern(pattern: string): string { break; } else { const nextEle = elements[0]; - if (nextEle.match(/{[a-zA-Z_]+(?:=.*?)?}/g)) { + if (nextEle.match(/(?<=\{).*?(?=(?:=.*?)?\})/g)) { elements.shift(); - name.push( - nextEle.substring( - 1, - nextEle.includes('=') ? nextEle.indexOf('=') : nextEle.length - 1 - ) - ); + const params = nextEle.match(/(?<=\{).*?(?=(?:=.*?)?\})/g); + if (params!.length === 1) { + name.push(params![0]); + } else { + // For non-slash resource 'organization/{organization}/tasks/{task_id}{task_name}/result' + // Take parameters that match pattern [{task_id}, {task_name}] and combine them as part of the name. + const params = nextEle.match(/(?<=\{).*?(?=(?:=.*?)?\})/g); + name.push(params!.join('_')); + } } else { if (eleName!.match(/{[a-zA-Z_]+(?:=.*?)?}/g)) { continue; diff --git a/templates/typescript_gapic/package.json b/templates/typescript_gapic/package.json index 7c43cc024..19a6f6cc1 100644 --- a/templates/typescript_gapic/package.json +++ b/templates/typescript_gapic/package.json @@ -24,7 +24,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.3.1" + "google-gax": "^2.4.0" }, "devDependencies": { "@types/mocha": "^7.0.2", diff --git a/test-fixtures/protos/google/showcase/v1beta1/identity.proto b/test-fixtures/protos/google/showcase/v1beta1/identity.proto index a723a0f1f..a05d18c4b 100644 --- a/test-fixtures/protos/google/showcase/v1beta1/identity.proto +++ b/test-fixtures/protos/google/showcase/v1beta1/identity.proto @@ -41,6 +41,7 @@ service Identity { body: "*" }; option (google.api.method_signature) = "user.display_name,user.email"; + option (google.api.method_signature) = "user.display_name,user.email,user.age,user.nickname,user.enable_notifications,user.height_feet"; } // Retrieves the User with the given uri. @@ -100,6 +101,25 @@ message User { google.protobuf.Timestamp update_time = 5 [ (google.api.field_behavior) = OUTPUT_ONLY ]; + + // Typescript generator doe not support proto3 optional fields + // The age of the use in years. + // optional int32 age = 6; + + // The height of the user in feet. + // optional double height_feet = 7; + + // The nickname of the user. + // + // (-- aip.dev/not-precedent: An empty string is a valid nickname. + // Ordinarily, proto3_optional should not be used on a `string` field. --) + // optional string nickname = 8; + + // Enables the receiving of notifications. The default is true if unset. + // + // (-- aip.dev/not-precedent: The default for the feature is true. + // Ordinarily, the default for a `bool` field should be false. --) + // optional bool enable_notifications = 9; } // The request message for the google.showcase.v1beta1.Identity\CreateUser diff --git a/test-fixtures/protos/google/showcase/v1beta1/messaging.proto b/test-fixtures/protos/google/showcase/v1beta1/messaging.proto index b94275f16..fb3bf51c5 100644 --- a/test-fixtures/protos/google/showcase/v1beta1/messaging.proto +++ b/test-fixtures/protos/google/showcase/v1beta1/messaging.proto @@ -289,7 +289,10 @@ message Blurb { option (google.api.resource) = { type: "showcase.googleapis.com/Blurb" pattern: "rooms/{room_id}/blurbs/{blurb_id}" + pattern: "rooms/{room_id}/blurbs/legacy/{legacy_room_id}.{blurb_id}" pattern: "user/{user_id}/profile/blurbs/{blurb_id}" + pattern: "user/{user_id}/profile/blurbs/legacy/{legacy_user_id}~{blurb_id}" + }; // The resource name of the chat room. @@ -317,6 +320,18 @@ message Blurb { google.protobuf.Timestamp update_time = 6 [ (google.api.field_behavior) = OUTPUT_ONLY ]; + + // (-- aip.dev/not-precedent: This is designed for testing non-slash + // resource patterns. Ordinarily, non-slash separators are discouraged. --) + oneof legacy_id { + // The legacy id of the room. This field is used to signal + // the use of the compound resource pattern `rooms/{room_id}/blurbs/{legacy_room_id}.{blurb_id}` + string legacy_room_id = 7; + + // The legacy id of the user. This field is used to signal + // the use of the compound resource pattern `rooms/{room_id}/blurbs/{legacy_user_id}~{blurb_id}` + string legacy_user_id = 8; + } } // The request message for the google.showcase.v1beta1.Messaging\CreateBlurb diff --git a/test/unit/resource-database.ts b/test/unit/resource-database.ts index f23ad3d37..28802eb13 100644 --- a/test/unit/resource-database.ts +++ b/test/unit/resource-database.ts @@ -34,6 +34,10 @@ describe('src/schema/resource-database.ts', () => { const resourcePatternSpecial1 = 'location/{location}/profile/case/{case_id}'; const resourcePatternSpecial2 = 'organization/{organization=**}/case'; const resourcePatternSpecial3 = '{organization=**}/tasks/{task}/result'; + const nonSlashPatternSpecial = + 'organization/{organization}/tasks/{taskId}-{taskName}/result'; + const nonSlashPatternSpecial2 = + 'organization/{organization}/tasks/{taskId=*}.{taskName}/result'; const resourceParameters = ['location', 'example']; const parentResourceName = 'Location'; const parentResourceType = 'locations.googleapis.com/Location'; @@ -114,6 +118,8 @@ describe('src/schema/resource-database.ts', () => { resourcePatternSpecial1, resourcePatternSpecial2, resourcePatternSpecial3, + nonSlashPatternSpecial, + nonSlashPatternSpecial2, ], }; rdb.registerResource(resource, errorLocation); @@ -144,6 +150,47 @@ describe('src/schema/resource-database.ts', () => { ); assert(registeredResourceByPattern3); assert.strictEqual(registeredResourceByPattern3!.name, 'task_result'); + + const registeredNonSlashResource = rdb.getResourceByPattern( + nonSlashPatternSpecial + ); + assert(registeredNonSlashResource); + assert.strictEqual( + registeredNonSlashResource!.name, + 'organization_taskId_taskName_result' + ); + + const registeredNonSlashResource2 = rdb.getResourceByPattern( + nonSlashPatternSpecial2 + ); + assert(registeredNonSlashResource2); + assert.strictEqual( + registeredNonSlashResource2!.name, + 'organization_taskId_taskName_result' + ); + }); + + it('get correct resource name for single non-slash pattern resource', () => { + const rdb = new ResourceDatabase(); + const resource: protos.google.api.IResourceDescriptor = { + type: 'examples.googleapis.com/Case', + pattern: [nonSlashPatternSpecial], + }; + rdb.registerResource(resource, errorLocation); + const registeredResource = rdb.getResourceByType( + 'examples.googleapis.com/Case' + ); + assert(registeredResource); + assert.strictEqual( + registeredResource!.type, + 'examples.googleapis.com/Case' + ); + + const registeredNonSlashResource = rdb.getResourceByPattern( + nonSlashPatternSpecial + ); + assert(registeredNonSlashResource); + assert.strictEqual(registeredNonSlashResource!.name, 'Case'); }); it('can get registered resource by type', () => {