Skip to content
Open
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
4 changes: 2 additions & 2 deletions librarian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ version: v0.13.0
repo: googleapis/google-cloud-python
sources:
googleapis:
commit: 392c8aa259daf4570073220faa9e842cf1e2e173
sha256: 2b3be6d9749cdf2a337f2c76aa08857096671ebd4b17007d09ee3752b7b10fe9
commit: 84009fb6ad8975910a5cb62d32e7f35e48c9da02
sha256: b82e61ef9bc042fe02c9c9113a53d207331dc7cd8c10cc0d4f4cbeb7e65f1577
default:
output: packages
tag_format: '{name}-v{version}'
Expand Down
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 @@ -82,6 +82,7 @@
ActionResponse,
AttachedGif,
CardWithId,
CreateMessageNotificationOptions,
CreateMessageRequest,
DeleteMessageRequest,
Dialog,
Expand Down Expand Up @@ -222,6 +223,7 @@
"ActionResponse",
"AttachedGif",
"CardWithId",
"CreateMessageNotificationOptions",
"CreateMessageRequest",
"DeleteMessageRequest",
"Dialog",
Expand Down
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 @@ -84,6 +84,7 @@
ActionResponse,
AttachedGif,
CardWithId,
CreateMessageNotificationOptions,
CreateMessageRequest,
DeleteMessageRequest,
Dialog,
Expand Down Expand Up @@ -269,6 +270,7 @@ def _get_version(dependency_name):
"ContextualAddOnMarkup",
"CreateCustomEmojiRequest",
"CreateMembershipRequest",
"CreateMessageNotificationOptions",
"CreateMessageRequest",
"CreateReactionRequest",
"CreateSectionRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
ActionResponse,
AttachedGif,
CardWithId,
CreateMessageNotificationOptions,
CreateMessageRequest,
DeleteMessageRequest,
Dialog,
Expand Down Expand Up @@ -231,6 +232,7 @@
"ActionResponse",
"AttachedGif",
"CardWithId",
"CreateMessageNotificationOptions",
"CreateMessageRequest",
"DeleteMessageRequest",
"Dialog",
Expand Down
69 changes: 69 additions & 0 deletions packages/google-apps-chat/google/apps/chat_v1/types/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"DeleteMessageRequest",
"UpdateMessageRequest",
"CreateMessageRequest",
"CreateMessageNotificationOptions",
"ListMessagesRequest",
"ListMessagesResponse",
"DialogAction",
Expand Down Expand Up @@ -205,6 +206,10 @@ class Message(proto.Message):

