Skip to content

Commit a7ae461

Browse files
Google APIscopybara-github
authored andcommitted
feat: A new method customEmojis.create is added
feat: A new method `customEmojis.delete` is added feat: A new method `customEmojis.get` is added feat: A new method `customEmojis.list` is added docs: A comment for message `CustomEmoji` is changed docs: A comment for field `filter` in message `.google.chat.v1.ListReactionsRequest` is changed PiperOrigin-RevId: 753602235
1 parent 8105f2a commit a7ae461

4 files changed

Lines changed: 251 additions & 3 deletions

File tree

google/chat/v1/chat_grpc_service_config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
{ "service": "google.chat.v1.ChatService", "method": "CreateReaction" },
2121
{ "service": "google.chat.v1.ChatService", "method": "ListReactions" },
2222
{ "service": "google.chat.v1.ChatService", "method": "DeleteReaction" },
23+
{ "service": "google.chat.v1.ChatService", "method": "CreateCustomEmoji" },
24+
{ "service": "google.chat.v1.ChatService", "method": "DeleteCustomEmoji" },
25+
{ "service": "google.chat.v1.ChatService", "method": "GetCustomEmoji" },
26+
{ "service": "google.chat.v1.ChatService", "method": "ListCustomEmojis" },
2327
{ "service": "google.chat.v1.ChatService", "method": "UploadAttachment" },
2428
{ "service": "google.chat.v1.ChatService", "method": "FindDirectMessage" },
2529
{ "service": "google.chat.v1.ChatService", "method": "CompleteImportSpace" },

google/chat/v1/chat_service.proto

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ service ChatService {
5050
"https://www.googleapis.com/auth/chat.admin.spaces,"
5151
"https://www.googleapis.com/auth/chat.admin.spaces.readonly,"
5252
"https://www.googleapis.com/auth/chat.bot,"
53+
"https://www.googleapis.com/auth/chat.customemojis,"
54+
"https://www.googleapis.com/auth/chat.customemojis.readonly,"
5355
"https://www.googleapis.com/auth/chat.delete,"
5456
"https://www.googleapis.com/auth/chat.import,"
5557
"https://www.googleapis.com/auth/chat.memberships,"
@@ -653,6 +655,85 @@ service ChatService {
653655
option (google.api.method_signature) = "name";
654656
}
655657

658+
// Creates a custom emoji.
659+
//
660+
// Custom emojis are only available for Google Workspace accounts, and the
661+
// administrator must turn custom emojis on for the organization. For more
662+
// information, see [Learn about custom emojis in Google
663+
// Chat](https://support.google.com/chat/answer/12800149) and
664+
// [Manage custom emoji
665+
// permissions](https://support.google.com/a/answer/12850085).
666+
//
667+
// Requires [user
668+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
669+
rpc CreateCustomEmoji(CreateCustomEmojiRequest) returns (CustomEmoji) {
670+
option (google.api.http) = {
671+
post: "/v1/customEmojis"
672+
body: "custom_emoji"
673+
};
674+
option (google.api.method_signature) = "custom_emoji";
675+
}
676+
677+
// Returns details about a custom emoji.
678+
//
679+
// Custom emojis are only available for Google Workspace accounts, and the
680+
// administrator must turn custom emojis on for the organization. For more
681+
// information, see [Learn about custom emojis in Google
682+
// Chat](https://support.google.com/chat/answer/12800149) and
683+
// [Manage custom emoji
684+
// permissions](https://support.google.com/a/answer/12850085).
685+
//
686+
// Requires [user
687+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
688+
rpc GetCustomEmoji(GetCustomEmojiRequest) returns (CustomEmoji) {
689+
option (google.api.http) = {
690+
get: "/v1/{name=customEmojis/*}"
691+
};
692+
option (google.api.method_signature) = "name";
693+
}
694+
695+
// Lists custom emojis visible to the authenticated user.
696+
//
697+
// Custom emojis are only available for Google Workspace accounts, and the
698+
// administrator must turn custom emojis on for the organization. For more
699+
// information, see [Learn about custom emojis in Google
700+
// Chat](https://support.google.com/chat/answer/12800149) and
701+
// [Manage custom emoji
702+
// permissions](https://support.google.com/a/answer/12850085).
703+
//
704+
// Requires [user
705+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
706+
rpc ListCustomEmojis(ListCustomEmojisRequest)
707+
returns (ListCustomEmojisResponse) {
708+
option (google.api.http) = {
709+
get: "/v1/customEmojis"
710+
};
711+
option (google.api.method_signature) = "";
712+
}
713+
714+
// Deletes a custom emoji. By default, users can only delete custom emoji they
715+
// created. [Emoji managers](https://support.google.com/a/answer/12850085)
716+
// assigned by the administrator can delete any custom emoji in the
717+
// organization. See [Learn about custom emojis in Google
718+
// Chat](https://support.google.com/chat/answer/12800149).
719+
//
720+
// Custom emojis are only available for Google Workspace accounts, and the
721+
// administrator must turn custom emojis on for the organization. For more
722+
// information, see [Learn about custom emojis in Google
723+
// Chat](https://support.google.com/chat/answer/12800149) and
724+
// [Manage custom emoji
725+
// permissions](https://support.google.com/a/answer/12850085).
726+
//
727+
// Requires [user
728+
// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
729+
rpc DeleteCustomEmoji(DeleteCustomEmojiRequest)
730+
returns (google.protobuf.Empty) {
731+
option (google.api.http) = {
732+
delete: "/v1/{name=customEmojis/*}"
733+
};
734+
option (google.api.method_signature) = "name";
735+
}
736+
656737
// Returns details about a user's read state within a space, used to identify
657738
// read and unread messages. For an example, see [Get details about a user's
658739
// space read

google/chat/v1/chat_v1.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ authentication:
1818
oauth:
1919
canonical_scopes: |-
2020
https://www.googleapis.com/auth/chat.import
21+
- selector: google.chat.v1.ChatService.CreateCustomEmoji
22+
oauth:
23+
canonical_scopes: |-
24+
https://www.googleapis.com/auth/chat.customemojis
2125
- selector: google.chat.v1.ChatService.CreateMembership
2226
oauth:
2327
canonical_scopes: |-
@@ -45,6 +49,10 @@ authentication:
4549
https://www.googleapis.com/auth/chat.import,
4650
https://www.googleapis.com/auth/chat.spaces,
4751
https://www.googleapis.com/auth/chat.spaces.create
52+
- selector: google.chat.v1.ChatService.DeleteCustomEmoji
53+
oauth:
54+
canonical_scopes: |-
55+
https://www.googleapis.com/auth/chat.customemojis
4856
- selector: google.chat.v1.ChatService.DeleteMembership
4957
oauth:
5058
canonical_scopes: |-
@@ -80,6 +88,11 @@ authentication:
8088
oauth:
8189
canonical_scopes: |-
8290
https://www.googleapis.com/auth/chat.bot
91+
- selector: google.chat.v1.ChatService.GetCustomEmoji
92+
oauth:
93+
canonical_scopes: |-
94+
https://www.googleapis.com/auth/chat.customemojis,
95+
https://www.googleapis.com/auth/chat.customemojis.readonly
8396
- selector: google.chat.v1.ChatService.GetMembership
8497
oauth:
8598
canonical_scopes: |-
@@ -127,6 +140,11 @@ authentication:
127140
canonical_scopes: |-
128141
https://www.googleapis.com/auth/chat.users.readstate,
129142
https://www.googleapis.com/auth/chat.users.readstate.readonly
143+
- selector: google.chat.v1.ChatService.ListCustomEmojis
144+
oauth:
145+
canonical_scopes: |-
146+
https://www.googleapis.com/auth/chat.customemojis,
147+
https://www.googleapis.com/auth/chat.customemojis.readonly
130148
- selector: google.chat.v1.ChatService.ListMemberships
131149
oauth:
132150
canonical_scopes: |-

google/chat/v1/reaction.proto

Lines changed: 148 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,74 @@ message Emoji {
6161
}
6262
}
6363

