Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support non-slash resource for Ads #461

Merged
merged 29 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
10aad2c
unit test case for non-slash resource
xiaozhenliu-gg5 May 5, 2020
33b28c5
logic for non-slash resource
xiaozhenliu-gg5 May 5, 2020
ce8eca5
Merge branch 'master' into non-slash-resource
xiaozhenliu-gg5 May 5, 2020
afa8379
add one more test
xiaozhenliu-gg5 May 5, 2020
132f3d0
clean up
xiaozhenliu-gg5 May 5, 2020
1a3f023
feedback
xiaozhenliu-gg5 May 5, 2020
18b7cef
Merge branch 'master' into non-slash-resource
xiaozhenliu-gg5 May 5, 2020
e1c4a57
Merge branch 'master' into non-slash-resource
xiaozhenliu-gg5 May 5, 2020
6d1d310
Merge branch 'master' into non-slash-resource
xiaozhenliu-gg5 May 6, 2020
3847fb9
Merge branch 'master' into non-slash-resource
xiaozhenliu-gg5 May 7, 2020
ef0979d
Merge branch 'master' into non-slash-resource
xiaozhenliu-gg5 May 8, 2020
9e6caa5
Merge branch 'master' of github.com:googleapis/gapic-generator-typesc…
xiaozhenliu-gg5 May 18, 2020
2fd44a4
Merge branch 'non-slash-resource' of github.com:googleapis/gapic-gene…
xiaozhenliu-gg5 May 18, 2020
e1aa440
test
xiaozhenliu-gg5 May 18, 2020
fdca0cf
fix
xiaozhenliu-gg5 May 18, 2020
12442dd
update showcase proto
xiaozhenliu-gg5 May 19, 2020
2ae5822
disable optional fields
xiaozhenliu-gg5 May 19, 2020
529f411
Merge branch 'master' of github.com:googleapis/gapic-generator-typesc…
xiaozhenliu-gg5 May 19, 2020
da1d768
update baseline
xiaozhenliu-gg5 May 19, 2020
6437849
Merge branch 'master' into non-slash-resource
xiaozhenliu-gg5 May 21, 2020
82956f2
depend on gax develop branch
xiaozhenliu-gg5 May 21, 2020
ad3e408
update baseline
xiaozhenliu-gg5 May 21, 2020
5470e58
Merge branch 'non-slash-resource' of github.com:googleapis/gapic-gene…
xiaozhenliu-gg5 May 21, 2020
f8c4c86
use master branch
xiaozhenliu-gg5 May 21, 2020
214aba2
update baseline
xiaozhenliu-gg5 May 21, 2020
c9f7613
Merge branch 'master' into non-slash-resource
xiaozhenliu-gg5 May 21, 2020
0e4fecc
update gax dependency
xiaozhenliu-gg5 May 21, 2020
40a853b
Merge branch 'master' into non-slash-resource
xiaozhenliu-gg5 May 21, 2020
b8d3cf5
Merge branch 'master' into non-slash-resource
alexander-fenster May 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion baselines/asset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion baselines/bigquery-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion baselines/disable-packing-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
104 changes: 104 additions & 0 deletions baselines/disable-packing-test/src/v1beta1/echo_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
),
Expand All @@ -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,
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down
104 changes: 104 additions & 0 deletions baselines/disable-packing-test/src/v1beta1/identity_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
),
Expand All @@ -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,
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down
Loading