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: [google-apps-chat] A new field custom_emoji_metadata is added to message .google.chat.v1.Annotation #13474

Merged
merged 3 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 0 deletions packages/google-apps-chat/google/apps/chat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
Annotation,
AnnotationType,
ChatSpaceLinkData,
CustomEmojiMetadata,
DriveLinkData,
RichLinkMetadata,
SlashCommandMetadata,
Expand Down Expand Up @@ -141,6 +142,7 @@
"ActionStatus",
"Annotation",
"ChatSpaceLinkData",
"CustomEmojiMetadata",
"DriveLinkData",
"RichLinkMetadata",
"SlashCommandMetadata",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.2.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
2 changes: 2 additions & 0 deletions packages/google-apps-chat/google/apps/chat_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Annotation,
AnnotationType,
ChatSpaceLinkData,
CustomEmojiMetadata,
DriveLinkData,
RichLinkMetadata,
SlashCommandMetadata,
Expand Down Expand Up @@ -150,6 +151,7 @@
"CreateReactionRequest",
"CreateSpaceRequest",
"CustomEmoji",
"CustomEmojiMetadata",
"DeleteMembershipRequest",
"DeleteMessageRequest",
"DeleteReactionRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.2.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -3170,8 +3170,8 @@ async def create_reaction(
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> gc_reaction.Reaction:
r"""Creates a reaction and adds it to a message. Only unicode emojis
are supported. For an example, see `Add a reaction to a
r"""Creates a reaction and adds it to a message. For an example, see
`Add a reaction to a
message <https://developers.google.com/workspace/chat/create-reactions>`__.

Requires `user
Expand Down Expand Up @@ -3420,8 +3420,7 @@ async def delete_reaction(
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> None:
r"""Deletes a reaction to a message. Only unicode emojis are
supported. For an example, see `Delete a
r"""Deletes a reaction to a message. For an example, see `Delete a
reaction <https://developers.google.com/workspace/chat/delete-reactions>`__.

Requires `user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3648,8 +3648,8 @@ def create_reaction(
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> gc_reaction.Reaction:
r"""Creates a reaction and adds it to a message. Only unicode emojis
are supported. For an example, see `Add a reaction to a
r"""Creates a reaction and adds it to a message. For an example, see
`Add a reaction to a
message <https://developers.google.com/workspace/chat/create-reactions>`__.

Requires `user
Expand Down Expand Up @@ -3892,8 +3892,7 @@ def delete_reaction(
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> None:
r"""Deletes a reaction to a message. Only unicode emojis are
supported. For an example, see `Delete a
r"""Deletes a reaction to a message. For an example, see `Delete a
reaction <https://developers.google.com/workspace/chat/delete-reactions>`__.

Requires `user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1277,8 +1277,8 @@ def create_reaction(
) -> Callable[[gc_reaction.CreateReactionRequest], gc_reaction.Reaction]:
r"""Return a callable for the create reaction method over gRPC.

Creates a reaction and adds it to a message. Only unicode emojis
are supported. For an example, see `Add a reaction to a
Creates a reaction and adds it to a message. For an example, see
`Add a reaction to a
message <https://developers.google.com/workspace/chat/create-reactions>`__.

Requires `user
Expand Down Expand Up @@ -1339,8 +1339,7 @@ def delete_reaction(
) -> Callable[[reaction.DeleteReactionRequest], empty_pb2.Empty]:
r"""Return a callable for the delete reaction method over gRPC.

Deletes a reaction to a message. Only unicode emojis are
supported. For an example, see `Delete a
Deletes a reaction to a message. For an example, see `Delete a
reaction <https://developers.google.com/workspace/chat/delete-reactions>`__.

Requires `user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1304,8 +1304,8 @@ def create_reaction(
) -> Callable[[gc_reaction.CreateReactionRequest], Awaitable[gc_reaction.Reaction]]:
r"""Return a callable for the create reaction method over gRPC.

Creates a reaction and adds it to a message. Only unicode emojis
are supported. For an example, see `Add a reaction to a
Creates a reaction and adds it to a message. For an example, see
`Add a reaction to a
message <https://developers.google.com/workspace/chat/create-reactions>`__.

Requires `user
Expand Down Expand Up @@ -1368,8 +1368,7 @@ def delete_reaction(
) -> Callable[[reaction.DeleteReactionRequest], Awaitable[empty_pb2.Empty]]:
r"""Return a callable for the delete reaction method over gRPC.

Deletes a reaction to a message. Only unicode emojis are
supported. For an example, see `Delete a
Deletes a reaction to a message. For an example, see `Delete a
reaction <https://developers.google.com/workspace/chat/delete-reactions>`__.