64-
// Represents a custom emoji.
64+
// Represents a [custom emoji](https://support.google.com/chat/answer/12800149).
6565
message CustomEmoji {
66+
option (google.api.resource) = {
67+
type: "chat.googleapis.com/CustomEmoji"
68+
pattern: "customEmojis/{custom_emoji}"
69+
plural: "customEmojis"
70+
singular: "customEmoji"
71+
};
72+
73+
// Payload data for the custom emoji.
74+
message CustomEmojiPayload {
75+
// Required. Input only. The image used for the custom emoji.
76+
//
77+
// The payload must be under 256 KB and the dimension of
78+
// the image must be square and between 64 and 500 pixels. The
79+
// restrictions are subject to change.
80+
bytes file_content = 1 [
81+
(google.api.field_behavior) = INPUT_ONLY,
82+
(google.api.field_behavior) = REQUIRED
83+
];
84+
85+
// Required. Input only. The image file name.
86+
//
87+
// Supported file extensions: `.png`, `.jpg`, `.gif`.
88+
string filename = 2 [
89+
(google.api.field_behavior) = INPUT_ONLY,
90+
(google.api.field_behavior) = REQUIRED
91+
];
92+
}
93+
94+
// Identifier. The resource name of the custom emoji, assigned by the server.
95+
//
96+
// Format: `customEmojis/{customEmoji}`
97+
string name = 2 [(google.api.field_behavior) = IDENTIFIER];
98+
6699
// Output only. Unique key for the custom emoji resource.
67100
string uid = 1 [
68101
(google.api.field_info).format = UUID4,
69102
(google.api.field_behavior) = OUTPUT_ONLY
70103
];
104+
105+
// Optional. Immutable. User-provided name for the custom emoji, which is
106+
// unique within the organization.
107+
//
108+
// Required when the custom emoji is created, output only otherwise.
109+
//
110+
// Emoji names must start and end with colons, must be lowercase and can only
111+
// contain alphanumeric characters, hyphens, and underscores.
112+
// Hyphens and underscores should be used to separate words and cannot be used
113+
// consecutively.
114+
//
115+
// Example: `:valid-emoji-name:`
116+
string emoji_name = 3 [
117+
(google.api.field_behavior) = OPTIONAL,
118+
(google.api.field_behavior) = IMMUTABLE
119+
];
120+
121+
// Output only. A temporary image URL for the custom emoji, valid for at least
122+
// 10 minutes. Note that this is not populated in the response when the custom
123+
// emoji is created.
124+
string temporary_image_uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
125+
126+
// Optional. Input only. Payload data.
127+
// Required when the custom emoji is created.
128+
CustomEmojiPayload payload = 5 [
129+
(google.api.field_behavior) = INPUT_ONLY,
130+
(google.api.field_behavior) = OPTIONAL
131+
];
71132
}
72133

