diff --git a/AppsChat/metadata/Chat/V1/ChatService.php b/AppsChat/metadata/Chat/V1/ChatService.php index d25f3518a063..032f02e33060 100644 --- a/AppsChat/metadata/Chat/V1/ChatService.php +++ b/AppsChat/metadata/Chat/V1/ChatService.php @@ -30,7 +30,7 @@ public static function initOnce() { \GPBMetadata\Google\Chat\V1\ThreadReadState::initOnce(); \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); $pool->internalAddGeneratedFile( - "\x0A\x86M\x0A!google/chat/v1/chat_service.proto\x12\x0Egoogle.chat.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/chat/v1/attachment.proto\x1A!google/chat/v1/availability.proto\x1A\x1Fgoogle/chat/v1/membership.proto\x1A\x1Cgoogle/chat/v1/message.proto\x1A\x1Dgoogle/chat/v1/reaction.proto\x1A\x1Cgoogle/chat/v1/section.proto\x1A\x1Agoogle/chat/v1/space.proto\x1A google/chat/v1/space_event.proto\x1A/google/chat/v1/space_notification_setting.proto\x1A%google/chat/v1/space_read_state.proto\x1A google/chat/v1/space_setup.proto\x1A&google/chat/v1/thread_read_state.proto\x1A\x1Bgoogle/protobuf/empty.proto2\xC6G\x0A\x0BChatService\x12\x9B\x01\x0A\x0DCreateMessage\x12\$.google.chat.v1.CreateMessageRequest\x1A\x17.google.chat.v1.Message\"K\xDAA\x19parent,message,message_id\x82\xD3\xE4\x93\x02)\"\x1E/v1/{parent=spaces/*}/messages:\x07message\x12\x8A\x01\x0A\x0CListMessages\x12#.google.chat.v1.ListMessagesRequest\x1A\$.google.chat.v1.ListMessagesResponse\"/\xDAA\x06parent\x82\xD3\xE4\x93\x02 \x12\x1E/v1/{parent=spaces/*}/messages\x12\x92\x01\x0A\x0FListMemberships\x12&.google.chat.v1.ListMembershipsRequest\x1A'.google.chat.v1.ListMembershipsResponse\".\xDAA\x06parent\x82\xD3\xE4\x93\x02\x1F\x12\x1D/v1/{parent=spaces/*}/members\x12\x7F\x0A\x0DGetMembership\x12\$.google.chat.v1.GetMembershipRequest\x1A\x1A.google.chat.v1.Membership\",\xDAA\x04name\x82\xD3\xE4\x93\x02\x1F\x12\x1D/v1/{name=spaces/*/members/*}\x12w\x0A\x0AGetMessage\x12!.google.chat.v1.GetMessageRequest\x1A\x17.google.chat.v1.Message\"-\xDAA\x04name\x82\xD3\xE4\x93\x02 \x12\x1E/v1/{name=spaces/*/messages/*}\x12\xD1\x01\x0A\x0DUpdateMessage\x12\$.google.chat.v1.UpdateMessageRequest\x1A\x17.google.chat.v1.Message\"\x80\x01\xDAA\x13message,update_mask\x82\xD3\xE4\x93\x02d\x1A&/v1/{message.name=spaces/*/messages/*}:\x07messageZ12&/v1/{message.name=spaces/*/messages/*}:\x07message\x12|\x0A\x0DDeleteMessage\x12\$.google.chat.v1.DeleteMessageRequest\x1A\x16.google.protobuf.Empty\"-\xDAA\x04name\x82\xD3\xE4\x93\x02 *\x1E/v1/{name=spaces/*/messages/*}\x12\x8E\x01\x0A\x0DGetAttachment\x12\$.google.chat.v1.GetAttachmentRequest\x1A\x1A.google.chat.v1.Attachment\";\xDAA\x04name\x82\xD3\xE4\x93\x02.\x12,/v1/{name=spaces/*/messages/*/attachments/*}\x12\x9A\x01\x0A\x10UploadAttachment\x12'.google.chat.v1.UploadAttachmentRequest\x1A(.google.chat.v1.UploadAttachmentResponse\"3\x82\xD3\xE4\x93\x02-\"(/v1/{parent=spaces/*}/attachments:upload:\x01*\x12j\x0A\x0AListSpaces\x12!.google.chat.v1.ListSpacesRequest\x1A\".google.chat.v1.ListSpacesResponse\"\x15\xDAA\x00\x82\xD3\xE4\x93\x02\x0C\x12\x0A/v1/spaces\x12w\x0A\x0CSearchSpaces\x12#.google.chat.v1.SearchSpacesRequest\x1A\$.google.chat.v1.SearchSpacesResponse\"\x1C\xDAA\x00\x82\xD3\xE4\x93\x02\x13\x12\x11/v1/spaces:search\x12f\x0A\x08GetSpace\x12\x1F.google.chat.v1.GetSpaceRequest\x1A\x15.google.chat.v1.Space\"\"\xDAA\x04name\x82\xD3\xE4\x93\x02\x15\x12\x13/v1/{name=spaces/*}\x12k\x0A\x0BCreateSpace\x12\".google.chat.v1.CreateSpaceRequest\x1A\x15.google.chat.v1.Space\"!\xDAA\x05space\x82\xD3\xE4\x93\x02\x13\"\x0A/v1/spaces:\x05space\x12c\x0A\x0ASetUpSpace\x12!.google.chat.v1.SetUpSpaceRequest\x1A\x15.google.chat.v1.Space\"\x1B\x82\xD3\xE4\x93\x02\x15\"\x10/v1/spaces:setup:\x01*\x12\x86\x01\x0A\x0BUpdateSpace\x12\".google.chat.v1.UpdateSpaceRequest\x1A\x15.google.chat.v1.Space\"<\xDAA\x11space,update_mask\x82\xD3\xE4\x93\x02\"2\x19/v1/{space.name=spaces/*}:\x05space\x12m\x0A\x0BDeleteSpace\x12\".google.chat.v1.DeleteSpaceRequest\x1A\x16.google.protobuf.Empty\"\"\xDAA\x04name\x82\xD3\xE4\x93\x02\x15*\x13/v1/{name=spaces/*}\x12\x9D\x01\x0A\x13CompleteImportSpace\x12*.google.chat.v1.CompleteImportSpaceRequest\x1A+.google.chat.v1.CompleteImportSpaceResponse\"-\x82\xD3\xE4\x93\x02'\"\"/v1/{name=spaces/*}:completeImport:\x01*\x12z\x0A\x11FindDirectMessage\x12(.google.chat.v1.FindDirectMessageRequest\x1A\x15.google.chat.v1.Space\"\$\x82\xD3\xE4\x93\x02\x1E\x12\x1C/v1/spaces:findDirectMessage\x12\x82\x01\x0A\x0EFindGroupChats\x12%.google.chat.v1.FindGroupChatsRequest\x1A&.google.chat.v1.FindGroupChatsResponse\"!\x82\xD3\xE4\x93\x02\x1B\x12\x19/v1/spaces:findGroupChats\x12\x9E\x01\x0A\x10CreateMembership\x12'.google.chat.v1.CreateMembershipRequest\x1A\x1A.google.chat.v1.Membership\"E\xDAA\x11parent,membership\x82\xD3\xE4\x93\x02+\"\x1D/v1/{parent=spaces/*}/members:\x0Amembership\x12\xAE\x01\x0A\x10UpdateMembership\x12'.google.chat.v1.UpdateMembershipRequest\x1A\x1A.google.chat.v1.Membership\"U\xDAA\x16membership,update_mask\x82\xD3\xE4\x93\x0262(/v1/{membership.name=spaces/*/members/*}:\x0Amembership\x12\x85\x01\x0A\x10DeleteMembership\x12'.google.chat.v1.DeleteMembershipRequest\x1A\x1A.google.chat.v1.Membership\",\xDAA\x04name\x82\xD3\xE4\x93\x02\x1F*\x1D/v1/{name=spaces/*/members/*}\x12\xA1\x01\x0A\x0ECreateReaction\x12%.google.chat.v1.CreateReactionRequest\x1A\x18.google.chat.v1.Reaction\"N\xDAA\x0Fparent,reaction\x82\xD3\xE4\x93\x026\"*/v1/{parent=spaces/*/messages/*}/reactions:\x08reaction\x12\x99\x01\x0A\x0DListReactions\x12\$.google.chat.v1.ListReactionsRequest\x1A%.google.chat.v1.ListReactionsResponse\";\xDAA\x06parent\x82\xD3\xE4\x93\x02,\x12*/v1/{parent=spaces/*/messages/*}/reactions\x12\x8A\x01\x0A\x0EDeleteReaction\x12%.google.chat.v1.DeleteReactionRequest\x1A\x16.google.protobuf.Empty\"9\xDAA\x04name\x82\xD3\xE4\x93\x02,**/v1/{name=spaces/*/messages/*/reactions/*}\x12\x91\x01\x0A\x11CreateCustomEmoji\x12(.google.chat.v1.CreateCustomEmojiRequest\x1A\x1B.google.chat.v1.CustomEmoji\"5\xDAA\x0Ccustom_emoji\x82\xD3\xE4\x93\x02 \"\x10/v1/customEmojis:\x0Ccustom_emoji\x12~\x0A\x0EGetCustomEmoji\x12%.google.chat.v1.GetCustomEmojiRequest\x1A\x1B.google.chat.v1.CustomEmoji\"(\xDAA\x04name\x82\xD3\xE4\x93\x02\x1B\x12\x19/v1/{name=customEmojis/*}\x12\x82\x01\x0A\x10ListCustomEmojis\x12'.google.chat.v1.ListCustomEmojisRequest\x1A(.google.chat.v1.ListCustomEmojisResponse\"\x1B\xDAA\x00\x82\xD3\xE4\x93\x02\x12\x12\x10/v1/customEmojis\x12\x7F\x0A\x11DeleteCustomEmoji\x12(.google.chat.v1.DeleteCustomEmojiRequest\x1A\x16.google.protobuf.Empty\"(\xDAA\x04name\x82\xD3\xE4\x93\x02\x1B*\x19/v1/{name=customEmojis/*}\x12\x98\x01\x0A\x11GetSpaceReadState\x12(.google.chat.v1.GetSpaceReadStateRequest\x1A\x1E.google.chat.v1.SpaceReadState\"9\xDAA\x04name\x82\xD3\xE4\x93\x02,\x12*/v1/{name=users/*/spaces/*/spaceReadState}\x12\xD9\x01\x0A\x14UpdateSpaceReadState\x12+.google.chat.v1.UpdateSpaceReadStateRequest\x1A\x1E.google.chat.v1.SpaceReadState\"t\xDAA\x1Cspace_read_state,update_mask\x82\xD3\xE4\x93\x02O2;/v1/{space_read_state.name=users/*/spaces/*/spaceReadState}:\x10space_read_state\x12\xA6\x01\x0A\x12GetThreadReadState\x12).google.chat.v1.GetThreadReadStateRequest\x1A\x1F.google.chat.v1.ThreadReadState\"D\xDAA\x04name\x82\xD3\xE4\x93\x027\x125/v1/{name=users/*/spaces/*/threads/*/threadReadState}\x12\x87\x01\x0A\x0FGetAvailability\x12&.google.chat.v1.GetAvailabilityRequest\x1A\x1C.google.chat.v1.Availability\".\xDAA\x04name\x82\xD3\xE4\x93\x02!\x12\x1F/v1/{name=users/*/availability}\x12\x8A\x01\x0A\x0CMarkAsActive\x12#.google.chat.v1.MarkAsActiveRequest\x1A\x1C.google.chat.v1.Availability\"7\x82\xD3\xE4\x93\x021\",/v1/{name=users/*/availability}:markAsActive:\x01*\x12\x84\x01\x0A\x0AMarkAsAway\x12!.google.chat.v1.MarkAsAwayRequest\x1A\x1C.google.chat.v1.Availability\"5\x82\xD3\xE4\x93\x02/\"*/v1/{name=users/*/availability}:markAsAway:\x01*\x12\x9C\x01\x0A\x12MarkAsDoNotDisturb\x12).google.chat.v1.MarkAsDoNotDisturbRequest\x1A\x1C.google.chat.v1.Availability\"=\x82\xD3\xE4\x93\x027\"2/v1/{name=users/*/availability}:markAsDoNotDisturb:\x01*\x12\xBC\x01\x0A\x12UpdateAvailability\x12).google.chat.v1.UpdateAvailabilityRequest\x1A\x1C.google.chat.v1.Availability\"]\xDAA\x18availability,update_mask\x82\xD3\xE4\x93\x02<2,/v1/{availability.name=users/*/availability}:\x0Cavailability\x12\x83\x01\x0A\x0DGetSpaceEvent\x12\$.google.chat.v1.GetSpaceEventRequest\x1A\x1A.google.chat.v1.SpaceEvent\"0\xDAA\x04name\x82\xD3\xE4\x93\x02#\x12!/v1/{name=spaces/*/spaceEvents/*}\x12\x9D\x01\x0A\x0FListSpaceEvents\x12&.google.chat.v1.ListSpaceEventsRequest\x1A'.google.chat.v1.ListSpaceEventsResponse\"9\xDAA\x0Dparent,filter\x82\xD3\xE4\x93\x02#\x12!/v1/{parent=spaces/*}/spaceEvents\x12\xC0\x01\x0A\x1BGetSpaceNotificationSetting\x122.google.chat.v1.GetSpaceNotificationSettingRequest\x1A(.google.chat.v1.SpaceNotificationSetting\"C\xDAA\x04name\x82\xD3\xE4\x93\x026\x124/v1/{name=users/*/spaces/*/spaceNotificationSetting}\x12\xA0\x02\x0A\x1EUpdateSpaceNotificationSetting\x125.google.chat.v1.UpdateSpaceNotificationSettingRequest\x1A(.google.chat.v1.SpaceNotificationSetting\"\x9C\x01\xDAA&space_notification_setting,update_mask\x82\xD3\xE4\x93\x02m2O/v1/{space_notification_setting.name=users/*/spaces/*/spaceNotificationSetting}:\x1Aspace_notification_setting\x12\x8F\x01\x0A\x0DCreateSection\x12\$.google.chat.v1.CreateSectionRequest\x1A\x17.google.chat.v1.Section\"?\xDAA\x0Eparent,section\x82\xD3\xE4\x93\x02(\"\x1D/v1/{parent=users/*}/sections:\x07section\x12{\x0A\x0DDeleteSection\x12\$.google.chat.v1.DeleteSectionRequest\x1A\x16.google.protobuf.Empty\",\xDAA\x04name\x82\xD3\xE4\x93\x02\x1F*\x1D/v1/{name=users/*/sections/*}\x12\x9C\x01\x0A\x0DUpdateSection\x12\$.google.chat.v1.UpdateSectionRequest\x1A\x17.google.chat.v1.Section\"L\xDAA\x13section,update_mask\x82\xD3\xE4\x93\x0202%/v1/{section.name=users/*/sections/*}:\x07section\x12\x89\x01\x0A\x0CListSections\x12#.google.chat.v1.ListSectionsRequest\x1A\$.google.chat.v1.ListSectionsResponse\".\xDAA\x06parent\x82\xD3\xE4\x93\x02\x1F\x12\x1D/v1/{parent=users/*}/sections\x12\x95\x01\x0A\x0FPositionSection\x12&.google.chat.v1.PositionSectionRequest\x1A'.google.chat.v1.PositionSectionResponse\"1\x82\xD3\xE4\x93\x02+\"&/v1/{name=users/*/sections/*}:position:\x01*\x12\x9D\x01\x0A\x10ListSectionItems\x12'.google.chat.v1.ListSectionItemsRequest\x1A(.google.chat.v1.ListSectionItemsResponse\"6\xDAA\x06parent\x82\xD3\xE4\x93\x02'\x12%/v1/{parent=users/*/sections/*}/items\x12\xAF\x01\x0A\x0FMoveSectionItem\x12&.google.chat.v1.MoveSectionItemRequest\x1A'.google.chat.v1.MoveSectionItemResponse\"K\xDAA\x13name,target_section\x82\xD3\xE4\x93\x02/\"*/v1/{name=users/*/sections/*/items/*}:move:\x01*\x1A\xB7\x0F\xCAA\x13chat.googleapis.com\xD2A\x9D\x0Fhttps://www.googleapis.com/auth/chat.admin.delete,https://www.googleapis.com/auth/chat.admin.memberships,https://www.googleapis.com/auth/chat.admin.memberships.readonly,https://www.googleapis.com/auth/chat.admin.spaces,https://www.googleapis.com/auth/chat.admin.spaces.readonly,https://www.googleapis.com/auth/chat.app.delete,https://www.googleapis.com/auth/chat.app.memberships,https://www.googleapis.com/auth/chat.app.memberships.readonly,https://www.googleapis.com/auth/chat.app.messages.readonly,https://www.googleapis.com/auth/chat.app.spaces,https://www.googleapis.com/auth/chat.app.spaces.create,https://www.googleapis.com/auth/chat.app.spaces.readonly,https://www.googleapis.com/auth/chat.bot,https://www.googleapis.com/auth/chat.customemojis,https://www.googleapis.com/auth/chat.customemojis.readonly,https://www.googleapis.com/auth/chat.delete,https://www.googleapis.com/auth/chat.import,https://www.googleapis.com/auth/chat.memberships,https://www.googleapis.com/auth/chat.memberships.app,https://www.googleapis.com/auth/chat.memberships.readonly,https://www.googleapis.com/auth/chat.messages,https://www.googleapis.com/auth/chat.messages.create,https://www.googleapis.com/auth/chat.messages.reactions,https://www.googleapis.com/auth/chat.messages.reactions.create,https://www.googleapis.com/auth/chat.messages.reactions.readonly,https://www.googleapis.com/auth/chat.messages.readonly,https://www.googleapis.com/auth/chat.spaces,https://www.googleapis.com/auth/chat.spaces.create,https://www.googleapis.com/auth/chat.spaces.readonly,https://www.googleapis.com/auth/chat.users.availability,https://www.googleapis.com/auth/chat.users.availability.readonly,https://www.googleapis.com/auth/chat.users.readstate,https://www.googleapis.com/auth/chat.users.readstate.readonly,https://www.googleapis.com/auth/chat.users.sections,https://www.googleapis.com/auth/chat.users.sections.readonly,https://www.googleapis.com/auth/chat.users.spacesettingsB\xA9\x01\x0A\x12com.google.chat.v1B\x10ChatServiceProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xA2\x02\x0BDYNAPIProto\xAA\x02\x13Google.Apps.Chat.V1\xCA\x02\x13Google\\Apps\\Chat\\V1\xEA\x02\x16Google::Apps::Chat::V1b\x06proto3" + "\x0A\xAAN\x0A!google/chat/v1/chat_service.proto\x12\x0Egoogle.chat.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/chat/v1/attachment.proto\x1A!google/chat/v1/availability.proto\x1A\x1Fgoogle/chat/v1/membership.proto\x1A\x1Cgoogle/chat/v1/message.proto\x1A\x1Dgoogle/chat/v1/reaction.proto\x1A\x1Cgoogle/chat/v1/section.proto\x1A\x1Agoogle/chat/v1/space.proto\x1A google/chat/v1/space_event.proto\x1A/google/chat/v1/space_notification_setting.proto\x1A%google/chat/v1/space_read_state.proto\x1A google/chat/v1/space_setup.proto\x1A&google/chat/v1/thread_read_state.proto\x1A\x1Bgoogle/protobuf/empty.proto2\xEAH\x0A\x0BChatService\x12\x9B\x01\x0A\x0DCreateMessage\x12\$.google.chat.v1.CreateMessageRequest\x1A\x17.google.chat.v1.Message\"K\xDAA\x19parent,message,message_id\x82\xD3\xE4\x93\x02)\"\x1E/v1/{parent=spaces/*}/messages:\x07message\x12\x8A\x01\x0A\x0CListMessages\x12#.google.chat.v1.ListMessagesRequest\x1A\$.google.chat.v1.ListMessagesResponse\"/\xDAA\x06parent\x82\xD3\xE4\x93\x02 \x12\x1E/v1/{parent=spaces/*}/messages\x12\x92\x01\x0A\x0FListMemberships\x12&.google.chat.v1.ListMembershipsRequest\x1A'.google.chat.v1.ListMembershipsResponse\".\xDAA\x06parent\x82\xD3\xE4\x93\x02\x1F\x12\x1D/v1/{parent=spaces/*}/members\x12\x7F\x0A\x0DGetMembership\x12\$.google.chat.v1.GetMembershipRequest\x1A\x1A.google.chat.v1.Membership\",\xDAA\x04name\x82\xD3\xE4\x93\x02\x1F\x12\x1D/v1/{name=spaces/*/members/*}\x12w\x0A\x0AGetMessage\x12!.google.chat.v1.GetMessageRequest\x1A\x17.google.chat.v1.Message\"-\xDAA\x04name\x82\xD3\xE4\x93\x02 \x12\x1E/v1/{name=spaces/*/messages/*}\x12\xD1\x01\x0A\x0DUpdateMessage\x12\$.google.chat.v1.UpdateMessageRequest\x1A\x17.google.chat.v1.Message\"\x80\x01\xDAA\x13message,update_mask\x82\xD3\xE4\x93\x02d\x1A&/v1/{message.name=spaces/*/messages/*}:\x07messageZ12&/v1/{message.name=spaces/*/messages/*}:\x07message\x12|\x0A\x0DDeleteMessage\x12\$.google.chat.v1.DeleteMessageRequest\x1A\x16.google.protobuf.Empty\"-\xDAA\x04name\x82\xD3\xE4\x93\x02 *\x1E/v1/{name=spaces/*/messages/*}\x12\xA1\x01\x0A\x0ESearchMessages\x12%.google.chat.v1.SearchMessagesRequest\x1A&.google.chat.v1.SearchMessagesResponse\"@\xDAA\x0Dparent,filter\x82\xD3\xE4\x93\x02*\"%/v1/{parent=spaces/*}/messages:search:\x01*\x12\x8E\x01\x0A\x0DGetAttachment\x12\$.google.chat.v1.GetAttachmentRequest\x1A\x1A.google.chat.v1.Attachment\";\xDAA\x04name\x82\xD3\xE4\x93\x02.\x12,/v1/{name=spaces/*/messages/*/attachments/*}\x12\x9A\x01\x0A\x10UploadAttachment\x12'.google.chat.v1.UploadAttachmentRequest\x1A(.google.chat.v1.UploadAttachmentResponse\"3\x82\xD3\xE4\x93\x02-\"(/v1/{parent=spaces/*}/attachments:upload:\x01*\x12j\x0A\x0AListSpaces\x12!.google.chat.v1.ListSpacesRequest\x1A\".google.chat.v1.ListSpacesResponse\"\x15\xDAA\x00\x82\xD3\xE4\x93\x02\x0C\x12\x0A/v1/spaces\x12w\x0A\x0CSearchSpaces\x12#.google.chat.v1.SearchSpacesRequest\x1A\$.google.chat.v1.SearchSpacesResponse\"\x1C\xDAA\x00\x82\xD3\xE4\x93\x02\x13\x12\x11/v1/spaces:search\x12f\x0A\x08GetSpace\x12\x1F.google.chat.v1.GetSpaceRequest\x1A\x15.google.chat.v1.Space\"\"\xDAA\x04name\x82\xD3\xE4\x93\x02\x15\x12\x13/v1/{name=spaces/*}\x12k\x0A\x0BCreateSpace\x12\".google.chat.v1.CreateSpaceRequest\x1A\x15.google.chat.v1.Space\"!\xDAA\x05space\x82\xD3\xE4\x93\x02\x13\"\x0A/v1/spaces:\x05space\x12c\x0A\x0ASetUpSpace\x12!.google.chat.v1.SetUpSpaceRequest\x1A\x15.google.chat.v1.Space\"\x1B\x82\xD3\xE4\x93\x02\x15\"\x10/v1/spaces:setup:\x01*\x12\x86\x01\x0A\x0BUpdateSpace\x12\".google.chat.v1.UpdateSpaceRequest\x1A\x15.google.chat.v1.Space\"<\xDAA\x11space,update_mask\x82\xD3\xE4\x93\x02\"2\x19/v1/{space.name=spaces/*}:\x05space\x12m\x0A\x0BDeleteSpace\x12\".google.chat.v1.DeleteSpaceRequest\x1A\x16.google.protobuf.Empty\"\"\xDAA\x04name\x82\xD3\xE4\x93\x02\x15*\x13/v1/{name=spaces/*}\x12\x9D\x01\x0A\x13CompleteImportSpace\x12*.google.chat.v1.CompleteImportSpaceRequest\x1A+.google.chat.v1.CompleteImportSpaceResponse\"-\x82\xD3\xE4\x93\x02'\"\"/v1/{name=spaces/*}:completeImport:\x01*\x12z\x0A\x11FindDirectMessage\x12(.google.chat.v1.FindDirectMessageRequest\x1A\x15.google.chat.v1.Space\"\$\x82\xD3\xE4\x93\x02\x1E\x12\x1C/v1/spaces:findDirectMessage\x12\x82\x01\x0A\x0EFindGroupChats\x12%.google.chat.v1.FindGroupChatsRequest\x1A&.google.chat.v1.FindGroupChatsResponse\"!\x82\xD3\xE4\x93\x02\x1B\x12\x19/v1/spaces:findGroupChats\x12\x9E\x01\x0A\x10CreateMembership\x12'.google.chat.v1.CreateMembershipRequest\x1A\x1A.google.chat.v1.Membership\"E\xDAA\x11parent,membership\x82\xD3\xE4\x93\x02+\"\x1D/v1/{parent=spaces/*}/members:\x0Amembership\x12\xAE\x01\x0A\x10UpdateMembership\x12'.google.chat.v1.UpdateMembershipRequest\x1A\x1A.google.chat.v1.Membership\"U\xDAA\x16membership,update_mask\x82\xD3\xE4\x93\x0262(/v1/{membership.name=spaces/*/members/*}:\x0Amembership\x12\x85\x01\x0A\x10DeleteMembership\x12'.google.chat.v1.DeleteMembershipRequest\x1A\x1A.google.chat.v1.Membership\",\xDAA\x04name\x82\xD3\xE4\x93\x02\x1F*\x1D/v1/{name=spaces/*/members/*}\x12\xA1\x01\x0A\x0ECreateReaction\x12%.google.chat.v1.CreateReactionRequest\x1A\x18.google.chat.v1.Reaction\"N\xDAA\x0Fparent,reaction\x82\xD3\xE4\x93\x026\"*/v1/{parent=spaces/*/messages/*}/reactions:\x08reaction\x12\x99\x01\x0A\x0DListReactions\x12\$.google.chat.v1.ListReactionsRequest\x1A%.google.chat.v1.ListReactionsResponse\";\xDAA\x06parent\x82\xD3\xE4\x93\x02,\x12*/v1/{parent=spaces/*/messages/*}/reactions\x12\x8A\x01\x0A\x0EDeleteReaction\x12%.google.chat.v1.DeleteReactionRequest\x1A\x16.google.protobuf.Empty\"9\xDAA\x04name\x82\xD3\xE4\x93\x02,**/v1/{name=spaces/*/messages/*/reactions/*}\x12\x91\x01\x0A\x11CreateCustomEmoji\x12(.google.chat.v1.CreateCustomEmojiRequest\x1A\x1B.google.chat.v1.CustomEmoji\"5\xDAA\x0Ccustom_emoji\x82\xD3\xE4\x93\x02 \"\x10/v1/customEmojis:\x0Ccustom_emoji\x12~\x0A\x0EGetCustomEmoji\x12%.google.chat.v1.GetCustomEmojiRequest\x1A\x1B.google.chat.v1.CustomEmoji\"(\xDAA\x04name\x82\xD3\xE4\x93\x02\x1B\x12\x19/v1/{name=customEmojis/*}\x12\x82\x01\x0A\x10ListCustomEmojis\x12'.google.chat.v1.ListCustomEmojisRequest\x1A(.google.chat.v1.ListCustomEmojisResponse\"\x1B\xDAA\x00\x82\xD3\xE4\x93\x02\x12\x12\x10/v1/customEmojis\x12\x7F\x0A\x11DeleteCustomEmoji\x12(.google.chat.v1.DeleteCustomEmojiRequest\x1A\x16.google.protobuf.Empty\"(\xDAA\x04name\x82\xD3\xE4\x93\x02\x1B*\x19/v1/{name=customEmojis/*}\x12\x98\x01\x0A\x11GetSpaceReadState\x12(.google.chat.v1.GetSpaceReadStateRequest\x1A\x1E.google.chat.v1.SpaceReadState\"9\xDAA\x04name\x82\xD3\xE4\x93\x02,\x12*/v1/{name=users/*/spaces/*/spaceReadState}\x12\xD9\x01\x0A\x14UpdateSpaceReadState\x12+.google.chat.v1.UpdateSpaceReadStateRequest\x1A\x1E.google.chat.v1.SpaceReadState\"t\xDAA\x1Cspace_read_state,update_mask\x82\xD3\xE4\x93\x02O2;/v1/{space_read_state.name=users/*/spaces/*/spaceReadState}:\x10space_read_state\x12\xA6\x01\x0A\x12GetThreadReadState\x12).google.chat.v1.GetThreadReadStateRequest\x1A\x1F.google.chat.v1.ThreadReadState\"D\xDAA\x04name\x82\xD3\xE4\x93\x027\x125/v1/{name=users/*/spaces/*/threads/*/threadReadState}\x12\x87\x01\x0A\x0FGetAvailability\x12&.google.chat.v1.GetAvailabilityRequest\x1A\x1C.google.chat.v1.Availability\".\xDAA\x04name\x82\xD3\xE4\x93\x02!\x12\x1F/v1/{name=users/*/availability}\x12\x8A\x01\x0A\x0CMarkAsActive\x12#.google.chat.v1.MarkAsActiveRequest\x1A\x1C.google.chat.v1.Availability\"7\x82\xD3\xE4\x93\x021\",/v1/{name=users/*/availability}:markAsActive:\x01*\x12\x84\x01\x0A\x0AMarkAsAway\x12!.google.chat.v1.MarkAsAwayRequest\x1A\x1C.google.chat.v1.Availability\"5\x82\xD3\xE4\x93\x02/\"*/v1/{name=users/*/availability}:markAsAway:\x01*\x12\x9C\x01\x0A\x12MarkAsDoNotDisturb\x12).google.chat.v1.MarkAsDoNotDisturbRequest\x1A\x1C.google.chat.v1.Availability\"=\x82\xD3\xE4\x93\x027\"2/v1/{name=users/*/availability}:markAsDoNotDisturb:\x01*\x12\xBC\x01\x0A\x12UpdateAvailability\x12).google.chat.v1.UpdateAvailabilityRequest\x1A\x1C.google.chat.v1.Availability\"]\xDAA\x18availability,update_mask\x82\xD3\xE4\x93\x02<2,/v1/{availability.name=users/*/availability}:\x0Cavailability\x12\x83\x01\x0A\x0DGetSpaceEvent\x12\$.google.chat.v1.GetSpaceEventRequest\x1A\x1A.google.chat.v1.SpaceEvent\"0\xDAA\x04name\x82\xD3\xE4\x93\x02#\x12!/v1/{name=spaces/*/spaceEvents/*}\x12\x9D\x01\x0A\x0FListSpaceEvents\x12&.google.chat.v1.ListSpaceEventsRequest\x1A'.google.chat.v1.ListSpaceEventsResponse\"9\xDAA\x0Dparent,filter\x82\xD3\xE4\x93\x02#\x12!/v1/{parent=spaces/*}/spaceEvents\x12\xC0\x01\x0A\x1BGetSpaceNotificationSetting\x122.google.chat.v1.GetSpaceNotificationSettingRequest\x1A(.google.chat.v1.SpaceNotificationSetting\"C\xDAA\x04name\x82\xD3\xE4\x93\x026\x124/v1/{name=users/*/spaces/*/spaceNotificationSetting}\x12\xA0\x02\x0A\x1EUpdateSpaceNotificationSetting\x125.google.chat.v1.UpdateSpaceNotificationSettingRequest\x1A(.google.chat.v1.SpaceNotificationSetting\"\x9C\x01\xDAA&space_notification_setting,update_mask\x82\xD3\xE4\x93\x02m2O/v1/{space_notification_setting.name=users/*/spaces/*/spaceNotificationSetting}:\x1Aspace_notification_setting\x12\x8F\x01\x0A\x0DCreateSection\x12\$.google.chat.v1.CreateSectionRequest\x1A\x17.google.chat.v1.Section\"?\xDAA\x0Eparent,section\x82\xD3\xE4\x93\x02(\"\x1D/v1/{parent=users/*}/sections:\x07section\x12{\x0A\x0DDeleteSection\x12\$.google.chat.v1.DeleteSectionRequest\x1A\x16.google.protobuf.Empty\",\xDAA\x04name\x82\xD3\xE4\x93\x02\x1F*\x1D/v1/{name=users/*/sections/*}\x12\x9C\x01\x0A\x0DUpdateSection\x12\$.google.chat.v1.UpdateSectionRequest\x1A\x17.google.chat.v1.Section\"L\xDAA\x13section,update_mask\x82\xD3\xE4\x93\x0202%/v1/{section.name=users/*/sections/*}:\x07section\x12\x89\x01\x0A\x0CListSections\x12#.google.chat.v1.ListSectionsRequest\x1A\$.google.chat.v1.ListSectionsResponse\".\xDAA\x06parent\x82\xD3\xE4\x93\x02\x1F\x12\x1D/v1/{parent=users/*}/sections\x12\x95\x01\x0A\x0FPositionSection\x12&.google.chat.v1.PositionSectionRequest\x1A'.google.chat.v1.PositionSectionResponse\"1\x82\xD3\xE4\x93\x02+\"&/v1/{name=users/*/sections/*}:position:\x01*\x12\x9D\x01\x0A\x10ListSectionItems\x12'.google.chat.v1.ListSectionItemsRequest\x1A(.google.chat.v1.ListSectionItemsResponse\"6\xDAA\x06parent\x82\xD3\xE4\x93\x02'\x12%/v1/{parent=users/*/sections/*}/items\x12\xAF\x01\x0A\x0FMoveSectionItem\x12&.google.chat.v1.MoveSectionItemRequest\x1A'.google.chat.v1.MoveSectionItemResponse\"K\xDAA\x13name,target_section\x82\xD3\xE4\x93\x02/\"*/v1/{name=users/*/sections/*/items/*}:move:\x01*\x1A\xB7\x0F\xCAA\x13chat.googleapis.com\xD2A\x9D\x0Fhttps://www.googleapis.com/auth/chat.admin.delete,https://www.googleapis.com/auth/chat.admin.memberships,https://www.googleapis.com/auth/chat.admin.memberships.readonly,https://www.googleapis.com/auth/chat.admin.spaces,https://www.googleapis.com/auth/chat.admin.spaces.readonly,https://www.googleapis.com/auth/chat.app.delete,https://www.googleapis.com/auth/chat.app.memberships,https://www.googleapis.com/auth/chat.app.memberships.readonly,https://www.googleapis.com/auth/chat.app.messages.readonly,https://www.googleapis.com/auth/chat.app.spaces,https://www.googleapis.com/auth/chat.app.spaces.create,https://www.googleapis.com/auth/chat.app.spaces.readonly,https://www.googleapis.com/auth/chat.bot,https://www.googleapis.com/auth/chat.customemojis,https://www.googleapis.com/auth/chat.customemojis.readonly,https://www.googleapis.com/auth/chat.delete,https://www.googleapis.com/auth/chat.import,https://www.googleapis.com/auth/chat.memberships,https://www.googleapis.com/auth/chat.memberships.app,https://www.googleapis.com/auth/chat.memberships.readonly,https://www.googleapis.com/auth/chat.messages,https://www.googleapis.com/auth/chat.messages.create,https://www.googleapis.com/auth/chat.messages.reactions,https://www.googleapis.com/auth/chat.messages.reactions.create,https://www.googleapis.com/auth/chat.messages.reactions.readonly,https://www.googleapis.com/auth/chat.messages.readonly,https://www.googleapis.com/auth/chat.spaces,https://www.googleapis.com/auth/chat.spaces.create,https://www.googleapis.com/auth/chat.spaces.readonly,https://www.googleapis.com/auth/chat.users.availability,https://www.googleapis.com/auth/chat.users.availability.readonly,https://www.googleapis.com/auth/chat.users.readstate,https://www.googleapis.com/auth/chat.users.readstate.readonly,https://www.googleapis.com/auth/chat.users.sections,https://www.googleapis.com/auth/chat.users.sections.readonly,https://www.googleapis.com/auth/chat.users.spacesettingsB\xA9\x01\x0A\x12com.google.chat.v1B\x10ChatServiceProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xA2\x02\x0BDYNAPIProto\xAA\x02\x13Google.Apps.Chat.V1\xCA\x02\x13Google\\Apps\\Chat\\V1\xEA\x02\x16Google::Apps::Chat::V1b\x06proto3" , true); static::$is_initialized = true; diff --git a/AppsChat/metadata/Chat/V1/Message.php b/AppsChat/metadata/Chat/V1/Message.php index 667e69ec7d11..ded1fba22456 100644 --- a/AppsChat/metadata/Chat/V1/Message.php +++ b/AppsChat/metadata/Chat/V1/Message.php @@ -26,11 +26,12 @@ public static function initOnce() { \GPBMetadata\Google\Chat\V1\Reaction::initOnce(); \GPBMetadata\Google\Chat\V1\SlashCommand::initOnce(); \GPBMetadata\Google\Chat\V1\Space::initOnce(); + \GPBMetadata\Google\Chat\V1\SpaceNotificationSetting::initOnce(); \GPBMetadata\Google\Chat\V1\User::initOnce(); \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( - "\x0A\x9D*\x0A\x1Cgoogle/chat/v1/message.proto\x12\x0Egoogle.chat.v1\x1A\x19google/api/resource.proto\x1A\x1Egoogle/apps/card/v1/card.proto\x1A\"google/chat/v1/action_status.proto\x1A\x1Fgoogle/chat/v1/annotation.proto\x1A\x1Fgoogle/chat/v1/attachment.proto\x1A%google/chat/v1/contextual_addon.proto\x1A&google/chat/v1/deletion_metadata.proto\x1A google/chat/v1/matched_url.proto\x1A\x1Dgoogle/chat/v1/reaction.proto\x1A\"google/chat/v1/slash_command.proto\x1A\x1Agoogle/chat/v1/space.proto\x1A\x19google/chat/v1/user.proto\x1A google/protobuf/field_mask.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xE9\x0A\x0A\x07Message\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x12)\x0A\x06sender\x18\x02 \x01(\x0B2\x14.google.chat.v1.UserB\x03\xE0A\x03\x127\x0A\x0Bcreate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x06\xE0A\x05\xE0A\x01\x129\x0A\x10last_update_time\x18\x17 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bdelete_time\x18\x1A \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12\x11\x0A\x04text\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x1B\x0A\x0Eformatted_text\x18+ \x01(\x09B\x03\xE0A\x03\x12=\x0A\x05cards\x18\x05 \x03(\x0B2*.google.chat.v1.ContextualAddOnMarkup.CardB\x02\x18\x01\x121\x0A\x08cards_v2\x18\x16 \x03(\x0B2\x1A.google.chat.v1.CardWithIdB\x03\xE0A\x01\x124\x0A\x0Bannotations\x18\x0A \x03(\x0B2\x1A.google.chat.v1.AnnotationB\x03\xE0A\x03\x12&\x0A\x06thread\x18\x0B \x01(\x0B2\x16.google.chat.v1.Thread\x12)\x0A\x05space\x18\x0C \x01(\x0B2\x15.google.chat.v1.SpaceB\x03\xE0A\x03\x12\x1A\x0A\x0Dfallback_text\x18\x0D \x01(\x09B\x03\xE0A\x01\x12<\x0A\x0Faction_response\x18\x0E \x01(\x0B2\x1E.google.chat.v1.ActionResponseB\x03\xE0A\x04\x12\x1A\x0A\x0Dargument_text\x18\x0F \x01(\x09B\x03\xE0A\x03\x128\x0A\x0Dslash_command\x18\x11 \x01(\x0B2\x1C.google.chat.v1.SlashCommandB\x03\xE0A\x03\x123\x0A\x0Aattachment\x18\x12 \x03(\x0B2\x1A.google.chat.v1.AttachmentB\x03\xE0A\x01\x124\x0A\x0Bmatched_url\x18\x14 \x01(\x0B2\x1A.google.chat.v1.MatchedUrlB\x03\xE0A\x03\x12\x19\x0A\x0Cthread_reply\x18\x19 \x01(\x08B\x03\xE0A\x03\x12\x13\x0A\x06silent\x18. \x01(\x08B\x03\xE0A\x03\x12'\x0A\x1Aclient_assigned_message_id\x18 \x01(\x09B\x03\xE0A\x01\x12K\x0A\x18emoji_reaction_summaries\x18! \x03(\x0B2\$.google.chat.v1.EmojiReactionSummaryB\x03\xE0A\x03\x12<\x0A\x16private_message_viewer\x18\$ \x01(\x0B2\x14.google.chat.v1.UserB\x06\xE0A\x05\xE0A\x01\x12@\x0A\x11deletion_metadata\x18& \x01(\x0B2 .google.chat.v1.DeletionMetadataB\x03\xE0A\x03\x12K\x0A\x17quoted_message_metadata\x18' \x01(\x0B2%.google.chat.v1.QuotedMessageMetadataB\x03\xE0A\x01\x127\x0A\x0Dattached_gifs\x18* \x03(\x0B2\x1B.google.chat.v1.AttachedGifB\x03\xE0A\x03\x12?\x0A\x11accessory_widgets\x18, \x03(\x0B2\x1F.google.chat.v1.AccessoryWidgetB\x03\xE0A\x01:C\xEAA@\x0A\x1Bchat.googleapis.com/Message\x12!spaces/{space}/messages/{message}\"\x1F\x0A\x0BAttachedGif\x12\x10\x0A\x03uri\x18\x01 \x01(\x09B\x03\xE0A\x03\"\xA5\x04\x0A\x15QuotedMessageMetadata\x121\x0A\x04name\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bchat.googleapis.com/Message\x129\x0A\x10last_update_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x02\x12H\x0A\x0Aquote_type\x18\x04 \x01(\x0E2/.google.chat.v1.QuotedMessageMetadata.QuoteTypeB\x03\xE0A\x01\x12K\x0A\x17quoted_message_snapshot\x18\x05 \x01(\x0B2%.google.chat.v1.QuotedMessageSnapshotB\x03\xE0A\x03\x12B\x0A\x12forwarded_metadata\x18\x06 \x01(\x0B2!.google.chat.v1.ForwardedMetadataB\x03\xE0A\x03\"?\x0A\x09QuoteType\x12\x1A\x0A\x16QUOTE_TYPE_UNSPECIFIED\x10\x00\x12\x09\x0A\x05REPLY\x10\x01\x12\x0B\x0A\x07FORWARD\x10\x02:\x81\x01\xEAA~\x0A)chat.googleapis.com/QuotedMessageMetadata\x12Qspaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}\"\xC8\x01\x0A\x15QuotedMessageSnapshot\x12\x13\x0A\x06sender\x18\x01 \x01(\x09B\x03\xE0A\x03\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x1B\x0A\x0Eformatted_text\x18\x03 \x01(\x09B\x03\xE0A\x03\x124\x0A\x0Bannotations\x18\x04 \x03(\x0B2\x1A.google.chat.v1.AnnotationB\x03\xE0A\x03\x124\x0A\x0Battachments\x18\x05 \x03(\x0B2\x1A.google.chat.v1.AttachmentB\x03\xE0A\x03\"f\x0A\x11ForwardedMetadata\x120\x0A\x05space\x18\x01 \x01(\x09B!\xE0A\x03\xFAA\x1B\x0A\x19chat.googleapis.com/Space\x12\x1F\x0A\x12space_display_name\x18\x02 \x01(\x09B\x03\xE0A\x03\"v\x0A\x06Thread\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x12\x17\x0A\x0Athread_key\x18\x03 \x01(\x09B\x03\xE0A\x01:@\xEAA=\x0A\x1Achat.googleapis.com/Thread\x12\x1Fspaces/{space}/threads/{thread}\"\xD2\x04\x0A\x0EActionResponse\x12>\x0A\x04type\x18\x01 \x01(\x0E2+.google.chat.v1.ActionResponse.ResponseTypeB\x03\xE0A\x04\x12\x10\x0A\x03url\x18\x02 \x01(\x09B\x03\xE0A\x04\x128\x0A\x0Ddialog_action\x18\x03 \x01(\x0B2\x1C.google.chat.v1.DialogActionB\x03\xE0A\x04\x12I\x0A\x0Eupdated_widget\x18\x04 \x01(\x0B2,.google.chat.v1.ActionResponse.UpdatedWidgetB\x03\xE0A\x04\x1AR\x0A\x0ESelectionItems\x12@\x0A\x05items\x18\x01 \x03(\x0B21.google.apps.card.v1.SelectionInput.SelectionItem\x1Aw\x0A\x0DUpdatedWidget\x12D\x0A\x0Bsuggestions\x18\x01 \x01(\x0B2-.google.chat.v1.ActionResponse.SelectionItemsH\x00\x12\x0E\x0A\x06widget\x18\x02 \x01(\x09B\x10\x0A\x0Eupdated_widget\"\x9B\x01\x0A\x0CResponseType\x12\x14\x0A\x10TYPE_UNSPECIFIED\x10\x00\x12\x0F\x0A\x0BNEW_MESSAGE\x10\x01\x12\x12\x0A\x0EUPDATE_MESSAGE\x10\x02\x12\x1D\x0A\x19UPDATE_USER_MESSAGE_CARDS\x10\x06\x12\x12\x0A\x0EREQUEST_CONFIG\x10\x03\x12\x0A\x0A\x06DIALOG\x10\x04\x12\x11\x0A\x0DUPDATE_WIDGET\x10\x07\"S\x0A\x0FAccessoryWidget\x126\x0A\x0Bbutton_list\x18\x01 \x01(\x0B2\x1F.google.apps.card.v1.ButtonListH\x00B\x08\x0A\x06action\"F\x0A\x11GetMessageRequest\x121\x0A\x04name\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bchat.googleapis.com/Message\"]\x0A\x14DeleteMessageRequest\x121\x0A\x04name\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bchat.googleapis.com/Message\x12\x12\x0A\x05force\x18\x02 \x01(\x08B\x03\xE0A\x01\"\x97\x01\x0A\x14UpdateMessageRequest\x12-\x0A\x07message\x18\x01 \x01(\x0B2\x17.google.chat.v1.MessageB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x02\x12\x1A\x0A\x0Dallow_missing\x18\x04 \x01(\x08B\x03\xE0A\x01\"\x88\x04\x0A\x14CreateMessageRequest\x123\x0A\x06parent\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x12\x1Bchat.googleapis.com/Message\x12-\x0A\x07message\x18\x04 \x01(\x0B2\x17.google.chat.v1.MessageB\x03\xE0A\x02\x12\x19\x0A\x0Athread_key\x18\x06 \x01(\x09B\x05\x18\x01\xE0A\x01\x12\x17\x0A\x0Arequest_id\x18\x07 \x01(\x09B\x03\xE0A\x01\x12Z\x0A\x14message_reply_option\x18\x08 \x01(\x0E27.google.chat.v1.CreateMessageRequest.MessageReplyOptionB\x03\xE0A\x01\x12\x17\x0A\x0Amessage_id\x18\x09 \x01(\x09B\x03\xE0A\x01\x12b\x0A#create_message_notification_options\x18\x0A \x01(\x0B20.google.chat.v1.CreateMessageNotificationOptionsB\x03\xE0A\x01\"\x7F\x0A\x12MessageReplyOption\x12\$\x0A MESSAGE_REPLY_OPTION_UNSPECIFIED\x10\x00\x12(\x0A\$REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD\x10\x01\x12\x19\x0A\x15REPLY_MESSAGE_OR_FAIL\x10\x02\"\xF2\x01\x0A CreateMessageNotificationOptions\x12\\\x0A\x11notification_type\x18\x01 \x01(\x0E2A.google.chat.v1.CreateMessageNotificationOptions.NotificationType\"p\x0A\x10NotificationType\x12\x1A\x0A\x16NOTIFICATION_TYPE_NONE\x10\x00\x12\"\x0A\x1ENOTIFICATION_TYPE_FORCE_NOTIFY\x10\x02\x12\x1C\x0A\x18NOTIFICATION_TYPE_SILENT\x10\x03\"\xC2\x01\x0A\x13ListMessagesRequest\x123\x0A\x06parent\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x12\x1Bchat.googleapis.com/Message\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08order_by\x18\x05 \x01(\x09B\x03\xE0A\x01\x12\x19\x0A\x0Cshow_deleted\x18\x06 \x01(\x08B\x03\xE0A\x01\"Z\x0A\x14ListMessagesResponse\x12)\x0A\x08messages\x18\x01 \x03(\x0B2\x17.google.chat.v1.Message\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"\x81\x01\x0A\x0CDialogAction\x12-\x0A\x06dialog\x18\x01 \x01(\x0B2\x16.google.chat.v1.DialogB\x03\xE0A\x04H\x00\x128\x0A\x0Daction_status\x18\x02 \x01(\x0B2\x1C.google.chat.v1.ActionStatusB\x03\xE0A\x04B\x08\x0A\x06action\"6\x0A\x06Dialog\x12,\x0A\x04body\x18\x01 \x01(\x0B2\x19.google.apps.card.v1.CardB\x03\xE0A\x04\"F\x0A\x0ACardWithId\x12\x0F\x0A\x07card_id\x18\x01 \x01(\x09\x12'\x0A\x04card\x18\x02 \x01(\x0B2\x19.google.apps.card.v1.CardB\xA5\x01\x0A\x12com.google.chat.v1B\x0CMessageProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xA2\x02\x0BDYNAPIProto\xAA\x02\x13Google.Apps.Chat.V1\xCA\x02\x13Google\\Apps\\Chat\\V1\xEA\x02\x16Google::Apps::Chat::V1b\x06proto3" + "\x0A\xD9/\x0A\x1Cgoogle/chat/v1/message.proto\x12\x0Egoogle.chat.v1\x1A\x19google/api/resource.proto\x1A\x1Egoogle/apps/card/v1/card.proto\x1A\"google/chat/v1/action_status.proto\x1A\x1Fgoogle/chat/v1/annotation.proto\x1A\x1Fgoogle/chat/v1/attachment.proto\x1A%google/chat/v1/contextual_addon.proto\x1A&google/chat/v1/deletion_metadata.proto\x1A google/chat/v1/matched_url.proto\x1A\x1Dgoogle/chat/v1/reaction.proto\x1A\"google/chat/v1/slash_command.proto\x1A\x1Agoogle/chat/v1/space.proto\x1A/google/chat/v1/space_notification_setting.proto\x1A\x19google/chat/v1/user.proto\x1A google/protobuf/field_mask.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xE9\x0A\x0A\x07Message\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x12)\x0A\x06sender\x18\x02 \x01(\x0B2\x14.google.chat.v1.UserB\x03\xE0A\x03\x127\x0A\x0Bcreate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x06\xE0A\x05\xE0A\x01\x129\x0A\x10last_update_time\x18\x17 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bdelete_time\x18\x1A \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12\x11\x0A\x04text\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x1B\x0A\x0Eformatted_text\x18+ \x01(\x09B\x03\xE0A\x03\x12=\x0A\x05cards\x18\x05 \x03(\x0B2*.google.chat.v1.ContextualAddOnMarkup.CardB\x02\x18\x01\x121\x0A\x08cards_v2\x18\x16 \x03(\x0B2\x1A.google.chat.v1.CardWithIdB\x03\xE0A\x01\x124\x0A\x0Bannotations\x18\x0A \x03(\x0B2\x1A.google.chat.v1.AnnotationB\x03\xE0A\x03\x12&\x0A\x06thread\x18\x0B \x01(\x0B2\x16.google.chat.v1.Thread\x12)\x0A\x05space\x18\x0C \x01(\x0B2\x15.google.chat.v1.SpaceB\x03\xE0A\x03\x12\x1A\x0A\x0Dfallback_text\x18\x0D \x01(\x09B\x03\xE0A\x01\x12<\x0A\x0Faction_response\x18\x0E \x01(\x0B2\x1E.google.chat.v1.ActionResponseB\x03\xE0A\x04\x12\x1A\x0A\x0Dargument_text\x18\x0F \x01(\x09B\x03\xE0A\x03\x128\x0A\x0Dslash_command\x18\x11 \x01(\x0B2\x1C.google.chat.v1.SlashCommandB\x03\xE0A\x03\x123\x0A\x0Aattachment\x18\x12 \x03(\x0B2\x1A.google.chat.v1.AttachmentB\x03\xE0A\x01\x124\x0A\x0Bmatched_url\x18\x14 \x01(\x0B2\x1A.google.chat.v1.MatchedUrlB\x03\xE0A\x03\x12\x19\x0A\x0Cthread_reply\x18\x19 \x01(\x08B\x03\xE0A\x03\x12\x13\x0A\x06silent\x18. \x01(\x08B\x03\xE0A\x03\x12'\x0A\x1Aclient_assigned_message_id\x18 \x01(\x09B\x03\xE0A\x01\x12K\x0A\x18emoji_reaction_summaries\x18! \x03(\x0B2\$.google.chat.v1.EmojiReactionSummaryB\x03\xE0A\x03\x12<\x0A\x16private_message_viewer\x18\$ \x01(\x0B2\x14.google.chat.v1.UserB\x06\xE0A\x05\xE0A\x01\x12@\x0A\x11deletion_metadata\x18& \x01(\x0B2 .google.chat.v1.DeletionMetadataB\x03\xE0A\x03\x12K\x0A\x17quoted_message_metadata\x18' \x01(\x0B2%.google.chat.v1.QuotedMessageMetadataB\x03\xE0A\x01\x127\x0A\x0Dattached_gifs\x18* \x03(\x0B2\x1B.google.chat.v1.AttachedGifB\x03\xE0A\x03\x12?\x0A\x11accessory_widgets\x18, \x03(\x0B2\x1F.google.chat.v1.AccessoryWidgetB\x03\xE0A\x01:C\xEAA@\x0A\x1Bchat.googleapis.com/Message\x12!spaces/{space}/messages/{message}\"\x1F\x0A\x0BAttachedGif\x12\x10\x0A\x03uri\x18\x01 \x01(\x09B\x03\xE0A\x03\"\xA5\x04\x0A\x15QuotedMessageMetadata\x121\x0A\x04name\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bchat.googleapis.com/Message\x129\x0A\x10last_update_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x02\x12H\x0A\x0Aquote_type\x18\x04 \x01(\x0E2/.google.chat.v1.QuotedMessageMetadata.QuoteTypeB\x03\xE0A\x01\x12K\x0A\x17quoted_message_snapshot\x18\x05 \x01(\x0B2%.google.chat.v1.QuotedMessageSnapshotB\x03\xE0A\x03\x12B\x0A\x12forwarded_metadata\x18\x06 \x01(\x0B2!.google.chat.v1.ForwardedMetadataB\x03\xE0A\x03\"?\x0A\x09QuoteType\x12\x1A\x0A\x16QUOTE_TYPE_UNSPECIFIED\x10\x00\x12\x09\x0A\x05REPLY\x10\x01\x12\x0B\x0A\x07FORWARD\x10\x02:\x81\x01\xEAA~\x0A)chat.googleapis.com/QuotedMessageMetadata\x12Qspaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}\"\xC8\x01\x0A\x15QuotedMessageSnapshot\x12\x13\x0A\x06sender\x18\x01 \x01(\x09B\x03\xE0A\x03\x12\x11\x0A\x04text\x18\x02 \x01(\x09B\x03\xE0A\x03\x12\x1B\x0A\x0Eformatted_text\x18\x03 \x01(\x09B\x03\xE0A\x03\x124\x0A\x0Bannotations\x18\x04 \x03(\x0B2\x1A.google.chat.v1.AnnotationB\x03\xE0A\x03\x124\x0A\x0Battachments\x18\x05 \x03(\x0B2\x1A.google.chat.v1.AttachmentB\x03\xE0A\x03\"f\x0A\x11ForwardedMetadata\x120\x0A\x05space\x18\x01 \x01(\x09B!\xE0A\x03\xFAA\x1B\x0A\x19chat.googleapis.com/Space\x12\x1F\x0A\x12space_display_name\x18\x02 \x01(\x09B\x03\xE0A\x03\"v\x0A\x06Thread\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x12\x17\x0A\x0Athread_key\x18\x03 \x01(\x09B\x03\xE0A\x01:@\xEAA=\x0A\x1Achat.googleapis.com/Thread\x12\x1Fspaces/{space}/threads/{thread}\"\xD2\x04\x0A\x0EActionResponse\x12>\x0A\x04type\x18\x01 \x01(\x0E2+.google.chat.v1.ActionResponse.ResponseTypeB\x03\xE0A\x04\x12\x10\x0A\x03url\x18\x02 \x01(\x09B\x03\xE0A\x04\x128\x0A\x0Ddialog_action\x18\x03 \x01(\x0B2\x1C.google.chat.v1.DialogActionB\x03\xE0A\x04\x12I\x0A\x0Eupdated_widget\x18\x04 \x01(\x0B2,.google.chat.v1.ActionResponse.UpdatedWidgetB\x03\xE0A\x04\x1AR\x0A\x0ESelectionItems\x12@\x0A\x05items\x18\x01 \x03(\x0B21.google.apps.card.v1.SelectionInput.SelectionItem\x1Aw\x0A\x0DUpdatedWidget\x12D\x0A\x0Bsuggestions\x18\x01 \x01(\x0B2-.google.chat.v1.ActionResponse.SelectionItemsH\x00\x12\x0E\x0A\x06widget\x18\x02 \x01(\x09B\x10\x0A\x0Eupdated_widget\"\x9B\x01\x0A\x0CResponseType\x12\x14\x0A\x10TYPE_UNSPECIFIED\x10\x00\x12\x0F\x0A\x0BNEW_MESSAGE\x10\x01\x12\x12\x0A\x0EUPDATE_MESSAGE\x10\x02\x12\x1D\x0A\x19UPDATE_USER_MESSAGE_CARDS\x10\x06\x12\x12\x0A\x0EREQUEST_CONFIG\x10\x03\x12\x0A\x0A\x06DIALOG\x10\x04\x12\x11\x0A\x0DUPDATE_WIDGET\x10\x07\"S\x0A\x0FAccessoryWidget\x126\x0A\x0Bbutton_list\x18\x01 \x01(\x0B2\x1F.google.apps.card.v1.ButtonListH\x00B\x08\x0A\x06action\"F\x0A\x11GetMessageRequest\x121\x0A\x04name\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bchat.googleapis.com/Message\"]\x0A\x14DeleteMessageRequest\x121\x0A\x04name\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x0A\x1Bchat.googleapis.com/Message\x12\x12\x0A\x05force\x18\x02 \x01(\x08B\x03\xE0A\x01\"\x97\x01\x0A\x14UpdateMessageRequest\x12-\x0A\x07message\x18\x01 \x01(\x0B2\x17.google.chat.v1.MessageB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x02\x12\x1A\x0A\x0Dallow_missing\x18\x04 \x01(\x08B\x03\xE0A\x01\"\x88\x04\x0A\x14CreateMessageRequest\x123\x0A\x06parent\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x12\x1Bchat.googleapis.com/Message\x12-\x0A\x07message\x18\x04 \x01(\x0B2\x17.google.chat.v1.MessageB\x03\xE0A\x02\x12\x19\x0A\x0Athread_key\x18\x06 \x01(\x09B\x05\x18\x01\xE0A\x01\x12\x17\x0A\x0Arequest_id\x18\x07 \x01(\x09B\x03\xE0A\x01\x12Z\x0A\x14message_reply_option\x18\x08 \x01(\x0E27.google.chat.v1.CreateMessageRequest.MessageReplyOptionB\x03\xE0A\x01\x12\x17\x0A\x0Amessage_id\x18\x09 \x01(\x09B\x03\xE0A\x01\x12b\x0A#create_message_notification_options\x18\x0A \x01(\x0B20.google.chat.v1.CreateMessageNotificationOptionsB\x03\xE0A\x01\"\x7F\x0A\x12MessageReplyOption\x12\$\x0A MESSAGE_REPLY_OPTION_UNSPECIFIED\x10\x00\x12(\x0A\$REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD\x10\x01\x12\x19\x0A\x15REPLY_MESSAGE_OR_FAIL\x10\x02\"\xF2\x01\x0A CreateMessageNotificationOptions\x12\\\x0A\x11notification_type\x18\x01 \x01(\x0E2A.google.chat.v1.CreateMessageNotificationOptions.NotificationType\"p\x0A\x10NotificationType\x12\x1A\x0A\x16NOTIFICATION_TYPE_NONE\x10\x00\x12\"\x0A\x1ENOTIFICATION_TYPE_FORCE_NOTIFY\x10\x02\x12\x1C\x0A\x18NOTIFICATION_TYPE_SILENT\x10\x03\"\xC2\x01\x0A\x13ListMessagesRequest\x123\x0A\x06parent\x18\x01 \x01(\x09B#\xE0A\x02\xFAA\x1D\x12\x1Bchat.googleapis.com/Message\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08order_by\x18\x05 \x01(\x09B\x03\xE0A\x01\x12\x19\x0A\x0Cshow_deleted\x18\x06 \x01(\x08B\x03\xE0A\x01\"Z\x0A\x14ListMessagesResponse\x12)\x0A\x08messages\x18\x01 \x03(\x0B2\x17.google.chat.v1.Message\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"\x81\x01\x0A\x0CDialogAction\x12-\x0A\x06dialog\x18\x01 \x01(\x0B2\x16.google.chat.v1.DialogB\x03\xE0A\x04H\x00\x128\x0A\x0Daction_status\x18\x02 \x01(\x0B2\x1C.google.chat.v1.ActionStatusB\x03\xE0A\x04B\x08\x0A\x06action\"6\x0A\x06Dialog\x12,\x0A\x04body\x18\x01 \x01(\x0B2\x19.google.apps.card.v1.CardB\x03\xE0A\x04\"F\x0A\x0ACardWithId\x12\x0F\x0A\x07card_id\x18\x01 \x01(\x09\x12'\x0A\x04card\x18\x02 \x01(\x0B2\x19.google.apps.card.v1.Card\"\xEF\x02\x0A\x15SearchMessagesRequest\x121\x0A\x06parent\x18\x01 \x01(\x09B!\xE0A\x02\xFAA\x1B\x0A\x19chat.googleapis.com/Space\x12\x13\x0A\x06filter\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x16\x0A\x09page_size\x18\x03 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08order_by\x18\x05 \x01(\x09B\x03\xE0A\x01\x12K\x0A\x04view\x18\x07 \x01(\x0E28.google.chat.v1.SearchMessagesRequest.SearchMessagesViewB\x03\xE0A\x01\"y\x0A\x12SearchMessagesView\x12\$\x0A SEARCH_MESSAGES_VIEW_UNSPECIFIED\x10\x00\x12\x1E\x0A\x1ASEARCH_MESSAGES_VIEW_BASIC\x10\x01\x12\x1D\x0A\x19SEARCH_MESSAGES_VIEW_FULL\x10\x02\"g\x0A\x16SearchMessagesResponse\x124\x0A\x07results\x18\x01 \x03(\x0B2#.google.chat.v1.SearchMessageResult\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"\xAD\x01\x0A\x13SearchMessageResult\x12(\x0A\x07message\x18\x01 \x01(\x0B2\x17.google.chat.v1.Message\x12\x11\x0A\x04read\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12P\x0A\x12space_mute_setting\x18\x04 \x01(\x0E24.google.chat.v1.SpaceNotificationSetting.MuteSettingB\x07\x0A\x05_readB\xA5\x01\x0A\x12com.google.chat.v1B\x0CMessageProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xA2\x02\x0BDYNAPIProto\xAA\x02\x13Google.Apps.Chat.V1\xCA\x02\x13Google\\Apps\\Chat\\V1\xEA\x02\x16Google::Apps::Chat::V1b\x06proto3" , true); static::$is_initialized = true; diff --git a/AppsChat/samples/V1/ChatServiceClient/search_messages.php b/AppsChat/samples/V1/ChatServiceClient/search_messages.php new file mode 100644 index 000000000000..931f15d258be --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/search_messages.php @@ -0,0 +1,235 @@ +=`. + * - `sender.name`: The resource name of the sender (`users/{user}`). Only + * supports `=`. You can use the e-mail as an alias for `{user}`. For + * example, `users/example@gmail.com`, where `example@gmail.com` is the + * e-mail of the Google Chat user. + * - `space.name`: The resource name of the space where the message is posted. + * (`spaces/{space}`). Only supports `=`. If this filter is not set, the + * search is performed across all direct messages and spaces the user has + * access to as a space member. + * - `space.display_name`: Supports the operator `:` (has) and filters spaces + * based on a partial match of their display name. Results are limited to + * the top five space matches. For example, `space.display_name:Project` + * searches for messages in the top five spaces that contain the word + * "Project" in their display names. + * - `attachment`: Supports the operator `:*` (has any) to check for the + * presence of attachments. If `attachment:*` is specified, only messages + * that have at least one attachment are returned. + * - `annotations.user_mentions.user.name`: The resource name of the mentioned + * user (`users/{user}`). Only supports `:` (has). For example: + * `annotations.user_mentions.user.name:"users/1234567890"` returns only + * messages that contain a mention to the specified user. Alternatively, the + * alias `me` can be used to filter for messages that mention the caller + * user, for example: `annotations.user_mentions.user.name:users/me`. You + * can also use the e-mail as an alias for `{user}`, for example, + * `users/example@gmail.com`. + * + * For advanced filtering, the following functions are also available: + * + * - `has_link()`: Returns only messages that have at least one hyperlink in + * the message text. + * - `is_unread()`: Filters out messages that have been read by the calling + * user. + * + * Using the `space.display_name` filter requires that the calling credentials + * include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * + * - `https://www.googleapis.com/auth/chat.spaces.readonly` + * - `https://www.googleapis.com/auth/chat.spaces` + * + * Using the `is_unread()` filter requires that the calling credentials + * include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * + * - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + * - `https://www.googleapis.com/auth/chat.users.readstate` + * + * + * Across different fields, only `AND` operators are supported. A valid + * example is `sender.name = "users/1234567890" AND is_unread()`. The word + * `AND` is optional and is implied if omitted. For example, `sender.name = + * "users/1234567890" is_unread()` is valid and is equivalent to the previous + * example. An invalid example is `sender.name = "users/1234567890" OR + * is_unread()` because `OR` is not supported between different fields. + * + * Among the same field: + * + * - `create_time` supports only `AND`, and can only be used to represent + * an interval, such as `create_time >= "2022-01-01T00:00:00+00:00" AND + * create_time < "2023-01-01T00:00:00+00:00"`. + * - `sender.name` supports only the `OR` operator, for example: + * `sender.name = "users/1234567890" OR sender.name = "users/0987654321"`. + * - `space.name` supports only the `OR` operator, for example: + * `space.name = "spaces/ABCDEFGH" OR space.name = "spaces/QWERTYUI"`. + * - `space.display_name` supports the operators `AND` and `OR`, but not a + * mix of both. For example: + * `space.display_name:Project AND space.display_name:Tasks` returns + * messages that are in spaces with display names containing both `Project` + * and `Tasks`, whereas + * `space.display_name:Project OR space.display_name:Tasks` returns messages + * that are in spaces with display names containing either `Project` or + * `Tasks` or both. + * - `annotations.user_mentions.user.name` supports the operators `AND` and + * `OR`, but not a mix of both. For example: + * `annotations.user_mentions.user.name:"users/1234567890" AND + * annotations.user_mentions.user.name:"users/0987654321"` returns only + * messages that mentions both users, whereas + * `annotations.user_mentions.user.name:"users/1234567890" OR + * annotations.user_mentions.user.name:"users/0987654321"` returns messages + * that mention either user or both. + * + * Parentheses are required to disambiguate operator precedence when combining + * `AND` and `OR` operators in the same query. For example: + * `(sender.name="users/me" OR sender.name="users/123456") AND is_unread()`. + * Otherwise, parentheses are optional. + * + * The following example queries are valid: + * + * ``` + * "Pending reports" AND create_time >= "2023-01-01T00:00:00Z" + * + * sender.name = "users/example@gmail.com" + * + * annotations.user_mentions.user.name:"users/0987654321" + * + * attachment:* AND space.name = "spaces/ABCDEFGH" + * + * tasks AND is_unread() AND sender.name = "users/1234567890" + * + * "things to do" "urgent" + * + * (sender.name = "users/1234567890") + * AND (create_time < "2023-05-01T00:00:00Z") + * + * tasks AND space.name = "spaces/ABCDEFGH" AND has_link() + * + * "project one" is_unread() + * + * space.display_name:Project tasks + * ``` + * + * The maximum query length is 1,000 characters. + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + */ +function search_messages_sample(string $formattedParent, string $filter): void +{ + // Create a client. + $chatServiceClient = new ChatServiceClient(); + + // Prepare the request message. + $request = (new SearchMessagesRequest()) + ->setParent($formattedParent) + ->setFilter($filter); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $chatServiceClient->searchMessages($request); + + /** @var SearchMessageResult $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ChatServiceClient::spaceName('[SPACE]'); + $filter = '[FILTER]'; + + search_messages_sample($formattedParent, $filter); +} +// [END chat_v1_generated_ChatService_SearchMessages_sync] diff --git a/AppsChat/src/Chat/V1/Client/ChatServiceClient.php b/AppsChat/src/Chat/V1/Client/ChatServiceClient.php index ce404338461d..84f9e2daf600 100644 --- a/AppsChat/src/Chat/V1/Client/ChatServiceClient.php +++ b/AppsChat/src/Chat/V1/Client/ChatServiceClient.php @@ -80,6 +80,7 @@ use Google\Apps\Chat\V1\PositionSectionRequest; use Google\Apps\Chat\V1\PositionSectionResponse; use Google\Apps\Chat\V1\Reaction; +use Google\Apps\Chat\V1\SearchMessagesRequest; use Google\Apps\Chat\V1\SearchSpacesRequest; use Google\Apps\Chat\V1\Section; use Google\Apps\Chat\V1\SetUpSpaceRequest; @@ -151,6 +152,7 @@ * @method PromiseInterface markAsDoNotDisturbAsync(MarkAsDoNotDisturbRequest $request, array $optionalArgs = []) * @method PromiseInterface moveSectionItemAsync(MoveSectionItemRequest $request, array $optionalArgs = []) * @method PromiseInterface positionSectionAsync(PositionSectionRequest $request, array $optionalArgs = []) + * @method PromiseInterface searchMessagesAsync(SearchMessagesRequest $request, array $optionalArgs = []) * @method PromiseInterface searchSpacesAsync(SearchSpacesRequest $request, array $optionalArgs = []) * @method PromiseInterface setUpSpaceAsync(SetUpSpaceRequest $request, array $optionalArgs = []) * @method PromiseInterface updateAvailabilityAsync(UpdateAvailabilityRequest $request, array $optionalArgs = []) @@ -2397,6 +2399,58 @@ public function positionSection(PositionSectionRequest $request, array $callOpti return $this->startApiCall('PositionSection', $request, $callOptions)->wait(); } + /** + * Searches for messages in Google Chat that the calling user has access to. + * Returns a list of messages matching the search criteria. + * + * To search across all spaces the user has access to, set `parent` to + * `spaces/-`. Using any other value for `parent` results in an + * `INVALID_ARGUMENT` error. The returned messages have their `name` field + * populated with the full resource name, which includes the specific `space` + * in which the message resides. + * + * This API doesn't return all message types. The types of messages listed + * below aren't included in the response. Use + * [ListMessages][google.chat.v1.ChatService.ListMessages] to list all + * messages. + * + * - Private Messages that are visible to the authenticated user. + * - Messages posted by Chat apps in spaces or group chats. + * - Messages in a Chat app DM. + * - Messages from blocked users. + * - Messages in spaces that the caller has muted. + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * with one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * + * - `https://www.googleapis.com/auth/chat.messages.readonly` + * - `https://www.googleapis.com/auth/chat.messages` + * + * The async variant is {@see ChatServiceClient::searchMessagesAsync()} . + * + * @example samples/V1/ChatServiceClient/search_messages.php + * + * @param SearchMessagesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchMessages(SearchMessagesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchMessages', $request, $callOptions); + } + /** * Returns a list of spaces in a Google Workspace organization based on an * administrator's search. In the request, set `use_admin_access` to `true`. diff --git a/AppsChat/src/Chat/V1/CreateMessageNotificationOptions/NotificationType.php b/AppsChat/src/Chat/V1/CreateMessageNotificationOptions/NotificationType.php index 6b71e84da553..8da0167f9f57 100644 --- a/AppsChat/src/Chat/V1/CreateMessageNotificationOptions/NotificationType.php +++ b/AppsChat/src/Chat/V1/CreateMessageNotificationOptions/NotificationType.php @@ -33,9 +33,9 @@ class NotificationType */ const NOTIFICATION_TYPE_FORCE_NOTIFY = 2; /** - * 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. + * Do not notify recipients, and do not mark the message as unread. + * This behaves similarly to the user muting the conversation or enabling + * [Chat Do Not Disturb](https://support.google.com/chat/answer/9093489). * Requires [app authentication] * (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * diff --git a/AppsChat/src/Chat/V1/Message.php b/AppsChat/src/Chat/V1/Message.php index 9f8b51bd86e5..d9c578ae012d 100644 --- a/AppsChat/src/Chat/V1/Message.php +++ b/AppsChat/src/Chat/V1/Message.php @@ -86,8 +86,8 @@ class Message extends \Google\Protobuf\Internal\Message * but includes the following: * * [Markup * syntax](https://developers.google.com/workspace/chat/format-messages) - * for bold, italic, strikethrough, monospace, monospace block, and bulleted - * list. + * for bold, italic, strikethrough, monospace, monospace block, bulleted + * list, and block quote. * * [User * mentions](https://developers.google.com/workspace/chat/format-messages#messages-\@mention) * using the format ``. @@ -188,8 +188,8 @@ class Message extends \Google\Protobuf\Internal\Message */ private $attachment; /** - * Output only. A URL in `spaces.messages.text` that matches a link preview - * pattern. For more information, see [Preview + * Output only. A URL in the Chat message `text` field that matches a link + * preview pattern. For more information, see [Preview * links](https://developers.google.com/workspace/chat/preview-links). * * Generated from protobuf field .google.chat.v1.MatchedUrl matched_url = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -336,8 +336,8 @@ class Message extends \Google\Protobuf\Internal\Message * but includes the following: * * [Markup * syntax](https://developers.google.com/workspace/chat/format-messages) - * for bold, italic, strikethrough, monospace, monospace block, and bulleted - * list. + * for bold, italic, strikethrough, monospace, monospace block, bulleted + * list, and block quote. * * [User * mentions](https://developers.google.com/workspace/chat/format-messages#messages-\@mention) * using the format ``. @@ -393,8 +393,8 @@ class Message extends \Google\Protobuf\Internal\Message * @type \Google\Apps\Chat\V1\Attachment[] $attachment * Optional. User-uploaded attachment. * @type \Google\Apps\Chat\V1\MatchedUrl $matched_url - * Output only. A URL in `spaces.messages.text` that matches a link preview - * pattern. For more information, see [Preview + * Output only. A URL in the Chat message `text` field that matches a link + * preview pattern. For more information, see [Preview * links](https://developers.google.com/workspace/chat/preview-links). * @type bool $thread_reply * Output only. When `true`, the message is a response in a reply thread. When @@ -714,8 +714,8 @@ public function setText($var) * but includes the following: * * [Markup * syntax](https://developers.google.com/workspace/chat/format-messages) - * for bold, italic, strikethrough, monospace, monospace block, and bulleted - * list. + * for bold, italic, strikethrough, monospace, monospace block, bulleted + * list, and block quote. * * [User * mentions](https://developers.google.com/workspace/chat/format-messages#messages-\@mention) * using the format ``. @@ -743,8 +743,8 @@ public function getFormattedText() * but includes the following: * * [Markup * syntax](https://developers.google.com/workspace/chat/format-messages) - * for bold, italic, strikethrough, monospace, monospace block, and bulleted - * list. + * for bold, italic, strikethrough, monospace, monospace block, bulleted + * list, and block quote. * * [User * mentions](https://developers.google.com/workspace/chat/format-messages#messages-\@mention) * using the format ``. @@ -1123,8 +1123,8 @@ public function setAttachment($var) } /** - * Output only. A URL in `spaces.messages.text` that matches a link preview - * pattern. For more information, see [Preview + * Output only. A URL in the Chat message `text` field that matches a link + * preview pattern. For more information, see [Preview * links](https://developers.google.com/workspace/chat/preview-links). * * Generated from protobuf field .google.chat.v1.MatchedUrl matched_url = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1146,8 +1146,8 @@ public function clearMatchedUrl() } /** - * Output only. A URL in `spaces.messages.text` that matches a link preview - * pattern. For more information, see [Preview + * Output only. A URL in the Chat message `text` field that matches a link + * preview pattern. For more information, see [Preview * links](https://developers.google.com/workspace/chat/preview-links). * * Generated from protobuf field .google.chat.v1.MatchedUrl matched_url = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/AppsChat/src/Chat/V1/SearchMessageResult.php b/AppsChat/src/Chat/V1/SearchMessageResult.php new file mode 100644 index 000000000000..ab05985c19c7 --- /dev/null +++ b/AppsChat/src/Chat/V1/SearchMessageResult.php @@ -0,0 +1,199 @@ +google.chat.v1.SearchMessageResult + */ +class SearchMessageResult extends \Google\Protobuf\Internal\Message +{ + /** + * The matched message. + * + * Generated from protobuf field .google.chat.v1.Message message = 1; + */ + protected $message = null; + /** + * Indicates if the matched message is read by the calling user. + * Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and the + * calling credentials include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + * - `https://www.googleapis.com/auth/chat.users.readstate` + * + * Generated from protobuf field optional bool read = 3; + */ + protected $read = null; + /** + * The mute setting of the calling user for the space where the message is + * posted. The caller app can use this information to decide how to process + * the message depending on whether the space is muted for the user or not. + * Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and the + * calling credentials include the following [authorization + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.users.spacesettings` + * + * Generated from protobuf field .google.chat.v1.SpaceNotificationSetting.MuteSetting space_mute_setting = 4; + */ + protected $space_mute_setting = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Message $message + * The matched message. + * @type bool $read + * Indicates if the matched message is read by the calling user. + * Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and the + * calling credentials include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + * - `https://www.googleapis.com/auth/chat.users.readstate` + * @type int $space_mute_setting + * The mute setting of the calling user for the space where the message is + * posted. The caller app can use this information to decide how to process + * the message depending on whether the space is muted for the user or not. + * Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and the + * calling credentials include the following [authorization + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.users.spacesettings` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * The matched message. + * + * Generated from protobuf field .google.chat.v1.Message message = 1; + * @return \Google\Apps\Chat\V1\Message|null + */ + public function getMessage() + { + return $this->message; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * The matched message. + * + * Generated from protobuf field .google.chat.v1.Message message = 1; + * @param \Google\Apps\Chat\V1\Message $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Message::class); + $this->message = $var; + + return $this; + } + + /** + * Indicates if the matched message is read by the calling user. + * Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and the + * calling credentials include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + * - `https://www.googleapis.com/auth/chat.users.readstate` + * + * Generated from protobuf field optional bool read = 3; + * @return bool + */ + public function getRead() + { + return isset($this->read) ? $this->read : false; + } + + public function hasRead() + { + return isset($this->read); + } + + public function clearRead() + { + unset($this->read); + } + + /** + * Indicates if the matched message is read by the calling user. + * Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and the + * calling credentials include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + * - `https://www.googleapis.com/auth/chat.users.readstate` + * + * Generated from protobuf field optional bool read = 3; + * @param bool $var + * @return $this + */ + public function setRead($var) + { + GPBUtil::checkBool($var); + $this->read = $var; + + return $this; + } + + /** + * The mute setting of the calling user for the space where the message is + * posted. The caller app can use this information to decide how to process + * the message depending on whether the space is muted for the user or not. + * Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and the + * calling credentials include the following [authorization + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.users.spacesettings` + * + * Generated from protobuf field .google.chat.v1.SpaceNotificationSetting.MuteSetting space_mute_setting = 4; + * @return int + */ + public function getSpaceMuteSetting() + { + return $this->space_mute_setting; + } + + /** + * The mute setting of the calling user for the space where the message is + * posted. The caller app can use this information to decide how to process + * the message depending on whether the space is muted for the user or not. + * Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and the + * calling credentials include the following [authorization + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.users.spacesettings` + * + * Generated from protobuf field .google.chat.v1.SpaceNotificationSetting.MuteSetting space_mute_setting = 4; + * @param int $var + * @return $this + */ + public function setSpaceMuteSetting($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\SpaceNotificationSetting\MuteSetting::class); + $this->space_mute_setting = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/SearchMessagesRequest.php b/AppsChat/src/Chat/V1/SearchMessagesRequest.php new file mode 100644 index 000000000000..b35aed00ffd8 --- /dev/null +++ b/AppsChat/src/Chat/V1/SearchMessagesRequest.php @@ -0,0 +1,855 @@ +google.chat.v1.SearchMessagesRequest + */ +class SearchMessagesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the space to search within. + * To search across all spaces the user has access to, set this field to + * `spaces/-`. Using any other value for `parent` results in an + * `INVALID_ARGUMENT` error. + * To limit the search to one or more spaces, use `space.name` or + * `space.display_name` in the `filter`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. A search query. + * The query can specify one or more search keywords, which are used to filter + * the results, + * You can also filter the results using the following message fields: + * - `create_time`: Accepts a timestamp in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the + * supported comparison operators are: `<` and `>=`. + * - `sender.name`: The resource name of the sender (`users/{user}`). Only + * supports `=`. You can use the e-mail as an alias for `{user}`. For + * example, `users/example\@gmail.com`, where `example\@gmail.com` is the + * e-mail of the Google Chat user. + * - `space.name`: The resource name of the space where the message is posted. + * (`spaces/{space}`). Only supports `=`. If this filter is not set, the + * search is performed across all direct messages and spaces the user has + * access to as a space member. + * - `space.display_name`: Supports the operator `:` (has) and filters spaces + * based on a partial match of their display name. Results are limited to + * the top five space matches. For example, `space.display_name:Project` + * searches for messages in the top five spaces that contain the word + * "Project" in their display names. + * - `attachment`: Supports the operator `:*` (has any) to check for the + * presence of attachments. If `attachment:*` is specified, only messages + * that have at least one attachment are returned. + * - `annotations.user_mentions.user.name`: The resource name of the mentioned + * user (`users/{user}`). Only supports `:` (has). For example: + * `annotations.user_mentions.user.name:"users/1234567890"` returns only + * messages that contain a mention to the specified user. Alternatively, the + * alias `me` can be used to filter for messages that mention the caller + * user, for example: `annotations.user_mentions.user.name:users/me`. You + * can also use the e-mail as an alias for `{user}`, for example, + * `users/example\@gmail.com`. + * For advanced filtering, the following functions are also available: + * - `has_link()`: Returns only messages that have at least one hyperlink in + * the message text. + * - `is_unread()`: Filters out messages that have been read by the calling + * user. + * Using the `space.display_name` filter requires that the calling credentials + * include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.spaces.readonly` + * - `https://www.googleapis.com/auth/chat.spaces` + * Using the `is_unread()` filter requires that the calling credentials + * include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + * - `https://www.googleapis.com/auth/chat.users.readstate` + * Across different fields, only `AND` operators are supported. A valid + * example is `sender.name = "users/1234567890" AND is_unread()`. The word + * `AND` is optional and is implied if omitted. For example, `sender.name = + * "users/1234567890" is_unread()` is valid and is equivalent to the previous + * example. An invalid example is `sender.name = "users/1234567890" OR + * is_unread()` because `OR` is not supported between different fields. + * Among the same field: + * - `create_time` supports only `AND`, and can only be used to represent + * an interval, such as `create_time >= "2022-01-01T00:00:00+00:00" AND + * create_time < "2023-01-01T00:00:00+00:00"`. + * - `sender.name` supports only the `OR` operator, for example: + * `sender.name = "users/1234567890" OR sender.name = "users/0987654321"`. + * - `space.name` supports only the `OR` operator, for example: + * `space.name = "spaces/ABCDEFGH" OR space.name = "spaces/QWERTYUI"`. + * - `space.display_name` supports the operators `AND` and `OR`, but not a + * mix of both. For example: + * `space.display_name:Project AND space.display_name:Tasks` returns + * messages that are in spaces with display names containing both `Project` + * and `Tasks`, whereas + * `space.display_name:Project OR space.display_name:Tasks` returns messages + * that are in spaces with display names containing either `Project` or + * `Tasks` or both. + * - `annotations.user_mentions.user.name` supports the operators `AND` and + * `OR`, but not a mix of both. For example: + * `annotations.user_mentions.user.name:"users/1234567890" AND + * annotations.user_mentions.user.name:"users/0987654321"` returns only + * messages that mentions both users, whereas + * `annotations.user_mentions.user.name:"users/1234567890" OR + * annotations.user_mentions.user.name:"users/0987654321"` returns messages + * that mention either user or both. + * Parentheses are required to disambiguate operator precedence when combining + * `AND` and `OR` operators in the same query. For example: + * `(sender.name="users/me" OR sender.name="users/123456") AND is_unread()`. + * Otherwise, parentheses are optional. + * The following example queries are valid: + * ``` + * "Pending reports" AND create_time >= "2023-01-01T00:00:00Z" + * sender.name = "users/example\@gmail.com" + * annotations.user_mentions.user.name:"users/0987654321" + * attachment:* AND space.name = "spaces/ABCDEFGH" + * tasks AND is_unread() AND sender.name = "users/1234567890" + * "things to do" "urgent" + * (sender.name = "users/1234567890") + * AND (create_time < "2023-05-01T00:00:00Z") + * tasks AND space.name = "spaces/ABCDEFGH" AND has_link() + * "project one" is_unread() + * space.display_name:Project tasks + * ``` + * The maximum query length is 1,000 characters. + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Optional. The maximum number of results to return. The service may return + * fewer than this value. + * If unspecified, at most 25 are returned. + * The maximum value is 100. If you use a value more than 100, it's + * automatically changed to 100. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token, received from the previous search messages call. Provide + * this parameter to retrieve the subsequent page. + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. How the results list is ordered. + * Supported attributes to order by are: + * - `create_time`: Sorts the results by the time of the message creation. + * Default value. + * - `relevance`: Sorts the results by relevance. + * [Developer Preview](https://developers.google.com/workspace/preview). + * The default ordering is `create_time desc`. Only a single order per query + * (`create_time` or `relevance`) is supported. Only descending order (`desc`) + * is supported, and it must be specified after the order attribute. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Specifies what kind of search results view to return. The default + * is `SEARCH_MESSAGES_VIEW_BASIC`. + * + * Generated from protobuf field .google.chat.v1.SearchMessagesRequest.SearchMessagesView view = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * @param string $parent Required. The resource name of the space to search within. + * + * To search across all spaces the user has access to, set this field to + * `spaces/-`. Using any other value for `parent` results in an + * `INVALID_ARGUMENT` error. + * + * To limit the search to one or more spaces, use `space.name` or + * `space.display_name` in the `filter`. Please see + * {@see ChatServiceClient::spaceName()} for help formatting this field. + * @param string $filter Required. A search query. + * + * The query can specify one or more search keywords, which are used to filter + * the results, + * + * You can also filter the results using the following message fields: + * + * - `create_time`: Accepts a timestamp in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the + * supported comparison operators are: `<` and `>=`. + * - `sender.name`: The resource name of the sender (`users/{user}`). Only + * supports `=`. You can use the e-mail as an alias for `{user}`. For + * example, `users/example@gmail.com`, where `example@gmail.com` is the + * e-mail of the Google Chat user. + * - `space.name`: The resource name of the space where the message is posted. + * (`spaces/{space}`). Only supports `=`. If this filter is not set, the + * search is performed across all direct messages and spaces the user has + * access to as a space member. + * - `space.display_name`: Supports the operator `:` (has) and filters spaces + * based on a partial match of their display name. Results are limited to + * the top five space matches. For example, `space.display_name:Project` + * searches for messages in the top five spaces that contain the word + * "Project" in their display names. + * - `attachment`: Supports the operator `:*` (has any) to check for the + * presence of attachments. If `attachment:*` is specified, only messages + * that have at least one attachment are returned. + * - `annotations.user_mentions.user.name`: The resource name of the mentioned + * user (`users/{user}`). Only supports `:` (has). For example: + * `annotations.user_mentions.user.name:"users/1234567890"` returns only + * messages that contain a mention to the specified user. Alternatively, the + * alias `me` can be used to filter for messages that mention the caller + * user, for example: `annotations.user_mentions.user.name:users/me`. You + * can also use the e-mail as an alias for `{user}`, for example, + * `users/example@gmail.com`. + * + * For advanced filtering, the following functions are also available: + * + * - `has_link()`: Returns only messages that have at least one hyperlink in + * the message text. + * - `is_unread()`: Filters out messages that have been read by the calling + * user. + * + * Using the `space.display_name` filter requires that the calling credentials + * include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * + * - `https://www.googleapis.com/auth/chat.spaces.readonly` + * - `https://www.googleapis.com/auth/chat.spaces` + * + * Using the `is_unread()` filter requires that the calling credentials + * include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * + * - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + * - `https://www.googleapis.com/auth/chat.users.readstate` + * + * + * Across different fields, only `AND` operators are supported. A valid + * example is `sender.name = "users/1234567890" AND is_unread()`. The word + * `AND` is optional and is implied if omitted. For example, `sender.name = + * "users/1234567890" is_unread()` is valid and is equivalent to the previous + * example. An invalid example is `sender.name = "users/1234567890" OR + * is_unread()` because `OR` is not supported between different fields. + * + * Among the same field: + * + * - `create_time` supports only `AND`, and can only be used to represent + * an interval, such as `create_time >= "2022-01-01T00:00:00+00:00" AND + * create_time < "2023-01-01T00:00:00+00:00"`. + * - `sender.name` supports only the `OR` operator, for example: + * `sender.name = "users/1234567890" OR sender.name = "users/0987654321"`. + * - `space.name` supports only the `OR` operator, for example: + * `space.name = "spaces/ABCDEFGH" OR space.name = "spaces/QWERTYUI"`. + * - `space.display_name` supports the operators `AND` and `OR`, but not a + * mix of both. For example: + * `space.display_name:Project AND space.display_name:Tasks` returns + * messages that are in spaces with display names containing both `Project` + * and `Tasks`, whereas + * `space.display_name:Project OR space.display_name:Tasks` returns messages + * that are in spaces with display names containing either `Project` or + * `Tasks` or both. + * - `annotations.user_mentions.user.name` supports the operators `AND` and + * `OR`, but not a mix of both. For example: + * `annotations.user_mentions.user.name:"users/1234567890" AND + * annotations.user_mentions.user.name:"users/0987654321"` returns only + * messages that mentions both users, whereas + * `annotations.user_mentions.user.name:"users/1234567890" OR + * annotations.user_mentions.user.name:"users/0987654321"` returns messages + * that mention either user or both. + * + * Parentheses are required to disambiguate operator precedence when combining + * `AND` and `OR` operators in the same query. For example: + * `(sender.name="users/me" OR sender.name="users/123456") AND is_unread()`. + * Otherwise, parentheses are optional. + * + * The following example queries are valid: + * + * ``` + * "Pending reports" AND create_time >= "2023-01-01T00:00:00Z" + * + * sender.name = "users/example@gmail.com" + * + * annotations.user_mentions.user.name:"users/0987654321" + * + * attachment:* AND space.name = "spaces/ABCDEFGH" + * + * tasks AND is_unread() AND sender.name = "users/1234567890" + * + * "things to do" "urgent" + * + * (sender.name = "users/1234567890") + * AND (create_time < "2023-05-01T00:00:00Z") + * + * tasks AND space.name = "spaces/ABCDEFGH" AND has_link() + * + * "project one" is_unread() + * + * space.display_name:Project tasks + * ``` + * + * The maximum query length is 1,000 characters. + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * @return \Google\Apps\Chat\V1\SearchMessagesRequest + * + * @experimental + */ + public static function build(string $parent, string $filter): self + { + return (new self()) + ->setParent($parent) + ->setFilter($filter); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the space to search within. + * To search across all spaces the user has access to, set this field to + * `spaces/-`. Using any other value for `parent` results in an + * `INVALID_ARGUMENT` error. + * To limit the search to one or more spaces, use `space.name` or + * `space.display_name` in the `filter`. + * @type string $filter + * Required. A search query. + * The query can specify one or more search keywords, which are used to filter + * the results, + * You can also filter the results using the following message fields: + * - `create_time`: Accepts a timestamp in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the + * supported comparison operators are: `<` and `>=`. + * - `sender.name`: The resource name of the sender (`users/{user}`). Only + * supports `=`. You can use the e-mail as an alias for `{user}`. For + * example, `users/example\@gmail.com`, where `example\@gmail.com` is the + * e-mail of the Google Chat user. + * - `space.name`: The resource name of the space where the message is posted. + * (`spaces/{space}`). Only supports `=`. If this filter is not set, the + * search is performed across all direct messages and spaces the user has + * access to as a space member. + * - `space.display_name`: Supports the operator `:` (has) and filters spaces + * based on a partial match of their display name. Results are limited to + * the top five space matches. For example, `space.display_name:Project` + * searches for messages in the top five spaces that contain the word + * "Project" in their display names. + * - `attachment`: Supports the operator `:*` (has any) to check for the + * presence of attachments. If `attachment:*` is specified, only messages + * that have at least one attachment are returned. + * - `annotations.user_mentions.user.name`: The resource name of the mentioned + * user (`users/{user}`). Only supports `:` (has). For example: + * `annotations.user_mentions.user.name:"users/1234567890"` returns only + * messages that contain a mention to the specified user. Alternatively, the + * alias `me` can be used to filter for messages that mention the caller + * user, for example: `annotations.user_mentions.user.name:users/me`. You + * can also use the e-mail as an alias for `{user}`, for example, + * `users/example\@gmail.com`. + * For advanced filtering, the following functions are also available: + * - `has_link()`: Returns only messages that have at least one hyperlink in + * the message text. + * - `is_unread()`: Filters out messages that have been read by the calling + * user. + * Using the `space.display_name` filter requires that the calling credentials + * include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.spaces.readonly` + * - `https://www.googleapis.com/auth/chat.spaces` + * Using the `is_unread()` filter requires that the calling credentials + * include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + * - `https://www.googleapis.com/auth/chat.users.readstate` + * Across different fields, only `AND` operators are supported. A valid + * example is `sender.name = "users/1234567890" AND is_unread()`. The word + * `AND` is optional and is implied if omitted. For example, `sender.name = + * "users/1234567890" is_unread()` is valid and is equivalent to the previous + * example. An invalid example is `sender.name = "users/1234567890" OR + * is_unread()` because `OR` is not supported between different fields. + * Among the same field: + * - `create_time` supports only `AND`, and can only be used to represent + * an interval, such as `create_time >= "2022-01-01T00:00:00+00:00" AND + * create_time < "2023-01-01T00:00:00+00:00"`. + * - `sender.name` supports only the `OR` operator, for example: + * `sender.name = "users/1234567890" OR sender.name = "users/0987654321"`. + * - `space.name` supports only the `OR` operator, for example: + * `space.name = "spaces/ABCDEFGH" OR space.name = "spaces/QWERTYUI"`. + * - `space.display_name` supports the operators `AND` and `OR`, but not a + * mix of both. For example: + * `space.display_name:Project AND space.display_name:Tasks` returns + * messages that are in spaces with display names containing both `Project` + * and `Tasks`, whereas + * `space.display_name:Project OR space.display_name:Tasks` returns messages + * that are in spaces with display names containing either `Project` or + * `Tasks` or both. + * - `annotations.user_mentions.user.name` supports the operators `AND` and + * `OR`, but not a mix of both. For example: + * `annotations.user_mentions.user.name:"users/1234567890" AND + * annotations.user_mentions.user.name:"users/0987654321"` returns only + * messages that mentions both users, whereas + * `annotations.user_mentions.user.name:"users/1234567890" OR + * annotations.user_mentions.user.name:"users/0987654321"` returns messages + * that mention either user or both. + * Parentheses are required to disambiguate operator precedence when combining + * `AND` and `OR` operators in the same query. For example: + * `(sender.name="users/me" OR sender.name="users/123456") AND is_unread()`. + * Otherwise, parentheses are optional. + * The following example queries are valid: + * ``` + * "Pending reports" AND create_time >= "2023-01-01T00:00:00Z" + * sender.name = "users/example\@gmail.com" + * annotations.user_mentions.user.name:"users/0987654321" + * attachment:* AND space.name = "spaces/ABCDEFGH" + * tasks AND is_unread() AND sender.name = "users/1234567890" + * "things to do" "urgent" + * (sender.name = "users/1234567890") + * AND (create_time < "2023-05-01T00:00:00Z") + * tasks AND space.name = "spaces/ABCDEFGH" AND has_link() + * "project one" is_unread() + * space.display_name:Project tasks + * ``` + * The maximum query length is 1,000 characters. + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @type int $page_size + * Optional. The maximum number of results to return. The service may return + * fewer than this value. + * If unspecified, at most 25 are returned. + * The maximum value is 100. If you use a value more than 100, it's + * automatically changed to 100. + * @type string $page_token + * Optional. A token, received from the previous search messages call. Provide + * this parameter to retrieve the subsequent page. + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + * @type string $order_by + * Optional. How the results list is ordered. + * Supported attributes to order by are: + * - `create_time`: Sorts the results by the time of the message creation. + * Default value. + * - `relevance`: Sorts the results by relevance. + * [Developer Preview](https://developers.google.com/workspace/preview). + * The default ordering is `create_time desc`. Only a single order per query + * (`create_time` or `relevance`) is supported. Only descending order (`desc`) + * is supported, and it must be specified after the order attribute. + * @type int $view + * Optional. Specifies what kind of search results view to return. The default + * is `SEARCH_MESSAGES_VIEW_BASIC`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the space to search within. + * To search across all spaces the user has access to, set this field to + * `spaces/-`. Using any other value for `parent` results in an + * `INVALID_ARGUMENT` error. + * To limit the search to one or more spaces, use `space.name` or + * `space.display_name` in the `filter`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the space to search within. + * To search across all spaces the user has access to, set this field to + * `spaces/-`. Using any other value for `parent` results in an + * `INVALID_ARGUMENT` error. + * To limit the search to one or more spaces, use `space.name` or + * `space.display_name` in the `filter`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. A search query. + * The query can specify one or more search keywords, which are used to filter + * the results, + * You can also filter the results using the following message fields: + * - `create_time`: Accepts a timestamp in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the + * supported comparison operators are: `<` and `>=`. + * - `sender.name`: The resource name of the sender (`users/{user}`). Only + * supports `=`. You can use the e-mail as an alias for `{user}`. For + * example, `users/example\@gmail.com`, where `example\@gmail.com` is the + * e-mail of the Google Chat user. + * - `space.name`: The resource name of the space where the message is posted. + * (`spaces/{space}`). Only supports `=`. If this filter is not set, the + * search is performed across all direct messages and spaces the user has + * access to as a space member. + * - `space.display_name`: Supports the operator `:` (has) and filters spaces + * based on a partial match of their display name. Results are limited to + * the top five space matches. For example, `space.display_name:Project` + * searches for messages in the top five spaces that contain the word + * "Project" in their display names. + * - `attachment`: Supports the operator `:*` (has any) to check for the + * presence of attachments. If `attachment:*` is specified, only messages + * that have at least one attachment are returned. + * - `annotations.user_mentions.user.name`: The resource name of the mentioned + * user (`users/{user}`). Only supports `:` (has). For example: + * `annotations.user_mentions.user.name:"users/1234567890"` returns only + * messages that contain a mention to the specified user. Alternatively, the + * alias `me` can be used to filter for messages that mention the caller + * user, for example: `annotations.user_mentions.user.name:users/me`. You + * can also use the e-mail as an alias for `{user}`, for example, + * `users/example\@gmail.com`. + * For advanced filtering, the following functions are also available: + * - `has_link()`: Returns only messages that have at least one hyperlink in + * the message text. + * - `is_unread()`: Filters out messages that have been read by the calling + * user. + * Using the `space.display_name` filter requires that the calling credentials + * include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.spaces.readonly` + * - `https://www.googleapis.com/auth/chat.spaces` + * Using the `is_unread()` filter requires that the calling credentials + * include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + * - `https://www.googleapis.com/auth/chat.users.readstate` + * Across different fields, only `AND` operators are supported. A valid + * example is `sender.name = "users/1234567890" AND is_unread()`. The word + * `AND` is optional and is implied if omitted. For example, `sender.name = + * "users/1234567890" is_unread()` is valid and is equivalent to the previous + * example. An invalid example is `sender.name = "users/1234567890" OR + * is_unread()` because `OR` is not supported between different fields. + * Among the same field: + * - `create_time` supports only `AND`, and can only be used to represent + * an interval, such as `create_time >= "2022-01-01T00:00:00+00:00" AND + * create_time < "2023-01-01T00:00:00+00:00"`. + * - `sender.name` supports only the `OR` operator, for example: + * `sender.name = "users/1234567890" OR sender.name = "users/0987654321"`. + * - `space.name` supports only the `OR` operator, for example: + * `space.name = "spaces/ABCDEFGH" OR space.name = "spaces/QWERTYUI"`. + * - `space.display_name` supports the operators `AND` and `OR`, but not a + * mix of both. For example: + * `space.display_name:Project AND space.display_name:Tasks` returns + * messages that are in spaces with display names containing both `Project` + * and `Tasks`, whereas + * `space.display_name:Project OR space.display_name:Tasks` returns messages + * that are in spaces with display names containing either `Project` or + * `Tasks` or both. + * - `annotations.user_mentions.user.name` supports the operators `AND` and + * `OR`, but not a mix of both. For example: + * `annotations.user_mentions.user.name:"users/1234567890" AND + * annotations.user_mentions.user.name:"users/0987654321"` returns only + * messages that mentions both users, whereas + * `annotations.user_mentions.user.name:"users/1234567890" OR + * annotations.user_mentions.user.name:"users/0987654321"` returns messages + * that mention either user or both. + * Parentheses are required to disambiguate operator precedence when combining + * `AND` and `OR` operators in the same query. For example: + * `(sender.name="users/me" OR sender.name="users/123456") AND is_unread()`. + * Otherwise, parentheses are optional. + * The following example queries are valid: + * ``` + * "Pending reports" AND create_time >= "2023-01-01T00:00:00Z" + * sender.name = "users/example\@gmail.com" + * annotations.user_mentions.user.name:"users/0987654321" + * attachment:* AND space.name = "spaces/ABCDEFGH" + * tasks AND is_unread() AND sender.name = "users/1234567890" + * "things to do" "urgent" + * (sender.name = "users/1234567890") + * AND (create_time < "2023-05-01T00:00:00Z") + * tasks AND space.name = "spaces/ABCDEFGH" AND has_link() + * "project one" is_unread() + * space.display_name:Project tasks + * ``` + * The maximum query length is 1,000 characters. + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. A search query. + * The query can specify one or more search keywords, which are used to filter + * the results, + * You can also filter the results using the following message fields: + * - `create_time`: Accepts a timestamp in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the + * supported comparison operators are: `<` and `>=`. + * - `sender.name`: The resource name of the sender (`users/{user}`). Only + * supports `=`. You can use the e-mail as an alias for `{user}`. For + * example, `users/example\@gmail.com`, where `example\@gmail.com` is the + * e-mail of the Google Chat user. + * - `space.name`: The resource name of the space where the message is posted. + * (`spaces/{space}`). Only supports `=`. If this filter is not set, the + * search is performed across all direct messages and spaces the user has + * access to as a space member. + * - `space.display_name`: Supports the operator `:` (has) and filters spaces + * based on a partial match of their display name. Results are limited to + * the top five space matches. For example, `space.display_name:Project` + * searches for messages in the top five spaces that contain the word + * "Project" in their display names. + * - `attachment`: Supports the operator `:*` (has any) to check for the + * presence of attachments. If `attachment:*` is specified, only messages + * that have at least one attachment are returned. + * - `annotations.user_mentions.user.name`: The resource name of the mentioned + * user (`users/{user}`). Only supports `:` (has). For example: + * `annotations.user_mentions.user.name:"users/1234567890"` returns only + * messages that contain a mention to the specified user. Alternatively, the + * alias `me` can be used to filter for messages that mention the caller + * user, for example: `annotations.user_mentions.user.name:users/me`. You + * can also use the e-mail as an alias for `{user}`, for example, + * `users/example\@gmail.com`. + * For advanced filtering, the following functions are also available: + * - `has_link()`: Returns only messages that have at least one hyperlink in + * the message text. + * - `is_unread()`: Filters out messages that have been read by the calling + * user. + * Using the `space.display_name` filter requires that the calling credentials + * include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.spaces.readonly` + * - `https://www.googleapis.com/auth/chat.spaces` + * Using the `is_unread()` filter requires that the calling credentials + * include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + * - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + * - `https://www.googleapis.com/auth/chat.users.readstate` + * Across different fields, only `AND` operators are supported. A valid + * example is `sender.name = "users/1234567890" AND is_unread()`. The word + * `AND` is optional and is implied if omitted. For example, `sender.name = + * "users/1234567890" is_unread()` is valid and is equivalent to the previous + * example. An invalid example is `sender.name = "users/1234567890" OR + * is_unread()` because `OR` is not supported between different fields. + * Among the same field: + * - `create_time` supports only `AND`, and can only be used to represent + * an interval, such as `create_time >= "2022-01-01T00:00:00+00:00" AND + * create_time < "2023-01-01T00:00:00+00:00"`. + * - `sender.name` supports only the `OR` operator, for example: + * `sender.name = "users/1234567890" OR sender.name = "users/0987654321"`. + * - `space.name` supports only the `OR` operator, for example: + * `space.name = "spaces/ABCDEFGH" OR space.name = "spaces/QWERTYUI"`. + * - `space.display_name` supports the operators `AND` and `OR`, but not a + * mix of both. For example: + * `space.display_name:Project AND space.display_name:Tasks` returns + * messages that are in spaces with display names containing both `Project` + * and `Tasks`, whereas + * `space.display_name:Project OR space.display_name:Tasks` returns messages + * that are in spaces with display names containing either `Project` or + * `Tasks` or both. + * - `annotations.user_mentions.user.name` supports the operators `AND` and + * `OR`, but not a mix of both. For example: + * `annotations.user_mentions.user.name:"users/1234567890" AND + * annotations.user_mentions.user.name:"users/0987654321"` returns only + * messages that mentions both users, whereas + * `annotations.user_mentions.user.name:"users/1234567890" OR + * annotations.user_mentions.user.name:"users/0987654321"` returns messages + * that mention either user or both. + * Parentheses are required to disambiguate operator precedence when combining + * `AND` and `OR` operators in the same query. For example: + * `(sender.name="users/me" OR sender.name="users/123456") AND is_unread()`. + * Otherwise, parentheses are optional. + * The following example queries are valid: + * ``` + * "Pending reports" AND create_time >= "2023-01-01T00:00:00Z" + * sender.name = "users/example\@gmail.com" + * annotations.user_mentions.user.name:"users/0987654321" + * attachment:* AND space.name = "spaces/ABCDEFGH" + * tasks AND is_unread() AND sender.name = "users/1234567890" + * "things to do" "urgent" + * (sender.name = "users/1234567890") + * AND (create_time < "2023-05-01T00:00:00Z") + * tasks AND space.name = "spaces/ABCDEFGH" AND has_link() + * "project one" is_unread() + * space.display_name:Project tasks + * ``` + * The maximum query length is 1,000 characters. + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The maximum number of results to return. The service may return + * fewer than this value. + * If unspecified, at most 25 are returned. + * The maximum value is 100. If you use a value more than 100, it's + * automatically changed to 100. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of results to return. The service may return + * fewer than this value. + * If unspecified, at most 25 are returned. + * The maximum value is 100. If you use a value more than 100, it's + * automatically changed to 100. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token, received from the previous search messages call. Provide + * this parameter to retrieve the subsequent page. + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token, received from the previous search messages call. Provide + * this parameter to retrieve the subsequent page. + * When paginating, all other parameters provided should match the call that + * provided the page token. Passing different values to the other parameters + * might lead to unexpected results. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. How the results list is ordered. + * Supported attributes to order by are: + * - `create_time`: Sorts the results by the time of the message creation. + * Default value. + * - `relevance`: Sorts the results by relevance. + * [Developer Preview](https://developers.google.com/workspace/preview). + * The default ordering is `create_time desc`. Only a single order per query + * (`create_time` or `relevance`) is supported. Only descending order (`desc`) + * is supported, and it must be specified after the order attribute. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. How the results list is ordered. + * Supported attributes to order by are: + * - `create_time`: Sorts the results by the time of the message creation. + * Default value. + * - `relevance`: Sorts the results by relevance. + * [Developer Preview](https://developers.google.com/workspace/preview). + * The default ordering is `create_time desc`. Only a single order per query + * (`create_time` or `relevance`) is supported. Only descending order (`desc`) + * is supported, and it must be specified after the order attribute. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Specifies what kind of search results view to return. The default + * is `SEARCH_MESSAGES_VIEW_BASIC`. + * + * Generated from protobuf field .google.chat.v1.SearchMessagesRequest.SearchMessagesView view = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. Specifies what kind of search results view to return. The default + * is `SEARCH_MESSAGES_VIEW_BASIC`. + * + * Generated from protobuf field .google.chat.v1.SearchMessagesRequest.SearchMessagesView view = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\SearchMessagesRequest\SearchMessagesView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/SearchMessagesRequest/SearchMessagesView.php b/AppsChat/src/Chat/V1/SearchMessagesRequest/SearchMessagesView.php new file mode 100644 index 000000000000..b3355594134c --- /dev/null +++ b/AppsChat/src/Chat/V1/SearchMessagesRequest/SearchMessagesView.php @@ -0,0 +1,64 @@ +google.chat.v1.SearchMessagesRequest.SearchMessagesView + */ +class SearchMessagesView +{ + /** + * The default / unset value. + * The API will default to the BASIC view. + * + * Generated from protobuf enum SEARCH_MESSAGES_VIEW_UNSPECIFIED = 0; + */ + const SEARCH_MESSAGES_VIEW_UNSPECIFIED = 0; + /** + * Includes only the matched messages in the results, but no additional + * metadata. This is the default value. + * + * Generated from protobuf enum SEARCH_MESSAGES_VIEW_BASIC = 1; + */ + const SEARCH_MESSAGES_VIEW_BASIC = 1; + /** + * Includes everything in the results: the matched messages and additional + * metadata. + * + * Generated from protobuf enum SEARCH_MESSAGES_VIEW_FULL = 2; + */ + const SEARCH_MESSAGES_VIEW_FULL = 2; + + private static $valueToName = [ + self::SEARCH_MESSAGES_VIEW_UNSPECIFIED => 'SEARCH_MESSAGES_VIEW_UNSPECIFIED', + self::SEARCH_MESSAGES_VIEW_BASIC => 'SEARCH_MESSAGES_VIEW_BASIC', + self::SEARCH_MESSAGES_VIEW_FULL => 'SEARCH_MESSAGES_VIEW_FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/AppsChat/src/Chat/V1/SearchMessagesResponse.php b/AppsChat/src/Chat/V1/SearchMessagesResponse.php new file mode 100644 index 000000000000..e28ca4cc66ca --- /dev/null +++ b/AppsChat/src/Chat/V1/SearchMessagesResponse.php @@ -0,0 +1,105 @@ +google.chat.v1.SearchMessagesResponse + */ +class SearchMessagesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of search results that matched the query. + * + * Generated from protobuf field repeated .google.chat.v1.SearchMessageResult results = 1; + */ + private $results; + /** + * A token that can be used to retrieve the next page. If this field is empty, + * there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\SearchMessageResult[] $results + * The list of search results that matched the query. + * @type string $next_page_token + * A token that can be used to retrieve the next page. If this field is empty, + * there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * The list of search results that matched the query. + * + * Generated from protobuf field repeated .google.chat.v1.SearchMessageResult results = 1; + * @return RepeatedField<\Google\Apps\Chat\V1\SearchMessageResult> + */ + public function getResults() + { + return $this->results; + } + + /** + * The list of search results that matched the query. + * + * Generated from protobuf field repeated .google.chat.v1.SearchMessageResult results = 1; + * @param \Google\Apps\Chat\V1\SearchMessageResult[] $var + * @return $this + */ + public function setResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\SearchMessageResult::class); + $this->results = $arr; + + return $this; + } + + /** + * A token that can be used to retrieve the next page. If this field is empty, + * there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that can be used to retrieve the next page. If this field is empty, + * there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/Space/SpaceThreadingState.php b/AppsChat/src/Chat/V1/Space/SpaceThreadingState.php index 21245bdae2bd..da2bbe8c1230 100644 --- a/AppsChat/src/Chat/V1/Space/SpaceThreadingState.php +++ b/AppsChat/src/Chat/V1/Space/SpaceThreadingState.php @@ -20,9 +20,9 @@ class SpaceThreadingState */ const SPACE_THREADING_STATE_UNSPECIFIED = 0; /** - * Named spaces that support message threads. When users respond to a - * message, they can reply in-thread, which keeps their response in the - * context of the original message. + * Spaces that support message threads. When users respond to a message, + * they can reply in-thread, which keeps their response in the context of + * the original message. * * Generated from protobuf enum THREADED_MESSAGES = 2; */ @@ -35,8 +35,10 @@ class SpaceThreadingState */ const GROUPED_MESSAGES = 3; /** - * Direct messages (DMs) between two people and group conversations between - * 3 or more people. + * Spaces that don't support message threading. This space threading state + * is only used for special cases including: + * * Continuous meeting chat where threading is intentionally turned off. + * * Legacy group conversations that were created prior to 2022. * * Generated from protobuf enum UNTHREADED_MESSAGES = 4; */ diff --git a/AppsChat/src/Chat/V1/gapic_metadata.json b/AppsChat/src/Chat/V1/gapic_metadata.json index 4eb25cad7cbe..25633adefe67 100644 --- a/AppsChat/src/Chat/V1/gapic_metadata.json +++ b/AppsChat/src/Chat/V1/gapic_metadata.json @@ -200,6 +200,11 @@ "positionSection" ] }, + "SearchMessages": { + "methods": [ + "searchMessages" + ] + }, "SearchSpaces": { "methods": [ "searchSpaces" diff --git a/AppsChat/src/Chat/V1/resources/chat_service_client_config.json b/AppsChat/src/Chat/V1/resources/chat_service_client_config.json index b043b0213cf1..f240a6b9f4ea 100644 --- a/AppsChat/src/Chat/V1/resources/chat_service_client_config.json +++ b/AppsChat/src/Chat/V1/resources/chat_service_client_config.json @@ -218,6 +218,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "SearchMessages": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "SearchSpaces": { "timeout_millis": 30000, "retry_codes_name": "retry_policy_1_codes", diff --git a/AppsChat/src/Chat/V1/resources/chat_service_descriptor_config.php b/AppsChat/src/Chat/V1/resources/chat_service_descriptor_config.php index 79ad1cf5502e..677f44287480 100644 --- a/AppsChat/src/Chat/V1/resources/chat_service_descriptor_config.php +++ b/AppsChat/src/Chat/V1/resources/chat_service_descriptor_config.php @@ -503,6 +503,26 @@ ], ], ], + 'SearchMessages' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getResults', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Apps\Chat\V1\SearchMessagesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'SearchSpaces' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', diff --git a/AppsChat/src/Chat/V1/resources/chat_service_rest_client_config.php b/AppsChat/src/Chat/V1/resources/chat_service_rest_client_config.php index 68a270ffddf8..3137e630909d 100644 --- a/AppsChat/src/Chat/V1/resources/chat_service_rest_client_config.php +++ b/AppsChat/src/Chat/V1/resources/chat_service_rest_client_config.php @@ -414,6 +414,18 @@ ], ], ], + 'SearchMessages' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=spaces/*}/messages:search', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'SearchSpaces' => [ 'method' => 'get', 'uriTemplate' => '/v1/spaces:search', diff --git a/AppsChat/tests/Unit/V1/Client/ChatServiceClientTest.php b/AppsChat/tests/Unit/V1/Client/ChatServiceClientTest.php index 724aa1b0c91d..276d889d9478 100644 --- a/AppsChat/tests/Unit/V1/Client/ChatServiceClientTest.php +++ b/AppsChat/tests/Unit/V1/Client/ChatServiceClientTest.php @@ -84,6 +84,9 @@ use Google\Apps\Chat\V1\PositionSectionRequest; use Google\Apps\Chat\V1\PositionSectionResponse; use Google\Apps\Chat\V1\Reaction; +use Google\Apps\Chat\V1\SearchMessageResult; +use Google\Apps\Chat\V1\SearchMessagesRequest; +use Google\Apps\Chat\V1\SearchMessagesResponse; use Google\Apps\Chat\V1\SearchSpacesRequest; use Google\Apps\Chat\V1\SearchSpacesResponse; use Google\Apps\Chat\V1\Section; @@ -2758,6 +2761,81 @@ public function positionSectionExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function searchMessagesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $resultsElement = new SearchMessageResult(); + $results = [$resultsElement]; + $expectedResponse = new SearchMessagesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setResults($results); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->spaceName('[SPACE]'); + $filter = 'filter-1274492040'; + $request = (new SearchMessagesRequest())->setParent($formattedParent)->setFilter($filter); + $response = $gapicClient->searchMessages($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getResults()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/SearchMessages', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getFilter(); + $this->assertProtobufEquals($filter, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchMessagesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->spaceName('[SPACE]'); + $filter = 'filter-1274492040'; + $request = (new SearchMessagesRequest())->setParent($formattedParent)->setFilter($filter); + try { + $gapicClient->searchMessages($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function searchSpacesTest() {