Requires `user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
Annotation,
AnnotationType,
ChatSpaceLinkData,
CustomEmojiMetadata,
DriveLinkData,
RichLinkMetadata,
SlashCommandMetadata,
Expand Down Expand Up @@ -127,6 +128,7 @@
"ActionStatus",
"Annotation",
"ChatSpaceLinkData",
"CustomEmojiMetadata",
"DriveLinkData",
"RichLinkMetadata",
"SlashCommandMetadata",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import proto # type: ignore

from google.apps.chat_v1.types import attachment
from google.apps.chat_v1.types import attachment, reaction
from google.apps.chat_v1.types import user as gc_user

__protobuf__ = proto.module(
Expand All @@ -30,6 +30,7 @@
"UserMentionMetadata",
"SlashCommandMetadata",
"RichLinkMetadata",
"CustomEmojiMetadata",
"DriveLinkData",
"ChatSpaceLinkData",
},
Expand All @@ -48,11 +49,14 @@ class AnnotationType(proto.Enum):
A slash command is invoked.
RICH_LINK (3):
A rich link annotation.
CUSTOM_EMOJI (4):
A custom emoji annotation.
"""
ANNOTATION_TYPE_UNSPECIFIED = 0
USER_MENTION = 1
SLASH_COMMAND = 2
RICH_LINK = 3
CUSTOM_EMOJI = 4


class Annotation(proto.Message):
Expand Down Expand Up @@ -115,6 +119,10 @@ class Annotation(proto.Message):
rich_link_metadata (google.apps.chat_v1.types.RichLinkMetadata):
The metadata for a rich link.

This field is a member of `oneof`_ ``metadata``.
custom_emoji_metadata (google.apps.chat_v1.types.CustomEmojiMetadata):
The metadata for a custom emoji.

This field is a member of `oneof`_ ``metadata``.
"""

Expand Down Expand Up @@ -150,6 +158,12 @@ class Annotation(proto.Message):
oneof="metadata",
message="RichLinkMetadata",
)
custom_emoji_metadata: "CustomEmojiMetadata" = proto.Field(
proto.MESSAGE,
number=7,
oneof="metadata",
message="CustomEmojiMetadata",
)


class UserMentionMetadata(proto.Message):
Expand Down Expand Up @@ -309,6 +323,21 @@ class RichLinkType(proto.Enum):
)


class CustomEmojiMetadata(proto.Message):
r"""Annotation metadata for custom emoji.

Attributes:
custom_emoji (google.apps.chat_v1.types.CustomEmoji):
The custom emoji.
"""

custom_emoji: reaction.CustomEmoji = proto.Field(
proto.MESSAGE,
number=1,
message=reaction.CustomEmoji,
)


class DriveLinkData(proto.Message):
r"""Data for Google Drive links.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Emoji(proto.Message):

This field is a member of `oneof`_ ``content``.
custom_emoji (google.apps.chat_v1.types.CustomEmoji):
Output only. A custom emoji.
A custom emoji.

This field is a member of `oneof`_ ``content``.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-apps-chat",
"version": "0.2.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18696,6 +18696,7 @@ def test_create_message_rest_call_success(request_type):
"message": "message_value",
},
},
"custom_emoji_metadata": {"custom_emoji": {"uid": "uid_value"}},
}
],
"thread": {"name": "name_value", "thread_key": "thread_key_value"},
Expand Down Expand Up @@ -18774,10 +18775,7 @@ def test_create_message_rest_call_success(request_type):
"client_assigned_message_id": "client_assigned_message_id_value",
"emoji_reaction_summaries": [
{
"emoji": {
"unicode": "unicode_value",
"custom_emoji": {"uid": "uid_value"},
},
"emoji": {"unicode": "unicode_value", "custom_emoji": {}},
"reaction_count": 1501,
}
],
Expand Down Expand Up @@ -19778,6 +19776,7 @@ def test_update_message_rest_call_success(request_type):
"message": "message_value",
},
},
"custom_emoji_metadata": {"custom_emoji": {"uid": "uid_value"}},
}
],
"thread": {"name": "name_value", "thread_key": "thread_key_value"},
Expand Down Expand Up @@ -19856,10 +19855,7 @@ def test_update_message_rest_call_success(request_type):
"client_assigned_message_id": "client_assigned_message_id_value",
"emoji_reaction_summaries": [
{
"emoji": {
"unicode": "unicode_value",
"custom_emoji": {"uid": "uid_value"},
},
"emoji": {"unicode": "unicode_value", "custom_emoji": {}},
"reaction_count": 1501,
}
],
Expand Down
Loading