73134
// The number of people who reacted to a message with a specific emoji.
@@ -163,8 +224,7 @@ message ListReactionsRequest {
163224
// AND user.name = "users/{user}"
164225
// ```
165226
//
166-
// Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
167-
// error.
227+
// Invalid queries are rejected with an `INVALID_ARGUMENT` error.
168228
string filter = 4 [(google.api.field_behavior) = OPTIONAL];
169229
}
170230

@@ -188,3 +248,88 @@ message DeleteReactionRequest {
188248
(google.api.resource_reference) = { type: "chat.googleapis.com/Reaction" }
189249
];
190250
}
251+
252+
// A request to create a custom emoji.
253+
message CreateCustomEmojiRequest {
254+
// Required. The custom emoji to create.
255+
CustomEmoji custom_emoji = 1 [(google.api.field_behavior) = REQUIRED];
256+
}
257+
258+
// A request to return a single custom emoji.
259+
message GetCustomEmojiRequest {
260+
// Required. Resource name of the custom emoji.
261+
//
262+
// Format: `customEmojis/{customEmoji}`
263+
//
264+
// You can use the emoji name as an alias for `{customEmoji}`. For example,
265+
// `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name
266+
// for a custom emoji.
267+
string name = 1 [
268+
(google.api.field_behavior) = REQUIRED,
269+
(google.api.resource_reference) = {
270+
type: "chat.googleapis.com/CustomEmoji"
271+
}
272+
];
273+
}
274+
275+
// A request to return a list of custom emojis.
276+
message ListCustomEmojisRequest {
277+
// Optional. The maximum number of custom emojis returned. The service can
278+
// return fewer custom emojis than this value. If unspecified, the default
279+
// value is 25. The maximum value is 200; values above 200 are changed to 200.
280+
int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
281+
282+
// Optional. (If resuming from a previous query.)
283+
//
284+
// A page token received from a previous list custom emoji call. Provide this
285+
// to retrieve the subsequent page.
286+
//
287+
// When paginating, the filter value should match the call that provided the
288+
// page token. Passing a different value might lead to unexpected results.
289+
string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
290+
291+
// Optional. A query filter.
292+
//
293+
// Supports filtering by creator.
294+
//
295+
// To filter by creator, you must specify a valid value. Currently only
296+
// `creator("users/me")` and `NOT creator("users/me")` are accepted to filter
297+
// custom emojis by whether they were created by the calling user or not.
298+
//
299+
// For example, the following query returns custom emojis created by the
300+
// caller:
301+
// ```
302+
// creator("users/me")
303+
// ```
304+
//
305+
// Invalid queries are rejected with an `INVALID_ARGUMENT` error.
306+
string filter = 3 [(google.api.field_behavior) = OPTIONAL];
307+
}
308+
309+
// A response to list custom emojis.
310+
message ListCustomEmojisResponse {
311+
// Unordered list. List of custom emojis.
312+
repeated CustomEmoji custom_emojis = 1
313+
[(google.api.field_behavior) = UNORDERED_LIST];
314+
315+
// A token that you can send as `pageToken` to retrieve the next page of
316+
// results. If empty, there are no subsequent pages.
317+
string next_page_token = 2;
318+
}
319+
320+
// Request for deleting a custom emoji.
321+
message DeleteCustomEmojiRequest {
322+
// Required. Resource name of the custom emoji to delete.
323+
//
324+
// Format: `customEmojis/{customEmoji}`
325+
//
326+
// You can use the emoji name as an alias for `{customEmoji}`. For example,
327+
// `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name
328+
// for a custom emoji.
329+
string name = 1 [
330+
(google.api.field_behavior) = REQUIRED,
331+
(google.api.resource_reference) = {
332+
type: "chat.googleapis.com/CustomEmoji"
333+
}
334+
];
335+
}

0 commit comments

Comments
 (0)