If the space doesn't support reply in threads, this field is
always ``false``.
silent (bool):
Output only. Whether this is a silent
message. Silent messages are messages where Chat
suppresses push notifications for recipients.
client_assigned_message_id (str):
Optional. A custom ID for the message. You can use field to
identify a message, or to get, delete, or update a message.
Expand Down Expand Up @@ -352,6 +357,10 @@ class Message(proto.Message):
proto.BOOL,
number=25,
)
silent: bool = proto.Field(
proto.BOOL,
number=46,
)
client_assigned_message_id: str = proto.Field(
proto.STRING,
number=32,
Expand Down Expand Up @@ -911,6 +920,11 @@ class CreateMessageRequest(proto.Message):

For details, see `Name a
message <https://developers.google.com/workspace/chat/create-messages#name_a_created_message>`__.
create_message_notification_options (google.apps.chat_v1.types.CreateMessageNotificationOptions):
Optional. Controls the notification behavior when the
message is posted. To learn more, see `Force notifications
or send silent
messages <https://developer.google.com/workspace/chat/create-messages#force-notify-silent>`__.
"""

class MessageReplyOption(proto.Enum):
Expand Down Expand Up @@ -967,6 +981,61 @@ class MessageReplyOption(proto.Enum):
proto.STRING,
number=9,
)
create_message_notification_options: "CreateMessageNotificationOptions" = (
proto.Field(
proto.MESSAGE,
number=10,
message="CreateMessageNotificationOptions",
)
)


class CreateMessageNotificationOptions(proto.Message):
r"""Options for the notification behavior when the message is
posted.

Attributes:
notification_type (google.apps.chat_v1.types.CreateMessageNotificationOptions.NotificationType):
The notification type for the message.
"""

class NotificationType(proto.Enum):
r"""The notification types options for the message.

Values:
NOTIFICATION_TYPE_NONE (0):
Default behavior. Notification behavior is
similar to when the human user sends the message
using the Chat UI: no notification is sent to
the human sender.
NOTIFICATION_TYPE_FORCE_NOTIFY (2):
Force notify recipients. This bypasses users' space
notification settings and `Chat Do Not Disturb
settings <https://support.google.com/chat/answer/9093489>`__.
This option does not bypass device-level Do Not Disturb
settings.

Requires [app authentication]
(https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
NOTIFICATION_TYPE_SILENT (3):
Silence the notification as if the recipients have `Chat Do
Not
Disturb <https://support.google.com/chat/answer/9093489>`__
enabled or have muted the space.

Requires [app authentication]
(https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
"""

NOTIFICATION_TYPE_NONE = 0
NOTIFICATION_TYPE_FORCE_NOTIFY = 2
NOTIFICATION_TYPE_SILENT = 3

notification_type: NotificationType = proto.Field(
proto.ENUM,
number=1,
enum=NotificationType,
)


class ListMessagesRequest(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,7 @@ def test_create_message(request_type, transport: str = "grpc"):
fallback_text="fallback_text_value",
argument_text="argument_text_value",
thread_reply=True,
silent=True,
client_assigned_message_id="client_assigned_message_id_value",
)
response = client.create_message(request)
Expand All @@ -1387,6 +1388,7 @@ def test_create_message(request_type, transport: str = "grpc"):
assert response.fallback_text == "fallback_text_value"
assert response.argument_text == "argument_text_value"
assert response.thread_reply is True
assert response.silent is True
assert response.client_assigned_message_id == "client_assigned_message_id_value"


Expand Down Expand Up @@ -1525,6 +1527,7 @@ async def test_create_message_async(
fallback_text="fallback_text_value",
argument_text="argument_text_value",
thread_reply=True,
silent=True,
client_assigned_message_id="client_assigned_message_id_value",
)
)
Expand All @@ -1544,6 +1547,7 @@ async def test_create_message_async(
assert response.fallback_text == "fallback_text_value"
assert response.argument_text == "argument_text_value"
assert response.thread_reply is True
assert response.silent is True
assert response.client_assigned_message_id == "client_assigned_message_id_value"


Expand Down Expand Up @@ -3107,6 +3111,7 @@ def test_get_message(request_type, transport: str = "grpc"):
fallback_text="fallback_text_value",
argument_text="argument_text_value",
thread_reply=True,
silent=True,
client_assigned_message_id="client_assigned_message_id_value",
)
response = client.get_message(request)
Expand All @@ -3125,6 +3130,7 @@ def test_get_message(request_type, transport: str = "grpc"):
assert response.fallback_text == "fallback_text_value"
assert response.argument_text == "argument_text_value"
assert response.thread_reply is True
assert response.silent is True
assert response.client_assigned_message_id == "client_assigned_message_id_value"


Expand Down Expand Up @@ -3257,6 +3263,7 @@ async def test_get_message_async(
fallback_text="fallback_text_value",
argument_text="argument_text_value",
thread_reply=True,
silent=True,
client_assigned_message_id="client_assigned_message_id_value",
)
)
Expand All @@ -3276,6 +3283,7 @@ async def test_get_message_async(
assert response.fallback_text == "fallback_text_value"
assert response.argument_text == "argument_text_value"
assert response.thread_reply is True
assert response.silent is True
assert response.client_assigned_message_id == "client_assigned_message_id_value"


Expand Down Expand Up @@ -3450,6 +3458,7 @@ def test_update_message(request_type, transport: str = "grpc"):
fallback_text="fallback_text_value",
argument_text="argument_text_value",
thread_reply=True,
silent=True,
client_assigned_message_id="client_assigned_message_id_value",
)
response = client.update_message(request)
Expand All @@ -3468,6 +3477,7 @@ def test_update_message(request_type, transport: str = "grpc"):
assert response.fallback_text == "fallback_text_value"
assert response.argument_text == "argument_text_value"
assert response.thread_reply is True
assert response.silent is True
assert response.client_assigned_message_id == "client_assigned_message_id_value"


Expand Down Expand Up @@ -3596,6 +3606,7 @@ async def test_update_message_async(
fallback_text="fallback_text_value",
argument_text="argument_text_value",
thread_reply=True,
silent=True,
client_assigned_message_id="client_assigned_message_id_value",
)
)
Expand All @@ -3615,6 +3626,7 @@ async def test_update_message_async(
assert response.fallback_text == "fallback_text_value"
assert response.argument_text == "argument_text_value"
assert response.thread_reply is True
assert response.silent is True
assert response.client_assigned_message_id == "client_assigned_message_id_value"


Expand Down Expand Up @@ -16805,6 +16817,7 @@ def test_create_message_rest_required_fields(
# Check that path parameters and body parameters are not mixing in.
assert not set(unset_fields) - set(
(
"create_message_notification_options",
"message_id",
"message_reply_option",
"request_id",
Expand Down Expand Up @@ -16869,6 +16882,7 @@ def test_create_message_rest_unset_required_fields():
assert set(unset_fields) == (
set(
(
"createMessageNotificationOptions",
"messageId",
"messageReplyOption",
"requestId",
Expand Down Expand Up @@ -25650,6 +25664,7 @@ async def test_create_message_empty_call_grpc_asyncio():
fallback_text="fallback_text_value",
argument_text="argument_text_value",
thread_reply=True,
silent=True,
client_assigned_message_id="client_assigned_message_id_value",
)
)
Expand Down Expand Up @@ -25766,6 +25781,7 @@ async def test_get_message_empty_call_grpc_asyncio():
fallback_text="fallback_text_value",
argument_text="argument_text_value",
thread_reply=True,
silent=True,
client_assigned_message_id="client_assigned_message_id_value",
)
)
Expand Down Expand Up @@ -25799,6 +25815,7 @@ async def test_update_message_empty_call_grpc_asyncio():
fallback_text="fallback_text_value",
argument_text="argument_text_value",
thread_reply=True,
silent=True,
client_assigned_message_id="client_assigned_message_id_value",
)
)
Expand Down Expand Up @@ -27406,6 +27423,7 @@ def test_create_message_rest_call_success(request_type):
],
"matched_url": {"url": "url_value"},
"thread_reply": True,
"silent": True,
"client_assigned_message_id": "client_assigned_message_id_value",
"emoji_reaction_summaries": [
{
Expand Down Expand Up @@ -27513,6 +27531,7 @@ def get_message_fields(field):
fallback_text="fallback_text_value",
argument_text="argument_text_value",
thread_reply=True,
silent=True,
client_assigned_message_id="client_assigned_message_id_value",
)

Expand All @@ -27536,6 +27555,7 @@ def get_message_fields(field):
assert response.fallback_text == "fallback_text_value"
assert response.argument_text == "argument_text_value"
assert response.thread_reply is True
assert response.silent is True
assert response.client_assigned_message_id == "client_assigned_message_id_value"


Expand Down Expand Up @@ -28045,6 +28065,7 @@ def test_get_message_rest_call_success(request_type):
fallback_text="fallback_text_value",
argument_text="argument_text_value",
thread_reply=True,
silent=True,
client_assigned_message_id="client_assigned_message_id_value",
)

Expand All @@ -28068,6 +28089,7 @@ def test_get_message_rest_call_success(request_type):
assert response.fallback_text == "fallback_text_value"
assert response.argument_text == "argument_text_value"
assert response.thread_reply is True
assert response.silent is True
assert response.client_assigned_message_id == "client_assigned_message_id_value"


Expand Down Expand Up @@ -28624,6 +28646,7 @@ def test_update_message_rest_call_success(request_type):
],
"matched_url": {"url": "url_value"},
"thread_reply": True,
"silent": True,
"client_assigned_message_id": "client_assigned_message_id_value",
"emoji_reaction_summaries": [
{
Expand Down Expand Up @@ -28731,6 +28754,7 @@ def get_message_fields(field):
fallback_text="fallback_text_value",
argument_text="argument_text_value",
thread_reply=True,
silent=True,
client_assigned_message_id="client_assigned_message_id_value",
)

Expand All @@ -28754,6 +28778,7 @@ def get_message_fields(field):
assert response.fallback_text == "fallback_text_value"
assert response.argument_text == "argument_text_value"
assert response.thread_reply is True
assert response.silent is True
assert response.client_assigned_message_id == "client_assigned_message_id_value"


Expand Down
Loading
Loading