From 720357b2db6ae83f4d44752e4c98daae775b9712 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Thu, 11 Apr 2024 16:03:37 +0000 Subject: [PATCH 1/3] feat: introduce AppsChat --- AppsChat/.OwlBot.yaml | 6 + AppsChat/.gitattributes | 8 + AppsChat/.github/pull_request_template.md | 24 + AppsChat/.repo-metadata.json | 8 + AppsChat/CONTRIBUTING.md | 10 + AppsChat/LICENSE | 202 ++ AppsChat/README.md | 45 + AppsChat/VERSION | 1 + AppsChat/composer.json | 32 + AppsChat/metadata/Card/V1/Card.php | Bin 0 -> 8477 bytes AppsChat/metadata/Chat/V1/ActionStatus.php | 31 + AppsChat/metadata/Chat/V1/Annotation.php | Bin 0 -> 2038 bytes AppsChat/metadata/Chat/V1/Attachment.php | Bin 0 -> 1779 bytes AppsChat/metadata/Chat/V1/ChatService.php | Bin 0 -> 5388 bytes AppsChat/metadata/Chat/V1/ContextualAddon.php | Bin 0 -> 1479 bytes .../metadata/Chat/V1/DeletionMetadata.php | Bin 0 -> 1023 bytes AppsChat/metadata/Chat/V1/Group.php | 30 + AppsChat/metadata/Chat/V1/HistoryState.php | Bin 0 -> 837 bytes AppsChat/metadata/Chat/V1/MatchedUrl.php | 31 + AppsChat/metadata/Chat/V1/Membership.php | Bin 0 -> 2411 bytes AppsChat/metadata/Chat/V1/Message.php | Bin 0 -> 5774 bytes AppsChat/metadata/Chat/V1/Reaction.php | Bin 0 -> 1842 bytes AppsChat/metadata/Chat/V1/SlashCommand.php | 30 + AppsChat/metadata/Chat/V1/Space.php | Bin 0 -> 2793 bytes AppsChat/metadata/Chat/V1/SpaceSetup.php | 35 + AppsChat/metadata/Chat/V1/User.php | Bin 0 -> 1051 bytes AppsChat/metadata/Chat/V1/Widgets.php | Bin 0 -> 2649 bytes AppsChat/owlbot.py | 78 + AppsChat/phpunit.xml.dist | 16 + .../complete_import_space.php | 73 + .../ChatServiceClient/create_membership.php | 95 + .../V1/ChatServiceClient/create_message.php | 81 + .../V1/ChatServiceClient/create_reaction.php | 76 + .../V1/ChatServiceClient/create_space.php | 65 + .../ChatServiceClient/delete_membership.php | 84 + .../V1/ChatServiceClient/delete_message.php | 83 + .../V1/ChatServiceClient/delete_reaction.php | 70 + .../V1/ChatServiceClient/delete_space.php | 73 + .../ChatServiceClient/find_direct_message.php | 95 + .../V1/ChatServiceClient/get_attachment.php | 74 + .../V1/ChatServiceClient/get_membership.php | 87 + .../V1/ChatServiceClient/get_message.php | 85 + .../V1/ChatServiceClient/get_space.php | 77 + .../V1/ChatServiceClient/list_memberships.php | 92 + .../V1/ChatServiceClient/list_messages.php | 77 + .../V1/ChatServiceClient/list_reactions.php | 77 + .../V1/ChatServiceClient/list_spaces.php | 72 + .../V1/ChatServiceClient/set_up_space.php | 96 + .../V1/ChatServiceClient/update_message.php | 71 + .../V1/ChatServiceClient/update_space.php | 65 + .../ChatServiceClient/upload_attachment.php | 77 + AppsChat/src/Card/V1/Action.php | 331 +++ .../src/Card/V1/Action/ActionParameter.php | 109 + AppsChat/src/Card/V1/Action/Interaction.php | 72 + AppsChat/src/Card/V1/Action/LoadIndicator.php | 58 + AppsChat/src/Card/V1/BorderStyle.php | 148 ++ .../src/Card/V1/BorderStyle/BorderType.php | 64 + AppsChat/src/Card/V1/Button.php | 399 +++ AppsChat/src/Card/V1/ButtonList.php | 71 + AppsChat/src/Card/V1/Card.php | 638 +++++ AppsChat/src/Card/V1/Card/CardAction.php | 116 + AppsChat/src/Card/V1/Card/CardFixedFooter.php | 144 ++ AppsChat/src/Card/V1/Card/CardHeader.php | 231 ++ AppsChat/src/Card/V1/Card/DisplayStyle.php | 69 + AppsChat/src/Card/V1/Card/DividerStyle.php | 65 + AppsChat/src/Card/V1/Card/Section.php | 253 ++ AppsChat/src/Card/V1/Columns.php | 90 + AppsChat/src/Card/V1/Columns/Column.php | 191 ++ .../V1/Columns/Column/HorizontalSizeStyle.php | 68 + .../V1/Columns/Column/VerticalAlignment.php | 71 + .../src/Card/V1/Columns/Column/Widgets.php | 275 +++ AppsChat/src/Card/V1/DateTimePicker.php | 314 +++ .../V1/DateTimePicker/DateTimePickerType.php | 65 + AppsChat/src/Card/V1/DecoratedText.php | 480 ++++ .../Card/V1/DecoratedText/SwitchControl.php | 245 ++ .../SwitchControl/ControlType.php | 68 + AppsChat/src/Card/V1/Divider.php | 41 + AppsChat/src/Card/V1/Grid.php | 280 +++ AppsChat/src/Card/V1/Grid/GridItem.php | 221 ++ .../Card/V1/Grid/GridItem/GridItemLayout.php | 64 + AppsChat/src/Card/V1/Icon.php | 254 ++ AppsChat/src/Card/V1/Image.php | 164 ++ AppsChat/src/Card/V1/ImageComponent.php | 191 ++ AppsChat/src/Card/V1/ImageCropStyle.php | 138 ++ .../Card/V1/ImageCropStyle/ImageCropType.php | 79 + AppsChat/src/Card/V1/OnClick.php | 198 ++ AppsChat/src/Card/V1/OpenLink.php | 157 ++ AppsChat/src/Card/V1/OpenLink/OnClose.php | 65 + AppsChat/src/Card/V1/OpenLink/OpenAs.php | 62 + AppsChat/src/Card/V1/SelectionInput.php | 439 ++++ .../V1/SelectionInput/PlatformDataSource.php | 83 + .../PlatformDataSource/CommonDataSource.php | 59 + .../Card/V1/SelectionInput/SelectionItem.php | 243 ++ .../Card/V1/SelectionInput/SelectionType.php | 104 + AppsChat/src/Card/V1/Suggestions.php | 84 + .../Card/V1/Suggestions/SuggestionItem.php | 81 + AppsChat/src/Card/V1/TextInput.php | 531 ++++ AppsChat/src/Card/V1/TextInput/Type.php | 60 + AppsChat/src/Card/V1/TextParagraph.php | 79 + AppsChat/src/Card/V1/Widget.php | 1062 ++++++++ .../Card/V1/Widget/HorizontalAlignment.php | 74 + AppsChat/src/Card/V1/Widget/ImageType.php | 59 + AppsChat/src/Chat/V1/AccessoryWidget.php | 75 + AppsChat/src/Chat/V1/ActionResponse.php | 201 ++ .../Chat/V1/ActionResponse/ResponseType.php | 94 + .../Chat/V1/ActionResponse/SelectionItems.php | 68 + .../Chat/V1/ActionResponse/UpdatedWidget.php | 115 + AppsChat/src/Chat/V1/ActionStatus.php | 106 + AppsChat/src/Chat/V1/Annotation.php | 285 +++ AppsChat/src/Chat/V1/AnnotationType.php | 68 + AppsChat/src/Chat/V1/AttachedGif.php | 67 + AppsChat/src/Chat/V1/Attachment.php | 338 +++ AppsChat/src/Chat/V1/Attachment/Source.php | 54 + AppsChat/src/Chat/V1/AttachmentDataRef.php | 111 + AppsChat/src/Chat/V1/CardWithId.php | 120 + AppsChat/src/Chat/V1/ChatServiceClient.php | 34 + .../Chat/V1/CompleteImportSpaceRequest.php | 71 + .../Chat/V1/CompleteImportSpaceResponse.php | 75 + .../src/Chat/V1/ContextualAddOnMarkup.php | 33 + .../Chat/V1/ContextualAddOnMarkup/Card.php | 181 ++ .../ContextualAddOnMarkup/Card/CardAction.php | 116 + .../ContextualAddOnMarkup/Card/CardHeader.php | 176 ++ .../Card/CardHeader/ImageStyle.php | 58 + .../V1/ContextualAddOnMarkup/Card/Section.php | 137 ++ .../src/Chat/V1/CreateMembershipRequest.php | 177 ++ AppsChat/src/Chat/V1/CreateMessageRequest.php | 336 +++ .../MessageReplyOption.php | 72 + .../src/Chat/V1/CreateReactionRequest.php | 115 + AppsChat/src/Chat/V1/CreateSpaceRequest.php | 153 ++ AppsChat/src/Chat/V1/CustomEmoji.php | 67 + .../src/Chat/V1/DeleteMembershipRequest.php | 105 + AppsChat/src/Chat/V1/DeleteMessageRequest.php | 139 ++ .../src/Chat/V1/DeleteReactionRequest.php | 71 + AppsChat/src/Chat/V1/DeleteSpaceRequest.php | 71 + AppsChat/src/Chat/V1/DeletionMetadata.php | 68 + .../Chat/V1/DeletionMetadata/DeletionType.php | 90 + AppsChat/src/Chat/V1/Dialog.php | 85 + AppsChat/src/Chat/V1/DialogAction.php | 136 + AppsChat/src/Chat/V1/DriveDataRef.php | 67 + AppsChat/src/Chat/V1/DriveLinkData.php | 119 + AppsChat/src/Chat/V1/Emoji.php | 108 + AppsChat/src/Chat/V1/EmojiReactionSummary.php | 121 + .../src/Chat/V1/FindDirectMessageRequest.php | 111 + .../Chat/V1/Gapic/ChatServiceGapicClient.php | 2190 +++++++++++++++++ AppsChat/src/Chat/V1/GetAttachmentRequest.php | 69 + AppsChat/src/Chat/V1/GetMembershipRequest.php | 97 + AppsChat/src/Chat/V1/GetMessageRequest.php | 85 + AppsChat/src/Chat/V1/GetSpaceRequest.php | 71 + AppsChat/src/Chat/V1/Group.php | 83 + AppsChat/src/Chat/V1/HistoryState.php | 65 + .../src/Chat/V1/ListMembershipsRequest.php | 407 +++ .../src/Chat/V1/ListMembershipsResponse.php | 103 + AppsChat/src/Chat/V1/ListMessagesRequest.php | 405 +++ AppsChat/src/Chat/V1/ListMessagesResponse.php | 103 + AppsChat/src/Chat/V1/ListReactionsRequest.php | 333 +++ .../src/Chat/V1/ListReactionsResponse.php | 103 + AppsChat/src/Chat/V1/ListSpacesRequest.php | 219 ++ AppsChat/src/Chat/V1/ListSpacesResponse.php | 103 + AppsChat/src/Chat/V1/MatchedUrl.php | 69 + AppsChat/src/Chat/V1/Membership.php | 352 +++ .../src/Chat/V1/Membership/MembershipRole.php | 71 + .../Chat/V1/Membership/MembershipState.php | 71 + AppsChat/src/Chat/V1/Message.php | 1618 ++++++++++++ .../src/Chat/V1/QuotedMessageMetadata.php | 119 + AppsChat/src/Chat/V1/Reaction.php | 159 ++ AppsChat/src/Chat/V1/RichLinkMetadata.php | 143 ++ .../Chat/V1/RichLinkMetadata/RichLinkType.php | 55 + AppsChat/src/Chat/V1/SetUpSpaceRequest.php | 303 +++ AppsChat/src/Chat/V1/SlashCommand.php | 68 + AppsChat/src/Chat/V1/SlashCommandMetadata.php | 213 ++ .../src/Chat/V1/SlashCommandMetadata/Type.php | 60 + AppsChat/src/Chat/V1/Space.php | 638 +++++ AppsChat/src/Chat/V1/Space/SpaceDetails.php | 114 + .../src/Chat/V1/Space/SpaceThreadingState.php | 73 + AppsChat/src/Chat/V1/Space/SpaceType.php | 72 + AppsChat/src/Chat/V1/Space/Type.php | 61 + AppsChat/src/Chat/V1/Thread.php | 134 + AppsChat/src/Chat/V1/UpdateMessageRequest.php | 205 ++ AppsChat/src/Chat/V1/UpdateSpaceRequest.php | 237 ++ .../src/Chat/V1/UploadAttachmentRequest.php | 103 + .../src/Chat/V1/UploadAttachmentResponse.php | 75 + AppsChat/src/Chat/V1/User.php | 274 +++ AppsChat/src/Chat/V1/User/Type.php | 60 + AppsChat/src/Chat/V1/UserMentionMetadata.php | 111 + .../src/Chat/V1/UserMentionMetadata/Type.php | 60 + AppsChat/src/Chat/V1/WidgetMarkup.php | 179 ++ AppsChat/src/Chat/V1/WidgetMarkup/Button.php | 109 + .../src/Chat/V1/WidgetMarkup/FormAction.php | 115 + .../FormAction/ActionParameter.php | 105 + AppsChat/src/Chat/V1/WidgetMarkup/Icon.php | 196 ++ AppsChat/src/Chat/V1/WidgetMarkup/Image.php | 158 ++ .../src/Chat/V1/WidgetMarkup/ImageButton.php | 194 ++ .../src/Chat/V1/WidgetMarkup/KeyValue.php | 423 ++++ AppsChat/src/Chat/V1/WidgetMarkup/OnClick.php | 109 + .../src/Chat/V1/WidgetMarkup/OpenLink.php | 68 + .../src/Chat/V1/WidgetMarkup/TextButton.php | 112 + .../Chat/V1/WidgetMarkup/TextParagraph.php | 68 + AppsChat/src/Chat/V1/gapic_metadata.json | 128 + .../resources/chat_service_client_config.json | 144 ++ .../chat_service_descriptor_config.php | 48 + .../chat_service_rest_client_config.php | 241 ++ .../tests/Unit/V1/ChatServiceClientTest.php | 1525 ++++++++++++ composer.json | 5 + 203 files changed, 30514 insertions(+) create mode 100644 AppsChat/.OwlBot.yaml create mode 100644 AppsChat/.gitattributes create mode 100644 AppsChat/.github/pull_request_template.md create mode 100644 AppsChat/.repo-metadata.json create mode 100644 AppsChat/CONTRIBUTING.md create mode 100644 AppsChat/LICENSE create mode 100644 AppsChat/README.md create mode 100644 AppsChat/VERSION create mode 100644 AppsChat/composer.json create mode 100644 AppsChat/metadata/Card/V1/Card.php create mode 100644 AppsChat/metadata/Chat/V1/ActionStatus.php create mode 100644 AppsChat/metadata/Chat/V1/Annotation.php create mode 100644 AppsChat/metadata/Chat/V1/Attachment.php create mode 100644 AppsChat/metadata/Chat/V1/ChatService.php create mode 100644 AppsChat/metadata/Chat/V1/ContextualAddon.php create mode 100644 AppsChat/metadata/Chat/V1/DeletionMetadata.php create mode 100644 AppsChat/metadata/Chat/V1/Group.php create mode 100644 AppsChat/metadata/Chat/V1/HistoryState.php create mode 100644 AppsChat/metadata/Chat/V1/MatchedUrl.php create mode 100644 AppsChat/metadata/Chat/V1/Membership.php create mode 100644 AppsChat/metadata/Chat/V1/Message.php create mode 100644 AppsChat/metadata/Chat/V1/Reaction.php create mode 100644 AppsChat/metadata/Chat/V1/SlashCommand.php create mode 100644 AppsChat/metadata/Chat/V1/Space.php create mode 100644 AppsChat/metadata/Chat/V1/SpaceSetup.php create mode 100644 AppsChat/metadata/Chat/V1/User.php create mode 100644 AppsChat/metadata/Chat/V1/Widgets.php create mode 100644 AppsChat/owlbot.py create mode 100644 AppsChat/phpunit.xml.dist create mode 100644 AppsChat/samples/V1/ChatServiceClient/complete_import_space.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/create_membership.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/create_message.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/create_reaction.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/create_space.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/delete_membership.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/delete_message.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/delete_reaction.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/delete_space.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/find_direct_message.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/get_attachment.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/get_membership.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/get_message.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/get_space.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/list_memberships.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/list_messages.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/list_reactions.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/list_spaces.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/set_up_space.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/update_message.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/update_space.php create mode 100644 AppsChat/samples/V1/ChatServiceClient/upload_attachment.php create mode 100644 AppsChat/src/Card/V1/Action.php create mode 100644 AppsChat/src/Card/V1/Action/ActionParameter.php create mode 100644 AppsChat/src/Card/V1/Action/Interaction.php create mode 100644 AppsChat/src/Card/V1/Action/LoadIndicator.php create mode 100644 AppsChat/src/Card/V1/BorderStyle.php create mode 100644 AppsChat/src/Card/V1/BorderStyle/BorderType.php create mode 100644 AppsChat/src/Card/V1/Button.php create mode 100644 AppsChat/src/Card/V1/ButtonList.php create mode 100644 AppsChat/src/Card/V1/Card.php create mode 100644 AppsChat/src/Card/V1/Card/CardAction.php create mode 100644 AppsChat/src/Card/V1/Card/CardFixedFooter.php create mode 100644 AppsChat/src/Card/V1/Card/CardHeader.php create mode 100644 AppsChat/src/Card/V1/Card/DisplayStyle.php create mode 100644 AppsChat/src/Card/V1/Card/DividerStyle.php create mode 100644 AppsChat/src/Card/V1/Card/Section.php create mode 100644 AppsChat/src/Card/V1/Columns.php create mode 100644 AppsChat/src/Card/V1/Columns/Column.php create mode 100644 AppsChat/src/Card/V1/Columns/Column/HorizontalSizeStyle.php create mode 100644 AppsChat/src/Card/V1/Columns/Column/VerticalAlignment.php create mode 100644 AppsChat/src/Card/V1/Columns/Column/Widgets.php create mode 100644 AppsChat/src/Card/V1/DateTimePicker.php create mode 100644 AppsChat/src/Card/V1/DateTimePicker/DateTimePickerType.php create mode 100644 AppsChat/src/Card/V1/DecoratedText.php create mode 100644 AppsChat/src/Card/V1/DecoratedText/SwitchControl.php create mode 100644 AppsChat/src/Card/V1/DecoratedText/SwitchControl/ControlType.php create mode 100644 AppsChat/src/Card/V1/Divider.php create mode 100644 AppsChat/src/Card/V1/Grid.php create mode 100644 AppsChat/src/Card/V1/Grid/GridItem.php create mode 100644 AppsChat/src/Card/V1/Grid/GridItem/GridItemLayout.php create mode 100644 AppsChat/src/Card/V1/Icon.php create mode 100644 AppsChat/src/Card/V1/Image.php create mode 100644 AppsChat/src/Card/V1/ImageComponent.php create mode 100644 AppsChat/src/Card/V1/ImageCropStyle.php create mode 100644 AppsChat/src/Card/V1/ImageCropStyle/ImageCropType.php create mode 100644 AppsChat/src/Card/V1/OnClick.php create mode 100644 AppsChat/src/Card/V1/OpenLink.php create mode 100644 AppsChat/src/Card/V1/OpenLink/OnClose.php create mode 100644 AppsChat/src/Card/V1/OpenLink/OpenAs.php create mode 100644 AppsChat/src/Card/V1/SelectionInput.php create mode 100644 AppsChat/src/Card/V1/SelectionInput/PlatformDataSource.php create mode 100644 AppsChat/src/Card/V1/SelectionInput/PlatformDataSource/CommonDataSource.php create mode 100644 AppsChat/src/Card/V1/SelectionInput/SelectionItem.php create mode 100644 AppsChat/src/Card/V1/SelectionInput/SelectionType.php create mode 100644 AppsChat/src/Card/V1/Suggestions.php create mode 100644 AppsChat/src/Card/V1/Suggestions/SuggestionItem.php create mode 100644 AppsChat/src/Card/V1/TextInput.php create mode 100644 AppsChat/src/Card/V1/TextInput/Type.php create mode 100644 AppsChat/src/Card/V1/TextParagraph.php create mode 100644 AppsChat/src/Card/V1/Widget.php create mode 100644 AppsChat/src/Card/V1/Widget/HorizontalAlignment.php create mode 100644 AppsChat/src/Card/V1/Widget/ImageType.php create mode 100644 AppsChat/src/Chat/V1/AccessoryWidget.php create mode 100644 AppsChat/src/Chat/V1/ActionResponse.php create mode 100644 AppsChat/src/Chat/V1/ActionResponse/ResponseType.php create mode 100644 AppsChat/src/Chat/V1/ActionResponse/SelectionItems.php create mode 100644 AppsChat/src/Chat/V1/ActionResponse/UpdatedWidget.php create mode 100644 AppsChat/src/Chat/V1/ActionStatus.php create mode 100644 AppsChat/src/Chat/V1/Annotation.php create mode 100644 AppsChat/src/Chat/V1/AnnotationType.php create mode 100644 AppsChat/src/Chat/V1/AttachedGif.php create mode 100644 AppsChat/src/Chat/V1/Attachment.php create mode 100644 AppsChat/src/Chat/V1/Attachment/Source.php create mode 100644 AppsChat/src/Chat/V1/AttachmentDataRef.php create mode 100644 AppsChat/src/Chat/V1/CardWithId.php create mode 100644 AppsChat/src/Chat/V1/ChatServiceClient.php create mode 100644 AppsChat/src/Chat/V1/CompleteImportSpaceRequest.php create mode 100644 AppsChat/src/Chat/V1/CompleteImportSpaceResponse.php create mode 100644 AppsChat/src/Chat/V1/ContextualAddOnMarkup.php create mode 100644 AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card.php create mode 100644 AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/CardAction.php create mode 100644 AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/CardHeader.php create mode 100644 AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/CardHeader/ImageStyle.php create mode 100644 AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/Section.php create mode 100644 AppsChat/src/Chat/V1/CreateMembershipRequest.php create mode 100644 AppsChat/src/Chat/V1/CreateMessageRequest.php create mode 100644 AppsChat/src/Chat/V1/CreateMessageRequest/MessageReplyOption.php create mode 100644 AppsChat/src/Chat/V1/CreateReactionRequest.php create mode 100644 AppsChat/src/Chat/V1/CreateSpaceRequest.php create mode 100644 AppsChat/src/Chat/V1/CustomEmoji.php create mode 100644 AppsChat/src/Chat/V1/DeleteMembershipRequest.php create mode 100644 AppsChat/src/Chat/V1/DeleteMessageRequest.php create mode 100644 AppsChat/src/Chat/V1/DeleteReactionRequest.php create mode 100644 AppsChat/src/Chat/V1/DeleteSpaceRequest.php create mode 100644 AppsChat/src/Chat/V1/DeletionMetadata.php create mode 100644 AppsChat/src/Chat/V1/DeletionMetadata/DeletionType.php create mode 100644 AppsChat/src/Chat/V1/Dialog.php create mode 100644 AppsChat/src/Chat/V1/DialogAction.php create mode 100644 AppsChat/src/Chat/V1/DriveDataRef.php create mode 100644 AppsChat/src/Chat/V1/DriveLinkData.php create mode 100644 AppsChat/src/Chat/V1/Emoji.php create mode 100644 AppsChat/src/Chat/V1/EmojiReactionSummary.php create mode 100644 AppsChat/src/Chat/V1/FindDirectMessageRequest.php create mode 100644 AppsChat/src/Chat/V1/Gapic/ChatServiceGapicClient.php create mode 100644 AppsChat/src/Chat/V1/GetAttachmentRequest.php create mode 100644 AppsChat/src/Chat/V1/GetMembershipRequest.php create mode 100644 AppsChat/src/Chat/V1/GetMessageRequest.php create mode 100644 AppsChat/src/Chat/V1/GetSpaceRequest.php create mode 100644 AppsChat/src/Chat/V1/Group.php create mode 100644 AppsChat/src/Chat/V1/HistoryState.php create mode 100644 AppsChat/src/Chat/V1/ListMembershipsRequest.php create mode 100644 AppsChat/src/Chat/V1/ListMembershipsResponse.php create mode 100644 AppsChat/src/Chat/V1/ListMessagesRequest.php create mode 100644 AppsChat/src/Chat/V1/ListMessagesResponse.php create mode 100644 AppsChat/src/Chat/V1/ListReactionsRequest.php create mode 100644 AppsChat/src/Chat/V1/ListReactionsResponse.php create mode 100644 AppsChat/src/Chat/V1/ListSpacesRequest.php create mode 100644 AppsChat/src/Chat/V1/ListSpacesResponse.php create mode 100644 AppsChat/src/Chat/V1/MatchedUrl.php create mode 100644 AppsChat/src/Chat/V1/Membership.php create mode 100644 AppsChat/src/Chat/V1/Membership/MembershipRole.php create mode 100644 AppsChat/src/Chat/V1/Membership/MembershipState.php create mode 100644 AppsChat/src/Chat/V1/Message.php create mode 100644 AppsChat/src/Chat/V1/QuotedMessageMetadata.php create mode 100644 AppsChat/src/Chat/V1/Reaction.php create mode 100644 AppsChat/src/Chat/V1/RichLinkMetadata.php create mode 100644 AppsChat/src/Chat/V1/RichLinkMetadata/RichLinkType.php create mode 100644 AppsChat/src/Chat/V1/SetUpSpaceRequest.php create mode 100644 AppsChat/src/Chat/V1/SlashCommand.php create mode 100644 AppsChat/src/Chat/V1/SlashCommandMetadata.php create mode 100644 AppsChat/src/Chat/V1/SlashCommandMetadata/Type.php create mode 100644 AppsChat/src/Chat/V1/Space.php create mode 100644 AppsChat/src/Chat/V1/Space/SpaceDetails.php create mode 100644 AppsChat/src/Chat/V1/Space/SpaceThreadingState.php create mode 100644 AppsChat/src/Chat/V1/Space/SpaceType.php create mode 100644 AppsChat/src/Chat/V1/Space/Type.php create mode 100644 AppsChat/src/Chat/V1/Thread.php create mode 100644 AppsChat/src/Chat/V1/UpdateMessageRequest.php create mode 100644 AppsChat/src/Chat/V1/UpdateSpaceRequest.php create mode 100644 AppsChat/src/Chat/V1/UploadAttachmentRequest.php create mode 100644 AppsChat/src/Chat/V1/UploadAttachmentResponse.php create mode 100644 AppsChat/src/Chat/V1/User.php create mode 100644 AppsChat/src/Chat/V1/User/Type.php create mode 100644 AppsChat/src/Chat/V1/UserMentionMetadata.php create mode 100644 AppsChat/src/Chat/V1/UserMentionMetadata/Type.php create mode 100644 AppsChat/src/Chat/V1/WidgetMarkup.php create mode 100644 AppsChat/src/Chat/V1/WidgetMarkup/Button.php create mode 100644 AppsChat/src/Chat/V1/WidgetMarkup/FormAction.php create mode 100644 AppsChat/src/Chat/V1/WidgetMarkup/FormAction/ActionParameter.php create mode 100644 AppsChat/src/Chat/V1/WidgetMarkup/Icon.php create mode 100644 AppsChat/src/Chat/V1/WidgetMarkup/Image.php create mode 100644 AppsChat/src/Chat/V1/WidgetMarkup/ImageButton.php create mode 100644 AppsChat/src/Chat/V1/WidgetMarkup/KeyValue.php create mode 100644 AppsChat/src/Chat/V1/WidgetMarkup/OnClick.php create mode 100644 AppsChat/src/Chat/V1/WidgetMarkup/OpenLink.php create mode 100644 AppsChat/src/Chat/V1/WidgetMarkup/TextButton.php create mode 100644 AppsChat/src/Chat/V1/WidgetMarkup/TextParagraph.php create mode 100644 AppsChat/src/Chat/V1/gapic_metadata.json create mode 100644 AppsChat/src/Chat/V1/resources/chat_service_client_config.json create mode 100644 AppsChat/src/Chat/V1/resources/chat_service_descriptor_config.php create mode 100644 AppsChat/src/Chat/V1/resources/chat_service_rest_client_config.php create mode 100644 AppsChat/tests/Unit/V1/ChatServiceClientTest.php diff --git a/AppsChat/.OwlBot.yaml b/AppsChat/.OwlBot.yaml new file mode 100644 index 000000000000..1f2c6c892f98 --- /dev/null +++ b/AppsChat/.OwlBot.yaml @@ -0,0 +1,6 @@ +deep-copy-regex: + - source: /google/chat/(v1)/.*-php/(.*) + dest: /owl-bot-staging/AppsChat/$1/$2 + - source: /google/apps/card/(v1)/.*-php/(.*) + dest: /owl-bot-staging/AppsChat/card-protos/$1/$2 +api-name: AppsChat diff --git a/AppsChat/.gitattributes b/AppsChat/.gitattributes new file mode 100644 index 000000000000..8119e7fcc1b2 --- /dev/null +++ b/AppsChat/.gitattributes @@ -0,0 +1,8 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/.repo-metadata.json export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/AppsChat/.github/pull_request_template.md b/AppsChat/.github/pull_request_template.md new file mode 100644 index 000000000000..01e8f62554e3 --- /dev/null +++ b/AppsChat/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `AppsChat/src`, and tests in `AppsChat/tests`. + +* Push the changes in a new branch to a fork, and open a new pull request +[here](https://github.com/googleapis/google-cloud-php). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/AppsChat/.repo-metadata.json b/AppsChat/.repo-metadata.json new file mode 100644 index 000000000000..917a35ff0820 --- /dev/null +++ b/AppsChat/.repo-metadata.json @@ -0,0 +1,8 @@ +{ + "language": "php", + "distribution_name": "google/chat", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/chat/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "chat" +} diff --git a/AppsChat/CONTRIBUTING.md b/AppsChat/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/AppsChat/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/AppsChat/LICENSE b/AppsChat/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/AppsChat/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/AppsChat/README.md b/AppsChat/README.md new file mode 100644 index 000000000000..4f4e02075d2d --- /dev/null +++ b/AppsChat/README.md @@ -0,0 +1,45 @@ +# Google Apps Chat for PHP + +> Idiomatic PHP client for [Google Apps Chat](https://developers.google.com/chat/concepts). + +[![Latest Stable Version](https://poser.pugx.org/google/chat/v/stable)](https://packagist.org/packages/google/chat) [![Packagist](https://img.shields.io/packagist/dm/google/chat.svg)](https://packagist.org/packages/google/chat) + +* [API documentation](https://cloud.google.com/php/docs/reference/chat/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/chat +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/php-chat/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://developers.google.com/chat/concepts). diff --git a/AppsChat/VERSION b/AppsChat/VERSION new file mode 100644 index 000000000000..77d6f4ca2371 --- /dev/null +++ b/AppsChat/VERSION @@ -0,0 +1 @@ +0.0.0 diff --git a/AppsChat/composer.json b/AppsChat/composer.json new file mode 100644 index 000000000000..29d44291df31 --- /dev/null +++ b/AppsChat/composer.json @@ -0,0 +1,32 @@ +{ + "name": "google/apps-chat", + "description": "Google Apps Chat Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Apps\\Chat\\": "src/Chat", + "GPBMetadata\\Google\\Chat\\": "metadata/Chat", + "Google\\Apps\\Card\\": "src/Card", + "GPBMetadata\\Google\\Apps\\Card\\": "metadata/Card" + } + }, + "extra": { + "component": { + "id": "apps-chat", + "path": "AppsChat", + "target": "googleapis/php-apps-chat" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.30.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/AppsChat/metadata/Card/V1/Card.php b/AppsChat/metadata/Card/V1/Card.php new file mode 100644 index 0000000000000000000000000000000000000000..feffa0a802d322466a9f0ba20dabf989a795bf24 GIT binary patch literal 8477 zcmeHN&2!t<5jUw%E+v|Qm4uPw7>1qLZepsUlXybMcKKxqHAOHaCC8~|Fc1kz7=r)< zfOedY59uM(d+$AU+G+32ztEZX(8;x@p4)4$o$2m-4HaK%XCc72+Vx)voTCfiW-wV}FZr z?N^X%zlL1y~2$mSJ08qs({YL&Nq> zWPFkKaP0I0%XMU8(44+`?Yhj@B-$$@7teS{4&`XmvGK_JsuP%=W7zw3)9-uMC~&vFF@oa?=9Oqo@4@E%ly_ z%>9~cyI#3GInIQeo#w_}OUPas3?fnQqw%gqi_=zD;rl!A&TOkm=lJ(UvTBj6T70sp z{An5H$u`o5uy|}51Jf&{H!b=h*%)k-Nf(r4^VbA1=(} zjv475tQ=ZjnFIaMb_QSO}~D^+}e@NO`o;_<+Ajvp1grSVQB;)B|+F z!W@(J-Ne&Av<4U?MU|+@W2M(1!&%3kEwuLr^gcMG3hb-F!}!5iNa`3jcC@N!`YMezX`dKhf46C=?CK=a2*ju z$)~C^66qtzV;H#3V2X|JKZ{Li!%8d+F2GxLbx*A~I(oPFsM*kWTite}rruW@_52w$ z*lJg6s&!oua~ZY?T~W&jPyP%Fn^%w;G@lS-#`W zNA8?0C2v&^Noh~y{ur{{Ub=1h0rTf<>0;uB+-OZCL%t6I*a0nPH0JJ}ExnV-MjNR_ zg+?n~|ab z8?Yn*mqG1mjxO8_8Lq?pk!KAGz{GqjQOqqQ;A>+rj)#t4$j%5N%y>kD3_GxP?0VMM zt`iuxj@kdn8JZZl%gCK8Z6xj`;AlJItAuRIWymm}U?>H!*!^s`(rI7-;B!sw)S8Wa zO8FU_OW>8RfV{1B)GxGFuhP^jO?9ia(`fZhL{bJ8y1h!LhmKEcB0-~*PfJTM*J#!A zbJazdr!q*n0IM;Vres6j!r?~Q--iVzX&g&AR=*+^5w=IDOOBsWGO#4q7gfQNG%s1ud5*Cbod* z?zM?gM&%4YTQVX>n-v*MBx#c)@=R^sfpel`(f#q!k?B)U;tMF26P4PX&`F=bnlTPs z^uFQ9HWAN-9cMYOuwwxWMH}0$W7nptnV|{=W=8oD%(Ek%g=|-CZDASER9ggpnE!Wn zn?1E1zDg-yBh8dNcQM}v=Fmq}paMP_d8ZhPlV=tA*58L*{0$ZuQ-HU9CNw#syHW<2 zWKt>vdE|zhC+nSaDF0lELT&1A#G)+g{DqI|n?ZDD`!JrR~uf!vEDcoADz?I&G3voir(Z3vm99Kr(NcVmVtrZZ8RITUVgs14uzQiOmF?W zH01CUQ#Iu5c&o?aE!i*P>lNc4+40b-EC=dCUpGf?|Cm{IPI?>GsPM&l(bV0;L*ER@ zWE}4o5(Dk!P_8sUN)Q1tvtH>n^h&F)_tYJNQB*p6rL~%mcuu1)boMc=e3ybn4pJw4 z7z3GCT)eS6y*Q9A!2;ILuE!F6wj_nV7hq09kHT+abrI#f)9QE8s8Vr=QwalG=7H#$ zr^`iFYboERV4jt4YXFZO_o>5c8CH&9=u5Cn)gK0z&1({TH@yh2^WyUa5-nHyVe^FQ z5<)C);46PiL5`KhHP0RKu}FyDJQ|bHH_pNb6|@3#CF=M65jI>p_J@|sPLNW*gw=?P zkzIuI>P}^=q1P}{^xmWP$sT&rPVmy7w-aeBU-KOdqYBHnwcTz{+rc11@0q;)P`{a< zSN@uUY}NHJXY-SNA|i#K?ETQz)04U46uo$6!d`6RH?k2|*~io>kOl=S4}j!qYf5#>U*=$*T2x9W(^Ij{ zFt_uuW%9g$7>o2DOXep<;L^WT1nP3oR@nB6(G-ck5Q}DB63py!)_;+Pgr*_F6_P7ouFc3+kurDyQ*I4Mgd|-?s=y*nGhG}}@S$vS^u_cODXPgBl@8=W zdHEYjhPSsmIEqqxjU64wOWN+q9veqfy~gJ~z1nDM57Fhq&y}jSM{f7;C0If*q!9wv z(V<#-LBtK2e0;$}K#IKU-z{MS&mOV3d3|aO;o}{Ia4;U5w-RGBzFcuKQ|KZ;_t(?L z8x#hwKHiW%1L=wB;e|)T`;I&oG$g7MdXKL<lIkG&=?`Yv3W8hdrsFB*yS-U6)MSDQE&+pDO}N)`La zZktBFDd`Q6*f%?BOWoPs5%1H==kVH#?xw&ydyP&{t<4y*P3CGTnydA+HV)YEWmUt{ z7IUlecf3;w%Nrc~h|ZZp^`%`*2{P`;ba2w^gmeB2iGiabRTGKOg7=`ncm~h#w#e!; z-mqQg=s&BC!v%1FN|!ofMw49rv74JSk+Hr{!Ez`9_6T!SdU2rt2$q;M23?v^;3wY> zh0H~IsQA(?alhgEv+sH)e0b4;#L5*|6iZ+saDNwFfP4gtVeDKGjys6pI8#-)MUa8s zx3u0i&L5Bn&DKE_uhfy|mvgWvT3bvt;We%});$2aC>Y`>#0#&3lA(w%QRIK<%7F1; zuFBc2fqk(vKzzj8U2&zAe1RtxX(ERjGN32tMz}jp_jT5M_{?I;Z zi3{K(*T!*U(e;itj!cLB0$_uGWsEF8_9KDYinternalAddGeneratedFile( + ' +¯ +"google/chat/v1/action_status.protogoogle.chat.v1"R + ActionStatus% + status_code (2.google.rpc.Code +user_facing_message ( Bœ +com.google.chat.v1BActionStatusProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpbªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AppsChat/metadata/Chat/V1/Annotation.php b/AppsChat/metadata/Chat/V1/Annotation.php new file mode 100644 index 0000000000000000000000000000000000000000..62c79c5cae09771481e1c0528979740f40f3e6af GIT binary patch literal 2038 zcma)7-EQJW7>$8tmk&bdY}C?iyF1H9T2f^lL94cMnpA*Eur~Y%28QvpI37ByGytsJxGR6%cnYFCEW}53l&sp=! zYir!-bNC0~$$xYmF&XmrINq&eZ~5gtLASj z8`v{_>zYJ^#oyJi!ff@kxQ@(We5zyyYVDNHAa_UUF+A!kjh1$)bY5y(dYT82`^u=P zohz5kf>2LGieFdy9(M0Yqc0&JS>j)7KA9{V`{`Ck+)bZM&qb9kzmMe4@6QEI{sR(Cllgp%a+y?%=XEXladZyIt$Zg#_A#%(~J-vi_?8hz&!` zU43tJceojP!s{c$b{FOv=+2L)ZnXAv&tjX8KXu;tB>MP0@$e$taAM8#0+Fvdaa8$p zb*ifTSdG>n+kby2K8)a!#J`XvPLQNgWtVV D?#*eP literal 0 HcmV?d00001 diff --git a/AppsChat/metadata/Chat/V1/Attachment.php b/AppsChat/metadata/Chat/V1/Attachment.php new file mode 100644 index 0000000000000000000000000000000000000000..013dfc061df3f3f8599d69bcea444d2799d17c9e GIT binary patch literal 1779 zcma)7+j7%J7{(5m@HeDEoD4m%n3I{I^0;(*p%7ZxvW=%9_Be+NMl+hVw6=GuXoa*& zhcbSVK0+Ubr{J35u6Moa9u&(Z;ouv||Nh^9{Pxq6U*cH|cTkT+B*B~nX#5KC89{Nv zIP+PE#@S>-66CYPn1&=V5po7-XRwDlPJi#VfTk=J3}Z3C98E*zGBp+ZHhQpt%X)hd517LK7UOM8Hq_PO`}7ltoAa29Zzd50Q>3eecFhbh(9&3mMABMbmCS z;v|W1=sG0z6B=`t427#@O$lF&OIqp=^RzM?ouIm|(XvhyxrKO=k>%_NC4^^5w5jTr z0p^Q0_mnZ&F?G9?gh7kU@DXK+Wfff&K|Tf@k$hXHqSPpUcuMoe?I2k6*%iC5FDjFD zK7jYDaO*QmH`cX-DOq72HE-U?0XU|OBrituqxR1VK(TdW4bDo!R7!!TzY-@%DFihn;r6+wV9VXN+|KXVgFFc-{VX zXQO0XfsOs)_P};Jj@KUS>~(hbHp-Uw&URh+Uad@zNNg)Lg#t8+5gC@c%4y@Zdd?f- zZl`!kgdu;MFG+x~7K@m-09KEeQM(6g%d<1C!bLstiJ+WEgQ{9}?KikoB+ut8eUC|` zX`#t-3$7R0yew8j=InP8<-xY$N{{d&-iW-+NXm_$mO0nD|JE-5YopIiqDJ8QzRGbj z;A5!7I1#MXG;ZBdA-^-eIc>Pl^#ny%tFm{+b4gXj^K$J4R8OW!V-}^vczQa~V2J&GKJ#$#!9sx^X(e3}-j9l|^3>8e HhdIE1@76N@ literal 0 HcmV?d00001 diff --git a/AppsChat/metadata/Chat/V1/ChatService.php b/AppsChat/metadata/Chat/V1/ChatService.php new file mode 100644 index 0000000000000000000000000000000000000000..815f339431fd5a860dd2fcde679b70a5bf171606 GIT binary patch literal 5388 zcmbtY%WoS+7{?WaYWkiiEp=a;ZD>;0Su3rC#HImllQycLZPeGHvJ|b?<9O+MciCAt zYD)w{q6ZEf;6xD!uKX#z0XLtyz+b`4H#58IU2kodTUughUmPuNqiF7 zF==b9r&`=4S{Ma!-~^u5>UTOM(wv|dx*mxPP20Gm-M({QyS{Pr{yY<9}6zsc6~Q?ZO?tifUjvC+oOcZ7kN8<--+G8*SNqP z-yusEHKCL9E`$MdbWKx8wz%)i@8(TECXsJ@%?(1G$PMEl+G4DxxkKV4V*Hn-i_$Dt z=XSIufzdPzAlI}w>XWQ>O^Zm}kNj1@%@yn=-h*-0ssF!YjqONP@q4QvSTq)O_U95s@eljLfS4D&z@p)lc624uBl6()#tX`{`#-Kf7o|XKg);ZbHTL+4$wwzuOa!V`L6tizpbEypSm=b z$|*jdH=Cs@Yy}U7nP|vH2+MRZ4wqBWwMyRA+iEg&ErWm==Fj1HeXv17X^U-kmQP`3hc40;a!Bl z0@OF2&+AQT%5-VzENAVieB|wd8D1{<4_3MlLbguJOLvGo*8W$Ofi;WQ>?3Tv{MP zALuoxo!rqdIT`X(q7tCye)Sdq$QBo$rOE&;F0LW6LRfGl$0aM9?Xc`ov5u!e$a&!0LcrSW3HtNuFk%9@33C=U7T=0gqEntxg^X1Z}4 zQnS(6-QAUmQ`CmtkGt@?VYGs{J`rOZjxm$*x-gz5<4s$HPAy>AVK}`ItFm_Bdrv2o z6p^2f+i;kbm`o|eWT1B@j)Z__By#`LELZdfp_x()cIt#K3f`&Qk|N5LYwSjhSx4k% z*R`XWTQj_2Y*ilB9WUs&6V9O5*a^gAAnP3Y9vHS(dB26N-}lXK!mFQQg&{S#I^*HW zEA?x$$$xH&Cqecm`0u{sg55MZ!8EymX+B(O&A=i5%3|^aQWx)Qndi9Dr#RpgPiA{) H52616=Z|U8 literal 0 HcmV?d00001 diff --git a/AppsChat/metadata/Chat/V1/ContextualAddon.php b/AppsChat/metadata/Chat/V1/ContextualAddon.php new file mode 100644 index 0000000000000000000000000000000000000000..c72b5a23be72aecff6eec59588b1e73a7636a76e GIT binary patch literal 1479 zcmb7E-BQy)6t<-ldO)T|R0h3R5r;AZ=@dsVf+(derK8Y}Ep=ovli4KOHba`tBpVbR zUci^|-be8bd<8EYAHm&hD1YimFPhBeJKs6qIcLA;Fa3cJk5HX>B*2W=$UH`DK#(6$ zMlI?hGwSt7fGj%n9hU?uLe(bPYj#kr+UPvwp&^X|i)g4%Y2PJ9Yk*nts8qD5$H)g3 zVb{R6O+7Vc1n}^Xgg&+is<*aw3BxvKSg*&ydW8q;-O@UM<>D|zl@UosTmcnDNJ=6B>@^FbBKNM=oFk^{^Wf&T$pni#&@t)I%bm=~<+(j3lSPF8Y)U-ax0- zv_ucMe!an^1Ri$vDhaK?@fi(T9I9!3!bY7FCxzuCt)O#ys32?9v@1n!AQnXAe0GEa z!lJ-ikLwl$C!;t0@4eFBIyNsO)U-2AXB4rd)fY}8fOm0J?=~N2VU$7STY{fic>G^; zRAwYh72{TqN(-OI;m(C=HN9ON97g{9uMA`=IIxu(WCsM>B$!K~RAFlEsd|w^{bRf; zV&lJ^I9RE|WJuyEhI45&#);OhLDZI^$}5<*II)2frm>jmx+Rt4Xk{8QVy)*gTvu-X zdkR1loz#01#+k!h606QBd0u{G%9FIfEBi3z3~`?rAv@-bns zDZk05=XYS@w1YDj#+g%AVdA}9#bhiGE=!P`nykfvY*Ny}S(uiSFkEaBH|fdKH1)`jP^L8`dT4*6gJPi|=5xcO_iY#0O0i0h-n=nc3J7pDc~8 V;EJ?_a}M%X_lS}5mY={0z;A?*&c^@% literal 0 HcmV?d00001 diff --git a/AppsChat/metadata/Chat/V1/DeletionMetadata.php b/AppsChat/metadata/Chat/V1/DeletionMetadata.php new file mode 100644 index 0000000000000000000000000000000000000000..ce6976a0ddc4853dae10d7d19840e5eb7466bf68 GIT binary patch literal 1023 zcma)5(QeZ)6eSxQ!h$NeCFbhfS&oM(| z#E_ax0uZA)PALj7>^QCNa?|VNY_HAP-mu;PAc#B*W{cLzrNeC2=G7Ed&cF%XO9Mk{M8#rd$y0A<`zN74c zd+oldyLMlelmoCgaP+q6+m}7FFK;RL!H#Zpt)9HC90Emm9KUN0271Tz&5w@Nzmo4N z6>zW=@Q0S}bBw&BJO-6Dp>kul^-Tf_&-uokT8~ziS0T((;Ygp(f{0|}5>Do|DJk-g zXvm*{=qMdEisk!OrO3FdQ<|zG=<2ZkV^#G$QTB=lz+b?xt-}JYX<|du1VPh=_0ewr aj$WUX6F)10w3fSnW-dn-@mhcd0Dk}winternalAddGeneratedFile( + ' +ã +google/chat/v1/group.protogoogle.chat.v1" +Group +name ( B• +com.google.chat.v1B +GroupProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpbªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AppsChat/metadata/Chat/V1/HistoryState.php b/AppsChat/metadata/Chat/V1/HistoryState.php new file mode 100644 index 0000000000000000000000000000000000000000..ec2fc6b93e7166f3871733c628257c784c81279c GIT binary patch literal 837 zcmah{-HH=27`46dBFb7T2wp6Fs|(webxQFrwJz=UXXnCBv9+KKluRbm2Bwpc$tC#E$Qg`y0@T8MSZ+H^y7`=-<0@LUUZyUMkp^-4N~GO}g4 zB$UBqHu%6aiHRoRr0fi@OlP?4bP=K{$#b}N40B6>z9BH5ETWWCu$<;N<@t(dTyv80 zuSR+g5|ZZ35ZuQmMMgCj8Q6v(qpWofj?-dKr7)}ZU@v86w>O)Iex{kqNE!}VP8FAC zrI~?Zyk@$3Gh1n$-;K3&Jb{+ei19s~dij4Nnnw=fS+l&G&g&_9eE8bUWAx(MpD%)spI7rme=%Bpn$BmV zD}U^dhK&c!C+N}sIv9@|wdN5*Rbkqw55Ct>(d3GKOHQQ&a55UA@m0#F$v)S literal 0 HcmV?d00001 diff --git a/AppsChat/metadata/Chat/V1/MatchedUrl.php b/AppsChat/metadata/Chat/V1/MatchedUrl.php new file mode 100644 index 000000000000..bfe88200ad6f --- /dev/null +++ b/AppsChat/metadata/Chat/V1/MatchedUrl.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + ' +÷ + google/chat/v1/matched_url.protogoogle.chat.v1" + +MatchedUrl +url ( BàABš +com.google.chat.v1BMatchedUrlProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpbªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AppsChat/metadata/Chat/V1/Membership.php b/AppsChat/metadata/Chat/V1/Membership.php new file mode 100644 index 0000000000000000000000000000000000000000..6feaa39be9a0cfec68d9978193f218eb5dc37fed GIT binary patch literal 2411 zcmbtW-EJC36b@iWd_cCfNeywUdP<@MR|yCwYNd6YYB87)*?=(dMYSqgmH|dxcDFl& z+tl)HuY27`=ri;Q+L!Qk9-&vApIsn!B3y-=U1rXA=FE4#bI!i_&L8{m0M)UJ1B>AS z>c2&7jFBIB%(FcQ^{2xj4v_6leB$7sh)}hKnyoIXRU6%}IFx$Rz{WZndEUsuC3|eK z(pkAQ!IM4?=$QCL=?lQMCYbt`jZwW_ImXNySj;l(5@sH7n0Z>>1F#*7Qgl3n!#N=S z^QV1>*oZQV@yA0#d&DJ-SPuD>N4<}RmP0XzU$-4jU7HclMFP-rZCuzv%BQe>=zIK@ z`zQ*eEiTS4Z8ltn1J`oQDyDWoeC7phZmR1e%w}|nmBLPVtZ+w$sGwrh^=m=yBNj~Y z;^_zlm`wwBPsS}AT+H6g571=z#5^R}8C3AtIwM}7>+@U9oqP=1!C|&;j0*E&)&pngTX8zhg_tE8HIw-$M9DMwwI_=TT=!_ zA>ZOzdFy@%uzXSqLe`X!x3;eM8VPE`y$B}Uh$@)!`-fXm2(lWuz)CE-q%z3=o&=c7 zUMs_jsF+*~#R{vH2mcxfzLe3a<9T4T$g8rn0C@>Xp*@_7bIjWA*TwfQRh*kHyq*X| zC2?sav=^`vcn;3pmhhb$!8;rv&@t^1q$aXza|w=5@7}wL7h-sIOM40#Nm(znPD<;~ zu3AgQar18>Z3mdg*b{{1R;2Y-WF4_toJppVx-^m^9u6E}2S>m=HwET@fb}_3k{%7g z7ss{ZO09G9s?qM9bd7GU_ojK$t{pTE8@1}jEe#;`y47g%_n4N3+l}UFqs#xqwGGJd zcG)v}%E3k=--Wfgf5D%&4WBQ#@3fAtdS8dMTn&B1gjcm-G>v+#vk}*;?+jz9LbhcC zrloWFyokDV>0IUFqLKknuidvk&i@vJ?13bIAz=K|lozM=4WxW4z%C0F`smV#bCGJx zMEWc`LCglJ)b#EwoniSc$Wv%5p8qEXn@5DQc^I_wiE(Vgs&9>OkMaQ`!$>L_X946o z^M1sxl=7`+c^f>+WKdQw^z)?NGy>n#K>TEJ@l2=3MK0&5Xz&);hRaVqI4WHz&@<$9b-ov6|4zpibC_gz8+OhAS*p4?H%nW(o8+qzmgEvCnXa&^o z@2SV1@w;{TSy426pB4{9Pd_dH9j%(CST@x+2mk1J7vEIox-K?!T>y0bwA@e0_VVoU bY@j?*6MSLdi-t?=4-9*0sYdbzTmbwBb4B_@ literal 0 HcmV?d00001 diff --git a/AppsChat/metadata/Chat/V1/Message.php b/AppsChat/metadata/Chat/V1/Message.php new file mode 100644 index 0000000000000000000000000000000000000000..5fa92ad96c456af1c9f6ce4f063fe37829403aac GIT binary patch literal 5774 zcmbtYOLN=S6*l#tq(eO@M7AM0j$uZz<-{gON+)jUC^h(y%&}z3BxNTV&R`($ib4be zFdlMMkJ`zy+itq(wwvUqblG3vwSPi4?YR%YBuLqos|~1o&pG!zzjN;W?ho#f3!f|7 z#3r5|kdAV2ssu+waXlw+498Lq!ox%2DTdQ?O^bMWMXA)4C-s(6t<+jKk=1uX&mcvm z>o{GD6pSN1D4eVpdc^njF3B@N0Je?`u5J)zd#|)h0==ULdV8Dkw9ClTezyJqz_4`R zS9UosyaEOP-0;9M4aE=i06(jyubH+Pn7U>D3H9An4t2{X$U97X7}`c)I<`U?>b61F z?kHR)rCoI$v~N?1wAiC2qq*&x9T3mft#*a@hG)8g?pdjc1Ijb#hHi7 z8rQK{98z*q3A~W>pROn#2|~|)!1Sg9&f;I~5k68~v%O^!t5YIJ`ibdy#o}A5-U>O7 zwLwIjF2Lpb?XvE5Ff#1>;RlL%wpHf+CI&9_KZ4t~9U61T{s`V6(2b)Wv4e~AmK}`$ zAA?Z0)K2GP4zCc4P_?5pzqks!dSD!p&c269_n}daoZcWhbNj_Pn^=5DWvAEE?aoJV z)9SuB+rCdOkjin5vQpU9{o@ZmG3ITVh(&?kb4T+sT)6kWDNq2DATIhXguu19Oli^H zhX3A#Pv3=o(mdbIQ)JAatgkE!YTY#po+wKWlPjOaTdrR)u=XgD(y!RhB@W_|)+p?R zzM#30q>0PuJc77Z1i=>x2}WEHnocW1kljjZ zVmoQIPxDm6jzkkx(5xgxuwEnfB8SreP=|(?a$+mejddx+{=y-JSgnVNB`6|y#uP!6 zJ)9u-E5MX!Skf#^&_*Yxl+@acbO+Ktu{*?*$MFBm#!{Xu8D&DA=6-4XwK^`{hm3(% z2SlUd<#9&8646Iz=i|&RrC+O)uho?FEo9Lfffl;hPzCqZ_j0o{e+L;BGQqX-VO(e; zMMrr8$!DZ%Fn{QHJw3qDL1XJ*(RFUrCQQ=Y_2o%r9L@hSGDj3begJ6e_O9+7hi;y> zoYI(_lJ3GZW7keL$Og%Bx9BtCYSW$eWD%lppvlTyZ_~gjPv((1}T2 zVs)-EW6rJ4N$DXh4uP9|i*YGQ1(MC5AO0Awz6c#!B+=OsNXqToOwboeK~EXIK$d8f z;L`46O0dwNysmlZ%U?2QTuX{j1<|&7$Qg^Us2c{l+3`-bmu3eCT3^1)m~RX*M}*HA zU9tQ|eF)cB<#8Cp{^jQpg$qJQ=_V@?zwnBE&!Q^;E(oK~ayKB;r<9b1@z66lTrv%F ze;tF%BQ2NK`?0n3Iilu&)a&n7XcRbdD2_9C1hi6cEdG*uqy8E0j52q$dQabLe1T^` zBBF&?e0eA_&T=mxE#POcuUrKXRdq~GS+8JlkSacWqi$kZ(K#a#A|dBSLP;(L1H^xv z<^DYZ^MfEHeUE^D>hhj8zwy;@n$S@qlGLqq7yvE7Hfe_%?SxntAp1!r>pU* z7VT~bwJMB=tHWj0V4gR+j>ulthB6y>-=oz&>yFqeXvQ;9D-D=$;=sa2fTMF#KvVBLoA@)G?_58J_fPEETilFo4B3A~rEtmh)2Unb=zGE-Mn& zc2l{3j>A%!O_~X%zJ|1`d)SYePBRo>sq>_FB7UDGbRNuXyxWrH0pLm_$4qHbPSH6Q zG0o#ar0su-ZK3rk=_gnc&f+tK=D4(&9p%8$>tOiSR};ao}`L#nH=A?hU{dyS`v{O&~%6{YTtS7GR3@5SrcmcG$iR6LdwW z^bTo%Pl1GUR&<Ly19DDTLaxeAMUBhz1PE3V^S=Zsuu{f#GcLbaZ+=B=F^V`@b z+wAc*uhRBbrZdB{^?yaH?KWL*^OsqC0DLocg_9SHbfZ|L48`KJ^@B8l5YO338c#~AUXx;4K#PeKSCq3H5JDFMvXeHc3QZJBB&w^d^?B@Ud%itx z_aaJVo_Xep&%npvkx$X*egk-7|J+?%r-_j2mp#wU?EHSeotgdWo8&lwkI62^m{N%Y z(tl3mF_I+Zl7~DZ{cJeIl!Sboun1F+kez+3~3}#1)udDX0bs*bijTbV)Hh!XKLTIge!(yq=0dt zNh`v^{a9ie( z#+wGWK44OQ1#b|kld#|(!)VaOV|v1P>iegxP7gUR^bqr#`rlFctpq;^JSUeC@YAnZ zE>~wTDAl>As-;=-(d^dYpC$O-62l1<_7C9uRZG(^>=w=#d|%Wr@3~kFFRFt4Hj_BpR#(@c&^TR z-qoA_kFPpM@V!hXnK+q8?L;f`>n?>1*zL_+7uwZhy z*WgkXvycyR5_@y*mvA}EgyiF%#c0{wn#H(ne9S3^)ZSdT2A4vv?kkp!o3K3P;4VWo zV*{&GBZ3tZRJpq8i`?g=%YEOVX4ao+_ncFCV%Z0f3JH?G6tkVR_d)aP}T8e`)Ltj=H( z36BN3pFpjkCzLK#br0wAQ#r53__ORyCDz4KYdnC}9gOg-<{Q%uQz(9Mjd%ZWz*R** zqjLA1LQpeV51hw$!iZ;s(oMC=h}$Pa^^JNpbR#AGO}qSAxxQ=O2d|SP!rRs};i&z0 zVGROp4(#KhUXNFm8`js0 literal 0 HcmV?d00001 diff --git a/AppsChat/metadata/Chat/V1/SlashCommand.php b/AppsChat/metadata/Chat/V1/SlashCommand.php new file mode 100644 index 000000000000..d31b2a8bf0d2 --- /dev/null +++ b/AppsChat/metadata/Chat/V1/SlashCommand.php @@ -0,0 +1,30 @@ +internalAddGeneratedFile( + ' +ÿ +"google/chat/v1/slash_command.protogoogle.chat.v1"" + SlashCommand + +command_id (Bœ +com.google.chat.v1BSlashCommandProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpbªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AppsChat/metadata/Chat/V1/Space.php b/AppsChat/metadata/Chat/V1/Space.php new file mode 100644 index 0000000000000000000000000000000000000000..d0f7fa81bd7fd68d1337f2f4a777fdc29a2fe4d5 GIT binary patch literal 2793 zcmbVOO>Wyp6s{!8wVo1N9>po61PH^Xh>a!`>@0#ZO$+MBih#-%EZJxZ0R&Bs>_I4! zR_wO!|-?ND9P0QmNV$_2I4Z}ezvyLN1kIubEzB4Tv3{S?6QY|hnzK*DQK@h_Yn zd(2UJY{&Sy&$z{W7BkypzoFJ=>e%);MdZ7-96F-(F5mfQuxnUCdcO*xIM;~=)&iL!*?l}6!>nIm7oN_-ko+oi5j zl*{RHH{hDfc<9+@mQ-E9%@WaIgZ`QnR>Ej|UhoTIS2D^X>A^-SR1)LyiBFXh+N|zu zeMobLkclc37RWbnJ)v{4-7t?UWuz(ZXdj?yC6)-SCeSOfRjx}NcjgH$*9cLd%qC$F z#nvQnsZzr%}uepw#qv$St4zcGu#)puacb|=io&WAbXdFZuj zMq8*ofon2snf5A_-L!LI^GlP40Gv#jOFiaOE>owZ>98b2eFG}P7yY(%xHssxo88@R zyH)v&tiaO2{(i5LBg>F)^(uMo2ukuG397-(LEmh)tp(5$Ca%~+>?%O#VE?dhHJ_Wq zN}do{ZFLXY&7sw64+dtZT`6e4=b)MpUkM`l3ht#xJU?igt?pjO8Vt?hywD9;A4-FE zDQWk6<>F1^_1E%yuKft4 zDT67u59rTR>{Vn7igI6iy}YwApDEH|gK$M^?<|Yx5g{8fK^&haKNK>8>--J?V zpHPeAt0&2eSrvj@kAs)gzr;eSusmiS7MvpMFQFa+xlGN&z~>bGyevg?BrafqELM$z z*L*BtYyLc~0c#za=*{F}kGkksjeB_Cf6dz;aIf|VlwIb#Ef!HH?orP1vKiU>6*A#G zEd+8H;simZmomdo@O~Z2Q%N9OvUFVeqL zu3X@g>6&nRAzd2T`yZ8#f8>B*qR-`O1EjRR7>oM3pB_41Fm-1(SQjTjGU;KV;IJnu zCp>N01+&?POC(dZn`0saHac35iw literal 0 HcmV?d00001 diff --git a/AppsChat/metadata/Chat/V1/SpaceSetup.php b/AppsChat/metadata/Chat/V1/SpaceSetup.php new file mode 100644 index 000000000000..69d661afdf88 --- /dev/null +++ b/AppsChat/metadata/Chat/V1/SpaceSetup.php @@ -0,0 +1,35 @@ +internalAddGeneratedFile( + ' +¤ + google/chat/v1/space_setup.protogoogle.chat.v1google/chat/v1/membership.protogoogle/chat/v1/space.proto" +SetUpSpaceRequest) +space ( 2.google.chat.v1.SpaceBàA + +request_id ( BàA4 + memberships ( 2.google.chat.v1.MembershipBàABš +com.google.chat.v1BSpaceSetupProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpbªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AppsChat/metadata/Chat/V1/User.php b/AppsChat/metadata/Chat/V1/User.php new file mode 100644 index 0000000000000000000000000000000000000000..8b5c899a36a39e0b662dccec09fd18483c81e0be GIT binary patch literal 1051 zcmZ`&-Hy^g7`4Fe%4D;_Y7BTauA9InYZ1L0L<7r@Tr3a;5;slA&<-$3=}e|m5;VMp z58$;=;4}CXUi%czw9sAMg`3i^=X}5CynW9X9K3)X;uC=-ap80g<$^#im}Cy~;53}g zh=2}Ta_SLbLD=lWUVjK%&F=8Iq6RD!4nc6v*xVy!XMtsTRVjyo0!LW@@bQua96JPd z28}Bsv5O_PI}yRYR0MlmsRH15I0)cK5y4jg)sKf$k2)}rSgOYv4JOp5l46g3QJvP{ z40{1l#Jkv8=sS`!A8JD1cSz|R#yK_ij59S^4enYP=wa2McGs6g_}H_XBya@fl8J$W zA~Yv5S&@#E&bMWCIy!@;xJQKUG+BdEgyeR02nCU$@T*bZI>9FSXWz4+I;VD<63=ar z1zu4m5W1P_CdoePN3y-py{u>zFW=Ga;C0tc=4`8bmy*tOpGELJ4GMb?ZJxxREUf`+ zRe839Vou9q+eWO3)1L;&=u4Z&Afx4xH=t3&fea^>2Mk7qEs3pz|vAV4wNxB@2W6ks>^d@}9l|nF#U( z$m(*Dlm^E2 zh2yc%O(1Mpp0n5+Y8lENdPRI%jUPW!k7F}fbRt;2Tg6lIk^si!d< lA^ia%O+aW|nI1-lds9rVb`h)ZmRR=+HA2R6+JFrJe*rJJLec;L literal 0 HcmV?d00001 diff --git a/AppsChat/metadata/Chat/V1/Widgets.php b/AppsChat/metadata/Chat/V1/Widgets.php new file mode 100644 index 0000000000000000000000000000000000000000..addbc96ed7ce38f820b649f3d017e2ecb71e2837 GIT binary patch literal 2649 zcmbtW%Wm6N5RLrMV{FSeOqwWaQZSDqPLarP(g&(EX(@@a2umVC(JE31ASmhDCPI+} zNu_m*?7Qx!AJA^vFDd#JU3cGoXD%hhNf5zky`emuGxyAynala&%kU(G+wwm5dE_K~ zEDulR#1#<;z;`A*4xJH~_l;VIC(hVOoWZ`p4C;s(^!FYEj65ff<*!pL z`~Wikh0~$uj^sFT5`5foW83xJ#C1IPd*u5>K61R6Bld0Iqp3ei+`yL!p!*}fb5BlV zlJA``!2F)ba~1}rjOh+EKjD$@c!LIyN0A#QL1dt7wTcNXgd)q%z1gu8&OMTMQjXQ? zTO^;zNi^kWPnYG0C)3D(EO=9Zmy2J5*@LId(M!1qMQY38*=ECa6c)nVSNkI zHMlr4*psQ3xSs3tQUPD(rOU8646ve;S%h@~IGbQrw8*&R&stW;R_zc z*v)jCe71B5UInhC+0a!e@Z|@v{f3En;WamFm@QaO?>j0);nrWPutp<=4Z*a!-n9?A zJwvT)O-*gE3png~MKg`I(p6c8{;TQwK}RtUSXs)!YVEMcuF;RWVzPo%fc1J?uOF}# z={l4!T2nJSilt%L?qR2H5HYI>;LvObcRKyY8XsErqsTt(R-lr&PN7330q)V`^ z_SLRs8>-pV&5mla%Tf^_HTG1+V(;NqP;9of{g!1brm6LnHe-~{%+^p1#k3Ahm2Fex zmTswSmZiwzr)}zb$F`msD!WLuv~FLsRCWnP%XJjPHnc8Vr6W5kCD3bW1}hP|bJ(^t zqpcz}9Un}h=z6n>6hELq$he2;Y>?S#>8Rfp!A!MhDTk(lISDOtIMiFcmTurd`!>pG zvAmRrHS{vsI)QtZj^wXUOiQaDs1{ozvt=qs?W)9Jv#&K&9kD2n!mbn9)PiMu#%|18 zwf1ucBwVH5Xsp`oYaELe#K?Sef8+(z@xm*Z>>dZ{X61w~E?4v+4~LJ_$L}kb(mkr8 zgkfBvWvbHO`*Us`49Gl4mn__}{$9C~x>u|8qFN + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/AppsChat/samples/V1/ChatServiceClient/complete_import_space.php b/AppsChat/samples/V1/ChatServiceClient/complete_import_space.php new file mode 100644 index 000000000000..2e7db871affc --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/complete_import_space.php @@ -0,0 +1,73 @@ +completeImportSpace($formattedName); + printf('Response data: %s' . PHP_EOL, $response->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 +{ + $formattedName = ChatServiceClient::spaceName('[SPACE]'); + + complete_import_space_sample($formattedName); +} +// [END chat_v1_generated_ChatService_CompleteImportSpace_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/create_membership.php b/AppsChat/samples/V1/ChatServiceClient/create_membership.php new file mode 100644 index 000000000000..23ea151ed81b --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/create_membership.php @@ -0,0 +1,95 @@ +createMembership($formattedParent, $membership); + printf('Response data: %s' . PHP_EOL, $response->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]'); + + create_membership_sample($formattedParent); +} +// [END chat_v1_generated_ChatService_CreateMembership_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/create_message.php b/AppsChat/samples/V1/ChatServiceClient/create_message.php new file mode 100644 index 000000000000..df8c1af8faaf --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/create_message.php @@ -0,0 +1,81 @@ +createMessage($formattedParent, $message); + printf('Response data: %s' . PHP_EOL, $response->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]'); + + create_message_sample($formattedParent); +} +// [END chat_v1_generated_ChatService_CreateMessage_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/create_reaction.php b/AppsChat/samples/V1/ChatServiceClient/create_reaction.php new file mode 100644 index 000000000000..3c5827ff9499 --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/create_reaction.php @@ -0,0 +1,76 @@ +createReaction($formattedParent, $reaction); + printf('Response data: %s' . PHP_EOL, $response->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::messageName('[SPACE]', '[MESSAGE]'); + + create_reaction_sample($formattedParent); +} +// [END chat_v1_generated_ChatService_CreateReaction_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/create_space.php b/AppsChat/samples/V1/ChatServiceClient/create_space.php new file mode 100644 index 000000000000..11ed07c06bf8 --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/create_space.php @@ -0,0 +1,65 @@ +createSpace($space); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END chat_v1_generated_ChatService_CreateSpace_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/delete_membership.php b/AppsChat/samples/V1/ChatServiceClient/delete_membership.php new file mode 100644 index 000000000000..37ae5df2c18c --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/delete_membership.php @@ -0,0 +1,84 @@ +deleteMembership($formattedName); + printf('Response data: %s' . PHP_EOL, $response->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 +{ + $formattedName = ChatServiceClient::membershipName('[SPACE]', '[MEMBER]'); + + delete_membership_sample($formattedName); +} +// [END chat_v1_generated_ChatService_DeleteMembership_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/delete_message.php b/AppsChat/samples/V1/ChatServiceClient/delete_message.php new file mode 100644 index 000000000000..11dc48456c3f --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/delete_message.php @@ -0,0 +1,83 @@ +deleteMessage($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } 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 +{ + $formattedName = ChatServiceClient::messageName('[SPACE]', '[MESSAGE]'); + + delete_message_sample($formattedName); +} +// [END chat_v1_generated_ChatService_DeleteMessage_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/delete_reaction.php b/AppsChat/samples/V1/ChatServiceClient/delete_reaction.php new file mode 100644 index 000000000000..b021f18a4c6d --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/delete_reaction.php @@ -0,0 +1,70 @@ +deleteReaction($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } 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 +{ + $formattedName = ChatServiceClient::reactionName('[SPACE]', '[MESSAGE]', '[REACTION]'); + + delete_reaction_sample($formattedName); +} +// [END chat_v1_generated_ChatService_DeleteReaction_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/delete_space.php b/AppsChat/samples/V1/ChatServiceClient/delete_space.php new file mode 100644 index 000000000000..488b4846c86a --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/delete_space.php @@ -0,0 +1,73 @@ +deleteSpace($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } 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 +{ + $formattedName = ChatServiceClient::spaceName('[SPACE]'); + + delete_space_sample($formattedName); +} +// [END chat_v1_generated_ChatService_DeleteSpace_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/find_direct_message.php b/AppsChat/samples/V1/ChatServiceClient/find_direct_message.php new file mode 100644 index 000000000000..4bea324a9c95 --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/find_direct_message.php @@ -0,0 +1,95 @@ +findDirectMessage($name); + printf('Response data: %s' . PHP_EOL, $response->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 +{ + $name = '[NAME]'; + + find_direct_message_sample($name); +} +// [END chat_v1_generated_ChatService_FindDirectMessage_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/get_attachment.php b/AppsChat/samples/V1/ChatServiceClient/get_attachment.php new file mode 100644 index 000000000000..83ae101a778d --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/get_attachment.php @@ -0,0 +1,74 @@ +getAttachment($formattedName); + printf('Response data: %s' . PHP_EOL, $response->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 +{ + $formattedName = ChatServiceClient::attachmentName('[SPACE]', '[MESSAGE]', '[ATTACHMENT]'); + + get_attachment_sample($formattedName); +} +// [END chat_v1_generated_ChatService_GetAttachment_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/get_membership.php b/AppsChat/samples/V1/ChatServiceClient/get_membership.php new file mode 100644 index 000000000000..a8f698dd3ad5 --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/get_membership.php @@ -0,0 +1,87 @@ +getMembership($formattedName); + printf('Response data: %s' . PHP_EOL, $response->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 +{ + $formattedName = ChatServiceClient::membershipName('[SPACE]', '[MEMBER]'); + + get_membership_sample($formattedName); +} +// [END chat_v1_generated_ChatService_GetMembership_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/get_message.php b/AppsChat/samples/V1/ChatServiceClient/get_message.php new file mode 100644 index 000000000000..a0845f506d79 --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/get_message.php @@ -0,0 +1,85 @@ +getMessage($formattedName); + printf('Response data: %s' . PHP_EOL, $response->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 +{ + $formattedName = ChatServiceClient::messageName('[SPACE]', '[MESSAGE]'); + + get_message_sample($formattedName); +} +// [END chat_v1_generated_ChatService_GetMessage_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/get_space.php b/AppsChat/samples/V1/ChatServiceClient/get_space.php new file mode 100644 index 000000000000..2f9ccac58b2e --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/get_space.php @@ -0,0 +1,77 @@ +getSpace($formattedName); + printf('Response data: %s' . PHP_EOL, $response->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 +{ + $formattedName = ChatServiceClient::spaceName('[SPACE]'); + + get_space_sample($formattedName); +} +// [END chat_v1_generated_ChatService_GetSpace_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/list_memberships.php b/AppsChat/samples/V1/ChatServiceClient/list_memberships.php new file mode 100644 index 000000000000..6711ea92f4ed --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/list_memberships.php @@ -0,0 +1,92 @@ +listMemberships($formattedParent); + + /** @var Membership $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]'); + + list_memberships_sample($formattedParent); +} +// [END chat_v1_generated_ChatService_ListMemberships_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/list_messages.php b/AppsChat/samples/V1/ChatServiceClient/list_messages.php new file mode 100644 index 000000000000..6df222ba8af2 --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/list_messages.php @@ -0,0 +1,77 @@ +listMessages($formattedParent); + + /** @var Message $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]'); + + list_messages_sample($formattedParent); +} +// [END chat_v1_generated_ChatService_ListMessages_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/list_reactions.php b/AppsChat/samples/V1/ChatServiceClient/list_reactions.php new file mode 100644 index 000000000000..a1a21598f12d --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/list_reactions.php @@ -0,0 +1,77 @@ +listReactions($formattedParent); + + /** @var Reaction $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::messageName('[SPACE]', '[MESSAGE]'); + + list_reactions_sample($formattedParent); +} +// [END chat_v1_generated_ChatService_ListReactions_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/list_spaces.php b/AppsChat/samples/V1/ChatServiceClient/list_spaces.php new file mode 100644 index 000000000000..80928d7e0cc3 --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/list_spaces.php @@ -0,0 +1,72 @@ +listSpaces(); + + /** @var Space $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()); + } +} +// [END chat_v1_generated_ChatService_ListSpaces_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/set_up_space.php b/AppsChat/samples/V1/ChatServiceClient/set_up_space.php new file mode 100644 index 000000000000..6571f4115bde --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/set_up_space.php @@ -0,0 +1,96 @@ +setUpSpace($space); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END chat_v1_generated_ChatService_SetUpSpace_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/update_message.php b/AppsChat/samples/V1/ChatServiceClient/update_message.php new file mode 100644 index 000000000000..9881280c3df6 --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/update_message.php @@ -0,0 +1,71 @@ +updateMessage($message); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END chat_v1_generated_ChatService_UpdateMessage_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/update_space.php b/AppsChat/samples/V1/ChatServiceClient/update_space.php new file mode 100644 index 000000000000..63f73ab7f1ae --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/update_space.php @@ -0,0 +1,65 @@ +updateSpace($space); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END chat_v1_generated_ChatService_UpdateSpace_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/upload_attachment.php b/AppsChat/samples/V1/ChatServiceClient/upload_attachment.php new file mode 100644 index 000000000000..dbb05fac90b6 --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/upload_attachment.php @@ -0,0 +1,77 @@ +uploadAttachment($formattedParent, $filename); + printf('Response data: %s' . PHP_EOL, $response->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]'); + $filename = '[FILENAME]'; + + upload_attachment_sample($formattedParent, $filename); +} +// [END chat_v1_generated_ChatService_UploadAttachment_sync] diff --git a/AppsChat/src/Card/V1/Action.php b/AppsChat/src/Card/V1/Action.php new file mode 100644 index 000000000000..df7032c28a01 --- /dev/null +++ b/AppsChat/src/Card/V1/Action.php @@ -0,0 +1,331 @@ +google.apps.card.v1.Action + */ +class Action extends \Google\Protobuf\Internal\Message +{ + /** + * A custom function to invoke when the containing element is + * clicked or othrwise activated. + * For example usage, see [Create interactive + * cards](https://developers.google.com/chat/how-tos/cards-onclick). + * + * Generated from protobuf field string function = 1; + */ + protected $function = ''; + /** + * List of action parameters. + * + * Generated from protobuf field repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + private $parameters; + /** + * Specifies the loading indicator that the action displays while + * making the call to the action. + * + * Generated from protobuf field .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + */ + protected $load_indicator = 0; + /** + * Indicates whether form values persist after the action. The default value + * is `false`. + * If `true`, form values remain after the action is triggered. To let the + * user make changes while the action is being processed, set + * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) + * to `NONE`. For [card + * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create) + * in Chat apps, you must also set the action's + * [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype) + * to `UPDATE_MESSAGE` and use the same + * [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId) + * from the card that contained the action. + * If `false`, the form values are cleared when the action is triggered. + * To prevent the user from making changes while the action is being + * processed, set + * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) + * to `SPINNER`. + * + * Generated from protobuf field bool persist_values = 4; + */ + protected $persist_values = false; + /** + * Optional. Required when opening a + * [dialog](https://developers.google.com/chat/how-tos/dialogs). + * What to do in response to an interaction with a user, such as a user + * clicking a button in a card message. + * If unspecified, the app responds by executing an `action`—like opening a + * link or running a function—as normal. + * By specifying an `interaction`, the app can respond in special interactive + * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can + * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When + * specified, a loading indicator isn't shown. If specified for + * an add-on, the entire card is stripped and nothing is shown in the client. + * [Google Chat apps](https://developers.google.com/chat): + * + * Generated from protobuf field .google.apps.card.v1.Action.Interaction interaction = 5; + */ + protected $interaction = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $function + * A custom function to invoke when the containing element is + * clicked or othrwise activated. + * For example usage, see [Create interactive + * cards](https://developers.google.com/chat/how-tos/cards-onclick). + * @type array<\Google\Apps\Card\V1\Action\ActionParameter>|\Google\Protobuf\Internal\RepeatedField $parameters + * List of action parameters. + * @type int $load_indicator + * Specifies the loading indicator that the action displays while + * making the call to the action. + * @type bool $persist_values + * Indicates whether form values persist after the action. The default value + * is `false`. + * If `true`, form values remain after the action is triggered. To let the + * user make changes while the action is being processed, set + * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) + * to `NONE`. For [card + * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create) + * in Chat apps, you must also set the action's + * [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype) + * to `UPDATE_MESSAGE` and use the same + * [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId) + * from the card that contained the action. + * If `false`, the form values are cleared when the action is triggered. + * To prevent the user from making changes while the action is being + * processed, set + * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) + * to `SPINNER`. + * @type int $interaction + * Optional. Required when opening a + * [dialog](https://developers.google.com/chat/how-tos/dialogs). + * What to do in response to an interaction with a user, such as a user + * clicking a button in a card message. + * If unspecified, the app responds by executing an `action`—like opening a + * link or running a function—as normal. + * By specifying an `interaction`, the app can respond in special interactive + * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can + * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When + * specified, a loading indicator isn't shown. If specified for + * an add-on, the entire card is stripped and nothing is shown in the client. + * [Google Chat apps](https://developers.google.com/chat): + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * A custom function to invoke when the containing element is + * clicked or othrwise activated. + * For example usage, see [Create interactive + * cards](https://developers.google.com/chat/how-tos/cards-onclick). + * + * Generated from protobuf field string function = 1; + * @return string + */ + public function getFunction() + { + return $this->function; + } + + /** + * A custom function to invoke when the containing element is + * clicked or othrwise activated. + * For example usage, see [Create interactive + * cards](https://developers.google.com/chat/how-tos/cards-onclick). + * + * Generated from protobuf field string function = 1; + * @param string $var + * @return $this + */ + public function setFunction($var) + { + GPBUtil::checkString($var, True); + $this->function = $var; + + return $this; + } + + /** + * List of action parameters. + * + * Generated from protobuf field repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * List of action parameters. + * + * Generated from protobuf field repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + * @param array<\Google\Apps\Card\V1\Action\ActionParameter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParameters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Card\V1\Action\ActionParameter::class); + $this->parameters = $arr; + + return $this; + } + + /** + * Specifies the loading indicator that the action displays while + * making the call to the action. + * + * Generated from protobuf field .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * @return int + */ + public function getLoadIndicator() + { + return $this->load_indicator; + } + + /** + * Specifies the loading indicator that the action displays while + * making the call to the action. + * + * Generated from protobuf field .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * @param int $var + * @return $this + */ + public function setLoadIndicator($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\Action\LoadIndicator::class); + $this->load_indicator = $var; + + return $this; + } + + /** + * Indicates whether form values persist after the action. The default value + * is `false`. + * If `true`, form values remain after the action is triggered. To let the + * user make changes while the action is being processed, set + * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) + * to `NONE`. For [card + * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create) + * in Chat apps, you must also set the action's + * [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype) + * to `UPDATE_MESSAGE` and use the same + * [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId) + * from the card that contained the action. + * If `false`, the form values are cleared when the action is triggered. + * To prevent the user from making changes while the action is being + * processed, set + * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) + * to `SPINNER`. + * + * Generated from protobuf field bool persist_values = 4; + * @return bool + */ + public function getPersistValues() + { + return $this->persist_values; + } + + /** + * Indicates whether form values persist after the action. The default value + * is `false`. + * If `true`, form values remain after the action is triggered. To let the + * user make changes while the action is being processed, set + * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) + * to `NONE`. For [card + * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create) + * in Chat apps, you must also set the action's + * [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype) + * to `UPDATE_MESSAGE` and use the same + * [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId) + * from the card that contained the action. + * If `false`, the form values are cleared when the action is triggered. + * To prevent the user from making changes while the action is being + * processed, set + * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) + * to `SPINNER`. + * + * Generated from protobuf field bool persist_values = 4; + * @param bool $var + * @return $this + */ + public function setPersistValues($var) + { + GPBUtil::checkBool($var); + $this->persist_values = $var; + + return $this; + } + + /** + * Optional. Required when opening a + * [dialog](https://developers.google.com/chat/how-tos/dialogs). + * What to do in response to an interaction with a user, such as a user + * clicking a button in a card message. + * If unspecified, the app responds by executing an `action`—like opening a + * link or running a function—as normal. + * By specifying an `interaction`, the app can respond in special interactive + * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can + * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When + * specified, a loading indicator isn't shown. If specified for + * an add-on, the entire card is stripped and nothing is shown in the client. + * [Google Chat apps](https://developers.google.com/chat): + * + * Generated from protobuf field .google.apps.card.v1.Action.Interaction interaction = 5; + * @return int + */ + public function getInteraction() + { + return $this->interaction; + } + + /** + * Optional. Required when opening a + * [dialog](https://developers.google.com/chat/how-tos/dialogs). + * What to do in response to an interaction with a user, such as a user + * clicking a button in a card message. + * If unspecified, the app responds by executing an `action`—like opening a + * link or running a function—as normal. + * By specifying an `interaction`, the app can respond in special interactive + * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can + * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When + * specified, a loading indicator isn't shown. If specified for + * an add-on, the entire card is stripped and nothing is shown in the client. + * [Google Chat apps](https://developers.google.com/chat): + * + * Generated from protobuf field .google.apps.card.v1.Action.Interaction interaction = 5; + * @param int $var + * @return $this + */ + public function setInteraction($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\Action\Interaction::class); + $this->interaction = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/Action/ActionParameter.php b/AppsChat/src/Card/V1/Action/ActionParameter.php new file mode 100644 index 000000000000..a6ecb8540ade --- /dev/null +++ b/AppsChat/src/Card/V1/Action/ActionParameter.php @@ -0,0 +1,109 @@ +google.apps.card.v1.Action.ActionParameter + */ +class ActionParameter extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the parameter for the action script. + * + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + /** + * The value of the parameter. + * + * Generated from protobuf field string value = 2; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * The name of the parameter for the action script. + * @type string $value + * The value of the parameter. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The name of the parameter for the action script. + * + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * The name of the parameter for the action script. + * + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * The value of the parameter. + * + * Generated from protobuf field string value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The value of the parameter. + * + * Generated from protobuf field string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Card/V1/Action/Interaction.php b/AppsChat/src/Card/V1/Action/Interaction.php new file mode 100644 index 000000000000..f5dde517e34d --- /dev/null +++ b/AppsChat/src/Card/V1/Action/Interaction.php @@ -0,0 +1,72 @@ +google.apps.card.v1.Action.Interaction + */ +class Interaction +{ + /** + * Default value. The `action` executes as normal. + * + * Generated from protobuf enum INTERACTION_UNSPECIFIED = 0; + */ + const INTERACTION_UNSPECIFIED = 0; + /** + * Opens a [dialog](https://developers.google.com/chat/how-tos/dialogs), a + * windowed, card-based interface that Chat apps use to interact with users. + * Only supported by Chat apps in response to button-clicks on card + * messages. If specified for + * an add-on, the entire card is stripped and nothing is shown in the + * client. + * [Google Chat apps](https://developers.google.com/chat): + * + * Generated from protobuf enum OPEN_DIALOG = 1; + */ + const OPEN_DIALOG = 1; + + private static $valueToName = [ + self::INTERACTION_UNSPECIFIED => 'INTERACTION_UNSPECIFIED', + self::OPEN_DIALOG => 'OPEN_DIALOG', + ]; + + 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/Card/V1/Action/LoadIndicator.php b/AppsChat/src/Card/V1/Action/LoadIndicator.php new file mode 100644 index 000000000000..cfb8070bcfdb --- /dev/null +++ b/AppsChat/src/Card/V1/Action/LoadIndicator.php @@ -0,0 +1,58 @@ +google.apps.card.v1.Action.LoadIndicator + */ +class LoadIndicator +{ + /** + * Displays a spinner to indicate that content is loading. + * + * Generated from protobuf enum SPINNER = 0; + */ + const SPINNER = 0; + /** + * Nothing is displayed. + * + * Generated from protobuf enum NONE = 1; + */ + const NONE = 1; + + private static $valueToName = [ + self::SPINNER => 'SPINNER', + self::NONE => 'NONE', + ]; + + 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/Card/V1/BorderStyle.php b/AppsChat/src/Card/V1/BorderStyle.php new file mode 100644 index 000000000000..4cf88c737048 --- /dev/null +++ b/AppsChat/src/Card/V1/BorderStyle.php @@ -0,0 +1,148 @@ +google.apps.card.v1.BorderStyle + */ +class BorderStyle extends \Google\Protobuf\Internal\Message +{ + /** + * The border type. + * + * Generated from protobuf field .google.apps.card.v1.BorderStyle.BorderType type = 1; + */ + protected $type = 0; + /** + * The colors to use when the type is `BORDER_TYPE_STROKE`. + * + * Generated from protobuf field .google.type.Color stroke_color = 2; + */ + protected $stroke_color = null; + /** + * The corner radius for the border. + * + * Generated from protobuf field int32 corner_radius = 3; + */ + protected $corner_radius = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The border type. + * @type \Google\Type\Color $stroke_color + * The colors to use when the type is `BORDER_TYPE_STROKE`. + * @type int $corner_radius + * The corner radius for the border. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The border type. + * + * Generated from protobuf field .google.apps.card.v1.BorderStyle.BorderType type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The border type. + * + * Generated from protobuf field .google.apps.card.v1.BorderStyle.BorderType type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\BorderStyle\BorderType::class); + $this->type = $var; + + return $this; + } + + /** + * The colors to use when the type is `BORDER_TYPE_STROKE`. + * + * Generated from protobuf field .google.type.Color stroke_color = 2; + * @return \Google\Type\Color|null + */ + public function getStrokeColor() + { + return $this->stroke_color; + } + + public function hasStrokeColor() + { + return isset($this->stroke_color); + } + + public function clearStrokeColor() + { + unset($this->stroke_color); + } + + /** + * The colors to use when the type is `BORDER_TYPE_STROKE`. + * + * Generated from protobuf field .google.type.Color stroke_color = 2; + * @param \Google\Type\Color $var + * @return $this + */ + public function setStrokeColor($var) + { + GPBUtil::checkMessage($var, \Google\Type\Color::class); + $this->stroke_color = $var; + + return $this; + } + + /** + * The corner radius for the border. + * + * Generated from protobuf field int32 corner_radius = 3; + * @return int + */ + public function getCornerRadius() + { + return $this->corner_radius; + } + + /** + * The corner radius for the border. + * + * Generated from protobuf field int32 corner_radius = 3; + * @param int $var + * @return $this + */ + public function setCornerRadius($var) + { + GPBUtil::checkInt32($var); + $this->corner_radius = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/BorderStyle/BorderType.php b/AppsChat/src/Card/V1/BorderStyle/BorderType.php new file mode 100644 index 000000000000..63f69e7726ec --- /dev/null +++ b/AppsChat/src/Card/V1/BorderStyle/BorderType.php @@ -0,0 +1,64 @@ +google.apps.card.v1.BorderStyle.BorderType + */ +class BorderType +{ + /** + * Don't use. Unspecified. + * + * Generated from protobuf enum BORDER_TYPE_UNSPECIFIED = 0; + */ + const BORDER_TYPE_UNSPECIFIED = 0; + /** + * Default value. No border. + * + * Generated from protobuf enum NO_BORDER = 1; + */ + const NO_BORDER = 1; + /** + * Outline. + * + * Generated from protobuf enum STROKE = 2; + */ + const STROKE = 2; + + private static $valueToName = [ + self::BORDER_TYPE_UNSPECIFIED => 'BORDER_TYPE_UNSPECIFIED', + self::NO_BORDER => 'NO_BORDER', + self::STROKE => 'STROKE', + ]; + + 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/Card/V1/Button.php b/AppsChat/src/Card/V1/Button.php new file mode 100644 index 000000000000..2dc25b88e340 --- /dev/null +++ b/AppsChat/src/Card/V1/Button.php @@ -0,0 +1,399 @@ +google.apps.card.v1.Button + */ +class Button extends \Google\Protobuf\Internal\Message +{ + /** + * The text displayed inside the button. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * The icon image. If both `icon` and `text` are set, then the icon appears + * before the text. + * + * Generated from protobuf field .google.apps.card.v1.Icon icon = 2; + */ + protected $icon = null; + /** + * If set, the button is filled with a solid background color and the font + * color changes to maintain contrast with the background color. For example, + * setting a blue background likely results in white text. + * If unset, the image background is white and the font color is blue. + * For red, green, and blue, the value of each field is a `float` number that + * you can express in either of two ways: as a number between 0 and 255 + * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents + * the absence of a color and 1 or 255/255 represent the full presence of that + * color on the RGB scale. + * Optionally set `alpha`, which sets a level of transparency using this + * equation: + * ``` + * pixel color = alpha * (this color) + (1.0 - alpha) * (background color) + * ``` + * For `alpha`, a value of `1` corresponds with a solid color, and a value of + * `0` corresponds with a completely transparent color. + * For example, the following color represents a half transparent red: + * ``` + * "color": { + * "red": 1, + * "green": 0, + * "blue": 0, + * "alpha": 0.5 + * } + * ``` + * + * Generated from protobuf field .google.type.Color color = 3; + */ + protected $color = null; + /** + * Required. The action to perform when a user clicks the button, such as + * opening a hyperlink or running a custom function. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 4; + */ + protected $on_click = null; + /** + * If `true`, the button is displayed in an inactive state and doesn't respond + * to user actions. + * + * Generated from protobuf field bool disabled = 5; + */ + protected $disabled = false; + /** + * The alternative text that's used for accessibility. + * Set descriptive text that lets users know what the button does. For + * example, if a button opens a hyperlink, you might write: "Opens a new + * browser tab and navigates to the Google Chat developer documentation at + * https://developers.google.com/chat". + * + * Generated from protobuf field string alt_text = 6; + */ + protected $alt_text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The text displayed inside the button. + * @type \Google\Apps\Card\V1\Icon $icon + * The icon image. If both `icon` and `text` are set, then the icon appears + * before the text. + * @type \Google\Type\Color $color + * If set, the button is filled with a solid background color and the font + * color changes to maintain contrast with the background color. For example, + * setting a blue background likely results in white text. + * If unset, the image background is white and the font color is blue. + * For red, green, and blue, the value of each field is a `float` number that + * you can express in either of two ways: as a number between 0 and 255 + * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents + * the absence of a color and 1 or 255/255 represent the full presence of that + * color on the RGB scale. + * Optionally set `alpha`, which sets a level of transparency using this + * equation: + * ``` + * pixel color = alpha * (this color) + (1.0 - alpha) * (background color) + * ``` + * For `alpha`, a value of `1` corresponds with a solid color, and a value of + * `0` corresponds with a completely transparent color. + * For example, the following color represents a half transparent red: + * ``` + * "color": { + * "red": 1, + * "green": 0, + * "blue": 0, + * "alpha": 0.5 + * } + * ``` + * @type \Google\Apps\Card\V1\OnClick $on_click + * Required. The action to perform when a user clicks the button, such as + * opening a hyperlink or running a custom function. + * @type bool $disabled + * If `true`, the button is displayed in an inactive state and doesn't respond + * to user actions. + * @type string $alt_text + * The alternative text that's used for accessibility. + * Set descriptive text that lets users know what the button does. For + * example, if a button opens a hyperlink, you might write: "Opens a new + * browser tab and navigates to the Google Chat developer documentation at + * https://developers.google.com/chat". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The text displayed inside the button. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * The text displayed inside the button. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * The icon image. If both `icon` and `text` are set, then the icon appears + * before the text. + * + * Generated from protobuf field .google.apps.card.v1.Icon icon = 2; + * @return \Google\Apps\Card\V1\Icon|null + */ + public function getIcon() + { + return $this->icon; + } + + public function hasIcon() + { + return isset($this->icon); + } + + public function clearIcon() + { + unset($this->icon); + } + + /** + * The icon image. If both `icon` and `text` are set, then the icon appears + * before the text. + * + * Generated from protobuf field .google.apps.card.v1.Icon icon = 2; + * @param \Google\Apps\Card\V1\Icon $var + * @return $this + */ + public function setIcon($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Icon::class); + $this->icon = $var; + + return $this; + } + + /** + * If set, the button is filled with a solid background color and the font + * color changes to maintain contrast with the background color. For example, + * setting a blue background likely results in white text. + * If unset, the image background is white and the font color is blue. + * For red, green, and blue, the value of each field is a `float` number that + * you can express in either of two ways: as a number between 0 and 255 + * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents + * the absence of a color and 1 or 255/255 represent the full presence of that + * color on the RGB scale. + * Optionally set `alpha`, which sets a level of transparency using this + * equation: + * ``` + * pixel color = alpha * (this color) + (1.0 - alpha) * (background color) + * ``` + * For `alpha`, a value of `1` corresponds with a solid color, and a value of + * `0` corresponds with a completely transparent color. + * For example, the following color represents a half transparent red: + * ``` + * "color": { + * "red": 1, + * "green": 0, + * "blue": 0, + * "alpha": 0.5 + * } + * ``` + * + * Generated from protobuf field .google.type.Color color = 3; + * @return \Google\Type\Color|null + */ + public function getColor() + { + return $this->color; + } + + public function hasColor() + { + return isset($this->color); + } + + public function clearColor() + { + unset($this->color); + } + + /** + * If set, the button is filled with a solid background color and the font + * color changes to maintain contrast with the background color. For example, + * setting a blue background likely results in white text. + * If unset, the image background is white and the font color is blue. + * For red, green, and blue, the value of each field is a `float` number that + * you can express in either of two ways: as a number between 0 and 255 + * divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents + * the absence of a color and 1 or 255/255 represent the full presence of that + * color on the RGB scale. + * Optionally set `alpha`, which sets a level of transparency using this + * equation: + * ``` + * pixel color = alpha * (this color) + (1.0 - alpha) * (background color) + * ``` + * For `alpha`, a value of `1` corresponds with a solid color, and a value of + * `0` corresponds with a completely transparent color. + * For example, the following color represents a half transparent red: + * ``` + * "color": { + * "red": 1, + * "green": 0, + * "blue": 0, + * "alpha": 0.5 + * } + * ``` + * + * Generated from protobuf field .google.type.Color color = 3; + * @param \Google\Type\Color $var + * @return $this + */ + public function setColor($var) + { + GPBUtil::checkMessage($var, \Google\Type\Color::class); + $this->color = $var; + + return $this; + } + + /** + * Required. The action to perform when a user clicks the button, such as + * opening a hyperlink or running a custom function. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 4; + * @return \Google\Apps\Card\V1\OnClick|null + */ + public function getOnClick() + { + return $this->on_click; + } + + public function hasOnClick() + { + return isset($this->on_click); + } + + public function clearOnClick() + { + unset($this->on_click); + } + + /** + * Required. The action to perform when a user clicks the button, such as + * opening a hyperlink or running a custom function. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 4; + * @param \Google\Apps\Card\V1\OnClick $var + * @return $this + */ + public function setOnClick($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\OnClick::class); + $this->on_click = $var; + + return $this; + } + + /** + * If `true`, the button is displayed in an inactive state and doesn't respond + * to user actions. + * + * Generated from protobuf field bool disabled = 5; + * @return bool + */ + public function getDisabled() + { + return $this->disabled; + } + + /** + * If `true`, the button is displayed in an inactive state and doesn't respond + * to user actions. + * + * Generated from protobuf field bool disabled = 5; + * @param bool $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkBool($var); + $this->disabled = $var; + + return $this; + } + + /** + * The alternative text that's used for accessibility. + * Set descriptive text that lets users know what the button does. For + * example, if a button opens a hyperlink, you might write: "Opens a new + * browser tab and navigates to the Google Chat developer documentation at + * https://developers.google.com/chat". + * + * Generated from protobuf field string alt_text = 6; + * @return string + */ + public function getAltText() + { + return $this->alt_text; + } + + /** + * The alternative text that's used for accessibility. + * Set descriptive text that lets users know what the button does. For + * example, if a button opens a hyperlink, you might write: "Opens a new + * browser tab and navigates to the Google Chat developer documentation at + * https://developers.google.com/chat". + * + * Generated from protobuf field string alt_text = 6; + * @param string $var + * @return $this + */ + public function setAltText($var) + { + GPBUtil::checkString($var, True); + $this->alt_text = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/ButtonList.php b/AppsChat/src/Card/V1/ButtonList.php new file mode 100644 index 000000000000..1f9596193798 --- /dev/null +++ b/AppsChat/src/Card/V1/ButtonList.php @@ -0,0 +1,71 @@ +google.apps.card.v1.ButtonList + */ +class ButtonList extends \Google\Protobuf\Internal\Message +{ + /** + * An array of buttons. + * + * Generated from protobuf field repeated .google.apps.card.v1.Button buttons = 1; + */ + private $buttons; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Apps\Card\V1\Button>|\Google\Protobuf\Internal\RepeatedField $buttons + * An array of buttons. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * An array of buttons. + * + * Generated from protobuf field repeated .google.apps.card.v1.Button buttons = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getButtons() + { + return $this->buttons; + } + + /** + * An array of buttons. + * + * Generated from protobuf field repeated .google.apps.card.v1.Button buttons = 1; + * @param array<\Google\Apps\Card\V1\Button>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setButtons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Card\V1\Button::class); + $this->buttons = $arr; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/Card.php b/AppsChat/src/Card/V1/Card.php new file mode 100644 index 000000000000..b6d0bea549d1 --- /dev/null +++ b/AppsChat/src/Card/V1/Card.php @@ -0,0 +1,638 @@ +Online", + * }, + * }, + * { + * "decoratedText": { + * "startIcon": { + * "knownIcon": "PHONE", + * }, + * "text": "+1 (555) 555-1234", + * } + * }, + * { + * "buttonList": { + * "buttons": [ + * { + * "text": "Share", + * "onClick": { + * "openLink": { + * "url": "https://example.com/share", + * } + * } + * }, + * { + * "text": "Edit", + * "onClick": { + * "action": { + * "function": "goToView", + * "parameters": [ + * { + * "key": "viewType", + * "value": "EDIT", + * } + * ], + * } + * } + * }, + * ], + * } + * }, + * ], + * }, + * ], + * }, + * } + * ], + * } + * ``` + * + * Generated from protobuf message google.apps.card.v1.Card + */ +class Card extends \Google\Protobuf\Internal\Message +{ + /** + * The header of the card. A header usually contains a leading image and a + * title. Headers always appear at the top of a card. + * + * Generated from protobuf field .google.apps.card.v1.Card.CardHeader header = 1; + */ + protected $header = null; + /** + * Contains a collection of widgets. Each section has its own, optional + * header. Sections are visually separated by a line divider. For an example + * in Google Chat apps, see [Card + * section](https://developers.google.com/chat/ui/widgets/card-section). + * + * Generated from protobuf field repeated .google.apps.card.v1.Card.Section sections = 2; + */ + private $sections; + /** + * The divider style between sections. + * + * Generated from protobuf field .google.apps.card.v1.Card.DividerStyle section_divider_style = 9; + */ + protected $section_divider_style = 0; + /** + * The card's actions. Actions are added to the card's toolbar menu. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * For example, the following JSON constructs a card action menu with + * `Settings` and `Send Feedback` options: + * ``` + * "card_actions": [ + * { + * "actionLabel": "Settings", + * "onClick": { + * "action": { + * "functionName": "goToView", + * "parameters": [ + * { + * "key": "viewType", + * "value": "SETTING" + * } + * ], + * "loadIndicator": "LoadIndicator.SPINNER" + * } + * } + * }, + * { + * "actionLabel": "Send Feedback", + * "onClick": { + * "openLink": { + * "url": "https://example.com/feedback" + * } + * } + * } + * ] + * ``` + * + * Generated from protobuf field repeated .google.apps.card.v1.Card.CardAction card_actions = 3; + */ + private $card_actions; + /** + * Name of the card. Used as a card identifier in card navigation. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field string name = 4; + */ + protected $name = ''; + /** + * The fixed footer shown at the bottom of this card. + * Setting `fixedFooter` without specifying a `primaryButton` or a + * `secondaryButton` causes an error. For Chat apps, you can use fixed footers + * in + * [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not + * [card + * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create). + * [Google Workspace Add-ons and Chat + * apps](https://developers.google.com/workspace/extend): + * + * Generated from protobuf field .google.apps.card.v1.Card.CardFixedFooter fixed_footer = 5; + */ + protected $fixed_footer = null; + /** + * In Google Workspace Add-ons, sets the display properties of the + * `peekCardHeader`. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.Card.DisplayStyle display_style = 6; + */ + protected $display_style = 0; + /** + * When displaying contextual content, the peek card header acts as a + * placeholder so that the user can navigate forward between the homepage + * cards and the contextual cards. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.Card.CardHeader peek_card_header = 7; + */ + protected $peek_card_header = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Card\V1\Card\CardHeader $header + * The header of the card. A header usually contains a leading image and a + * title. Headers always appear at the top of a card. + * @type array<\Google\Apps\Card\V1\Card\Section>|\Google\Protobuf\Internal\RepeatedField $sections + * Contains a collection of widgets. Each section has its own, optional + * header. Sections are visually separated by a line divider. For an example + * in Google Chat apps, see [Card + * section](https://developers.google.com/chat/ui/widgets/card-section). + * @type int $section_divider_style + * The divider style between sections. + * @type array<\Google\Apps\Card\V1\Card\CardAction>|\Google\Protobuf\Internal\RepeatedField $card_actions + * The card's actions. Actions are added to the card's toolbar menu. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * For example, the following JSON constructs a card action menu with + * `Settings` and `Send Feedback` options: + * ``` + * "card_actions": [ + * { + * "actionLabel": "Settings", + * "onClick": { + * "action": { + * "functionName": "goToView", + * "parameters": [ + * { + * "key": "viewType", + * "value": "SETTING" + * } + * ], + * "loadIndicator": "LoadIndicator.SPINNER" + * } + * } + * }, + * { + * "actionLabel": "Send Feedback", + * "onClick": { + * "openLink": { + * "url": "https://example.com/feedback" + * } + * } + * } + * ] + * ``` + * @type string $name + * Name of the card. Used as a card identifier in card navigation. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * @type \Google\Apps\Card\V1\Card\CardFixedFooter $fixed_footer + * The fixed footer shown at the bottom of this card. + * Setting `fixedFooter` without specifying a `primaryButton` or a + * `secondaryButton` causes an error. For Chat apps, you can use fixed footers + * in + * [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not + * [card + * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create). + * [Google Workspace Add-ons and Chat + * apps](https://developers.google.com/workspace/extend): + * @type int $display_style + * In Google Workspace Add-ons, sets the display properties of the + * `peekCardHeader`. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * @type \Google\Apps\Card\V1\Card\CardHeader $peek_card_header + * When displaying contextual content, the peek card header acts as a + * placeholder so that the user can navigate forward between the homepage + * cards and the contextual cards. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The header of the card. A header usually contains a leading image and a + * title. Headers always appear at the top of a card. + * + * Generated from protobuf field .google.apps.card.v1.Card.CardHeader header = 1; + * @return \Google\Apps\Card\V1\Card\CardHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * The header of the card. A header usually contains a leading image and a + * title. Headers always appear at the top of a card. + * + * Generated from protobuf field .google.apps.card.v1.Card.CardHeader header = 1; + * @param \Google\Apps\Card\V1\Card\CardHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Card\CardHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Contains a collection of widgets. Each section has its own, optional + * header. Sections are visually separated by a line divider. For an example + * in Google Chat apps, see [Card + * section](https://developers.google.com/chat/ui/widgets/card-section). + * + * Generated from protobuf field repeated .google.apps.card.v1.Card.Section sections = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSections() + { + return $this->sections; + } + + /** + * Contains a collection of widgets. Each section has its own, optional + * header. Sections are visually separated by a line divider. For an example + * in Google Chat apps, see [Card + * section](https://developers.google.com/chat/ui/widgets/card-section). + * + * Generated from protobuf field repeated .google.apps.card.v1.Card.Section sections = 2; + * @param array<\Google\Apps\Card\V1\Card\Section>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Card\V1\Card\Section::class); + $this->sections = $arr; + + return $this; + } + + /** + * The divider style between sections. + * + * Generated from protobuf field .google.apps.card.v1.Card.DividerStyle section_divider_style = 9; + * @return int + */ + public function getSectionDividerStyle() + { + return $this->section_divider_style; + } + + /** + * The divider style between sections. + * + * Generated from protobuf field .google.apps.card.v1.Card.DividerStyle section_divider_style = 9; + * @param int $var + * @return $this + */ + public function setSectionDividerStyle($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\Card\DividerStyle::class); + $this->section_divider_style = $var; + + return $this; + } + + /** + * The card's actions. Actions are added to the card's toolbar menu. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * For example, the following JSON constructs a card action menu with + * `Settings` and `Send Feedback` options: + * ``` + * "card_actions": [ + * { + * "actionLabel": "Settings", + * "onClick": { + * "action": { + * "functionName": "goToView", + * "parameters": [ + * { + * "key": "viewType", + * "value": "SETTING" + * } + * ], + * "loadIndicator": "LoadIndicator.SPINNER" + * } + * } + * }, + * { + * "actionLabel": "Send Feedback", + * "onClick": { + * "openLink": { + * "url": "https://example.com/feedback" + * } + * } + * } + * ] + * ``` + * + * Generated from protobuf field repeated .google.apps.card.v1.Card.CardAction card_actions = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCardActions() + { + return $this->card_actions; + } + + /** + * The card's actions. Actions are added to the card's toolbar menu. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * For example, the following JSON constructs a card action menu with + * `Settings` and `Send Feedback` options: + * ``` + * "card_actions": [ + * { + * "actionLabel": "Settings", + * "onClick": { + * "action": { + * "functionName": "goToView", + * "parameters": [ + * { + * "key": "viewType", + * "value": "SETTING" + * } + * ], + * "loadIndicator": "LoadIndicator.SPINNER" + * } + * } + * }, + * { + * "actionLabel": "Send Feedback", + * "onClick": { + * "openLink": { + * "url": "https://example.com/feedback" + * } + * } + * } + * ] + * ``` + * + * Generated from protobuf field repeated .google.apps.card.v1.Card.CardAction card_actions = 3; + * @param array<\Google\Apps\Card\V1\Card\CardAction>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCardActions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Card\V1\Card\CardAction::class); + $this->card_actions = $arr; + + return $this; + } + + /** + * Name of the card. Used as a card identifier in card navigation. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field string name = 4; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the card. Used as a card identifier in card navigation. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field string name = 4; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The fixed footer shown at the bottom of this card. + * Setting `fixedFooter` without specifying a `primaryButton` or a + * `secondaryButton` causes an error. For Chat apps, you can use fixed footers + * in + * [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not + * [card + * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create). + * [Google Workspace Add-ons and Chat + * apps](https://developers.google.com/workspace/extend): + * + * Generated from protobuf field .google.apps.card.v1.Card.CardFixedFooter fixed_footer = 5; + * @return \Google\Apps\Card\V1\Card\CardFixedFooter|null + */ + public function getFixedFooter() + { + return $this->fixed_footer; + } + + public function hasFixedFooter() + { + return isset($this->fixed_footer); + } + + public function clearFixedFooter() + { + unset($this->fixed_footer); + } + + /** + * The fixed footer shown at the bottom of this card. + * Setting `fixedFooter` without specifying a `primaryButton` or a + * `secondaryButton` causes an error. For Chat apps, you can use fixed footers + * in + * [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not + * [card + * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create). + * [Google Workspace Add-ons and Chat + * apps](https://developers.google.com/workspace/extend): + * + * Generated from protobuf field .google.apps.card.v1.Card.CardFixedFooter fixed_footer = 5; + * @param \Google\Apps\Card\V1\Card\CardFixedFooter $var + * @return $this + */ + public function setFixedFooter($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Card\CardFixedFooter::class); + $this->fixed_footer = $var; + + return $this; + } + + /** + * In Google Workspace Add-ons, sets the display properties of the + * `peekCardHeader`. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.Card.DisplayStyle display_style = 6; + * @return int + */ + public function getDisplayStyle() + { + return $this->display_style; + } + + /** + * In Google Workspace Add-ons, sets the display properties of the + * `peekCardHeader`. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.Card.DisplayStyle display_style = 6; + * @param int $var + * @return $this + */ + public function setDisplayStyle($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\Card\DisplayStyle::class); + $this->display_style = $var; + + return $this; + } + + /** + * When displaying contextual content, the peek card header acts as a + * placeholder so that the user can navigate forward between the homepage + * cards and the contextual cards. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.Card.CardHeader peek_card_header = 7; + * @return \Google\Apps\Card\V1\Card\CardHeader|null + */ + public function getPeekCardHeader() + { + return $this->peek_card_header; + } + + public function hasPeekCardHeader() + { + return isset($this->peek_card_header); + } + + public function clearPeekCardHeader() + { + unset($this->peek_card_header); + } + + /** + * When displaying contextual content, the peek card header acts as a + * placeholder so that the user can navigate forward between the homepage + * cards and the contextual cards. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.Card.CardHeader peek_card_header = 7; + * @param \Google\Apps\Card\V1\Card\CardHeader $var + * @return $this + */ + public function setPeekCardHeader($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Card\CardHeader::class); + $this->peek_card_header = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/Card/CardAction.php b/AppsChat/src/Card/V1/Card/CardAction.php new file mode 100644 index 000000000000..42ec91741486 --- /dev/null +++ b/AppsChat/src/Card/V1/Card/CardAction.php @@ -0,0 +1,116 @@ +google.apps.card.v1.Card.CardAction + */ +class CardAction extends \Google\Protobuf\Internal\Message +{ + /** + * The label that displays as the action menu item. + * + * Generated from protobuf field string action_label = 1; + */ + protected $action_label = ''; + /** + * The `onClick` action for this action item. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 2; + */ + protected $on_click = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $action_label + * The label that displays as the action menu item. + * @type \Google\Apps\Card\V1\OnClick $on_click + * The `onClick` action for this action item. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The label that displays as the action menu item. + * + * Generated from protobuf field string action_label = 1; + * @return string + */ + public function getActionLabel() + { + return $this->action_label; + } + + /** + * The label that displays as the action menu item. + * + * Generated from protobuf field string action_label = 1; + * @param string $var + * @return $this + */ + public function setActionLabel($var) + { + GPBUtil::checkString($var, True); + $this->action_label = $var; + + return $this; + } + + /** + * The `onClick` action for this action item. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 2; + * @return \Google\Apps\Card\V1\OnClick|null + */ + public function getOnClick() + { + return $this->on_click; + } + + public function hasOnClick() + { + return isset($this->on_click); + } + + public function clearOnClick() + { + unset($this->on_click); + } + + /** + * The `onClick` action for this action item. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 2; + * @param \Google\Apps\Card\V1\OnClick $var + * @return $this + */ + public function setOnClick($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\OnClick::class); + $this->on_click = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Card/V1/Card/CardFixedFooter.php b/AppsChat/src/Card/V1/Card/CardFixedFooter.php new file mode 100644 index 000000000000..e0537f93597c --- /dev/null +++ b/AppsChat/src/Card/V1/Card/CardFixedFooter.php @@ -0,0 +1,144 @@ +google.apps.card.v1.Card.CardFixedFooter + */ +class CardFixedFooter extends \Google\Protobuf\Internal\Message +{ + /** + * The primary button of the fixed footer. The button must be a text button + * with text and color set. + * + * Generated from protobuf field .google.apps.card.v1.Button primary_button = 1; + */ + protected $primary_button = null; + /** + * The secondary button of the fixed footer. The button must be a text + * button with text and color set. + * If `secondaryButton` is set, you must also set `primaryButton`. + * + * Generated from protobuf field .google.apps.card.v1.Button secondary_button = 2; + */ + protected $secondary_button = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Card\V1\Button $primary_button + * The primary button of the fixed footer. The button must be a text button + * with text and color set. + * @type \Google\Apps\Card\V1\Button $secondary_button + * The secondary button of the fixed footer. The button must be a text + * button with text and color set. + * If `secondaryButton` is set, you must also set `primaryButton`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The primary button of the fixed footer. The button must be a text button + * with text and color set. + * + * Generated from protobuf field .google.apps.card.v1.Button primary_button = 1; + * @return \Google\Apps\Card\V1\Button|null + */ + public function getPrimaryButton() + { + return $this->primary_button; + } + + public function hasPrimaryButton() + { + return isset($this->primary_button); + } + + public function clearPrimaryButton() + { + unset($this->primary_button); + } + + /** + * The primary button of the fixed footer. The button must be a text button + * with text and color set. + * + * Generated from protobuf field .google.apps.card.v1.Button primary_button = 1; + * @param \Google\Apps\Card\V1\Button $var + * @return $this + */ + public function setPrimaryButton($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Button::class); + $this->primary_button = $var; + + return $this; + } + + /** + * The secondary button of the fixed footer. The button must be a text + * button with text and color set. + * If `secondaryButton` is set, you must also set `primaryButton`. + * + * Generated from protobuf field .google.apps.card.v1.Button secondary_button = 2; + * @return \Google\Apps\Card\V1\Button|null + */ + public function getSecondaryButton() + { + return $this->secondary_button; + } + + public function hasSecondaryButton() + { + return isset($this->secondary_button); + } + + public function clearSecondaryButton() + { + unset($this->secondary_button); + } + + /** + * The secondary button of the fixed footer. The button must be a text + * button with text and color set. + * If `secondaryButton` is set, you must also set `primaryButton`. + * + * Generated from protobuf field .google.apps.card.v1.Button secondary_button = 2; + * @param \Google\Apps\Card\V1\Button $var + * @return $this + */ + public function setSecondaryButton($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Button::class); + $this->secondary_button = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Card/V1/Card/CardHeader.php b/AppsChat/src/Card/V1/Card/CardHeader.php new file mode 100644 index 000000000000..2e5e177082d4 --- /dev/null +++ b/AppsChat/src/Card/V1/Card/CardHeader.php @@ -0,0 +1,231 @@ +google.apps.card.v1.Card.CardHeader + */ +class CardHeader extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The title of the card header. + * The header has a fixed height: if both a + * title and subtitle are specified, each takes up one line. If only the + * title is specified, it takes up both lines. + * + * Generated from protobuf field string title = 1; + */ + protected $title = ''; + /** + * The subtitle of the card header. If specified, appears on its own line + * below the `title`. + * + * Generated from protobuf field string subtitle = 2; + */ + protected $subtitle = ''; + /** + * The shape used to crop the image. + * [Google Workspace Add-ons and Chat + * apps](https://developers.google.com/workspace/extend): + * + * Generated from protobuf field .google.apps.card.v1.Widget.ImageType image_type = 3; + */ + protected $image_type = 0; + /** + * The HTTPS URL of the image in the card header. + * + * Generated from protobuf field string image_url = 4; + */ + protected $image_url = ''; + /** + * The alternative text of this image that's used for accessibility. + * + * Generated from protobuf field string image_alt_text = 5; + */ + protected $image_alt_text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * Required. The title of the card header. + * The header has a fixed height: if both a + * title and subtitle are specified, each takes up one line. If only the + * title is specified, it takes up both lines. + * @type string $subtitle + * The subtitle of the card header. If specified, appears on its own line + * below the `title`. + * @type int $image_type + * The shape used to crop the image. + * [Google Workspace Add-ons and Chat + * apps](https://developers.google.com/workspace/extend): + * @type string $image_url + * The HTTPS URL of the image in the card header. + * @type string $image_alt_text + * The alternative text of this image that's used for accessibility. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * Required. The title of the card header. + * The header has a fixed height: if both a + * title and subtitle are specified, each takes up one line. If only the + * title is specified, it takes up both lines. + * + * Generated from protobuf field string title = 1; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. The title of the card header. + * The header has a fixed height: if both a + * title and subtitle are specified, each takes up one line. If only the + * title is specified, it takes up both lines. + * + * Generated from protobuf field string title = 1; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * The subtitle of the card header. If specified, appears on its own line + * below the `title`. + * + * Generated from protobuf field string subtitle = 2; + * @return string + */ + public function getSubtitle() + { + return $this->subtitle; + } + + /** + * The subtitle of the card header. If specified, appears on its own line + * below the `title`. + * + * Generated from protobuf field string subtitle = 2; + * @param string $var + * @return $this + */ + public function setSubtitle($var) + { + GPBUtil::checkString($var, True); + $this->subtitle = $var; + + return $this; + } + + /** + * The shape used to crop the image. + * [Google Workspace Add-ons and Chat + * apps](https://developers.google.com/workspace/extend): + * + * Generated from protobuf field .google.apps.card.v1.Widget.ImageType image_type = 3; + * @return int + */ + public function getImageType() + { + return $this->image_type; + } + + /** + * The shape used to crop the image. + * [Google Workspace Add-ons and Chat + * apps](https://developers.google.com/workspace/extend): + * + * Generated from protobuf field .google.apps.card.v1.Widget.ImageType image_type = 3; + * @param int $var + * @return $this + */ + public function setImageType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\Widget\ImageType::class); + $this->image_type = $var; + + return $this; + } + + /** + * The HTTPS URL of the image in the card header. + * + * Generated from protobuf field string image_url = 4; + * @return string + */ + public function getImageUrl() + { + return $this->image_url; + } + + /** + * The HTTPS URL of the image in the card header. + * + * Generated from protobuf field string image_url = 4; + * @param string $var + * @return $this + */ + public function setImageUrl($var) + { + GPBUtil::checkString($var, True); + $this->image_url = $var; + + return $this; + } + + /** + * The alternative text of this image that's used for accessibility. + * + * Generated from protobuf field string image_alt_text = 5; + * @return string + */ + public function getImageAltText() + { + return $this->image_alt_text; + } + + /** + * The alternative text of this image that's used for accessibility. + * + * Generated from protobuf field string image_alt_text = 5; + * @param string $var + * @return $this + */ + public function setImageAltText($var) + { + GPBUtil::checkString($var, True); + $this->image_alt_text = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Card/V1/Card/DisplayStyle.php b/AppsChat/src/Card/V1/Card/DisplayStyle.php new file mode 100644 index 000000000000..c2c07bc46cd2 --- /dev/null +++ b/AppsChat/src/Card/V1/Card/DisplayStyle.php @@ -0,0 +1,69 @@ +google.apps.card.v1.Card.DisplayStyle + */ +class DisplayStyle +{ + /** + * Don't use. Unspecified. + * + * Generated from protobuf enum DISPLAY_STYLE_UNSPECIFIED = 0; + */ + const DISPLAY_STYLE_UNSPECIFIED = 0; + /** + * The header of the card appears at the bottom of the + * sidebar, partially covering the current top card of the stack. Clicking + * the header pops the card into the card stack. If the card has no header, + * a generated header is used instead. + * + * Generated from protobuf enum PEEK = 1; + */ + const PEEK = 1; + /** + * Default value. The card is shown by replacing the view of the top card in + * the card stack. + * + * Generated from protobuf enum REPLACE = 2; + */ + const REPLACE = 2; + + private static $valueToName = [ + self::DISPLAY_STYLE_UNSPECIFIED => 'DISPLAY_STYLE_UNSPECIFIED', + self::PEEK => 'PEEK', + self::REPLACE => 'REPLACE', + ]; + + 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/Card/V1/Card/DividerStyle.php b/AppsChat/src/Card/V1/Card/DividerStyle.php new file mode 100644 index 000000000000..666a0ada0063 --- /dev/null +++ b/AppsChat/src/Card/V1/Card/DividerStyle.php @@ -0,0 +1,65 @@ +google.apps.card.v1.Card.DividerStyle + */ +class DividerStyle +{ + /** + * Don't use. Unspecified. + * + * Generated from protobuf enum DIVIDER_STYLE_UNSPECIFIED = 0; + */ + const DIVIDER_STYLE_UNSPECIFIED = 0; + /** + * Default option. Render a solid divider between sections. + * + * Generated from protobuf enum SOLID_DIVIDER = 1; + */ + const SOLID_DIVIDER = 1; + /** + * If set, no divider is rendered between sections. + * + * Generated from protobuf enum NO_DIVIDER = 2; + */ + const NO_DIVIDER = 2; + + private static $valueToName = [ + self::DIVIDER_STYLE_UNSPECIFIED => 'DIVIDER_STYLE_UNSPECIFIED', + self::SOLID_DIVIDER => 'SOLID_DIVIDER', + self::NO_DIVIDER => 'NO_DIVIDER', + ]; + + 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/Card/V1/Card/Section.php b/AppsChat/src/Card/V1/Card/Section.php new file mode 100644 index 000000000000..9bb28625feb5 --- /dev/null +++ b/AppsChat/src/Card/V1/Card/Section.php @@ -0,0 +1,253 @@ +google.apps.card.v1.Card.Section + */ +class Section extends \Google\Protobuf\Internal\Message +{ + /** + * Text that appears at the top of a section. + * Supports simple HTML formatted text. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string header = 1; + */ + protected $header = ''; + /** + * All the widgets in the section. + * Must contain at least one widget. + * + * Generated from protobuf field repeated .google.apps.card.v1.Widget widgets = 2; + */ + private $widgets; + /** + * Indicates whether this section is collapsible. + * Collapsible sections hide some or all widgets, but users can expand the + * section to reveal the hidden widgets by clicking **Show more**. Users + * can hide the widgets again by clicking **Show less**. + * To determine which widgets are hidden, specify + * `uncollapsibleWidgetsCount`. + * + * Generated from protobuf field bool collapsible = 5; + */ + protected $collapsible = false; + /** + * The number of uncollapsible widgets which remain visible even when a + * section is collapsed. + * For example, when a section + * contains five widgets and the `uncollapsibleWidgetsCount` is set to `2`, + * the first two widgets are always shown and the last three are collapsed + * by default. The `uncollapsibleWidgetsCount` is taken into account only + * when `collapsible` is `true`. + * + * Generated from protobuf field int32 uncollapsible_widgets_count = 6; + */ + protected $uncollapsible_widgets_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $header + * Text that appears at the top of a section. + * Supports simple HTML formatted text. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * @type array<\Google\Apps\Card\V1\Widget>|\Google\Protobuf\Internal\RepeatedField $widgets + * All the widgets in the section. + * Must contain at least one widget. + * @type bool $collapsible + * Indicates whether this section is collapsible. + * Collapsible sections hide some or all widgets, but users can expand the + * section to reveal the hidden widgets by clicking **Show more**. Users + * can hide the widgets again by clicking **Show less**. + * To determine which widgets are hidden, specify + * `uncollapsibleWidgetsCount`. + * @type int $uncollapsible_widgets_count + * The number of uncollapsible widgets which remain visible even when a + * section is collapsed. + * For example, when a section + * contains five widgets and the `uncollapsibleWidgetsCount` is set to `2`, + * the first two widgets are always shown and the last three are collapsed + * by default. The `uncollapsibleWidgetsCount` is taken into account only + * when `collapsible` is `true`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * Text that appears at the top of a section. + * Supports simple HTML formatted text. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string header = 1; + * @return string + */ + public function getHeader() + { + return $this->header; + } + + /** + * Text that appears at the top of a section. + * Supports simple HTML formatted text. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string header = 1; + * @param string $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkString($var, True); + $this->header = $var; + + return $this; + } + + /** + * All the widgets in the section. + * Must contain at least one widget. + * + * Generated from protobuf field repeated .google.apps.card.v1.Widget widgets = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWidgets() + { + return $this->widgets; + } + + /** + * All the widgets in the section. + * Must contain at least one widget. + * + * Generated from protobuf field repeated .google.apps.card.v1.Widget widgets = 2; + * @param array<\Google\Apps\Card\V1\Widget>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWidgets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Card\V1\Widget::class); + $this->widgets = $arr; + + return $this; + } + + /** + * Indicates whether this section is collapsible. + * Collapsible sections hide some or all widgets, but users can expand the + * section to reveal the hidden widgets by clicking **Show more**. Users + * can hide the widgets again by clicking **Show less**. + * To determine which widgets are hidden, specify + * `uncollapsibleWidgetsCount`. + * + * Generated from protobuf field bool collapsible = 5; + * @return bool + */ + public function getCollapsible() + { + return $this->collapsible; + } + + /** + * Indicates whether this section is collapsible. + * Collapsible sections hide some or all widgets, but users can expand the + * section to reveal the hidden widgets by clicking **Show more**. Users + * can hide the widgets again by clicking **Show less**. + * To determine which widgets are hidden, specify + * `uncollapsibleWidgetsCount`. + * + * Generated from protobuf field bool collapsible = 5; + * @param bool $var + * @return $this + */ + public function setCollapsible($var) + { + GPBUtil::checkBool($var); + $this->collapsible = $var; + + return $this; + } + + /** + * The number of uncollapsible widgets which remain visible even when a + * section is collapsed. + * For example, when a section + * contains five widgets and the `uncollapsibleWidgetsCount` is set to `2`, + * the first two widgets are always shown and the last three are collapsed + * by default. The `uncollapsibleWidgetsCount` is taken into account only + * when `collapsible` is `true`. + * + * Generated from protobuf field int32 uncollapsible_widgets_count = 6; + * @return int + */ + public function getUncollapsibleWidgetsCount() + { + return $this->uncollapsible_widgets_count; + } + + /** + * The number of uncollapsible widgets which remain visible even when a + * section is collapsed. + * For example, when a section + * contains five widgets and the `uncollapsibleWidgetsCount` is set to `2`, + * the first two widgets are always shown and the last three are collapsed + * by default. The `uncollapsibleWidgetsCount` is taken into account only + * when `collapsible` is `true`. + * + * Generated from protobuf field int32 uncollapsible_widgets_count = 6; + * @param int $var + * @return $this + */ + public function setUncollapsibleWidgetsCount($var) + { + GPBUtil::checkInt32($var); + $this->uncollapsible_widgets_count = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Card/V1/Columns.php b/AppsChat/src/Card/V1/Columns.php new file mode 100644 index 000000000000..f6368131029a --- /dev/null +++ b/AppsChat/src/Card/V1/Columns.php @@ -0,0 +1,90 @@ +google.apps.card.v1.Columns + */ +class Columns extends \Google\Protobuf\Internal\Message +{ + /** + * An array of columns. You can include up to 2 columns in a card or dialog. + * + * Generated from protobuf field repeated .google.apps.card.v1.Columns.Column column_items = 2; + */ + private $column_items; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Apps\Card\V1\Columns\Column>|\Google\Protobuf\Internal\RepeatedField $column_items + * An array of columns. You can include up to 2 columns in a card or dialog. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * An array of columns. You can include up to 2 columns in a card or dialog. + * + * Generated from protobuf field repeated .google.apps.card.v1.Columns.Column column_items = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getColumnItems() + { + return $this->column_items; + } + + /** + * An array of columns. You can include up to 2 columns in a card or dialog. + * + * Generated from protobuf field repeated .google.apps.card.v1.Columns.Column column_items = 2; + * @param array<\Google\Apps\Card\V1\Columns\Column>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setColumnItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Card\V1\Columns\Column::class); + $this->column_items = $arr; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/Columns/Column.php b/AppsChat/src/Card/V1/Columns/Column.php new file mode 100644 index 000000000000..7d877a859253 --- /dev/null +++ b/AppsChat/src/Card/V1/Columns/Column.php @@ -0,0 +1,191 @@ +google.apps.card.v1.Columns.Column + */ +class Column extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies how a column fills the width of the card. + * [Google Chat apps](https://developers.google.com/chat): + * + * Generated from protobuf field .google.apps.card.v1.Columns.Column.HorizontalSizeStyle horizontal_size_style = 1; + */ + protected $horizontal_size_style = 0; + /** + * Specifies whether widgets align to the left, right, or center of a + * column. + * + * Generated from protobuf field .google.apps.card.v1.Widget.HorizontalAlignment horizontal_alignment = 2; + */ + protected $horizontal_alignment = 0; + /** + * Specifies whether widgets align to the top, bottom, or center of a + * column. + * [Google Chat apps](https://developers.google.com/chat): + * + * Generated from protobuf field .google.apps.card.v1.Columns.Column.VerticalAlignment vertical_alignment = 3; + */ + protected $vertical_alignment = 0; + /** + * An array of widgets included in a column. Widgets appear in the order + * that they are specified. + * + * Generated from protobuf field repeated .google.apps.card.v1.Columns.Column.Widgets widgets = 4; + */ + private $widgets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $horizontal_size_style + * Specifies how a column fills the width of the card. + * [Google Chat apps](https://developers.google.com/chat): + * @type int $horizontal_alignment + * Specifies whether widgets align to the left, right, or center of a + * column. + * @type int $vertical_alignment + * Specifies whether widgets align to the top, bottom, or center of a + * column. + * [Google Chat apps](https://developers.google.com/chat): + * @type array<\Google\Apps\Card\V1\Columns\Column\Widgets>|\Google\Protobuf\Internal\RepeatedField $widgets + * An array of widgets included in a column. Widgets appear in the order + * that they are specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * Specifies how a column fills the width of the card. + * [Google Chat apps](https://developers.google.com/chat): + * + * Generated from protobuf field .google.apps.card.v1.Columns.Column.HorizontalSizeStyle horizontal_size_style = 1; + * @return int + */ + public function getHorizontalSizeStyle() + { + return $this->horizontal_size_style; + } + + /** + * Specifies how a column fills the width of the card. + * [Google Chat apps](https://developers.google.com/chat): + * + * Generated from protobuf field .google.apps.card.v1.Columns.Column.HorizontalSizeStyle horizontal_size_style = 1; + * @param int $var + * @return $this + */ + public function setHorizontalSizeStyle($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\Columns\Column\HorizontalSizeStyle::class); + $this->horizontal_size_style = $var; + + return $this; + } + + /** + * Specifies whether widgets align to the left, right, or center of a + * column. + * + * Generated from protobuf field .google.apps.card.v1.Widget.HorizontalAlignment horizontal_alignment = 2; + * @return int + */ + public function getHorizontalAlignment() + { + return $this->horizontal_alignment; + } + + /** + * Specifies whether widgets align to the left, right, or center of a + * column. + * + * Generated from protobuf field .google.apps.card.v1.Widget.HorizontalAlignment horizontal_alignment = 2; + * @param int $var + * @return $this + */ + public function setHorizontalAlignment($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\Widget\HorizontalAlignment::class); + $this->horizontal_alignment = $var; + + return $this; + } + + /** + * Specifies whether widgets align to the top, bottom, or center of a + * column. + * [Google Chat apps](https://developers.google.com/chat): + * + * Generated from protobuf field .google.apps.card.v1.Columns.Column.VerticalAlignment vertical_alignment = 3; + * @return int + */ + public function getVerticalAlignment() + { + return $this->vertical_alignment; + } + + /** + * Specifies whether widgets align to the top, bottom, or center of a + * column. + * [Google Chat apps](https://developers.google.com/chat): + * + * Generated from protobuf field .google.apps.card.v1.Columns.Column.VerticalAlignment vertical_alignment = 3; + * @param int $var + * @return $this + */ + public function setVerticalAlignment($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\Columns\Column\VerticalAlignment::class); + $this->vertical_alignment = $var; + + return $this; + } + + /** + * An array of widgets included in a column. Widgets appear in the order + * that they are specified. + * + * Generated from protobuf field repeated .google.apps.card.v1.Columns.Column.Widgets widgets = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWidgets() + { + return $this->widgets; + } + + /** + * An array of widgets included in a column. Widgets appear in the order + * that they are specified. + * + * Generated from protobuf field repeated .google.apps.card.v1.Columns.Column.Widgets widgets = 4; + * @param array<\Google\Apps\Card\V1\Columns\Column\Widgets>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWidgets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Card\V1\Columns\Column\Widgets::class); + $this->widgets = $arr; + + return $this; + } + +} + + diff --git a/AppsChat/src/Card/V1/Columns/Column/HorizontalSizeStyle.php b/AppsChat/src/Card/V1/Columns/Column/HorizontalSizeStyle.php new file mode 100644 index 000000000000..aae55afdd1f6 --- /dev/null +++ b/AppsChat/src/Card/V1/Columns/Column/HorizontalSizeStyle.php @@ -0,0 +1,68 @@ +google.apps.card.v1.Columns.Column.HorizontalSizeStyle + */ +class HorizontalSizeStyle +{ + /** + * Don't use. Unspecified. + * + * Generated from protobuf enum HORIZONTAL_SIZE_STYLE_UNSPECIFIED = 0; + */ + const HORIZONTAL_SIZE_STYLE_UNSPECIFIED = 0; + /** + * Default value. Column fills the available space, up to 70% of the + * card's width. If both columns are set to `FILL_AVAILABLE_SPACE`, each + * column fills 50% of the space. + * + * Generated from protobuf enum FILL_AVAILABLE_SPACE = 1; + */ + const FILL_AVAILABLE_SPACE = 1; + /** + * Column fills the least amount of space possible and no more than 30% of + * the card's width. + * + * Generated from protobuf enum FILL_MINIMUM_SPACE = 2; + */ + const FILL_MINIMUM_SPACE = 2; + + private static $valueToName = [ + self::HORIZONTAL_SIZE_STYLE_UNSPECIFIED => 'HORIZONTAL_SIZE_STYLE_UNSPECIFIED', + self::FILL_AVAILABLE_SPACE => 'FILL_AVAILABLE_SPACE', + self::FILL_MINIMUM_SPACE => 'FILL_MINIMUM_SPACE', + ]; + + 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/Card/V1/Columns/Column/VerticalAlignment.php b/AppsChat/src/Card/V1/Columns/Column/VerticalAlignment.php new file mode 100644 index 000000000000..be17080af577 --- /dev/null +++ b/AppsChat/src/Card/V1/Columns/Column/VerticalAlignment.php @@ -0,0 +1,71 @@ +google.apps.card.v1.Columns.Column.VerticalAlignment + */ +class VerticalAlignment +{ + /** + * Don't use. Unspecified. + * + * Generated from protobuf enum VERTICAL_ALIGNMENT_UNSPECIFIED = 0; + */ + const VERTICAL_ALIGNMENT_UNSPECIFIED = 0; + /** + * Default value. Aligns widgets to the center of a column. + * + * Generated from protobuf enum CENTER = 1; + */ + const CENTER = 1; + /** + * Aligns widgets to the top of a column. + * + * Generated from protobuf enum TOP = 2; + */ + const TOP = 2; + /** + * Aligns widgets to the bottom of a column. + * + * Generated from protobuf enum BOTTOM = 3; + */ + const BOTTOM = 3; + + private static $valueToName = [ + self::VERTICAL_ALIGNMENT_UNSPECIFIED => 'VERTICAL_ALIGNMENT_UNSPECIFIED', + self::CENTER => 'CENTER', + self::TOP => 'TOP', + self::BOTTOM => 'BOTTOM', + ]; + + 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/Card/V1/Columns/Column/Widgets.php b/AppsChat/src/Card/V1/Columns/Column/Widgets.php new file mode 100644 index 000000000000..8bc7a0d98f27 --- /dev/null +++ b/AppsChat/src/Card/V1/Columns/Column/Widgets.php @@ -0,0 +1,275 @@ +google.apps.card.v1.Columns.Column.Widgets + */ +class Widgets extends \Google\Protobuf\Internal\Message +{ + protected $data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Card\V1\TextParagraph $text_paragraph + * [TextParagraph][google.apps.card.v1.TextParagraph] widget. + * @type \Google\Apps\Card\V1\Image $image + * [Image][google.apps.card.v1.Image] widget. + * @type \Google\Apps\Card\V1\DecoratedText $decorated_text + * [DecoratedText][google.apps.card.v1.DecoratedText] widget. + * @type \Google\Apps\Card\V1\ButtonList $button_list + * [ButtonList][google.apps.card.v1.ButtonList] widget. + * @type \Google\Apps\Card\V1\TextInput $text_input + * [TextInput][google.apps.card.v1.TextInput] widget. + * @type \Google\Apps\Card\V1\SelectionInput $selection_input + * [SelectionInput][google.apps.card.v1.SelectionInput] widget. + * @type \Google\Apps\Card\V1\DateTimePicker $date_time_picker + * [DateTimePicker][google.apps.card.v1.DateTimePicker] widget. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * [TextParagraph][google.apps.card.v1.TextParagraph] widget. + * + * Generated from protobuf field .google.apps.card.v1.TextParagraph text_paragraph = 1; + * @return \Google\Apps\Card\V1\TextParagraph|null + */ + public function getTextParagraph() + { + return $this->readOneof(1); + } + + public function hasTextParagraph() + { + return $this->hasOneof(1); + } + + /** + * [TextParagraph][google.apps.card.v1.TextParagraph] widget. + * + * Generated from protobuf field .google.apps.card.v1.TextParagraph text_paragraph = 1; + * @param \Google\Apps\Card\V1\TextParagraph $var + * @return $this + */ + public function setTextParagraph($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\TextParagraph::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * [Image][google.apps.card.v1.Image] widget. + * + * Generated from protobuf field .google.apps.card.v1.Image image = 2; + * @return \Google\Apps\Card\V1\Image|null + */ + public function getImage() + { + return $this->readOneof(2); + } + + public function hasImage() + { + return $this->hasOneof(2); + } + + /** + * [Image][google.apps.card.v1.Image] widget. + * + * Generated from protobuf field .google.apps.card.v1.Image image = 2; + * @param \Google\Apps\Card\V1\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Image::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * [DecoratedText][google.apps.card.v1.DecoratedText] widget. + * + * Generated from protobuf field .google.apps.card.v1.DecoratedText decorated_text = 3; + * @return \Google\Apps\Card\V1\DecoratedText|null + */ + public function getDecoratedText() + { + return $this->readOneof(3); + } + + public function hasDecoratedText() + { + return $this->hasOneof(3); + } + + /** + * [DecoratedText][google.apps.card.v1.DecoratedText] widget. + * + * Generated from protobuf field .google.apps.card.v1.DecoratedText decorated_text = 3; + * @param \Google\Apps\Card\V1\DecoratedText $var + * @return $this + */ + public function setDecoratedText($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\DecoratedText::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * [ButtonList][google.apps.card.v1.ButtonList] widget. + * + * Generated from protobuf field .google.apps.card.v1.ButtonList button_list = 4; + * @return \Google\Apps\Card\V1\ButtonList|null + */ + public function getButtonList() + { + return $this->readOneof(4); + } + + public function hasButtonList() + { + return $this->hasOneof(4); + } + + /** + * [ButtonList][google.apps.card.v1.ButtonList] widget. + * + * Generated from protobuf field .google.apps.card.v1.ButtonList button_list = 4; + * @param \Google\Apps\Card\V1\ButtonList $var + * @return $this + */ + public function setButtonList($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\ButtonList::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * [TextInput][google.apps.card.v1.TextInput] widget. + * + * Generated from protobuf field .google.apps.card.v1.TextInput text_input = 5; + * @return \Google\Apps\Card\V1\TextInput|null + */ + public function getTextInput() + { + return $this->readOneof(5); + } + + public function hasTextInput() + { + return $this->hasOneof(5); + } + + /** + * [TextInput][google.apps.card.v1.TextInput] widget. + * + * Generated from protobuf field .google.apps.card.v1.TextInput text_input = 5; + * @param \Google\Apps\Card\V1\TextInput $var + * @return $this + */ + public function setTextInput($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\TextInput::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * [SelectionInput][google.apps.card.v1.SelectionInput] widget. + * + * Generated from protobuf field .google.apps.card.v1.SelectionInput selection_input = 6; + * @return \Google\Apps\Card\V1\SelectionInput|null + */ + public function getSelectionInput() + { + return $this->readOneof(6); + } + + public function hasSelectionInput() + { + return $this->hasOneof(6); + } + + /** + * [SelectionInput][google.apps.card.v1.SelectionInput] widget. + * + * Generated from protobuf field .google.apps.card.v1.SelectionInput selection_input = 6; + * @param \Google\Apps\Card\V1\SelectionInput $var + * @return $this + */ + public function setSelectionInput($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\SelectionInput::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * [DateTimePicker][google.apps.card.v1.DateTimePicker] widget. + * + * Generated from protobuf field .google.apps.card.v1.DateTimePicker date_time_picker = 7; + * @return \Google\Apps\Card\V1\DateTimePicker|null + */ + public function getDateTimePicker() + { + return $this->readOneof(7); + } + + public function hasDateTimePicker() + { + return $this->hasOneof(7); + } + + /** + * [DateTimePicker][google.apps.card.v1.DateTimePicker] widget. + * + * Generated from protobuf field .google.apps.card.v1.DateTimePicker date_time_picker = 7; + * @param \Google\Apps\Card\V1\DateTimePicker $var + * @return $this + */ + public function setDateTimePicker($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\DateTimePicker::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getData() + { + return $this->whichOneof("data"); + } + +} + + diff --git a/AppsChat/src/Card/V1/DateTimePicker.php b/AppsChat/src/Card/V1/DateTimePicker.php new file mode 100644 index 000000000000..0c485997e47a --- /dev/null +++ b/AppsChat/src/Card/V1/DateTimePicker.php @@ -0,0 +1,314 @@ +google.apps.card.v1.DateTimePicker + */ +class DateTimePicker extends \Google\Protobuf\Internal\Message +{ + /** + * The name by which the `DateTimePicker` is identified in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The text that prompts users to input a date, a time, or a date and time. + * For example, if users are scheduling an appointment, use a label such as + * `Appointment date` or `Appointment date and time`. + * + * Generated from protobuf field string label = 2; + */ + protected $label = ''; + /** + * Whether the widget supports inputting a date, a time, or the date and time. + * + * Generated from protobuf field .google.apps.card.v1.DateTimePicker.DateTimePickerType type = 3; + */ + protected $type = 0; + /** + * The default value displayed in the widget, in milliseconds since [Unix + * epoch time](https://en.wikipedia.org/wiki/Unix_time). + * Specify the value based on the type of picker (`DateTimePickerType`): + * * `DATE_AND_TIME`: a calendar date and time in UTC. For example, to + * represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`. + * * `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent + * January 1, 2023, use `1672531200000`. + * * `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use + * `43200000` (or `12 * 60 * 60 * 1000`). + * + * Generated from protobuf field int64 value_ms_epoch = 4; + */ + protected $value_ms_epoch = 0; + /** + * The number representing the time zone offset from UTC, in minutes. + * If set, the `value_ms_epoch` is displayed in the specified time zone. + * If unset, the value defaults to the user's time zone setting. + * + * Generated from protobuf field int32 timezone_offset_date = 5; + */ + protected $timezone_offset_date = 0; + /** + * Triggered when the user clicks **Save** or **Clear** from the + * `DateTimePicker` interface. + * + * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 6; + */ + protected $on_change_action = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name by which the `DateTimePicker` is identified in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * @type string $label + * The text that prompts users to input a date, a time, or a date and time. + * For example, if users are scheduling an appointment, use a label such as + * `Appointment date` or `Appointment date and time`. + * @type int $type + * Whether the widget supports inputting a date, a time, or the date and time. + * @type int|string $value_ms_epoch + * The default value displayed in the widget, in milliseconds since [Unix + * epoch time](https://en.wikipedia.org/wiki/Unix_time). + * Specify the value based on the type of picker (`DateTimePickerType`): + * * `DATE_AND_TIME`: a calendar date and time in UTC. For example, to + * represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`. + * * `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent + * January 1, 2023, use `1672531200000`. + * * `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use + * `43200000` (or `12 * 60 * 60 * 1000`). + * @type int $timezone_offset_date + * The number representing the time zone offset from UTC, in minutes. + * If set, the `value_ms_epoch` is displayed in the specified time zone. + * If unset, the value defaults to the user's time zone setting. + * @type \Google\Apps\Card\V1\Action $on_change_action + * Triggered when the user clicks **Save** or **Clear** from the + * `DateTimePicker` interface. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The name by which the `DateTimePicker` is identified in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name by which the `DateTimePicker` is identified in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The text that prompts users to input a date, a time, or a date and time. + * For example, if users are scheduling an appointment, use a label such as + * `Appointment date` or `Appointment date and time`. + * + * Generated from protobuf field string label = 2; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * The text that prompts users to input a date, a time, or a date and time. + * For example, if users are scheduling an appointment, use a label such as + * `Appointment date` or `Appointment date and time`. + * + * Generated from protobuf field string label = 2; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + + /** + * Whether the widget supports inputting a date, a time, or the date and time. + * + * Generated from protobuf field .google.apps.card.v1.DateTimePicker.DateTimePickerType type = 3; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Whether the widget supports inputting a date, a time, or the date and time. + * + * Generated from protobuf field .google.apps.card.v1.DateTimePicker.DateTimePickerType type = 3; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\DateTimePicker\DateTimePickerType::class); + $this->type = $var; + + return $this; + } + + /** + * The default value displayed in the widget, in milliseconds since [Unix + * epoch time](https://en.wikipedia.org/wiki/Unix_time). + * Specify the value based on the type of picker (`DateTimePickerType`): + * * `DATE_AND_TIME`: a calendar date and time in UTC. For example, to + * represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`. + * * `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent + * January 1, 2023, use `1672531200000`. + * * `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use + * `43200000` (or `12 * 60 * 60 * 1000`). + * + * Generated from protobuf field int64 value_ms_epoch = 4; + * @return int|string + */ + public function getValueMsEpoch() + { + return $this->value_ms_epoch; + } + + /** + * The default value displayed in the widget, in milliseconds since [Unix + * epoch time](https://en.wikipedia.org/wiki/Unix_time). + * Specify the value based on the type of picker (`DateTimePickerType`): + * * `DATE_AND_TIME`: a calendar date and time in UTC. For example, to + * represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`. + * * `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent + * January 1, 2023, use `1672531200000`. + * * `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use + * `43200000` (or `12 * 60 * 60 * 1000`). + * + * Generated from protobuf field int64 value_ms_epoch = 4; + * @param int|string $var + * @return $this + */ + public function setValueMsEpoch($var) + { + GPBUtil::checkInt64($var); + $this->value_ms_epoch = $var; + + return $this; + } + + /** + * The number representing the time zone offset from UTC, in minutes. + * If set, the `value_ms_epoch` is displayed in the specified time zone. + * If unset, the value defaults to the user's time zone setting. + * + * Generated from protobuf field int32 timezone_offset_date = 5; + * @return int + */ + public function getTimezoneOffsetDate() + { + return $this->timezone_offset_date; + } + + /** + * The number representing the time zone offset from UTC, in minutes. + * If set, the `value_ms_epoch` is displayed in the specified time zone. + * If unset, the value defaults to the user's time zone setting. + * + * Generated from protobuf field int32 timezone_offset_date = 5; + * @param int $var + * @return $this + */ + public function setTimezoneOffsetDate($var) + { + GPBUtil::checkInt32($var); + $this->timezone_offset_date = $var; + + return $this; + } + + /** + * Triggered when the user clicks **Save** or **Clear** from the + * `DateTimePicker` interface. + * + * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 6; + * @return \Google\Apps\Card\V1\Action|null + */ + public function getOnChangeAction() + { + return $this->on_change_action; + } + + public function hasOnChangeAction() + { + return isset($this->on_change_action); + } + + public function clearOnChangeAction() + { + unset($this->on_change_action); + } + + /** + * Triggered when the user clicks **Save** or **Clear** from the + * `DateTimePicker` interface. + * + * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 6; + * @param \Google\Apps\Card\V1\Action $var + * @return $this + */ + public function setOnChangeAction($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Action::class); + $this->on_change_action = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/DateTimePicker/DateTimePickerType.php b/AppsChat/src/Card/V1/DateTimePicker/DateTimePickerType.php new file mode 100644 index 000000000000..63b03d361218 --- /dev/null +++ b/AppsChat/src/Card/V1/DateTimePicker/DateTimePickerType.php @@ -0,0 +1,65 @@ +google.apps.card.v1.DateTimePicker.DateTimePickerType + */ +class DateTimePickerType +{ + /** + * Users input a date and time. + * + * Generated from protobuf enum DATE_AND_TIME = 0; + */ + const DATE_AND_TIME = 0; + /** + * Users input a date. + * + * Generated from protobuf enum DATE_ONLY = 1; + */ + const DATE_ONLY = 1; + /** + * Users input a time. + * + * Generated from protobuf enum TIME_ONLY = 2; + */ + const TIME_ONLY = 2; + + private static $valueToName = [ + self::DATE_AND_TIME => 'DATE_AND_TIME', + self::DATE_ONLY => 'DATE_ONLY', + self::TIME_ONLY => 'TIME_ONLY', + ]; + + 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/Card/V1/DecoratedText.php b/AppsChat/src/Card/V1/DecoratedText.php new file mode 100644 index 000000000000..fee632f71776 --- /dev/null +++ b/AppsChat/src/Card/V1/DecoratedText.php @@ -0,0 +1,480 @@ +google.apps.card.v1.DecoratedText + */ +class DecoratedText extends \Google\Protobuf\Internal\Message +{ + /** + * Deprecated in favor of `startIcon`. + * + * Generated from protobuf field .google.apps.card.v1.Icon icon = 1 [deprecated = true]; + * @deprecated + */ + protected $icon = null; + /** + * The icon displayed in front of the text. + * + * Generated from protobuf field .google.apps.card.v1.Icon start_icon = 12; + */ + protected $start_icon = null; + /** + * The text that appears above `text`. Always truncates. + * + * Generated from protobuf field string top_label = 3; + */ + protected $top_label = ''; + /** + * Required. The primary text. + * Supports simple formatting. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string text = 4; + */ + protected $text = ''; + /** + * The wrap text setting. If `true`, the text wraps and displays on + * multiple lines. Otherwise, the text is truncated. + * Only applies to `text`, not `topLabel` and `bottomLabel`. + * + * Generated from protobuf field bool wrap_text = 5; + */ + protected $wrap_text = false; + /** + * The text that appears below `text`. Always wraps. + * + * Generated from protobuf field string bottom_label = 6; + */ + protected $bottom_label = ''; + /** + * This action is triggered when users click `topLabel` or `bottomLabel`. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 7; + */ + protected $on_click = null; + protected $control; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Card\V1\Icon $icon + * Deprecated in favor of `startIcon`. + * @type \Google\Apps\Card\V1\Icon $start_icon + * The icon displayed in front of the text. + * @type string $top_label + * The text that appears above `text`. Always truncates. + * @type string $text + * Required. The primary text. + * Supports simple formatting. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * @type bool $wrap_text + * The wrap text setting. If `true`, the text wraps and displays on + * multiple lines. Otherwise, the text is truncated. + * Only applies to `text`, not `topLabel` and `bottomLabel`. + * @type string $bottom_label + * The text that appears below `text`. Always wraps. + * @type \Google\Apps\Card\V1\OnClick $on_click + * This action is triggered when users click `topLabel` or `bottomLabel`. + * @type \Google\Apps\Card\V1\Button $button + * A button that a user can click to trigger an action. + * @type \Google\Apps\Card\V1\DecoratedText\SwitchControl $switch_control + * A switch widget that a user can click to change its state and trigger an + * action. + * @type \Google\Apps\Card\V1\Icon $end_icon + * An icon displayed after the text. + * Supports + * [built-in](https://developers.google.com/chat/format-messages#builtinicons) + * and + * [custom](https://developers.google.com/chat/format-messages#customicons) + * icons. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * Deprecated in favor of `startIcon`. + * + * Generated from protobuf field .google.apps.card.v1.Icon icon = 1 [deprecated = true]; + * @return \Google\Apps\Card\V1\Icon|null + * @deprecated + */ + public function getIcon() + { + @trigger_error('icon is deprecated.', E_USER_DEPRECATED); + return $this->icon; + } + + public function hasIcon() + { + @trigger_error('icon is deprecated.', E_USER_DEPRECATED); + return isset($this->icon); + } + + public function clearIcon() + { + @trigger_error('icon is deprecated.', E_USER_DEPRECATED); + unset($this->icon); + } + + /** + * Deprecated in favor of `startIcon`. + * + * Generated from protobuf field .google.apps.card.v1.Icon icon = 1 [deprecated = true]; + * @param \Google\Apps\Card\V1\Icon $var + * @return $this + * @deprecated + */ + public function setIcon($var) + { + @trigger_error('icon is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Icon::class); + $this->icon = $var; + + return $this; + } + + /** + * The icon displayed in front of the text. + * + * Generated from protobuf field .google.apps.card.v1.Icon start_icon = 12; + * @return \Google\Apps\Card\V1\Icon|null + */ + public function getStartIcon() + { + return $this->start_icon; + } + + public function hasStartIcon() + { + return isset($this->start_icon); + } + + public function clearStartIcon() + { + unset($this->start_icon); + } + + /** + * The icon displayed in front of the text. + * + * Generated from protobuf field .google.apps.card.v1.Icon start_icon = 12; + * @param \Google\Apps\Card\V1\Icon $var + * @return $this + */ + public function setStartIcon($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Icon::class); + $this->start_icon = $var; + + return $this; + } + + /** + * The text that appears above `text`. Always truncates. + * + * Generated from protobuf field string top_label = 3; + * @return string + */ + public function getTopLabel() + { + return $this->top_label; + } + + /** + * The text that appears above `text`. Always truncates. + * + * Generated from protobuf field string top_label = 3; + * @param string $var + * @return $this + */ + public function setTopLabel($var) + { + GPBUtil::checkString($var, True); + $this->top_label = $var; + + return $this; + } + + /** + * Required. The primary text. + * Supports simple formatting. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string text = 4; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Required. The primary text. + * Supports simple formatting. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string text = 4; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * The wrap text setting. If `true`, the text wraps and displays on + * multiple lines. Otherwise, the text is truncated. + * Only applies to `text`, not `topLabel` and `bottomLabel`. + * + * Generated from protobuf field bool wrap_text = 5; + * @return bool + */ + public function getWrapText() + { + return $this->wrap_text; + } + + /** + * The wrap text setting. If `true`, the text wraps and displays on + * multiple lines. Otherwise, the text is truncated. + * Only applies to `text`, not `topLabel` and `bottomLabel`. + * + * Generated from protobuf field bool wrap_text = 5; + * @param bool $var + * @return $this + */ + public function setWrapText($var) + { + GPBUtil::checkBool($var); + $this->wrap_text = $var; + + return $this; + } + + /** + * The text that appears below `text`. Always wraps. + * + * Generated from protobuf field string bottom_label = 6; + * @return string + */ + public function getBottomLabel() + { + return $this->bottom_label; + } + + /** + * The text that appears below `text`. Always wraps. + * + * Generated from protobuf field string bottom_label = 6; + * @param string $var + * @return $this + */ + public function setBottomLabel($var) + { + GPBUtil::checkString($var, True); + $this->bottom_label = $var; + + return $this; + } + + /** + * This action is triggered when users click `topLabel` or `bottomLabel`. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 7; + * @return \Google\Apps\Card\V1\OnClick|null + */ + public function getOnClick() + { + return $this->on_click; + } + + public function hasOnClick() + { + return isset($this->on_click); + } + + public function clearOnClick() + { + unset($this->on_click); + } + + /** + * This action is triggered when users click `topLabel` or `bottomLabel`. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 7; + * @param \Google\Apps\Card\V1\OnClick $var + * @return $this + */ + public function setOnClick($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\OnClick::class); + $this->on_click = $var; + + return $this; + } + + /** + * A button that a user can click to trigger an action. + * + * Generated from protobuf field .google.apps.card.v1.Button button = 8; + * @return \Google\Apps\Card\V1\Button|null + */ + public function getButton() + { + return $this->readOneof(8); + } + + public function hasButton() + { + return $this->hasOneof(8); + } + + /** + * A button that a user can click to trigger an action. + * + * Generated from protobuf field .google.apps.card.v1.Button button = 8; + * @param \Google\Apps\Card\V1\Button $var + * @return $this + */ + public function setButton($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Button::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * A switch widget that a user can click to change its state and trigger an + * action. + * + * Generated from protobuf field .google.apps.card.v1.DecoratedText.SwitchControl switch_control = 9; + * @return \Google\Apps\Card\V1\DecoratedText\SwitchControl|null + */ + public function getSwitchControl() + { + return $this->readOneof(9); + } + + public function hasSwitchControl() + { + return $this->hasOneof(9); + } + + /** + * A switch widget that a user can click to change its state and trigger an + * action. + * + * Generated from protobuf field .google.apps.card.v1.DecoratedText.SwitchControl switch_control = 9; + * @param \Google\Apps\Card\V1\DecoratedText\SwitchControl $var + * @return $this + */ + public function setSwitchControl($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\DecoratedText\SwitchControl::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * An icon displayed after the text. + * Supports + * [built-in](https://developers.google.com/chat/format-messages#builtinicons) + * and + * [custom](https://developers.google.com/chat/format-messages#customicons) + * icons. + * + * Generated from protobuf field .google.apps.card.v1.Icon end_icon = 11; + * @return \Google\Apps\Card\V1\Icon|null + */ + public function getEndIcon() + { + return $this->readOneof(11); + } + + public function hasEndIcon() + { + return $this->hasOneof(11); + } + + /** + * An icon displayed after the text. + * Supports + * [built-in](https://developers.google.com/chat/format-messages#builtinicons) + * and + * [custom](https://developers.google.com/chat/format-messages#customicons) + * icons. + * + * Generated from protobuf field .google.apps.card.v1.Icon end_icon = 11; + * @param \Google\Apps\Card\V1\Icon $var + * @return $this + */ + public function setEndIcon($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Icon::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * @return string + */ + public function getControl() + { + return $this->whichOneof("control"); + } + +} + diff --git a/AppsChat/src/Card/V1/DecoratedText/SwitchControl.php b/AppsChat/src/Card/V1/DecoratedText/SwitchControl.php new file mode 100644 index 000000000000..6fc9109c4e15 --- /dev/null +++ b/AppsChat/src/Card/V1/DecoratedText/SwitchControl.php @@ -0,0 +1,245 @@ +google.apps.card.v1.DecoratedText.SwitchControl + */ +class SwitchControl extends \Google\Protobuf\Internal\Message +{ + /** + * The name by which the switch widget is identified in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The value entered by a user, returned as part of a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string value = 2; + */ + protected $value = ''; + /** + * When `true`, the switch is selected. + * + * Generated from protobuf field bool selected = 3; + */ + protected $selected = false; + /** + * The action to perform when the switch state is changed, such as what + * function to run. + * + * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 4; + */ + protected $on_change_action = null; + /** + * How the switch appears in the user interface. + * [Google Workspace Add-ons + * and Chat apps](https://developers.google.com/workspace/extend): + * + * Generated from protobuf field .google.apps.card.v1.DecoratedText.SwitchControl.ControlType control_type = 5; + */ + protected $control_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name by which the switch widget is identified in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * @type string $value + * The value entered by a user, returned as part of a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * @type bool $selected + * When `true`, the switch is selected. + * @type \Google\Apps\Card\V1\Action $on_change_action + * The action to perform when the switch state is changed, such as what + * function to run. + * @type int $control_type + * How the switch appears in the user interface. + * [Google Workspace Add-ons + * and Chat apps](https://developers.google.com/workspace/extend): + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The name by which the switch widget is identified in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name by which the switch widget is identified in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The value entered by a user, returned as part of a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The value entered by a user, returned as part of a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * When `true`, the switch is selected. + * + * Generated from protobuf field bool selected = 3; + * @return bool + */ + public function getSelected() + { + return $this->selected; + } + + /** + * When `true`, the switch is selected. + * + * Generated from protobuf field bool selected = 3; + * @param bool $var + * @return $this + */ + public function setSelected($var) + { + GPBUtil::checkBool($var); + $this->selected = $var; + + return $this; + } + + /** + * The action to perform when the switch state is changed, such as what + * function to run. + * + * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 4; + * @return \Google\Apps\Card\V1\Action|null + */ + public function getOnChangeAction() + { + return $this->on_change_action; + } + + public function hasOnChangeAction() + { + return isset($this->on_change_action); + } + + public function clearOnChangeAction() + { + unset($this->on_change_action); + } + + /** + * The action to perform when the switch state is changed, such as what + * function to run. + * + * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 4; + * @param \Google\Apps\Card\V1\Action $var + * @return $this + */ + public function setOnChangeAction($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Action::class); + $this->on_change_action = $var; + + return $this; + } + + /** + * How the switch appears in the user interface. + * [Google Workspace Add-ons + * and Chat apps](https://developers.google.com/workspace/extend): + * + * Generated from protobuf field .google.apps.card.v1.DecoratedText.SwitchControl.ControlType control_type = 5; + * @return int + */ + public function getControlType() + { + return $this->control_type; + } + + /** + * How the switch appears in the user interface. + * [Google Workspace Add-ons + * and Chat apps](https://developers.google.com/workspace/extend): + * + * Generated from protobuf field .google.apps.card.v1.DecoratedText.SwitchControl.ControlType control_type = 5; + * @param int $var + * @return $this + */ + public function setControlType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\DecoratedText\SwitchControl\ControlType::class); + $this->control_type = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Card/V1/DecoratedText/SwitchControl/ControlType.php b/AppsChat/src/Card/V1/DecoratedText/SwitchControl/ControlType.php new file mode 100644 index 000000000000..5b7622dc4b81 --- /dev/null +++ b/AppsChat/src/Card/V1/DecoratedText/SwitchControl/ControlType.php @@ -0,0 +1,68 @@ +google.apps.card.v1.DecoratedText.SwitchControl.ControlType + */ +class ControlType +{ + /** + * A toggle-style switch. + * + * Generated from protobuf enum SWITCH = 0; + */ + const PBSWITCH = 0; + /** + * Deprecated in favor of `CHECK_BOX`. + * + * Generated from protobuf enum CHECKBOX = 1; + */ + const CHECKBOX = 1; + /** + * A checkbox. + * + * Generated from protobuf enum CHECK_BOX = 2; + */ + const CHECK_BOX = 2; + + private static $valueToName = [ + self::PBSWITCH => 'SWITCH', + self::CHECKBOX => 'CHECKBOX', + self::CHECK_BOX => 'CHECK_BOX', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + + diff --git a/AppsChat/src/Card/V1/Divider.php b/AppsChat/src/Card/V1/Divider.php new file mode 100644 index 000000000000..58e09faf499f --- /dev/null +++ b/AppsChat/src/Card/V1/Divider.php @@ -0,0 +1,41 @@ +google.apps.card.v1.Divider + */ +class Divider extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AppsChat/src/Card/V1/Grid.php b/AppsChat/src/Card/V1/Grid.php new file mode 100644 index 000000000000..6134843c8b65 --- /dev/null +++ b/AppsChat/src/Card/V1/Grid.php @@ -0,0 +1,280 @@ +google.apps.card.v1.Grid + */ +class Grid extends \Google\Protobuf\Internal\Message +{ + /** + * The text that displays in the grid header. + * + * Generated from protobuf field string title = 1; + */ + protected $title = ''; + /** + * The items to display in the grid. + * + * Generated from protobuf field repeated .google.apps.card.v1.Grid.GridItem items = 2; + */ + private $items; + /** + * The border style to apply to each grid item. + * + * Generated from protobuf field .google.apps.card.v1.BorderStyle border_style = 3; + */ + protected $border_style = null; + /** + * The number of columns to display in the grid. A default value + * is used if this field isn't specified, and that default value is + * different depending on where the grid is shown (dialog versus companion). + * + * Generated from protobuf field int32 column_count = 4; + */ + protected $column_count = 0; + /** + * This callback is reused by each individual grid item, but with the + * item's identifier and index in the items list added to the callback's + * parameters. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 5; + */ + protected $on_click = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * The text that displays in the grid header. + * @type array<\Google\Apps\Card\V1\Grid\GridItem>|\Google\Protobuf\Internal\RepeatedField $items + * The items to display in the grid. + * @type \Google\Apps\Card\V1\BorderStyle $border_style + * The border style to apply to each grid item. + * @type int $column_count + * The number of columns to display in the grid. A default value + * is used if this field isn't specified, and that default value is + * different depending on where the grid is shown (dialog versus companion). + * @type \Google\Apps\Card\V1\OnClick $on_click + * This callback is reused by each individual grid item, but with the + * item's identifier and index in the items list added to the callback's + * parameters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The text that displays in the grid header. + * + * Generated from protobuf field string title = 1; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * The text that displays in the grid header. + * + * Generated from protobuf field string title = 1; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * The items to display in the grid. + * + * Generated from protobuf field repeated .google.apps.card.v1.Grid.GridItem items = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * The items to display in the grid. + * + * Generated from protobuf field repeated .google.apps.card.v1.Grid.GridItem items = 2; + * @param array<\Google\Apps\Card\V1\Grid\GridItem>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Card\V1\Grid\GridItem::class); + $this->items = $arr; + + return $this; + } + + /** + * The border style to apply to each grid item. + * + * Generated from protobuf field .google.apps.card.v1.BorderStyle border_style = 3; + * @return \Google\Apps\Card\V1\BorderStyle|null + */ + public function getBorderStyle() + { + return $this->border_style; + } + + public function hasBorderStyle() + { + return isset($this->border_style); + } + + public function clearBorderStyle() + { + unset($this->border_style); + } + + /** + * The border style to apply to each grid item. + * + * Generated from protobuf field .google.apps.card.v1.BorderStyle border_style = 3; + * @param \Google\Apps\Card\V1\BorderStyle $var + * @return $this + */ + public function setBorderStyle($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\BorderStyle::class); + $this->border_style = $var; + + return $this; + } + + /** + * The number of columns to display in the grid. A default value + * is used if this field isn't specified, and that default value is + * different depending on where the grid is shown (dialog versus companion). + * + * Generated from protobuf field int32 column_count = 4; + * @return int + */ + public function getColumnCount() + { + return $this->column_count; + } + + /** + * The number of columns to display in the grid. A default value + * is used if this field isn't specified, and that default value is + * different depending on where the grid is shown (dialog versus companion). + * + * Generated from protobuf field int32 column_count = 4; + * @param int $var + * @return $this + */ + public function setColumnCount($var) + { + GPBUtil::checkInt32($var); + $this->column_count = $var; + + return $this; + } + + /** + * This callback is reused by each individual grid item, but with the + * item's identifier and index in the items list added to the callback's + * parameters. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 5; + * @return \Google\Apps\Card\V1\OnClick|null + */ + public function getOnClick() + { + return $this->on_click; + } + + public function hasOnClick() + { + return isset($this->on_click); + } + + public function clearOnClick() + { + unset($this->on_click); + } + + /** + * This callback is reused by each individual grid item, but with the + * item's identifier and index in the items list added to the callback's + * parameters. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 5; + * @param \Google\Apps\Card\V1\OnClick $var + * @return $this + */ + public function setOnClick($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\OnClick::class); + $this->on_click = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/Grid/GridItem.php b/AppsChat/src/Card/V1/Grid/GridItem.php new file mode 100644 index 000000000000..bc296728ff7a --- /dev/null +++ b/AppsChat/src/Card/V1/Grid/GridItem.php @@ -0,0 +1,221 @@ +google.apps.card.v1.Grid.GridItem + */ +class GridItem extends \Google\Protobuf\Internal\Message +{ + /** + * A user-specified identifier for this grid item. This identifier is + * returned in the parent grid's `onClick` callback parameters. + * + * Generated from protobuf field string id = 1; + */ + protected $id = ''; + /** + * The image that displays in the grid item. + * + * Generated from protobuf field .google.apps.card.v1.ImageComponent image = 2; + */ + protected $image = null; + /** + * The grid item's title. + * + * Generated from protobuf field string title = 3; + */ + protected $title = ''; + /** + * The grid item's subtitle. + * + * Generated from protobuf field string subtitle = 4; + */ + protected $subtitle = ''; + /** + * The layout to use for the grid item. + * + * Generated from protobuf field .google.apps.card.v1.Grid.GridItem.GridItemLayout layout = 9; + */ + protected $layout = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * A user-specified identifier for this grid item. This identifier is + * returned in the parent grid's `onClick` callback parameters. + * @type \Google\Apps\Card\V1\ImageComponent $image + * The image that displays in the grid item. + * @type string $title + * The grid item's title. + * @type string $subtitle + * The grid item's subtitle. + * @type int $layout + * The layout to use for the grid item. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * A user-specified identifier for this grid item. This identifier is + * returned in the parent grid's `onClick` callback parameters. + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * A user-specified identifier for this grid item. This identifier is + * returned in the parent grid's `onClick` callback parameters. + * + * Generated from protobuf field string id = 1; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The image that displays in the grid item. + * + * Generated from protobuf field .google.apps.card.v1.ImageComponent image = 2; + * @return \Google\Apps\Card\V1\ImageComponent|null + */ + public function getImage() + { + return $this->image; + } + + public function hasImage() + { + return isset($this->image); + } + + public function clearImage() + { + unset($this->image); + } + + /** + * The image that displays in the grid item. + * + * Generated from protobuf field .google.apps.card.v1.ImageComponent image = 2; + * @param \Google\Apps\Card\V1\ImageComponent $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\ImageComponent::class); + $this->image = $var; + + return $this; + } + + /** + * The grid item's title. + * + * Generated from protobuf field string title = 3; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * The grid item's title. + * + * Generated from protobuf field string title = 3; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * The grid item's subtitle. + * + * Generated from protobuf field string subtitle = 4; + * @return string + */ + public function getSubtitle() + { + return $this->subtitle; + } + + /** + * The grid item's subtitle. + * + * Generated from protobuf field string subtitle = 4; + * @param string $var + * @return $this + */ + public function setSubtitle($var) + { + GPBUtil::checkString($var, True); + $this->subtitle = $var; + + return $this; + } + + /** + * The layout to use for the grid item. + * + * Generated from protobuf field .google.apps.card.v1.Grid.GridItem.GridItemLayout layout = 9; + * @return int + */ + public function getLayout() + { + return $this->layout; + } + + /** + * The layout to use for the grid item. + * + * Generated from protobuf field .google.apps.card.v1.Grid.GridItem.GridItemLayout layout = 9; + * @param int $var + * @return $this + */ + public function setLayout($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\Grid\GridItem\GridItemLayout::class); + $this->layout = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Card/V1/Grid/GridItem/GridItemLayout.php b/AppsChat/src/Card/V1/Grid/GridItem/GridItemLayout.php new file mode 100644 index 000000000000..979273fc70bb --- /dev/null +++ b/AppsChat/src/Card/V1/Grid/GridItem/GridItemLayout.php @@ -0,0 +1,64 @@ +google.apps.card.v1.Grid.GridItem.GridItemLayout + */ +class GridItemLayout +{ + /** + * Don't use. Unspecified. + * + * Generated from protobuf enum GRID_ITEM_LAYOUT_UNSPECIFIED = 0; + */ + const GRID_ITEM_LAYOUT_UNSPECIFIED = 0; + /** + * The title and subtitle are shown below the grid item's image. + * + * Generated from protobuf enum TEXT_BELOW = 1; + */ + const TEXT_BELOW = 1; + /** + * The title and subtitle are shown above the grid item's image. + * + * Generated from protobuf enum TEXT_ABOVE = 2; + */ + const TEXT_ABOVE = 2; + + private static $valueToName = [ + self::GRID_ITEM_LAYOUT_UNSPECIFIED => 'GRID_ITEM_LAYOUT_UNSPECIFIED', + self::TEXT_BELOW => 'TEXT_BELOW', + self::TEXT_ABOVE => 'TEXT_ABOVE', + ]; + + 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/Card/V1/Icon.php b/AppsChat/src/Card/V1/Icon.php new file mode 100644 index 000000000000..4089bd01b618 --- /dev/null +++ b/AppsChat/src/Card/V1/Icon.php @@ -0,0 +1,254 @@ +google.apps.card.v1.Icon + */ +class Icon extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A description of the icon used for accessibility. + * If unspecified, the default value `Button` is provided. As a best practice, + * you should set a helpful description for what the icon displays, and if + * applicable, what it does. For example, `A user's account portrait`, or + * `Opens a new browser tab and navigates to the Google Chat developer + * documentation at https://developers.google.com/chat`. + * If the icon is set in a [`Button`][google.apps.card.v1.Button], the + * `altText` appears as helper text when the user hovers over the button. + * However, if the button also sets `text`, the icon's `altText` is ignored. + * + * Generated from protobuf field string alt_text = 3; + */ + protected $alt_text = ''; + /** + * The crop style applied to the image. In some cases, applying a + * `CIRCLE` crop causes the image to be drawn larger than a built-in + * icon. + * + * Generated from protobuf field .google.apps.card.v1.Widget.ImageType image_type = 4; + */ + protected $image_type = 0; + protected $icons; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $known_icon + * Display one of the built-in icons provided by Google Workspace. + * For example, to display an airplane icon, specify `AIRPLANE`. + * For a bus, specify `BUS`. + * For a full list of supported icons, see [built-in + * icons](https://developers.google.com/chat/format-messages#builtinicons). + * @type string $icon_url + * Display a custom icon hosted at an HTTPS URL. + * For example: + * ``` + * "iconUrl": + * "https://developers.google.com/chat/images/quickstart-app-avatar.png" + * ``` + * Supported file types include `.png` and `.jpg`. + * @type string $alt_text + * Optional. A description of the icon used for accessibility. + * If unspecified, the default value `Button` is provided. As a best practice, + * you should set a helpful description for what the icon displays, and if + * applicable, what it does. For example, `A user's account portrait`, or + * `Opens a new browser tab and navigates to the Google Chat developer + * documentation at https://developers.google.com/chat`. + * If the icon is set in a [`Button`][google.apps.card.v1.Button], the + * `altText` appears as helper text when the user hovers over the button. + * However, if the button also sets `text`, the icon's `altText` is ignored. + * @type int $image_type + * The crop style applied to the image. In some cases, applying a + * `CIRCLE` crop causes the image to be drawn larger than a built-in + * icon. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * Display one of the built-in icons provided by Google Workspace. + * For example, to display an airplane icon, specify `AIRPLANE`. + * For a bus, specify `BUS`. + * For a full list of supported icons, see [built-in + * icons](https://developers.google.com/chat/format-messages#builtinicons). + * + * Generated from protobuf field string known_icon = 1; + * @return string + */ + public function getKnownIcon() + { + return $this->readOneof(1); + } + + public function hasKnownIcon() + { + return $this->hasOneof(1); + } + + /** + * Display one of the built-in icons provided by Google Workspace. + * For example, to display an airplane icon, specify `AIRPLANE`. + * For a bus, specify `BUS`. + * For a full list of supported icons, see [built-in + * icons](https://developers.google.com/chat/format-messages#builtinicons). + * + * Generated from protobuf field string known_icon = 1; + * @param string $var + * @return $this + */ + public function setKnownIcon($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Display a custom icon hosted at an HTTPS URL. + * For example: + * ``` + * "iconUrl": + * "https://developers.google.com/chat/images/quickstart-app-avatar.png" + * ``` + * Supported file types include `.png` and `.jpg`. + * + * Generated from protobuf field string icon_url = 2; + * @return string + */ + public function getIconUrl() + { + return $this->readOneof(2); + } + + public function hasIconUrl() + { + return $this->hasOneof(2); + } + + /** + * Display a custom icon hosted at an HTTPS URL. + * For example: + * ``` + * "iconUrl": + * "https://developers.google.com/chat/images/quickstart-app-avatar.png" + * ``` + * Supported file types include `.png` and `.jpg`. + * + * Generated from protobuf field string icon_url = 2; + * @param string $var + * @return $this + */ + public function setIconUrl($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. A description of the icon used for accessibility. + * If unspecified, the default value `Button` is provided. As a best practice, + * you should set a helpful description for what the icon displays, and if + * applicable, what it does. For example, `A user's account portrait`, or + * `Opens a new browser tab and navigates to the Google Chat developer + * documentation at https://developers.google.com/chat`. + * If the icon is set in a [`Button`][google.apps.card.v1.Button], the + * `altText` appears as helper text when the user hovers over the button. + * However, if the button also sets `text`, the icon's `altText` is ignored. + * + * Generated from protobuf field string alt_text = 3; + * @return string + */ + public function getAltText() + { + return $this->alt_text; + } + + /** + * Optional. A description of the icon used for accessibility. + * If unspecified, the default value `Button` is provided. As a best practice, + * you should set a helpful description for what the icon displays, and if + * applicable, what it does. For example, `A user's account portrait`, or + * `Opens a new browser tab and navigates to the Google Chat developer + * documentation at https://developers.google.com/chat`. + * If the icon is set in a [`Button`][google.apps.card.v1.Button], the + * `altText` appears as helper text when the user hovers over the button. + * However, if the button also sets `text`, the icon's `altText` is ignored. + * + * Generated from protobuf field string alt_text = 3; + * @param string $var + * @return $this + */ + public function setAltText($var) + { + GPBUtil::checkString($var, True); + $this->alt_text = $var; + + return $this; + } + + /** + * The crop style applied to the image. In some cases, applying a + * `CIRCLE` crop causes the image to be drawn larger than a built-in + * icon. + * + * Generated from protobuf field .google.apps.card.v1.Widget.ImageType image_type = 4; + * @return int + */ + public function getImageType() + { + return $this->image_type; + } + + /** + * The crop style applied to the image. In some cases, applying a + * `CIRCLE` crop causes the image to be drawn larger than a built-in + * icon. + * + * Generated from protobuf field .google.apps.card.v1.Widget.ImageType image_type = 4; + * @param int $var + * @return $this + */ + public function setImageType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\Widget\ImageType::class); + $this->image_type = $var; + + return $this; + } + + /** + * @return string + */ + public function getIcons() + { + return $this->whichOneof("icons"); + } + +} + diff --git a/AppsChat/src/Card/V1/Image.php b/AppsChat/src/Card/V1/Image.php new file mode 100644 index 000000000000..a8c767deaecd --- /dev/null +++ b/AppsChat/src/Card/V1/Image.php @@ -0,0 +1,164 @@ +google.apps.card.v1.Image + */ +class Image extends \Google\Protobuf\Internal\Message +{ + /** + * The HTTPS URL that hosts the image. + * For example: + * ``` + * https://developers.google.com/chat/images/quickstart-app-avatar.png + * ``` + * + * Generated from protobuf field string image_url = 1; + */ + protected $image_url = ''; + /** + * When a user clicks the image, the click triggers this action. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 2; + */ + protected $on_click = null; + /** + * The alternative text of this image that's used for accessibility. + * + * Generated from protobuf field string alt_text = 3; + */ + protected $alt_text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image_url + * The HTTPS URL that hosts the image. + * For example: + * ``` + * https://developers.google.com/chat/images/quickstart-app-avatar.png + * ``` + * @type \Google\Apps\Card\V1\OnClick $on_click + * When a user clicks the image, the click triggers this action. + * @type string $alt_text + * The alternative text of this image that's used for accessibility. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The HTTPS URL that hosts the image. + * For example: + * ``` + * https://developers.google.com/chat/images/quickstart-app-avatar.png + * ``` + * + * Generated from protobuf field string image_url = 1; + * @return string + */ + public function getImageUrl() + { + return $this->image_url; + } + + /** + * The HTTPS URL that hosts the image. + * For example: + * ``` + * https://developers.google.com/chat/images/quickstart-app-avatar.png + * ``` + * + * Generated from protobuf field string image_url = 1; + * @param string $var + * @return $this + */ + public function setImageUrl($var) + { + GPBUtil::checkString($var, True); + $this->image_url = $var; + + return $this; + } + + /** + * When a user clicks the image, the click triggers this action. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 2; + * @return \Google\Apps\Card\V1\OnClick|null + */ + public function getOnClick() + { + return $this->on_click; + } + + public function hasOnClick() + { + return isset($this->on_click); + } + + public function clearOnClick() + { + unset($this->on_click); + } + + /** + * When a user clicks the image, the click triggers this action. + * + * Generated from protobuf field .google.apps.card.v1.OnClick on_click = 2; + * @param \Google\Apps\Card\V1\OnClick $var + * @return $this + */ + public function setOnClick($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\OnClick::class); + $this->on_click = $var; + + return $this; + } + + /** + * The alternative text of this image that's used for accessibility. + * + * Generated from protobuf field string alt_text = 3; + * @return string + */ + public function getAltText() + { + return $this->alt_text; + } + + /** + * The alternative text of this image that's used for accessibility. + * + * Generated from protobuf field string alt_text = 3; + * @param string $var + * @return $this + */ + public function setAltText($var) + { + GPBUtil::checkString($var, True); + $this->alt_text = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/ImageComponent.php b/AppsChat/src/Card/V1/ImageComponent.php new file mode 100644 index 000000000000..b0b07608f838 --- /dev/null +++ b/AppsChat/src/Card/V1/ImageComponent.php @@ -0,0 +1,191 @@ +google.apps.card.v1.ImageComponent + */ +class ImageComponent extends \Google\Protobuf\Internal\Message +{ + /** + * The image URL. + * + * Generated from protobuf field string image_uri = 1; + */ + protected $image_uri = ''; + /** + * The accessibility label for the image. + * + * Generated from protobuf field string alt_text = 2; + */ + protected $alt_text = ''; + /** + * The crop style to apply to the image. + * + * Generated from protobuf field .google.apps.card.v1.ImageCropStyle crop_style = 3; + */ + protected $crop_style = null; + /** + * The border style to apply to the image. + * + * Generated from protobuf field .google.apps.card.v1.BorderStyle border_style = 4; + */ + protected $border_style = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image_uri + * The image URL. + * @type string $alt_text + * The accessibility label for the image. + * @type \Google\Apps\Card\V1\ImageCropStyle $crop_style + * The crop style to apply to the image. + * @type \Google\Apps\Card\V1\BorderStyle $border_style + * The border style to apply to the image. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The image URL. + * + * Generated from protobuf field string image_uri = 1; + * @return string + */ + public function getImageUri() + { + return $this->image_uri; + } + + /** + * The image URL. + * + * Generated from protobuf field string image_uri = 1; + * @param string $var + * @return $this + */ + public function setImageUri($var) + { + GPBUtil::checkString($var, True); + $this->image_uri = $var; + + return $this; + } + + /** + * The accessibility label for the image. + * + * Generated from protobuf field string alt_text = 2; + * @return string + */ + public function getAltText() + { + return $this->alt_text; + } + + /** + * The accessibility label for the image. + * + * Generated from protobuf field string alt_text = 2; + * @param string $var + * @return $this + */ + public function setAltText($var) + { + GPBUtil::checkString($var, True); + $this->alt_text = $var; + + return $this; + } + + /** + * The crop style to apply to the image. + * + * Generated from protobuf field .google.apps.card.v1.ImageCropStyle crop_style = 3; + * @return \Google\Apps\Card\V1\ImageCropStyle|null + */ + public function getCropStyle() + { + return $this->crop_style; + } + + public function hasCropStyle() + { + return isset($this->crop_style); + } + + public function clearCropStyle() + { + unset($this->crop_style); + } + + /** + * The crop style to apply to the image. + * + * Generated from protobuf field .google.apps.card.v1.ImageCropStyle crop_style = 3; + * @param \Google\Apps\Card\V1\ImageCropStyle $var + * @return $this + */ + public function setCropStyle($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\ImageCropStyle::class); + $this->crop_style = $var; + + return $this; + } + + /** + * The border style to apply to the image. + * + * Generated from protobuf field .google.apps.card.v1.BorderStyle border_style = 4; + * @return \Google\Apps\Card\V1\BorderStyle|null + */ + public function getBorderStyle() + { + return $this->border_style; + } + + public function hasBorderStyle() + { + return isset($this->border_style); + } + + public function clearBorderStyle() + { + unset($this->border_style); + } + + /** + * The border style to apply to the image. + * + * Generated from protobuf field .google.apps.card.v1.BorderStyle border_style = 4; + * @param \Google\Apps\Card\V1\BorderStyle $var + * @return $this + */ + public function setBorderStyle($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\BorderStyle::class); + $this->border_style = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/ImageCropStyle.php b/AppsChat/src/Card/V1/ImageCropStyle.php new file mode 100644 index 000000000000..eb70bd52adf0 --- /dev/null +++ b/AppsChat/src/Card/V1/ImageCropStyle.php @@ -0,0 +1,138 @@ +google.apps.card.v1.ImageCropStyle + */ +class ImageCropStyle extends \Google\Protobuf\Internal\Message +{ + /** + * The crop type. + * + * Generated from protobuf field .google.apps.card.v1.ImageCropStyle.ImageCropType type = 1; + */ + protected $type = 0; + /** + * The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`. + * For example, here's how to apply a 16:9 aspect ratio: + * ``` + * cropStyle { + * "type": "RECTANGLE_CUSTOM", + * "aspectRatio": 16/9 + * } + * ``` + * + * Generated from protobuf field double aspect_ratio = 2; + */ + protected $aspect_ratio = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The crop type. + * @type float $aspect_ratio + * The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`. + * For example, here's how to apply a 16:9 aspect ratio: + * ``` + * cropStyle { + * "type": "RECTANGLE_CUSTOM", + * "aspectRatio": 16/9 + * } + * ``` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The crop type. + * + * Generated from protobuf field .google.apps.card.v1.ImageCropStyle.ImageCropType type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The crop type. + * + * Generated from protobuf field .google.apps.card.v1.ImageCropStyle.ImageCropType type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\ImageCropStyle\ImageCropType::class); + $this->type = $var; + + return $this; + } + + /** + * The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`. + * For example, here's how to apply a 16:9 aspect ratio: + * ``` + * cropStyle { + * "type": "RECTANGLE_CUSTOM", + * "aspectRatio": 16/9 + * } + * ``` + * + * Generated from protobuf field double aspect_ratio = 2; + * @return float + */ + public function getAspectRatio() + { + return $this->aspect_ratio; + } + + /** + * The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`. + * For example, here's how to apply a 16:9 aspect ratio: + * ``` + * cropStyle { + * "type": "RECTANGLE_CUSTOM", + * "aspectRatio": 16/9 + * } + * ``` + * + * Generated from protobuf field double aspect_ratio = 2; + * @param float $var + * @return $this + */ + public function setAspectRatio($var) + { + GPBUtil::checkDouble($var); + $this->aspect_ratio = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/ImageCropStyle/ImageCropType.php b/AppsChat/src/Card/V1/ImageCropStyle/ImageCropType.php new file mode 100644 index 000000000000..a9699aa12ff8 --- /dev/null +++ b/AppsChat/src/Card/V1/ImageCropStyle/ImageCropType.php @@ -0,0 +1,79 @@ +google.apps.card.v1.ImageCropStyle.ImageCropType + */ +class ImageCropType +{ + /** + * Don't use. Unspecified. + * + * Generated from protobuf enum IMAGE_CROP_TYPE_UNSPECIFIED = 0; + */ + const IMAGE_CROP_TYPE_UNSPECIFIED = 0; + /** + * Default value. Applies a square crop. + * + * Generated from protobuf enum SQUARE = 1; + */ + const SQUARE = 1; + /** + * Applies a circular crop. + * + * Generated from protobuf enum CIRCLE = 2; + */ + const CIRCLE = 2; + /** + * Applies a rectangular crop with a custom aspect ratio. Set the custom + * aspect ratio with `aspectRatio`. + * + * Generated from protobuf enum RECTANGLE_CUSTOM = 3; + */ + const RECTANGLE_CUSTOM = 3; + /** + * Applies a rectangular crop with a 4:3 aspect ratio. + * + * Generated from protobuf enum RECTANGLE_4_3 = 4; + */ + const RECTANGLE_4_3 = 4; + + private static $valueToName = [ + self::IMAGE_CROP_TYPE_UNSPECIFIED => 'IMAGE_CROP_TYPE_UNSPECIFIED', + self::SQUARE => 'SQUARE', + self::CIRCLE => 'CIRCLE', + self::RECTANGLE_CUSTOM => 'RECTANGLE_CUSTOM', + self::RECTANGLE_4_3 => 'RECTANGLE_4_3', + ]; + + 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/Card/V1/OnClick.php b/AppsChat/src/Card/V1/OnClick.php new file mode 100644 index 000000000000..7fe0139a6eda --- /dev/null +++ b/AppsChat/src/Card/V1/OnClick.php @@ -0,0 +1,198 @@ +google.apps.card.v1.OnClick + */ +class OnClick extends \Google\Protobuf\Internal\Message +{ + protected $data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Card\V1\Action $action + * If specified, an action is triggered by this `onClick`. + * @type \Google\Apps\Card\V1\OpenLink $open_link + * If specified, this `onClick` triggers an open link action. + * @type \Google\Apps\Card\V1\Action $open_dynamic_link_action + * An add-on triggers this action when the action needs to open a + * link. This differs from the `open_link` above in that this needs to talk + * to server to get the link. Thus some preparation work is required for + * web client to do before the open link action response comes back. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * @type \Google\Apps\Card\V1\Card $card + * A new card is pushed to the card stack after clicking if specified. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * If specified, an action is triggered by this `onClick`. + * + * Generated from protobuf field .google.apps.card.v1.Action action = 1; + * @return \Google\Apps\Card\V1\Action|null + */ + public function getAction() + { + return $this->readOneof(1); + } + + public function hasAction() + { + return $this->hasOneof(1); + } + + /** + * If specified, an action is triggered by this `onClick`. + * + * Generated from protobuf field .google.apps.card.v1.Action action = 1; + * @param \Google\Apps\Card\V1\Action $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Action::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * If specified, this `onClick` triggers an open link action. + * + * Generated from protobuf field .google.apps.card.v1.OpenLink open_link = 2; + * @return \Google\Apps\Card\V1\OpenLink|null + */ + public function getOpenLink() + { + return $this->readOneof(2); + } + + public function hasOpenLink() + { + return $this->hasOneof(2); + } + + /** + * If specified, this `onClick` triggers an open link action. + * + * Generated from protobuf field .google.apps.card.v1.OpenLink open_link = 2; + * @param \Google\Apps\Card\V1\OpenLink $var + * @return $this + */ + public function setOpenLink($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\OpenLink::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * An add-on triggers this action when the action needs to open a + * link. This differs from the `open_link` above in that this needs to talk + * to server to get the link. Thus some preparation work is required for + * web client to do before the open link action response comes back. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.Action open_dynamic_link_action = 3; + * @return \Google\Apps\Card\V1\Action|null + */ + public function getOpenDynamicLinkAction() + { + return $this->readOneof(3); + } + + public function hasOpenDynamicLinkAction() + { + return $this->hasOneof(3); + } + + /** + * An add-on triggers this action when the action needs to open a + * link. This differs from the `open_link` above in that this needs to talk + * to server to get the link. Thus some preparation work is required for + * web client to do before the open link action response comes back. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.Action open_dynamic_link_action = 3; + * @param \Google\Apps\Card\V1\Action $var + * @return $this + */ + public function setOpenDynamicLinkAction($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Action::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A new card is pushed to the card stack after clicking if specified. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.Card card = 4; + * @return \Google\Apps\Card\V1\Card|null + */ + public function getCard() + { + return $this->readOneof(4); + } + + public function hasCard() + { + return $this->hasOneof(4); + } + + /** + * A new card is pushed to the card stack after clicking if specified. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.Card card = 4; + * @param \Google\Apps\Card\V1\Card $var + * @return $this + */ + public function setCard($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Card::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getData() + { + return $this->whichOneof("data"); + } + +} + diff --git a/AppsChat/src/Card/V1/OpenLink.php b/AppsChat/src/Card/V1/OpenLink.php new file mode 100644 index 000000000000..f401cd8d1c40 --- /dev/null +++ b/AppsChat/src/Card/V1/OpenLink.php @@ -0,0 +1,157 @@ +google.apps.card.v1.OpenLink + */ +class OpenLink extends \Google\Protobuf\Internal\Message +{ + /** + * The URL to open. + * + * Generated from protobuf field string url = 1; + */ + protected $url = ''; + /** + * How to open a link. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.OpenLink.OpenAs open_as = 2; + */ + protected $open_as = 0; + /** + * Whether the client forgets about a link after opening it, or observes it + * until the window closes. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.OpenLink.OnClose on_close = 3; + */ + protected $on_close = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $url + * The URL to open. + * @type int $open_as + * How to open a link. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * @type int $on_close + * Whether the client forgets about a link after opening it, or observes it + * until the window closes. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The URL to open. + * + * Generated from protobuf field string url = 1; + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * The URL to open. + * + * Generated from protobuf field string url = 1; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + + /** + * How to open a link. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.OpenLink.OpenAs open_as = 2; + * @return int + */ + public function getOpenAs() + { + return $this->open_as; + } + + /** + * How to open a link. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.OpenLink.OpenAs open_as = 2; + * @param int $var + * @return $this + */ + public function setOpenAs($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\OpenLink\OpenAs::class); + $this->open_as = $var; + + return $this; + } + + /** + * Whether the client forgets about a link after opening it, or observes it + * until the window closes. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.OpenLink.OnClose on_close = 3; + * @return int + */ + public function getOnClose() + { + return $this->on_close; + } + + /** + * Whether the client forgets about a link after opening it, or observes it + * until the window closes. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.OpenLink.OnClose on_close = 3; + * @param int $var + * @return $this + */ + public function setOnClose($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\OpenLink\OnClose::class); + $this->on_close = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/OpenLink/OnClose.php b/AppsChat/src/Card/V1/OpenLink/OnClose.php new file mode 100644 index 000000000000..998685bc26f4 --- /dev/null +++ b/AppsChat/src/Card/V1/OpenLink/OnClose.php @@ -0,0 +1,65 @@ +google.apps.card.v1.OpenLink.OnClose + */ +class OnClose +{ + /** + * Default value. The card doesn't reload; nothing happens. + * + * Generated from protobuf enum NOTHING = 0; + */ + const NOTHING = 0; + /** + * Reloads the card after the child window closes. + * If used in conjunction with + * [`OpenAs.OVERLAY`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#openas), + * the child window acts as a modal dialog and the parent card is blocked + * until the child window closes. + * + * Generated from protobuf enum RELOAD = 1; + */ + const RELOAD = 1; + + private static $valueToName = [ + self::NOTHING => 'NOTHING', + self::RELOAD => 'RELOAD', + ]; + + 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/Card/V1/OpenLink/OpenAs.php b/AppsChat/src/Card/V1/OpenLink/OpenAs.php new file mode 100644 index 000000000000..c5058bb03a61 --- /dev/null +++ b/AppsChat/src/Card/V1/OpenLink/OpenAs.php @@ -0,0 +1,62 @@ +google.apps.card.v1.OpenLink.OpenAs + */ +class OpenAs +{ + /** + * The link opens as a full-size window (if that's the frame used by the + * client). + * + * Generated from protobuf enum FULL_SIZE = 0; + */ + const FULL_SIZE = 0; + /** + * The link opens as an overlay, such as a pop-up. + * + * Generated from protobuf enum OVERLAY = 1; + */ + const OVERLAY = 1; + + private static $valueToName = [ + self::FULL_SIZE => 'FULL_SIZE', + self::OVERLAY => 'OVERLAY', + ]; + + 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/Card/V1/SelectionInput.php b/AppsChat/src/Card/V1/SelectionInput.php new file mode 100644 index 000000000000..f226f4e03b64 --- /dev/null +++ b/AppsChat/src/Card/V1/SelectionInput.php @@ -0,0 +1,439 @@ +google.apps.card.v1.SelectionInput + */ +class SelectionInput extends \Google\Protobuf\Internal\Message +{ + /** + * The name that identifies the selection input in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The text that appears above the selection input field in the user + * interface. + * Specify text that helps the user enter the information your app needs. + * For example, if users are selecting the urgency of a work ticket from a + * drop-down menu, the label might be "Urgency" or "Select urgency". + * + * Generated from protobuf field string label = 2; + */ + protected $label = ''; + /** + * The type of items that are displayed to users in a `SelectionInput` widget. + * Selection types support different types of interactions. For example, users + * can select one or more checkboxes, but they can only select one value from + * a dropdown menu. + * + * Generated from protobuf field .google.apps.card.v1.SelectionInput.SelectionType type = 3; + */ + protected $type = 0; + /** + * An array of selectable items. For example, an array of radio buttons or + * checkboxes. Supports up to 100 items. + * + * Generated from protobuf field repeated .google.apps.card.v1.SelectionInput.SelectionItem items = 4; + */ + private $items; + /** + * If specified, the form is submitted when the selection changes. If not + * specified, you must specify a separate button that submits the form. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 5; + */ + protected $on_change_action = null; + /** + * For multiselect menus, the maximum number of items that a user can select. + * Minimum value is 1 item. If unspecified, defaults to 3 items. + * + * Generated from protobuf field int32 multi_select_max_selected_items = 6; + */ + protected $multi_select_max_selected_items = 0; + /** + * For multiselect menus, the number of text characters that a user inputs + * before the Chat app queries autocomplete and displays suggested items + * in the menu. + * If unspecified, defaults to 0 characters for static data sources and 3 + * characters for external data sources. + * + * Generated from protobuf field int32 multi_select_min_query_length = 7; + */ + protected $multi_select_min_query_length = 0; + protected $multi_select_data_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name that identifies the selection input in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * @type string $label + * The text that appears above the selection input field in the user + * interface. + * Specify text that helps the user enter the information your app needs. + * For example, if users are selecting the urgency of a work ticket from a + * drop-down menu, the label might be "Urgency" or "Select urgency". + * @type int $type + * The type of items that are displayed to users in a `SelectionInput` widget. + * Selection types support different types of interactions. For example, users + * can select one or more checkboxes, but they can only select one value from + * a dropdown menu. + * @type array<\Google\Apps\Card\V1\SelectionInput\SelectionItem>|\Google\Protobuf\Internal\RepeatedField $items + * An array of selectable items. For example, an array of radio buttons or + * checkboxes. Supports up to 100 items. + * @type \Google\Apps\Card\V1\Action $on_change_action + * If specified, the form is submitted when the selection changes. If not + * specified, you must specify a separate button that submits the form. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * @type int $multi_select_max_selected_items + * For multiselect menus, the maximum number of items that a user can select. + * Minimum value is 1 item. If unspecified, defaults to 3 items. + * @type int $multi_select_min_query_length + * For multiselect menus, the number of text characters that a user inputs + * before the Chat app queries autocomplete and displays suggested items + * in the menu. + * If unspecified, defaults to 0 characters for static data sources and 3 + * characters for external data sources. + * @type \Google\Apps\Card\V1\Action $external_data_source + * An external data source, such as a relational data base. + * @type \Google\Apps\Card\V1\SelectionInput\PlatformDataSource $platform_data_source + * A data source from Google Workspace. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The name that identifies the selection input in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name that identifies the selection input in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The text that appears above the selection input field in the user + * interface. + * Specify text that helps the user enter the information your app needs. + * For example, if users are selecting the urgency of a work ticket from a + * drop-down menu, the label might be "Urgency" or "Select urgency". + * + * Generated from protobuf field string label = 2; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * The text that appears above the selection input field in the user + * interface. + * Specify text that helps the user enter the information your app needs. + * For example, if users are selecting the urgency of a work ticket from a + * drop-down menu, the label might be "Urgency" or "Select urgency". + * + * Generated from protobuf field string label = 2; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + + /** + * The type of items that are displayed to users in a `SelectionInput` widget. + * Selection types support different types of interactions. For example, users + * can select one or more checkboxes, but they can only select one value from + * a dropdown menu. + * + * Generated from protobuf field .google.apps.card.v1.SelectionInput.SelectionType type = 3; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of items that are displayed to users in a `SelectionInput` widget. + * Selection types support different types of interactions. For example, users + * can select one or more checkboxes, but they can only select one value from + * a dropdown menu. + * + * Generated from protobuf field .google.apps.card.v1.SelectionInput.SelectionType type = 3; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\SelectionInput\SelectionType::class); + $this->type = $var; + + return $this; + } + + /** + * An array of selectable items. For example, an array of radio buttons or + * checkboxes. Supports up to 100 items. + * + * Generated from protobuf field repeated .google.apps.card.v1.SelectionInput.SelectionItem items = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * An array of selectable items. For example, an array of radio buttons or + * checkboxes. Supports up to 100 items. + * + * Generated from protobuf field repeated .google.apps.card.v1.SelectionInput.SelectionItem items = 4; + * @param array<\Google\Apps\Card\V1\SelectionInput\SelectionItem>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Card\V1\SelectionInput\SelectionItem::class); + $this->items = $arr; + + return $this; + } + + /** + * If specified, the form is submitted when the selection changes. If not + * specified, you must specify a separate button that submits the form. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 5; + * @return \Google\Apps\Card\V1\Action|null + */ + public function getOnChangeAction() + { + return $this->on_change_action; + } + + public function hasOnChangeAction() + { + return isset($this->on_change_action); + } + + public function clearOnChangeAction() + { + unset($this->on_change_action); + } + + /** + * If specified, the form is submitted when the selection changes. If not + * specified, you must specify a separate button that submits the form. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 5; + * @param \Google\Apps\Card\V1\Action $var + * @return $this + */ + public function setOnChangeAction($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Action::class); + $this->on_change_action = $var; + + return $this; + } + + /** + * For multiselect menus, the maximum number of items that a user can select. + * Minimum value is 1 item. If unspecified, defaults to 3 items. + * + * Generated from protobuf field int32 multi_select_max_selected_items = 6; + * @return int + */ + public function getMultiSelectMaxSelectedItems() + { + return $this->multi_select_max_selected_items; + } + + /** + * For multiselect menus, the maximum number of items that a user can select. + * Minimum value is 1 item. If unspecified, defaults to 3 items. + * + * Generated from protobuf field int32 multi_select_max_selected_items = 6; + * @param int $var + * @return $this + */ + public function setMultiSelectMaxSelectedItems($var) + { + GPBUtil::checkInt32($var); + $this->multi_select_max_selected_items = $var; + + return $this; + } + + /** + * For multiselect menus, the number of text characters that a user inputs + * before the Chat app queries autocomplete and displays suggested items + * in the menu. + * If unspecified, defaults to 0 characters for static data sources and 3 + * characters for external data sources. + * + * Generated from protobuf field int32 multi_select_min_query_length = 7; + * @return int + */ + public function getMultiSelectMinQueryLength() + { + return $this->multi_select_min_query_length; + } + + /** + * For multiselect menus, the number of text characters that a user inputs + * before the Chat app queries autocomplete and displays suggested items + * in the menu. + * If unspecified, defaults to 0 characters for static data sources and 3 + * characters for external data sources. + * + * Generated from protobuf field int32 multi_select_min_query_length = 7; + * @param int $var + * @return $this + */ + public function setMultiSelectMinQueryLength($var) + { + GPBUtil::checkInt32($var); + $this->multi_select_min_query_length = $var; + + return $this; + } + + /** + * An external data source, such as a relational data base. + * + * Generated from protobuf field .google.apps.card.v1.Action external_data_source = 8; + * @return \Google\Apps\Card\V1\Action|null + */ + public function getExternalDataSource() + { + return $this->readOneof(8); + } + + public function hasExternalDataSource() + { + return $this->hasOneof(8); + } + + /** + * An external data source, such as a relational data base. + * + * Generated from protobuf field .google.apps.card.v1.Action external_data_source = 8; + * @param \Google\Apps\Card\V1\Action $var + * @return $this + */ + public function setExternalDataSource($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Action::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * A data source from Google Workspace. + * + * Generated from protobuf field .google.apps.card.v1.SelectionInput.PlatformDataSource platform_data_source = 9; + * @return \Google\Apps\Card\V1\SelectionInput\PlatformDataSource|null + */ + public function getPlatformDataSource() + { + return $this->readOneof(9); + } + + public function hasPlatformDataSource() + { + return $this->hasOneof(9); + } + + /** + * A data source from Google Workspace. + * + * Generated from protobuf field .google.apps.card.v1.SelectionInput.PlatformDataSource platform_data_source = 9; + * @param \Google\Apps\Card\V1\SelectionInput\PlatformDataSource $var + * @return $this + */ + public function setPlatformDataSource($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\SelectionInput\PlatformDataSource::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * @return string + */ + public function getMultiSelectDataSource() + { + return $this->whichOneof("multi_select_data_source"); + } + +} + diff --git a/AppsChat/src/Card/V1/SelectionInput/PlatformDataSource.php b/AppsChat/src/Card/V1/SelectionInput/PlatformDataSource.php new file mode 100644 index 000000000000..d67d86938f94 --- /dev/null +++ b/AppsChat/src/Card/V1/SelectionInput/PlatformDataSource.php @@ -0,0 +1,83 @@ +google.apps.card.v1.SelectionInput.PlatformDataSource + */ +class PlatformDataSource extends \Google\Protobuf\Internal\Message +{ + protected $data_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $common_data_source + * A data source shared by all Google Workspace applications, such as + * users in a Google Workspace organization. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * A data source shared by all Google Workspace applications, such as + * users in a Google Workspace organization. + * + * Generated from protobuf field .google.apps.card.v1.SelectionInput.PlatformDataSource.CommonDataSource common_data_source = 1; + * @return int + */ + public function getCommonDataSource() + { + return $this->readOneof(1); + } + + public function hasCommonDataSource() + { + return $this->hasOneof(1); + } + + /** + * A data source shared by all Google Workspace applications, such as + * users in a Google Workspace organization. + * + * Generated from protobuf field .google.apps.card.v1.SelectionInput.PlatformDataSource.CommonDataSource common_data_source = 1; + * @param int $var + * @return $this + */ + public function setCommonDataSource($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\SelectionInput\PlatformDataSource\CommonDataSource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getDataSource() + { + return $this->whichOneof("data_source"); + } + +} + + diff --git a/AppsChat/src/Card/V1/SelectionInput/PlatformDataSource/CommonDataSource.php b/AppsChat/src/Card/V1/SelectionInput/PlatformDataSource/CommonDataSource.php new file mode 100644 index 000000000000..f55eb2a10f7c --- /dev/null +++ b/AppsChat/src/Card/V1/SelectionInput/PlatformDataSource/CommonDataSource.php @@ -0,0 +1,59 @@ +google.apps.card.v1.SelectionInput.PlatformDataSource.CommonDataSource + */ +class CommonDataSource +{ + /** + * Default value. Don't use. + * + * Generated from protobuf enum UNKNOWN = 0; + */ + const UNKNOWN = 0; + /** + * Google Workspace users. The user can only view and select users from + * their Google Workspace organization. + * + * Generated from protobuf enum USER = 1; + */ + const USER = 1; + + private static $valueToName = [ + self::UNKNOWN => 'UNKNOWN', + self::USER => 'USER', + ]; + + 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/Card/V1/SelectionInput/SelectionItem.php b/AppsChat/src/Card/V1/SelectionInput/SelectionItem.php new file mode 100644 index 000000000000..538614353a84 --- /dev/null +++ b/AppsChat/src/Card/V1/SelectionInput/SelectionItem.php @@ -0,0 +1,243 @@ +google.apps.card.v1.SelectionInput.SelectionItem + */ +class SelectionItem extends \Google\Protobuf\Internal\Message +{ + /** + * The text that identifies or describes the item to users. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * The value associated with this item. The client should use this as a form + * input value. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string value = 2; + */ + protected $value = ''; + /** + * Whether the item is selected by default. If the selection input only + * accepts one value (such as for radio buttons or a dropdown menu), only + * set this field for one item. + * + * Generated from protobuf field bool selected = 3; + */ + protected $selected = false; + /** + * For multiselect menus, the URL for the icon displayed next to + * the item's `text` field. Supports PNG and JPEG files. Must be an `HTTPS` + * URL. For example, + * `https://developers.google.com/chat/images/quickstart-app-avatar.png`. + * + * Generated from protobuf field string start_icon_uri = 4; + */ + protected $start_icon_uri = ''; + /** + * For multiselect menus, a text description or label that's + * displayed below the item's `text` field. + * + * Generated from protobuf field string bottom_text = 5; + */ + protected $bottom_text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The text that identifies or describes the item to users. + * @type string $value + * The value associated with this item. The client should use this as a form + * input value. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * @type bool $selected + * Whether the item is selected by default. If the selection input only + * accepts one value (such as for radio buttons or a dropdown menu), only + * set this field for one item. + * @type string $start_icon_uri + * For multiselect menus, the URL for the icon displayed next to + * the item's `text` field. Supports PNG and JPEG files. Must be an `HTTPS` + * URL. For example, + * `https://developers.google.com/chat/images/quickstart-app-avatar.png`. + * @type string $bottom_text + * For multiselect menus, a text description or label that's + * displayed below the item's `text` field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The text that identifies or describes the item to users. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * The text that identifies or describes the item to users. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * The value associated with this item. The client should use this as a form + * input value. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The value associated with this item. The client should use this as a form + * input value. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * Whether the item is selected by default. If the selection input only + * accepts one value (such as for radio buttons or a dropdown menu), only + * set this field for one item. + * + * Generated from protobuf field bool selected = 3; + * @return bool + */ + public function getSelected() + { + return $this->selected; + } + + /** + * Whether the item is selected by default. If the selection input only + * accepts one value (such as for radio buttons or a dropdown menu), only + * set this field for one item. + * + * Generated from protobuf field bool selected = 3; + * @param bool $var + * @return $this + */ + public function setSelected($var) + { + GPBUtil::checkBool($var); + $this->selected = $var; + + return $this; + } + + /** + * For multiselect menus, the URL for the icon displayed next to + * the item's `text` field. Supports PNG and JPEG files. Must be an `HTTPS` + * URL. For example, + * `https://developers.google.com/chat/images/quickstart-app-avatar.png`. + * + * Generated from protobuf field string start_icon_uri = 4; + * @return string + */ + public function getStartIconUri() + { + return $this->start_icon_uri; + } + + /** + * For multiselect menus, the URL for the icon displayed next to + * the item's `text` field. Supports PNG and JPEG files. Must be an `HTTPS` + * URL. For example, + * `https://developers.google.com/chat/images/quickstart-app-avatar.png`. + * + * Generated from protobuf field string start_icon_uri = 4; + * @param string $var + * @return $this + */ + public function setStartIconUri($var) + { + GPBUtil::checkString($var, True); + $this->start_icon_uri = $var; + + return $this; + } + + /** + * For multiselect menus, a text description or label that's + * displayed below the item's `text` field. + * + * Generated from protobuf field string bottom_text = 5; + * @return string + */ + public function getBottomText() + { + return $this->bottom_text; + } + + /** + * For multiselect menus, a text description or label that's + * displayed below the item's `text` field. + * + * Generated from protobuf field string bottom_text = 5; + * @param string $var + * @return $this + */ + public function setBottomText($var) + { + GPBUtil::checkString($var, True); + $this->bottom_text = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Card/V1/SelectionInput/SelectionType.php b/AppsChat/src/Card/V1/SelectionInput/SelectionType.php new file mode 100644 index 000000000000..ef97029033d3 --- /dev/null +++ b/AppsChat/src/Card/V1/SelectionInput/SelectionType.php @@ -0,0 +1,104 @@ +google.apps.card.v1.SelectionInput.SelectionType + */ +class SelectionType +{ + /** + * A set of checkboxes. Users can select one or more checkboxes. + * + * Generated from protobuf enum CHECK_BOX = 0; + */ + const CHECK_BOX = 0; + /** + * A set of radio buttons. Users can select one radio button. + * + * Generated from protobuf enum RADIO_BUTTON = 1; + */ + const RADIO_BUTTON = 1; + /** + * A set of switches. Users can turn on one or more switches. + * + * Generated from protobuf enum SWITCH = 2; + */ + const PBSWITCH = 2; + /** + * A dropdown menu. Users can select one item from the menu. + * + * Generated from protobuf enum DROPDOWN = 3; + */ + const DROPDOWN = 3; + /** + * A multiselect menu for static or dynamic data. From the menu bar, + * users select one or more items. Users can also input values to populate + * dynamic data. For example, users can start typing the name of a Google + * Chat space and the widget autosuggests the space. + * To populate items for a multiselect menu, you can use one of the + * following types of data sources: + * * Static data: Items are specified as `SelectionItem` objects in the + * widget. Up to 100 items. + * * Google Workspace data: Items are populated using data from Google + * Workspace, such as Google Workspace users or Google Chat spaces. + * * External data: Items are populated from an external data + * source outside of Google Workspace. + * For examples of how to implement multiselect menus, see the + * [`SelectionInput` widget + * page](https://developers.google.com/chat/ui/widgets/selection-input#multiselect-menu). + * [Google Workspace Add-ons and Chat + * apps](https://developers.google.com/workspace/extend): + * multiselect for Google Workspace Add-ons are in + * [Developer Preview](https://developers.google.com/workspace/preview). + * + * Generated from protobuf enum MULTI_SELECT = 4; + */ + const MULTI_SELECT = 4; + + private static $valueToName = [ + self::CHECK_BOX => 'CHECK_BOX', + self::RADIO_BUTTON => 'RADIO_BUTTON', + self::PBSWITCH => 'SWITCH', + self::DROPDOWN => 'DROPDOWN', + self::MULTI_SELECT => 'MULTI_SELECT', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + + diff --git a/AppsChat/src/Card/V1/Suggestions.php b/AppsChat/src/Card/V1/Suggestions.php new file mode 100644 index 000000000000..7efd8f319cfc --- /dev/null +++ b/AppsChat/src/Card/V1/Suggestions.php @@ -0,0 +1,84 @@ +google.apps.card.v1.Suggestions + */ +class Suggestions extends \Google\Protobuf\Internal\Message +{ + /** + * A list of suggestions used for autocomplete recommendations in text input + * fields. + * + * Generated from protobuf field repeated .google.apps.card.v1.Suggestions.SuggestionItem items = 1; + */ + private $items; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Apps\Card\V1\Suggestions\SuggestionItem>|\Google\Protobuf\Internal\RepeatedField $items + * A list of suggestions used for autocomplete recommendations in text input + * fields. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * A list of suggestions used for autocomplete recommendations in text input + * fields. + * + * Generated from protobuf field repeated .google.apps.card.v1.Suggestions.SuggestionItem items = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of suggestions used for autocomplete recommendations in text input + * fields. + * + * Generated from protobuf field repeated .google.apps.card.v1.Suggestions.SuggestionItem items = 1; + * @param array<\Google\Apps\Card\V1\Suggestions\SuggestionItem>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Card\V1\Suggestions\SuggestionItem::class); + $this->items = $arr; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/Suggestions/SuggestionItem.php b/AppsChat/src/Card/V1/Suggestions/SuggestionItem.php new file mode 100644 index 000000000000..9a60812c03f7 --- /dev/null +++ b/AppsChat/src/Card/V1/Suggestions/SuggestionItem.php @@ -0,0 +1,81 @@ +google.apps.card.v1.Suggestions.SuggestionItem + */ +class SuggestionItem extends \Google\Protobuf\Internal\Message +{ + protected $content; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The value of a suggested input to a text input field. This is + * equivalent to what users enter themselves. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The value of a suggested input to a text input field. This is + * equivalent to what users enter themselves. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->readOneof(1); + } + + public function hasText() + { + return $this->hasOneof(1); + } + + /** + * The value of a suggested input to a text input field. This is + * equivalent to what users enter themselves. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getContent() + { + return $this->whichOneof("content"); + } + +} + + diff --git a/AppsChat/src/Card/V1/TextInput.php b/AppsChat/src/Card/V1/TextInput.php new file mode 100644 index 000000000000..ad7a57ec4879 --- /dev/null +++ b/AppsChat/src/Card/V1/TextInput.php @@ -0,0 +1,531 @@ +google.apps.card.v1.TextInput + */ +class TextInput extends \Google\Protobuf\Internal\Message +{ + /** + * The name by which the text input is identified in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The text that appears above the text input field in the user interface. + * Specify text that helps the user enter the information your app needs. + * For example, if you are asking someone's name, but specifically need their + * surname, write `surname` instead of `name`. + * Required if `hintText` is unspecified. Otherwise, optional. + * + * Generated from protobuf field string label = 2; + */ + protected $label = ''; + /** + * Text that appears below the text input field meant to assist users by + * prompting them to enter a certain value. This text is always visible. + * Required if `label` is unspecified. Otherwise, optional. + * + * Generated from protobuf field string hint_text = 3; + */ + protected $hint_text = ''; + /** + * The value entered by a user, returned as part of a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string value = 4; + */ + protected $value = ''; + /** + * How a text input field appears in the user interface. + * For example, whether the field is single or multi-line. + * + * Generated from protobuf field .google.apps.card.v1.TextInput.Type type = 5; + */ + protected $type = 0; + /** + * What to do when a change occurs in the text input field. For example, a + * user adding to the field or deleting text. + * Examples of actions to take include running a custom function or opening + * a [dialog](https://developers.google.com/chat/how-tos/dialogs) + * in Google Chat. + * + * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 6; + */ + protected $on_change_action = null; + /** + * Suggested values that users can enter. These values appear when users click + * inside the text input field. As users type, the suggested values + * dynamically filter to match what the users have typed. + * For example, a text input field for programming language might suggest + * Java, JavaScript, Python, and C++. When users start typing `Jav`, the list + * of suggestions filters to show just `Java` and `JavaScript`. + * Suggested values help guide users to enter values that your app can make + * sense of. When referring to JavaScript, some users might enter `javascript` + * and others `java script`. Suggesting `JavaScript` can standardize how users + * interact with your app. + * When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set + * to `MULTIPLE_LINE`. + * [Google Workspace + * Add-ons and Chat apps](https://developers.google.com/workspace/extend): + * + * Generated from protobuf field .google.apps.card.v1.Suggestions initial_suggestions = 7; + */ + protected $initial_suggestions = null; + /** + * Optional. Specify what action to take when the text input field provides + * suggestions to users who interact with it. + * If unspecified, the suggestions are set by `initialSuggestions` and + * are processed by the client. + * If specified, the app takes the action specified here, such as running + * a custom function. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.Action auto_complete_action = 8; + */ + protected $auto_complete_action = null; + /** + * Text that appears in the text input field when the field is empty. + * Use this text to prompt users to enter a value. For example, `Enter a + * number from 0 to 100`. + * [Google Chat apps](https://developers.google.com/chat): + * + * Generated from protobuf field string placeholder_text = 12; + */ + protected $placeholder_text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name by which the text input is identified in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * @type string $label + * The text that appears above the text input field in the user interface. + * Specify text that helps the user enter the information your app needs. + * For example, if you are asking someone's name, but specifically need their + * surname, write `surname` instead of `name`. + * Required if `hintText` is unspecified. Otherwise, optional. + * @type string $hint_text + * Text that appears below the text input field meant to assist users by + * prompting them to enter a certain value. This text is always visible. + * Required if `label` is unspecified. Otherwise, optional. + * @type string $value + * The value entered by a user, returned as part of a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * @type int $type + * How a text input field appears in the user interface. + * For example, whether the field is single or multi-line. + * @type \Google\Apps\Card\V1\Action $on_change_action + * What to do when a change occurs in the text input field. For example, a + * user adding to the field or deleting text. + * Examples of actions to take include running a custom function or opening + * a [dialog](https://developers.google.com/chat/how-tos/dialogs) + * in Google Chat. + * @type \Google\Apps\Card\V1\Suggestions $initial_suggestions + * Suggested values that users can enter. These values appear when users click + * inside the text input field. As users type, the suggested values + * dynamically filter to match what the users have typed. + * For example, a text input field for programming language might suggest + * Java, JavaScript, Python, and C++. When users start typing `Jav`, the list + * of suggestions filters to show just `Java` and `JavaScript`. + * Suggested values help guide users to enter values that your app can make + * sense of. When referring to JavaScript, some users might enter `javascript` + * and others `java script`. Suggesting `JavaScript` can standardize how users + * interact with your app. + * When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set + * to `MULTIPLE_LINE`. + * [Google Workspace + * Add-ons and Chat apps](https://developers.google.com/workspace/extend): + * @type \Google\Apps\Card\V1\Action $auto_complete_action + * Optional. Specify what action to take when the text input field provides + * suggestions to users who interact with it. + * If unspecified, the suggestions are set by `initialSuggestions` and + * are processed by the client. + * If specified, the app takes the action specified here, such as running + * a custom function. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * @type string $placeholder_text + * Text that appears in the text input field when the field is empty. + * Use this text to prompt users to enter a value. For example, `Enter a + * number from 0 to 100`. + * [Google Chat apps](https://developers.google.com/chat): + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The name by which the text input is identified in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name by which the text input is identified in a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The text that appears above the text input field in the user interface. + * Specify text that helps the user enter the information your app needs. + * For example, if you are asking someone's name, but specifically need their + * surname, write `surname` instead of `name`. + * Required if `hintText` is unspecified. Otherwise, optional. + * + * Generated from protobuf field string label = 2; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * The text that appears above the text input field in the user interface. + * Specify text that helps the user enter the information your app needs. + * For example, if you are asking someone's name, but specifically need their + * surname, write `surname` instead of `name`. + * Required if `hintText` is unspecified. Otherwise, optional. + * + * Generated from protobuf field string label = 2; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + + /** + * Text that appears below the text input field meant to assist users by + * prompting them to enter a certain value. This text is always visible. + * Required if `label` is unspecified. Otherwise, optional. + * + * Generated from protobuf field string hint_text = 3; + * @return string + */ + public function getHintText() + { + return $this->hint_text; + } + + /** + * Text that appears below the text input field meant to assist users by + * prompting them to enter a certain value. This text is always visible. + * Required if `label` is unspecified. Otherwise, optional. + * + * Generated from protobuf field string hint_text = 3; + * @param string $var + * @return $this + */ + public function setHintText($var) + { + GPBUtil::checkString($var, True); + $this->hint_text = $var; + + return $this; + } + + /** + * The value entered by a user, returned as part of a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string value = 4; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The value entered by a user, returned as part of a form input event. + * For details about working with form inputs, see [Receive form + * data](https://developers.google.com/chat/ui/read-form-data). + * + * Generated from protobuf field string value = 4; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * How a text input field appears in the user interface. + * For example, whether the field is single or multi-line. + * + * Generated from protobuf field .google.apps.card.v1.TextInput.Type type = 5; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * How a text input field appears in the user interface. + * For example, whether the field is single or multi-line. + * + * Generated from protobuf field .google.apps.card.v1.TextInput.Type type = 5; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\TextInput\Type::class); + $this->type = $var; + + return $this; + } + + /** + * What to do when a change occurs in the text input field. For example, a + * user adding to the field or deleting text. + * Examples of actions to take include running a custom function or opening + * a [dialog](https://developers.google.com/chat/how-tos/dialogs) + * in Google Chat. + * + * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 6; + * @return \Google\Apps\Card\V1\Action|null + */ + public function getOnChangeAction() + { + return $this->on_change_action; + } + + public function hasOnChangeAction() + { + return isset($this->on_change_action); + } + + public function clearOnChangeAction() + { + unset($this->on_change_action); + } + + /** + * What to do when a change occurs in the text input field. For example, a + * user adding to the field or deleting text. + * Examples of actions to take include running a custom function or opening + * a [dialog](https://developers.google.com/chat/how-tos/dialogs) + * in Google Chat. + * + * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 6; + * @param \Google\Apps\Card\V1\Action $var + * @return $this + */ + public function setOnChangeAction($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Action::class); + $this->on_change_action = $var; + + return $this; + } + + /** + * Suggested values that users can enter. These values appear when users click + * inside the text input field. As users type, the suggested values + * dynamically filter to match what the users have typed. + * For example, a text input field for programming language might suggest + * Java, JavaScript, Python, and C++. When users start typing `Jav`, the list + * of suggestions filters to show just `Java` and `JavaScript`. + * Suggested values help guide users to enter values that your app can make + * sense of. When referring to JavaScript, some users might enter `javascript` + * and others `java script`. Suggesting `JavaScript` can standardize how users + * interact with your app. + * When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set + * to `MULTIPLE_LINE`. + * [Google Workspace + * Add-ons and Chat apps](https://developers.google.com/workspace/extend): + * + * Generated from protobuf field .google.apps.card.v1.Suggestions initial_suggestions = 7; + * @return \Google\Apps\Card\V1\Suggestions|null + */ + public function getInitialSuggestions() + { + return $this->initial_suggestions; + } + + public function hasInitialSuggestions() + { + return isset($this->initial_suggestions); + } + + public function clearInitialSuggestions() + { + unset($this->initial_suggestions); + } + + /** + * Suggested values that users can enter. These values appear when users click + * inside the text input field. As users type, the suggested values + * dynamically filter to match what the users have typed. + * For example, a text input field for programming language might suggest + * Java, JavaScript, Python, and C++. When users start typing `Jav`, the list + * of suggestions filters to show just `Java` and `JavaScript`. + * Suggested values help guide users to enter values that your app can make + * sense of. When referring to JavaScript, some users might enter `javascript` + * and others `java script`. Suggesting `JavaScript` can standardize how users + * interact with your app. + * When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set + * to `MULTIPLE_LINE`. + * [Google Workspace + * Add-ons and Chat apps](https://developers.google.com/workspace/extend): + * + * Generated from protobuf field .google.apps.card.v1.Suggestions initial_suggestions = 7; + * @param \Google\Apps\Card\V1\Suggestions $var + * @return $this + */ + public function setInitialSuggestions($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Suggestions::class); + $this->initial_suggestions = $var; + + return $this; + } + + /** + * Optional. Specify what action to take when the text input field provides + * suggestions to users who interact with it. + * If unspecified, the suggestions are set by `initialSuggestions` and + * are processed by the client. + * If specified, the app takes the action specified here, such as running + * a custom function. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.Action auto_complete_action = 8; + * @return \Google\Apps\Card\V1\Action|null + */ + public function getAutoCompleteAction() + { + return $this->auto_complete_action; + } + + public function hasAutoCompleteAction() + { + return isset($this->auto_complete_action); + } + + public function clearAutoCompleteAction() + { + unset($this->auto_complete_action); + } + + /** + * Optional. Specify what action to take when the text input field provides + * suggestions to users who interact with it. + * If unspecified, the suggestions are set by `initialSuggestions` and + * are processed by the client. + * If specified, the app takes the action specified here, such as running + * a custom function. + * [Google Workspace + * Add-ons](https://developers.google.com/workspace/add-ons): + * + * Generated from protobuf field .google.apps.card.v1.Action auto_complete_action = 8; + * @param \Google\Apps\Card\V1\Action $var + * @return $this + */ + public function setAutoCompleteAction($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Action::class); + $this->auto_complete_action = $var; + + return $this; + } + + /** + * Text that appears in the text input field when the field is empty. + * Use this text to prompt users to enter a value. For example, `Enter a + * number from 0 to 100`. + * [Google Chat apps](https://developers.google.com/chat): + * + * Generated from protobuf field string placeholder_text = 12; + * @return string + */ + public function getPlaceholderText() + { + return $this->placeholder_text; + } + + /** + * Text that appears in the text input field when the field is empty. + * Use this text to prompt users to enter a value. For example, `Enter a + * number from 0 to 100`. + * [Google Chat apps](https://developers.google.com/chat): + * + * Generated from protobuf field string placeholder_text = 12; + * @param string $var + * @return $this + */ + public function setPlaceholderText($var) + { + GPBUtil::checkString($var, True); + $this->placeholder_text = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/TextInput/Type.php b/AppsChat/src/Card/V1/TextInput/Type.php new file mode 100644 index 000000000000..edb779e74918 --- /dev/null +++ b/AppsChat/src/Card/V1/TextInput/Type.php @@ -0,0 +1,60 @@ +google.apps.card.v1.TextInput.Type + */ +class Type +{ + /** + * The text input field has a fixed height of one line. + * + * Generated from protobuf enum SINGLE_LINE = 0; + */ + const SINGLE_LINE = 0; + /** + * The text input field has a fixed height of multiple lines. + * + * Generated from protobuf enum MULTIPLE_LINE = 1; + */ + const MULTIPLE_LINE = 1; + + private static $valueToName = [ + self::SINGLE_LINE => 'SINGLE_LINE', + self::MULTIPLE_LINE => 'MULTIPLE_LINE', + ]; + + 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/Card/V1/TextParagraph.php b/AppsChat/src/Card/V1/TextParagraph.php new file mode 100644 index 000000000000..b55fdf0da69e --- /dev/null +++ b/AppsChat/src/Card/V1/TextParagraph.php @@ -0,0 +1,79 @@ +google.apps.card.v1.TextParagraph + */ +class TextParagraph extends \Google\Protobuf\Internal\Message +{ + /** + * The text that's shown in the widget. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The text that's shown in the widget. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The text that's shown in the widget. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * The text that's shown in the widget. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/Widget.php b/AppsChat/src/Card/V1/Widget.php new file mode 100644 index 000000000000..ee86c5de6591 --- /dev/null +++ b/AppsChat/src/Card/V1/Widget.php @@ -0,0 +1,1062 @@ +google.apps.card.v1.Widget + */ +class Widget extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies whether widgets align to the left, right, or center of a column. + * + * Generated from protobuf field .google.apps.card.v1.Widget.HorizontalAlignment horizontal_alignment = 8; + */ + protected $horizontal_alignment = 0; + protected $data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Card\V1\TextParagraph $text_paragraph + * Displays a text paragraph. Supports simple HTML formatted text. For more + * information about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * For example, the following JSON creates a bolded text: + * ``` + * "textParagraph": { + * "text": " bold text" + * } + * ``` + * @type \Google\Apps\Card\V1\Image $image + * Displays an image. + * For example, the following JSON creates an image with alternative text: + * ``` + * "image": { + * "imageUrl": + * "https://developers.google.com/chat/images/quickstart-app-avatar.png", + * "altText": "Chat app avatar" + * } + * ``` + * @type \Google\Apps\Card\V1\DecoratedText $decorated_text + * Displays a decorated text item. + * For example, the following JSON creates a decorated text widget showing + * email address: + * ``` + * "decoratedText": { + * "icon": { + * "knownIcon": "EMAIL" + * }, + * "topLabel": "Email Address", + * "text": "sasha@example.com", + * "bottomLabel": "This is a new Email address!", + * "switchControl": { + * "name": "has_send_welcome_email_to_sasha", + * "selected": false, + * "controlType": "CHECKBOX" + * } + * } + * ``` + * @type \Google\Apps\Card\V1\ButtonList $button_list + * A list of buttons. + * For example, the following JSON creates two buttons. The first + * is a blue text button and the second is an image button that opens a + * link: + * ``` + * "buttonList": { + * "buttons": [ + * { + * "text": "Edit", + * "color": { + * "red": 0, + * "green": 0, + * "blue": 1, + * "alpha": 1 + * }, + * "disabled": true, + * }, + * { + * "icon": { + * "knownIcon": "INVITE", + * "altText": "check calendar" + * }, + * "onClick": { + * "openLink": { + * "url": "https://example.com/calendar" + * } + * } + * } + * ] + * } + * ``` + * @type \Google\Apps\Card\V1\TextInput $text_input + * Displays a text box that users can type into. + * For example, the following JSON creates a text input for an email + * address: + * ``` + * "textInput": { + * "name": "mailing_address", + * "label": "Mailing Address" + * } + * ``` + * As another example, the following JSON creates a text input for a + * programming language with static suggestions: + * ``` + * "textInput": { + * "name": "preferred_programing_language", + * "label": "Preferred Language", + * "initialSuggestions": { + * "items": [ + * { + * "text": "C++" + * }, + * { + * "text": "Java" + * }, + * { + * "text": "JavaScript" + * }, + * { + * "text": "Python" + * } + * ] + * } + * } + * ``` + * @type \Google\Apps\Card\V1\SelectionInput $selection_input + * Displays a selection control that lets users select items. Selection + * controls can be checkboxes, radio buttons, switches, or dropdown menus. + * For example, the following JSON creates a dropdown menu that lets users + * choose a size: + * ``` + * "selectionInput": { + * "name": "size", + * "label": "Size" + * "type": "DROPDOWN", + * "items": [ + * { + * "text": "S", + * "value": "small", + * "selected": false + * }, + * { + * "text": "M", + * "value": "medium", + * "selected": true + * }, + * { + * "text": "L", + * "value": "large", + * "selected": false + * }, + * { + * "text": "XL", + * "value": "extra_large", + * "selected": false + * } + * ] + * } + * ``` + * @type \Google\Apps\Card\V1\DateTimePicker $date_time_picker + * Displays a widget that lets users input a date, time, or date and time. + * For example, the following JSON creates a date time picker to schedule an + * appointment: + * ``` + * "dateTimePicker": { + * "name": "appointment_time", + * "label": "Book your appointment at:", + * "type": "DATE_AND_TIME", + * "valueMsEpoch": "796435200000" + * } + * ``` + * @type \Google\Apps\Card\V1\Divider $divider + * Displays a horizontal line divider between widgets. + * For example, the following JSON creates a divider: + * ``` + * "divider": { + * } + * ``` + * @type \Google\Apps\Card\V1\Grid $grid + * Displays a grid with a collection of items. + * A grid supports any number of columns and items. The number of rows is + * determined by the upper bounds of the number items divided by the number + * of columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 + * items and 2 columns has 6 rows. + * [Google Workspace Add-ons and + * Chat apps](https://developers.google.com/workspace/extend): + * For example, the following JSON creates a 2 column grid with a single + * item: + * ``` + * "grid": { + * "title": "A fine collection of items", + * "columnCount": 2, + * "borderStyle": { + * "type": "STROKE", + * "cornerRadius": 4 + * }, + * "items": [ + * { + * "image": { + * "imageUri": "https://www.example.com/image.png", + * "cropStyle": { + * "type": "SQUARE" + * }, + * "borderStyle": { + * "type": "STROKE" + * } + * }, + * "title": "An item", + * "textAlignment": "CENTER" + * } + * ], + * "onClick": { + * "openLink": { + * "url": "https://www.example.com" + * } + * } + * } + * ``` + * @type \Google\Apps\Card\V1\Columns $columns + * Displays up to 2 columns. + * To include more than 2 columns, or to use rows, use the `Grid` widget. + * For example, the following JSON creates 2 columns that each contain + * text paragraphs: + * ``` + * "columns": { + * "columnItems": [ + * { + * "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", + * "horizontalAlignment": "CENTER", + * "verticalAlignment": "CENTER", + * "widgets": [ + * { + * "textParagraph": { + * "text": "First column text paragraph" + * } + * } + * ] + * }, + * { + * "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", + * "horizontalAlignment": "CENTER", + * "verticalAlignment": "CENTER", + * "widgets": [ + * { + * "textParagraph": { + * "text": "Second column text paragraph" + * } + * } + * ] + * } + * ] + * } + * ``` + * @type int $horizontal_alignment + * Specifies whether widgets align to the left, right, or center of a column. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * Displays a text paragraph. Supports simple HTML formatted text. For more + * information about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * For example, the following JSON creates a bolded text: + * ``` + * "textParagraph": { + * "text": " bold text" + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.TextParagraph text_paragraph = 1; + * @return \Google\Apps\Card\V1\TextParagraph|null + */ + public function getTextParagraph() + { + return $this->readOneof(1); + } + + public function hasTextParagraph() + { + return $this->hasOneof(1); + } + + /** + * Displays a text paragraph. Supports simple HTML formatted text. For more + * information about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * For example, the following JSON creates a bolded text: + * ``` + * "textParagraph": { + * "text": " bold text" + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.TextParagraph text_paragraph = 1; + * @param \Google\Apps\Card\V1\TextParagraph $var + * @return $this + */ + public function setTextParagraph($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\TextParagraph::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Displays an image. + * For example, the following JSON creates an image with alternative text: + * ``` + * "image": { + * "imageUrl": + * "https://developers.google.com/chat/images/quickstart-app-avatar.png", + * "altText": "Chat app avatar" + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.Image image = 2; + * @return \Google\Apps\Card\V1\Image|null + */ + public function getImage() + { + return $this->readOneof(2); + } + + public function hasImage() + { + return $this->hasOneof(2); + } + + /** + * Displays an image. + * For example, the following JSON creates an image with alternative text: + * ``` + * "image": { + * "imageUrl": + * "https://developers.google.com/chat/images/quickstart-app-avatar.png", + * "altText": "Chat app avatar" + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.Image image = 2; + * @param \Google\Apps\Card\V1\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Image::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Displays a decorated text item. + * For example, the following JSON creates a decorated text widget showing + * email address: + * ``` + * "decoratedText": { + * "icon": { + * "knownIcon": "EMAIL" + * }, + * "topLabel": "Email Address", + * "text": "sasha@example.com", + * "bottomLabel": "This is a new Email address!", + * "switchControl": { + * "name": "has_send_welcome_email_to_sasha", + * "selected": false, + * "controlType": "CHECKBOX" + * } + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.DecoratedText decorated_text = 3; + * @return \Google\Apps\Card\V1\DecoratedText|null + */ + public function getDecoratedText() + { + return $this->readOneof(3); + } + + public function hasDecoratedText() + { + return $this->hasOneof(3); + } + + /** + * Displays a decorated text item. + * For example, the following JSON creates a decorated text widget showing + * email address: + * ``` + * "decoratedText": { + * "icon": { + * "knownIcon": "EMAIL" + * }, + * "topLabel": "Email Address", + * "text": "sasha@example.com", + * "bottomLabel": "This is a new Email address!", + * "switchControl": { + * "name": "has_send_welcome_email_to_sasha", + * "selected": false, + * "controlType": "CHECKBOX" + * } + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.DecoratedText decorated_text = 3; + * @param \Google\Apps\Card\V1\DecoratedText $var + * @return $this + */ + public function setDecoratedText($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\DecoratedText::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A list of buttons. + * For example, the following JSON creates two buttons. The first + * is a blue text button and the second is an image button that opens a + * link: + * ``` + * "buttonList": { + * "buttons": [ + * { + * "text": "Edit", + * "color": { + * "red": 0, + * "green": 0, + * "blue": 1, + * "alpha": 1 + * }, + * "disabled": true, + * }, + * { + * "icon": { + * "knownIcon": "INVITE", + * "altText": "check calendar" + * }, + * "onClick": { + * "openLink": { + * "url": "https://example.com/calendar" + * } + * } + * } + * ] + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.ButtonList button_list = 4; + * @return \Google\Apps\Card\V1\ButtonList|null + */ + public function getButtonList() + { + return $this->readOneof(4); + } + + public function hasButtonList() + { + return $this->hasOneof(4); + } + + /** + * A list of buttons. + * For example, the following JSON creates two buttons. The first + * is a blue text button and the second is an image button that opens a + * link: + * ``` + * "buttonList": { + * "buttons": [ + * { + * "text": "Edit", + * "color": { + * "red": 0, + * "green": 0, + * "blue": 1, + * "alpha": 1 + * }, + * "disabled": true, + * }, + * { + * "icon": { + * "knownIcon": "INVITE", + * "altText": "check calendar" + * }, + * "onClick": { + * "openLink": { + * "url": "https://example.com/calendar" + * } + * } + * } + * ] + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.ButtonList button_list = 4; + * @param \Google\Apps\Card\V1\ButtonList $var + * @return $this + */ + public function setButtonList($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\ButtonList::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Displays a text box that users can type into. + * For example, the following JSON creates a text input for an email + * address: + * ``` + * "textInput": { + * "name": "mailing_address", + * "label": "Mailing Address" + * } + * ``` + * As another example, the following JSON creates a text input for a + * programming language with static suggestions: + * ``` + * "textInput": { + * "name": "preferred_programing_language", + * "label": "Preferred Language", + * "initialSuggestions": { + * "items": [ + * { + * "text": "C++" + * }, + * { + * "text": "Java" + * }, + * { + * "text": "JavaScript" + * }, + * { + * "text": "Python" + * } + * ] + * } + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.TextInput text_input = 5; + * @return \Google\Apps\Card\V1\TextInput|null + */ + public function getTextInput() + { + return $this->readOneof(5); + } + + public function hasTextInput() + { + return $this->hasOneof(5); + } + + /** + * Displays a text box that users can type into. + * For example, the following JSON creates a text input for an email + * address: + * ``` + * "textInput": { + * "name": "mailing_address", + * "label": "Mailing Address" + * } + * ``` + * As another example, the following JSON creates a text input for a + * programming language with static suggestions: + * ``` + * "textInput": { + * "name": "preferred_programing_language", + * "label": "Preferred Language", + * "initialSuggestions": { + * "items": [ + * { + * "text": "C++" + * }, + * { + * "text": "Java" + * }, + * { + * "text": "JavaScript" + * }, + * { + * "text": "Python" + * } + * ] + * } + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.TextInput text_input = 5; + * @param \Google\Apps\Card\V1\TextInput $var + * @return $this + */ + public function setTextInput($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\TextInput::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Displays a selection control that lets users select items. Selection + * controls can be checkboxes, radio buttons, switches, or dropdown menus. + * For example, the following JSON creates a dropdown menu that lets users + * choose a size: + * ``` + * "selectionInput": { + * "name": "size", + * "label": "Size" + * "type": "DROPDOWN", + * "items": [ + * { + * "text": "S", + * "value": "small", + * "selected": false + * }, + * { + * "text": "M", + * "value": "medium", + * "selected": true + * }, + * { + * "text": "L", + * "value": "large", + * "selected": false + * }, + * { + * "text": "XL", + * "value": "extra_large", + * "selected": false + * } + * ] + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.SelectionInput selection_input = 6; + * @return \Google\Apps\Card\V1\SelectionInput|null + */ + public function getSelectionInput() + { + return $this->readOneof(6); + } + + public function hasSelectionInput() + { + return $this->hasOneof(6); + } + + /** + * Displays a selection control that lets users select items. Selection + * controls can be checkboxes, radio buttons, switches, or dropdown menus. + * For example, the following JSON creates a dropdown menu that lets users + * choose a size: + * ``` + * "selectionInput": { + * "name": "size", + * "label": "Size" + * "type": "DROPDOWN", + * "items": [ + * { + * "text": "S", + * "value": "small", + * "selected": false + * }, + * { + * "text": "M", + * "value": "medium", + * "selected": true + * }, + * { + * "text": "L", + * "value": "large", + * "selected": false + * }, + * { + * "text": "XL", + * "value": "extra_large", + * "selected": false + * } + * ] + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.SelectionInput selection_input = 6; + * @param \Google\Apps\Card\V1\SelectionInput $var + * @return $this + */ + public function setSelectionInput($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\SelectionInput::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Displays a widget that lets users input a date, time, or date and time. + * For example, the following JSON creates a date time picker to schedule an + * appointment: + * ``` + * "dateTimePicker": { + * "name": "appointment_time", + * "label": "Book your appointment at:", + * "type": "DATE_AND_TIME", + * "valueMsEpoch": "796435200000" + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.DateTimePicker date_time_picker = 7; + * @return \Google\Apps\Card\V1\DateTimePicker|null + */ + public function getDateTimePicker() + { + return $this->readOneof(7); + } + + public function hasDateTimePicker() + { + return $this->hasOneof(7); + } + + /** + * Displays a widget that lets users input a date, time, or date and time. + * For example, the following JSON creates a date time picker to schedule an + * appointment: + * ``` + * "dateTimePicker": { + * "name": "appointment_time", + * "label": "Book your appointment at:", + * "type": "DATE_AND_TIME", + * "valueMsEpoch": "796435200000" + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.DateTimePicker date_time_picker = 7; + * @param \Google\Apps\Card\V1\DateTimePicker $var + * @return $this + */ + public function setDateTimePicker($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\DateTimePicker::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Displays a horizontal line divider between widgets. + * For example, the following JSON creates a divider: + * ``` + * "divider": { + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.Divider divider = 9; + * @return \Google\Apps\Card\V1\Divider|null + */ + public function getDivider() + { + return $this->readOneof(9); + } + + public function hasDivider() + { + return $this->hasOneof(9); + } + + /** + * Displays a horizontal line divider between widgets. + * For example, the following JSON creates a divider: + * ``` + * "divider": { + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.Divider divider = 9; + * @param \Google\Apps\Card\V1\Divider $var + * @return $this + */ + public function setDivider($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Divider::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Displays a grid with a collection of items. + * A grid supports any number of columns and items. The number of rows is + * determined by the upper bounds of the number items divided by the number + * of columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 + * items and 2 columns has 6 rows. + * [Google Workspace Add-ons and + * Chat apps](https://developers.google.com/workspace/extend): + * For example, the following JSON creates a 2 column grid with a single + * item: + * ``` + * "grid": { + * "title": "A fine collection of items", + * "columnCount": 2, + * "borderStyle": { + * "type": "STROKE", + * "cornerRadius": 4 + * }, + * "items": [ + * { + * "image": { + * "imageUri": "https://www.example.com/image.png", + * "cropStyle": { + * "type": "SQUARE" + * }, + * "borderStyle": { + * "type": "STROKE" + * } + * }, + * "title": "An item", + * "textAlignment": "CENTER" + * } + * ], + * "onClick": { + * "openLink": { + * "url": "https://www.example.com" + * } + * } + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.Grid grid = 10; + * @return \Google\Apps\Card\V1\Grid|null + */ + public function getGrid() + { + return $this->readOneof(10); + } + + public function hasGrid() + { + return $this->hasOneof(10); + } + + /** + * Displays a grid with a collection of items. + * A grid supports any number of columns and items. The number of rows is + * determined by the upper bounds of the number items divided by the number + * of columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 + * items and 2 columns has 6 rows. + * [Google Workspace Add-ons and + * Chat apps](https://developers.google.com/workspace/extend): + * For example, the following JSON creates a 2 column grid with a single + * item: + * ``` + * "grid": { + * "title": "A fine collection of items", + * "columnCount": 2, + * "borderStyle": { + * "type": "STROKE", + * "cornerRadius": 4 + * }, + * "items": [ + * { + * "image": { + * "imageUri": "https://www.example.com/image.png", + * "cropStyle": { + * "type": "SQUARE" + * }, + * "borderStyle": { + * "type": "STROKE" + * } + * }, + * "title": "An item", + * "textAlignment": "CENTER" + * } + * ], + * "onClick": { + * "openLink": { + * "url": "https://www.example.com" + * } + * } + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.Grid grid = 10; + * @param \Google\Apps\Card\V1\Grid $var + * @return $this + */ + public function setGrid($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Grid::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Displays up to 2 columns. + * To include more than 2 columns, or to use rows, use the `Grid` widget. + * For example, the following JSON creates 2 columns that each contain + * text paragraphs: + * ``` + * "columns": { + * "columnItems": [ + * { + * "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", + * "horizontalAlignment": "CENTER", + * "verticalAlignment": "CENTER", + * "widgets": [ + * { + * "textParagraph": { + * "text": "First column text paragraph" + * } + * } + * ] + * }, + * { + * "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", + * "horizontalAlignment": "CENTER", + * "verticalAlignment": "CENTER", + * "widgets": [ + * { + * "textParagraph": { + * "text": "Second column text paragraph" + * } + * } + * ] + * } + * ] + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.Columns columns = 11; + * @return \Google\Apps\Card\V1\Columns|null + */ + public function getColumns() + { + return $this->readOneof(11); + } + + public function hasColumns() + { + return $this->hasOneof(11); + } + + /** + * Displays up to 2 columns. + * To include more than 2 columns, or to use rows, use the `Grid` widget. + * For example, the following JSON creates 2 columns that each contain + * text paragraphs: + * ``` + * "columns": { + * "columnItems": [ + * { + * "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", + * "horizontalAlignment": "CENTER", + * "verticalAlignment": "CENTER", + * "widgets": [ + * { + * "textParagraph": { + * "text": "First column text paragraph" + * } + * } + * ] + * }, + * { + * "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", + * "horizontalAlignment": "CENTER", + * "verticalAlignment": "CENTER", + * "widgets": [ + * { + * "textParagraph": { + * "text": "Second column text paragraph" + * } + * } + * ] + * } + * ] + * } + * ``` + * + * Generated from protobuf field .google.apps.card.v1.Columns columns = 11; + * @param \Google\Apps\Card\V1\Columns $var + * @return $this + */ + public function setColumns($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Columns::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Specifies whether widgets align to the left, right, or center of a column. + * + * Generated from protobuf field .google.apps.card.v1.Widget.HorizontalAlignment horizontal_alignment = 8; + * @return int + */ + public function getHorizontalAlignment() + { + return $this->horizontal_alignment; + } + + /** + * Specifies whether widgets align to the left, right, or center of a column. + * + * Generated from protobuf field .google.apps.card.v1.Widget.HorizontalAlignment horizontal_alignment = 8; + * @param int $var + * @return $this + */ + public function setHorizontalAlignment($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Card\V1\Widget\HorizontalAlignment::class); + $this->horizontal_alignment = $var; + + return $this; + } + + /** + * @return string + */ + public function getData() + { + return $this->whichOneof("data"); + } + +} + diff --git a/AppsChat/src/Card/V1/Widget/HorizontalAlignment.php b/AppsChat/src/Card/V1/Widget/HorizontalAlignment.php new file mode 100644 index 000000000000..9fb56c2f051a --- /dev/null +++ b/AppsChat/src/Card/V1/Widget/HorizontalAlignment.php @@ -0,0 +1,74 @@ +google.apps.card.v1.Widget.HorizontalAlignment + */ +class HorizontalAlignment +{ + /** + * Don't use. Unspecified. + * + * Generated from protobuf enum HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0; + */ + const HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0; + /** + * Default value. Aligns widgets to the start position of the column. For + * left-to-right layouts, aligns to the left. For right-to-left layouts, + * aligns to the right. + * + * Generated from protobuf enum START = 1; + */ + const START = 1; + /** + * Aligns widgets to the center of the column. + * + * Generated from protobuf enum CENTER = 2; + */ + const CENTER = 2; + /** + * Aligns widgets to the end position of the column. For left-to-right + * layouts, aligns widgets to the right. For right-to-left layouts, aligns + * widgets to the left. + * + * Generated from protobuf enum END = 3; + */ + const END = 3; + + private static $valueToName = [ + self::HORIZONTAL_ALIGNMENT_UNSPECIFIED => 'HORIZONTAL_ALIGNMENT_UNSPECIFIED', + self::START => 'START', + self::CENTER => 'CENTER', + self::END => 'END', + ]; + + 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/Card/V1/Widget/ImageType.php b/AppsChat/src/Card/V1/Widget/ImageType.php new file mode 100644 index 000000000000..6f928738546a --- /dev/null +++ b/AppsChat/src/Card/V1/Widget/ImageType.php @@ -0,0 +1,59 @@ +google.apps.card.v1.Widget.ImageType + */ +class ImageType +{ + /** + * Default value. Applies a square mask to the image. For example, a 4x3 + * image becomes 3x3. + * + * Generated from protobuf enum SQUARE = 0; + */ + const SQUARE = 0; + /** + * Applies a circular mask to the image. For example, a 4x3 image becomes a + * circle with a diameter of 3. + * + * Generated from protobuf enum CIRCLE = 1; + */ + const CIRCLE = 1; + + private static $valueToName = [ + self::SQUARE => 'SQUARE', + self::CIRCLE => 'CIRCLE', + ]; + + 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/AccessoryWidget.php b/AppsChat/src/Chat/V1/AccessoryWidget.php new file mode 100644 index 000000000000..e9fd8eebefea --- /dev/null +++ b/AppsChat/src/Chat/V1/AccessoryWidget.php @@ -0,0 +1,75 @@ +google.chat.v1.AccessoryWidget + */ +class AccessoryWidget extends \Google\Protobuf\Internal\Message +{ + protected $action; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Card\V1\ButtonList $button_list + * A list of buttons that are displayed under the message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * A list of buttons that are displayed under the message. + * + * Generated from protobuf field .google.apps.card.v1.ButtonList button_list = 1; + * @return \Google\Apps\Card\V1\ButtonList|null + */ + public function getButtonList() + { + return $this->readOneof(1); + } + + public function hasButtonList() + { + return $this->hasOneof(1); + } + + /** + * A list of buttons that are displayed under the message. + * + * Generated from protobuf field .google.apps.card.v1.ButtonList button_list = 1; + * @param \Google\Apps\Card\V1\ButtonList $var + * @return $this + */ + public function setButtonList($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\ButtonList::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getAction() + { + return $this->whichOneof("action"); + } + +} + diff --git a/AppsChat/src/Chat/V1/ActionResponse.php b/AppsChat/src/Chat/V1/ActionResponse.php new file mode 100644 index 000000000000..ff4e4f6015ee --- /dev/null +++ b/AppsChat/src/Chat/V1/ActionResponse.php @@ -0,0 +1,201 @@ +google.chat.v1.ActionResponse + */ +class ActionResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Input only. The type of Chat app response. + * + * Generated from protobuf field .google.chat.v1.ActionResponse.ResponseType type = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $type = 0; + /** + * Input only. URL for users to authenticate or configure. (Only for + * `REQUEST_CONFIG` response types.) + * + * Generated from protobuf field string url = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $url = ''; + /** + * Input only. A response to an interaction event related to a + * [dialog](https://developers.google.com/chat/how-tos/dialogs). Must be + * accompanied by `ResponseType.Dialog`. + * + * Generated from protobuf field .google.chat.v1.DialogAction dialog_action = 3 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $dialog_action = null; + /** + * Input only. The response of the updated widget. + * + * Generated from protobuf field .google.chat.v1.ActionResponse.UpdatedWidget updated_widget = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $updated_widget = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Input only. The type of Chat app response. + * @type string $url + * Input only. URL for users to authenticate or configure. (Only for + * `REQUEST_CONFIG` response types.) + * @type \Google\Apps\Chat\V1\DialogAction $dialog_action + * Input only. A response to an interaction event related to a + * [dialog](https://developers.google.com/chat/how-tos/dialogs). Must be + * accompanied by `ResponseType.Dialog`. + * @type \Google\Apps\Chat\V1\ActionResponse\UpdatedWidget $updated_widget + * Input only. The response of the updated widget. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * Input only. The type of Chat app response. + * + * Generated from protobuf field .google.chat.v1.ActionResponse.ResponseType type = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Input only. The type of Chat app response. + * + * Generated from protobuf field .google.chat.v1.ActionResponse.ResponseType type = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\ActionResponse\ResponseType::class); + $this->type = $var; + + return $this; + } + + /** + * Input only. URL for users to authenticate or configure. (Only for + * `REQUEST_CONFIG` response types.) + * + * Generated from protobuf field string url = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Input only. URL for users to authenticate or configure. (Only for + * `REQUEST_CONFIG` response types.) + * + * Generated from protobuf field string url = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + + /** + * Input only. A response to an interaction event related to a + * [dialog](https://developers.google.com/chat/how-tos/dialogs). Must be + * accompanied by `ResponseType.Dialog`. + * + * Generated from protobuf field .google.chat.v1.DialogAction dialog_action = 3 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Apps\Chat\V1\DialogAction|null + */ + public function getDialogAction() + { + return $this->dialog_action; + } + + public function hasDialogAction() + { + return isset($this->dialog_action); + } + + public function clearDialogAction() + { + unset($this->dialog_action); + } + + /** + * Input only. A response to an interaction event related to a + * [dialog](https://developers.google.com/chat/how-tos/dialogs). Must be + * accompanied by `ResponseType.Dialog`. + * + * Generated from protobuf field .google.chat.v1.DialogAction dialog_action = 3 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Apps\Chat\V1\DialogAction $var + * @return $this + */ + public function setDialogAction($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\DialogAction::class); + $this->dialog_action = $var; + + return $this; + } + + /** + * Input only. The response of the updated widget. + * + * Generated from protobuf field .google.chat.v1.ActionResponse.UpdatedWidget updated_widget = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Apps\Chat\V1\ActionResponse\UpdatedWidget|null + */ + public function getUpdatedWidget() + { + return $this->updated_widget; + } + + public function hasUpdatedWidget() + { + return isset($this->updated_widget); + } + + public function clearUpdatedWidget() + { + unset($this->updated_widget); + } + + /** + * Input only. The response of the updated widget. + * + * Generated from protobuf field .google.chat.v1.ActionResponse.UpdatedWidget updated_widget = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Apps\Chat\V1\ActionResponse\UpdatedWidget $var + * @return $this + */ + public function setUpdatedWidget($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\ActionResponse\UpdatedWidget::class); + $this->updated_widget = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/ActionResponse/ResponseType.php b/AppsChat/src/Chat/V1/ActionResponse/ResponseType.php new file mode 100644 index 000000000000..5b38a65993da --- /dev/null +++ b/AppsChat/src/Chat/V1/ActionResponse/ResponseType.php @@ -0,0 +1,94 @@ +google.chat.v1.ActionResponse.ResponseType + */ +class ResponseType +{ + /** + * Default type that's handled as `NEW_MESSAGE`. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Post as a new message in the topic. + * + * Generated from protobuf enum NEW_MESSAGE = 1; + */ + const NEW_MESSAGE = 1; + /** + * Update the Chat app's message. This is only permitted on a `CARD_CLICKED` + * event where the message sender type is `BOT`. + * + * Generated from protobuf enum UPDATE_MESSAGE = 2; + */ + const UPDATE_MESSAGE = 2; + /** + * Update the cards on a user's message. This is only permitted as a + * response to a `MESSAGE` event with a matched url, or a `CARD_CLICKED` + * event where the message sender type is `HUMAN`. Text is ignored. + * + * Generated from protobuf enum UPDATE_USER_MESSAGE_CARDS = 6; + */ + const UPDATE_USER_MESSAGE_CARDS = 6; + /** + * Privately ask the user for additional authentication or configuration. + * + * Generated from protobuf enum REQUEST_CONFIG = 3; + */ + const REQUEST_CONFIG = 3; + /** + * Presents a + * [dialog](https://developers.google.com/chat/how-tos/dialogs). + * + * Generated from protobuf enum DIALOG = 4; + */ + const DIALOG = 4; + /** + * Widget text autocomplete options query. + * + * Generated from protobuf enum UPDATE_WIDGET = 7; + */ + const UPDATE_WIDGET = 7; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::NEW_MESSAGE => 'NEW_MESSAGE', + self::UPDATE_MESSAGE => 'UPDATE_MESSAGE', + self::UPDATE_USER_MESSAGE_CARDS => 'UPDATE_USER_MESSAGE_CARDS', + self::REQUEST_CONFIG => 'REQUEST_CONFIG', + self::DIALOG => 'DIALOG', + self::UPDATE_WIDGET => 'UPDATE_WIDGET', + ]; + + 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/ActionResponse/SelectionItems.php b/AppsChat/src/Chat/V1/ActionResponse/SelectionItems.php new file mode 100644 index 000000000000..990c69dce3d1 --- /dev/null +++ b/AppsChat/src/Chat/V1/ActionResponse/SelectionItems.php @@ -0,0 +1,68 @@ +google.chat.v1.ActionResponse.SelectionItems + */ +class SelectionItems extends \Google\Protobuf\Internal\Message +{ + /** + * An array of the SelectionItem objects. + * + * Generated from protobuf field repeated .google.apps.card.v1.SelectionInput.SelectionItem items = 1; + */ + private $items; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Apps\Card\V1\SelectionInput\SelectionItem>|\Google\Protobuf\Internal\RepeatedField $items + * An array of the SelectionItem objects. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * An array of the SelectionItem objects. + * + * Generated from protobuf field repeated .google.apps.card.v1.SelectionInput.SelectionItem items = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * An array of the SelectionItem objects. + * + * Generated from protobuf field repeated .google.apps.card.v1.SelectionInput.SelectionItem items = 1; + * @param array<\Google\Apps\Card\V1\SelectionInput\SelectionItem>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Card\V1\SelectionInput\SelectionItem::class); + $this->items = $arr; + + return $this; + } + +} + + diff --git a/AppsChat/src/Chat/V1/ActionResponse/UpdatedWidget.php b/AppsChat/src/Chat/V1/ActionResponse/UpdatedWidget.php new file mode 100644 index 000000000000..0d8dd3bb27ef --- /dev/null +++ b/AppsChat/src/Chat/V1/ActionResponse/UpdatedWidget.php @@ -0,0 +1,115 @@ +google.chat.v1.ActionResponse.UpdatedWidget + */ +class UpdatedWidget extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of the updated widget. The ID must match the one for the + * widget that triggered the update request. + * + * Generated from protobuf field string widget = 2; + */ + protected $widget = ''; + protected $updated_widget; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\ActionResponse\SelectionItems $suggestions + * List of widget autocomplete results + * @type string $widget + * The ID of the updated widget. The ID must match the one for the + * widget that triggered the update request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * List of widget autocomplete results + * + * Generated from protobuf field .google.chat.v1.ActionResponse.SelectionItems suggestions = 1; + * @return \Google\Apps\Chat\V1\ActionResponse\SelectionItems|null + */ + public function getSuggestions() + { + return $this->readOneof(1); + } + + public function hasSuggestions() + { + return $this->hasOneof(1); + } + + /** + * List of widget autocomplete results + * + * Generated from protobuf field .google.chat.v1.ActionResponse.SelectionItems suggestions = 1; + * @param \Google\Apps\Chat\V1\ActionResponse\SelectionItems $var + * @return $this + */ + public function setSuggestions($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\ActionResponse\SelectionItems::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The ID of the updated widget. The ID must match the one for the + * widget that triggered the update request. + * + * Generated from protobuf field string widget = 2; + * @return string + */ + public function getWidget() + { + return $this->widget; + } + + /** + * The ID of the updated widget. The ID must match the one for the + * widget that triggered the update request. + * + * Generated from protobuf field string widget = 2; + * @param string $var + * @return $this + */ + public function setWidget($var) + { + GPBUtil::checkString($var, True); + $this->widget = $var; + + return $this; + } + + /** + * @return string + */ + public function getUpdatedWidget() + { + return $this->whichOneof("updated_widget"); + } + +} + + diff --git a/AppsChat/src/Chat/V1/ActionStatus.php b/AppsChat/src/Chat/V1/ActionStatus.php new file mode 100644 index 000000000000..3e0ffca71e5b --- /dev/null +++ b/AppsChat/src/Chat/V1/ActionStatus.php @@ -0,0 +1,106 @@ +google.chat.v1.ActionStatus + */ +class ActionStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The status code. + * + * Generated from protobuf field .google.rpc.Code status_code = 1; + */ + protected $status_code = 0; + /** + * The message to send users about the status of their request. + * If unset, a generic message based on the `status_code` is sent. + * + * Generated from protobuf field string user_facing_message = 2; + */ + protected $user_facing_message = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $status_code + * The status code. + * @type string $user_facing_message + * The message to send users about the status of their request. + * If unset, a generic message based on the `status_code` is sent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\ActionStatus::initOnce(); + parent::__construct($data); + } + + /** + * The status code. + * + * Generated from protobuf field .google.rpc.Code status_code = 1; + * @return int + */ + public function getStatusCode() + { + return $this->status_code; + } + + /** + * The status code. + * + * Generated from protobuf field .google.rpc.Code status_code = 1; + * @param int $var + * @return $this + */ + public function setStatusCode($var) + { + GPBUtil::checkEnum($var, \Google\Rpc\Code::class); + $this->status_code = $var; + + return $this; + } + + /** + * The message to send users about the status of their request. + * If unset, a generic message based on the `status_code` is sent. + * + * Generated from protobuf field string user_facing_message = 2; + * @return string + */ + public function getUserFacingMessage() + { + return $this->user_facing_message; + } + + /** + * The message to send users about the status of their request. + * If unset, a generic message based on the `status_code` is sent. + * + * Generated from protobuf field string user_facing_message = 2; + * @param string $var + * @return $this + */ + public function setUserFacingMessage($var) + { + GPBUtil::checkString($var, True); + $this->user_facing_message = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/Annotation.php b/AppsChat/src/Chat/V1/Annotation.php new file mode 100644 index 000000000000..9bc518c93032 --- /dev/null +++ b/AppsChat/src/Chat/V1/Annotation.php @@ -0,0 +1,285 @@ +google.chat.v1.Annotation + */ +class Annotation extends \Google\Protobuf\Internal\Message +{ + /** + * The type of this annotation. + * + * Generated from protobuf field .google.chat.v1.AnnotationType type = 1; + */ + protected $type = 0; + /** + * Start index (0-based, inclusive) in the plain-text message body this + * annotation corresponds to. + * + * Generated from protobuf field optional int32 start_index = 2; + */ + protected $start_index = null; + /** + * Length of the substring in the plain-text message body this annotation + * corresponds to. + * + * Generated from protobuf field int32 length = 3; + */ + protected $length = 0; + protected $metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The type of this annotation. + * @type int $start_index + * Start index (0-based, inclusive) in the plain-text message body this + * annotation corresponds to. + * @type int $length + * Length of the substring in the plain-text message body this annotation + * corresponds to. + * @type \Google\Apps\Chat\V1\UserMentionMetadata $user_mention + * The metadata of user mention. + * @type \Google\Apps\Chat\V1\SlashCommandMetadata $slash_command + * The metadata for a slash command. + * @type \Google\Apps\Chat\V1\RichLinkMetadata $rich_link_metadata + * The metadata for a rich link. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Annotation::initOnce(); + parent::__construct($data); + } + + /** + * The type of this annotation. + * + * Generated from protobuf field .google.chat.v1.AnnotationType type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of this annotation. + * + * Generated from protobuf field .google.chat.v1.AnnotationType type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\AnnotationType::class); + $this->type = $var; + + return $this; + } + + /** + * Start index (0-based, inclusive) in the plain-text message body this + * annotation corresponds to. + * + * Generated from protobuf field optional int32 start_index = 2; + * @return int + */ + public function getStartIndex() + { + return isset($this->start_index) ? $this->start_index : 0; + } + + public function hasStartIndex() + { + return isset($this->start_index); + } + + public function clearStartIndex() + { + unset($this->start_index); + } + + /** + * Start index (0-based, inclusive) in the plain-text message body this + * annotation corresponds to. + * + * Generated from protobuf field optional int32 start_index = 2; + * @param int $var + * @return $this + */ + public function setStartIndex($var) + { + GPBUtil::checkInt32($var); + $this->start_index = $var; + + return $this; + } + + /** + * Length of the substring in the plain-text message body this annotation + * corresponds to. + * + * Generated from protobuf field int32 length = 3; + * @return int + */ + public function getLength() + { + return $this->length; + } + + /** + * Length of the substring in the plain-text message body this annotation + * corresponds to. + * + * Generated from protobuf field int32 length = 3; + * @param int $var + * @return $this + */ + public function setLength($var) + { + GPBUtil::checkInt32($var); + $this->length = $var; + + return $this; + } + + /** + * The metadata of user mention. + * + * Generated from protobuf field .google.chat.v1.UserMentionMetadata user_mention = 4; + * @return \Google\Apps\Chat\V1\UserMentionMetadata|null + */ + public function getUserMention() + { + return $this->readOneof(4); + } + + public function hasUserMention() + { + return $this->hasOneof(4); + } + + /** + * The metadata of user mention. + * + * Generated from protobuf field .google.chat.v1.UserMentionMetadata user_mention = 4; + * @param \Google\Apps\Chat\V1\UserMentionMetadata $var + * @return $this + */ + public function setUserMention($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\UserMentionMetadata::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * The metadata for a slash command. + * + * Generated from protobuf field .google.chat.v1.SlashCommandMetadata slash_command = 5; + * @return \Google\Apps\Chat\V1\SlashCommandMetadata|null + */ + public function getSlashCommand() + { + return $this->readOneof(5); + } + + public function hasSlashCommand() + { + return $this->hasOneof(5); + } + + /** + * The metadata for a slash command. + * + * Generated from protobuf field .google.chat.v1.SlashCommandMetadata slash_command = 5; + * @param \Google\Apps\Chat\V1\SlashCommandMetadata $var + * @return $this + */ + public function setSlashCommand($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\SlashCommandMetadata::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The metadata for a rich link. + * + * Generated from protobuf field .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + * @return \Google\Apps\Chat\V1\RichLinkMetadata|null + */ + public function getRichLinkMetadata() + { + return $this->readOneof(6); + } + + public function hasRichLinkMetadata() + { + return $this->hasOneof(6); + } + + /** + * The metadata for a rich link. + * + * Generated from protobuf field .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + * @param \Google\Apps\Chat\V1\RichLinkMetadata $var + * @return $this + */ + public function setRichLinkMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\RichLinkMetadata::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getMetadata() + { + return $this->whichOneof("metadata"); + } + +} + diff --git a/AppsChat/src/Chat/V1/AnnotationType.php b/AppsChat/src/Chat/V1/AnnotationType.php new file mode 100644 index 000000000000..c9b09b768c19 --- /dev/null +++ b/AppsChat/src/Chat/V1/AnnotationType.php @@ -0,0 +1,68 @@ +google.chat.v1.AnnotationType + */ +class AnnotationType +{ + /** + * Default value for the enum. Don't use. + * + * Generated from protobuf enum ANNOTATION_TYPE_UNSPECIFIED = 0; + */ + const ANNOTATION_TYPE_UNSPECIFIED = 0; + /** + * A user is mentioned. + * + * Generated from protobuf enum USER_MENTION = 1; + */ + const USER_MENTION = 1; + /** + * A slash command is invoked. + * + * Generated from protobuf enum SLASH_COMMAND = 2; + */ + const SLASH_COMMAND = 2; + /** + * A rich link annotation. + * + * Generated from protobuf enum RICH_LINK = 3; + */ + const RICH_LINK = 3; + + private static $valueToName = [ + self::ANNOTATION_TYPE_UNSPECIFIED => 'ANNOTATION_TYPE_UNSPECIFIED', + self::USER_MENTION => 'USER_MENTION', + self::SLASH_COMMAND => 'SLASH_COMMAND', + self::RICH_LINK => 'RICH_LINK', + ]; + + 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/AttachedGif.php b/AppsChat/src/Chat/V1/AttachedGif.php new file mode 100644 index 000000000000..0856cd583a48 --- /dev/null +++ b/AppsChat/src/Chat/V1/AttachedGif.php @@ -0,0 +1,67 @@ +google.chat.v1.AttachedGif + */ +class AttachedGif extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The URL that hosts the GIF image. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Output only. The URL that hosts the GIF image. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The URL that hosts the GIF image. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Output only. The URL that hosts the GIF image. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/Attachment.php b/AppsChat/src/Chat/V1/Attachment.php new file mode 100644 index 000000000000..dd041ff28c9d --- /dev/null +++ b/AppsChat/src/Chat/V1/Attachment.php @@ -0,0 +1,338 @@ +google.chat.v1.Attachment + */ +class Attachment extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name of the attachment, in the form + * `spaces/*/messages/*/attachments/*`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. The original file name for the content, not the full path. + * + * Generated from protobuf field string content_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $content_name = ''; + /** + * Output only. The content type (MIME type) of the file. + * + * Generated from protobuf field string content_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $content_type = ''; + /** + * Output only. The thumbnail URL which should be used to preview the + * attachment to a human user. Chat apps shouldn't use this URL to download + * attachment content. + * + * Generated from protobuf field string thumbnail_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $thumbnail_uri = ''; + /** + * Output only. The download URL which should be used to allow a human user to + * download the attachment. Chat apps shouldn't use this URL to download + * attachment content. + * + * Generated from protobuf field string download_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $download_uri = ''; + /** + * Output only. The source of the attachment. + * + * Generated from protobuf field .google.chat.v1.Attachment.Source source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $source = 0; + protected $data_ref; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Resource name of the attachment, in the form + * `spaces/*/messages/*/attachments/*`. + * @type string $content_name + * Output only. The original file name for the content, not the full path. + * @type string $content_type + * Output only. The content type (MIME type) of the file. + * @type \Google\Apps\Chat\V1\AttachmentDataRef $attachment_data_ref + * A reference to the attachment data. This field is used with the media API + * to download the attachment data. + * @type \Google\Apps\Chat\V1\DriveDataRef $drive_data_ref + * Output only. A reference to the Google Drive attachment. This field is + * used with the Google Drive API. + * @type string $thumbnail_uri + * Output only. The thumbnail URL which should be used to preview the + * attachment to a human user. Chat apps shouldn't use this URL to download + * attachment content. + * @type string $download_uri + * Output only. The download URL which should be used to allow a human user to + * download the attachment. Chat apps shouldn't use this URL to download + * attachment content. + * @type int $source + * Output only. The source of the attachment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Attachment::initOnce(); + parent::__construct($data); + } + + /** + * Resource name of the attachment, in the form + * `spaces/*/messages/*/attachments/*`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Resource name of the attachment, in the form + * `spaces/*/messages/*/attachments/*`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The original file name for the content, not the full path. + * + * Generated from protobuf field string content_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getContentName() + { + return $this->content_name; + } + + /** + * Output only. The original file name for the content, not the full path. + * + * Generated from protobuf field string content_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setContentName($var) + { + GPBUtil::checkString($var, True); + $this->content_name = $var; + + return $this; + } + + /** + * Output only. The content type (MIME type) of the file. + * + * Generated from protobuf field string content_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getContentType() + { + return $this->content_type; + } + + /** + * Output only. The content type (MIME type) of the file. + * + * Generated from protobuf field string content_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setContentType($var) + { + GPBUtil::checkString($var, True); + $this->content_type = $var; + + return $this; + } + + /** + * A reference to the attachment data. This field is used with the media API + * to download the attachment data. + * + * Generated from protobuf field .google.chat.v1.AttachmentDataRef attachment_data_ref = 4; + * @return \Google\Apps\Chat\V1\AttachmentDataRef|null + */ + public function getAttachmentDataRef() + { + return $this->readOneof(4); + } + + public function hasAttachmentDataRef() + { + return $this->hasOneof(4); + } + + /** + * A reference to the attachment data. This field is used with the media API + * to download the attachment data. + * + * Generated from protobuf field .google.chat.v1.AttachmentDataRef attachment_data_ref = 4; + * @param \Google\Apps\Chat\V1\AttachmentDataRef $var + * @return $this + */ + public function setAttachmentDataRef($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\AttachmentDataRef::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Output only. A reference to the Google Drive attachment. This field is + * used with the Google Drive API. + * + * Generated from protobuf field .google.chat.v1.DriveDataRef drive_data_ref = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Apps\Chat\V1\DriveDataRef|null + */ + public function getDriveDataRef() + { + return $this->readOneof(7); + } + + public function hasDriveDataRef() + { + return $this->hasOneof(7); + } + + /** + * Output only. A reference to the Google Drive attachment. This field is + * used with the Google Drive API. + * + * Generated from protobuf field .google.chat.v1.DriveDataRef drive_data_ref = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Apps\Chat\V1\DriveDataRef $var + * @return $this + */ + public function setDriveDataRef($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\DriveDataRef::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Output only. The thumbnail URL which should be used to preview the + * attachment to a human user. Chat apps shouldn't use this URL to download + * attachment content. + * + * Generated from protobuf field string thumbnail_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getThumbnailUri() + { + return $this->thumbnail_uri; + } + + /** + * Output only. The thumbnail URL which should be used to preview the + * attachment to a human user. Chat apps shouldn't use this URL to download + * attachment content. + * + * Generated from protobuf field string thumbnail_uri = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setThumbnailUri($var) + { + GPBUtil::checkString($var, True); + $this->thumbnail_uri = $var; + + return $this; + } + + /** + * Output only. The download URL which should be used to allow a human user to + * download the attachment. Chat apps shouldn't use this URL to download + * attachment content. + * + * Generated from protobuf field string download_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDownloadUri() + { + return $this->download_uri; + } + + /** + * Output only. The download URL which should be used to allow a human user to + * download the attachment. Chat apps shouldn't use this URL to download + * attachment content. + * + * Generated from protobuf field string download_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDownloadUri($var) + { + GPBUtil::checkString($var, True); + $this->download_uri = $var; + + return $this; + } + + /** + * Output only. The source of the attachment. + * + * Generated from protobuf field .google.chat.v1.Attachment.Source source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSource() + { + return $this->source; + } + + /** + * Output only. The source of the attachment. + * + * Generated from protobuf field .google.chat.v1.Attachment.Source source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\Attachment\Source::class); + $this->source = $var; + + return $this; + } + + /** + * @return string + */ + public function getDataRef() + { + return $this->whichOneof("data_ref"); + } + +} + diff --git a/AppsChat/src/Chat/V1/Attachment/Source.php b/AppsChat/src/Chat/V1/Attachment/Source.php new file mode 100644 index 000000000000..ae7b2b2ecd02 --- /dev/null +++ b/AppsChat/src/Chat/V1/Attachment/Source.php @@ -0,0 +1,54 @@ +google.chat.v1.Attachment.Source + */ +class Source +{ + /** + * Generated from protobuf enum SOURCE_UNSPECIFIED = 0; + */ + const SOURCE_UNSPECIFIED = 0; + /** + * Generated from protobuf enum DRIVE_FILE = 1; + */ + const DRIVE_FILE = 1; + /** + * Generated from protobuf enum UPLOADED_CONTENT = 2; + */ + const UPLOADED_CONTENT = 2; + + private static $valueToName = [ + self::SOURCE_UNSPECIFIED => 'SOURCE_UNSPECIFIED', + self::DRIVE_FILE => 'DRIVE_FILE', + self::UPLOADED_CONTENT => 'UPLOADED_CONTENT', + ]; + + 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/AttachmentDataRef.php b/AppsChat/src/Chat/V1/AttachmentDataRef.php new file mode 100644 index 000000000000..abf0fd8d9dfa --- /dev/null +++ b/AppsChat/src/Chat/V1/AttachmentDataRef.php @@ -0,0 +1,111 @@ +google.chat.v1.AttachmentDataRef + */ +class AttachmentDataRef extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the attachment data. This field is used with the media + * API to download the attachment data. + * + * Generated from protobuf field string resource_name = 1; + */ + protected $resource_name = ''; + /** + * Opaque token containing a reference to an uploaded attachment. Treated by + * clients as an opaque string and used to create or update Chat messages with + * attachments. + * + * Generated from protobuf field string attachment_upload_token = 2; + */ + protected $attachment_upload_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource_name + * The resource name of the attachment data. This field is used with the media + * API to download the attachment data. + * @type string $attachment_upload_token + * Opaque token containing a reference to an uploaded attachment. Treated by + * clients as an opaque string and used to create or update Chat messages with + * attachments. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Attachment::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the attachment data. This field is used with the media + * API to download the attachment data. + * + * Generated from protobuf field string resource_name = 1; + * @return string + */ + public function getResourceName() + { + return $this->resource_name; + } + + /** + * The resource name of the attachment data. This field is used with the media + * API to download the attachment data. + * + * Generated from protobuf field string resource_name = 1; + * @param string $var + * @return $this + */ + public function setResourceName($var) + { + GPBUtil::checkString($var, True); + $this->resource_name = $var; + + return $this; + } + + /** + * Opaque token containing a reference to an uploaded attachment. Treated by + * clients as an opaque string and used to create or update Chat messages with + * attachments. + * + * Generated from protobuf field string attachment_upload_token = 2; + * @return string + */ + public function getAttachmentUploadToken() + { + return $this->attachment_upload_token; + } + + /** + * Opaque token containing a reference to an uploaded attachment. Treated by + * clients as an opaque string and used to create or update Chat messages with + * attachments. + * + * Generated from protobuf field string attachment_upload_token = 2; + * @param string $var + * @return $this + */ + public function setAttachmentUploadToken($var) + { + GPBUtil::checkString($var, True); + $this->attachment_upload_token = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/CardWithId.php b/AppsChat/src/Chat/V1/CardWithId.php new file mode 100644 index 000000000000..a1a4231378d9 --- /dev/null +++ b/AppsChat/src/Chat/V1/CardWithId.php @@ -0,0 +1,120 @@ +google.chat.v1.CardWithId + */ +class CardWithId extends \Google\Protobuf\Internal\Message +{ + /** + * Required if the message contains multiple cards. A unique identifier for + * a card in a message. + * + * Generated from protobuf field string card_id = 1; + */ + protected $card_id = ''; + /** + * A card. Maximum size is 32 KB. + * + * Generated from protobuf field .google.apps.card.v1.Card card = 2; + */ + protected $card = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $card_id + * Required if the message contains multiple cards. A unique identifier for + * a card in a message. + * @type \Google\Apps\Card\V1\Card $card + * A card. Maximum size is 32 KB. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * Required if the message contains multiple cards. A unique identifier for + * a card in a message. + * + * Generated from protobuf field string card_id = 1; + * @return string + */ + public function getCardId() + { + return $this->card_id; + } + + /** + * Required if the message contains multiple cards. A unique identifier for + * a card in a message. + * + * Generated from protobuf field string card_id = 1; + * @param string $var + * @return $this + */ + public function setCardId($var) + { + GPBUtil::checkString($var, True); + $this->card_id = $var; + + return $this; + } + + /** + * A card. Maximum size is 32 KB. + * + * Generated from protobuf field .google.apps.card.v1.Card card = 2; + * @return \Google\Apps\Card\V1\Card|null + */ + public function getCard() + { + return $this->card; + } + + public function hasCard() + { + return isset($this->card); + } + + public function clearCard() + { + unset($this->card); + } + + /** + * A card. Maximum size is 32 KB. + * + * Generated from protobuf field .google.apps.card.v1.Card card = 2; + * @param \Google\Apps\Card\V1\Card $var + * @return $this + */ + public function setCard($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Card::class); + $this->card = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/ChatServiceClient.php b/AppsChat/src/Chat/V1/ChatServiceClient.php new file mode 100644 index 000000000000..9d334642ab7c --- /dev/null +++ b/AppsChat/src/Chat/V1/ChatServiceClient.php @@ -0,0 +1,34 @@ +google.chat.v1.CompleteImportSpaceRequest + */ +class CompleteImportSpaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the import mode space. + * Format: `spaces/{space}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the import mode space. + * Format: `spaces/{space}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Space::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the import mode space. + * Format: `spaces/{space}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the import mode space. + * Format: `spaces/{space}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/CompleteImportSpaceResponse.php b/AppsChat/src/Chat/V1/CompleteImportSpaceResponse.php new file mode 100644 index 000000000000..ba11ebfe4fec --- /dev/null +++ b/AppsChat/src/Chat/V1/CompleteImportSpaceResponse.php @@ -0,0 +1,75 @@ +google.chat.v1.CompleteImportSpaceResponse + */ +class CompleteImportSpaceResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The import mode space. + * + * Generated from protobuf field .google.chat.v1.Space space = 1; + */ + protected $space = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Space $space + * The import mode space. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Space::initOnce(); + parent::__construct($data); + } + + /** + * The import mode space. + * + * Generated from protobuf field .google.chat.v1.Space space = 1; + * @return \Google\Apps\Chat\V1\Space|null + */ + public function getSpace() + { + return $this->space; + } + + public function hasSpace() + { + return isset($this->space); + } + + public function clearSpace() + { + unset($this->space); + } + + /** + * The import mode space. + * + * Generated from protobuf field .google.chat.v1.Space space = 1; + * @param \Google\Apps\Chat\V1\Space $var + * @return $this + */ + public function setSpace($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space::class); + $this->space = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/ContextualAddOnMarkup.php b/AppsChat/src/Chat/V1/ContextualAddOnMarkup.php new file mode 100644 index 000000000000..0eec00f28227 --- /dev/null +++ b/AppsChat/src/Chat/V1/ContextualAddOnMarkup.php @@ -0,0 +1,33 @@ +google.chat.v1.ContextualAddOnMarkup + */ +class ContextualAddOnMarkup extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\ContextualAddon::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card.php b/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card.php new file mode 100644 index 000000000000..9368f85fc88a --- /dev/null +++ b/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card.php @@ -0,0 +1,181 @@ +google.chat.v1.ContextualAddOnMarkup.Card + */ +class Card extends \Google\Protobuf\Internal\Message +{ + /** + * The header of the card. A header usually contains a title and an image. + * + * Generated from protobuf field .google.chat.v1.ContextualAddOnMarkup.Card.CardHeader header = 1; + */ + protected $header = null; + /** + * Sections are separated by a line divider. + * + * Generated from protobuf field repeated .google.chat.v1.ContextualAddOnMarkup.Card.Section sections = 2; + */ + private $sections; + /** + * The actions of this card. + * + * Generated from protobuf field repeated .google.chat.v1.ContextualAddOnMarkup.Card.CardAction card_actions = 3; + */ + private $card_actions; + /** + * Name of the card. + * + * Generated from protobuf field string name = 4; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardHeader $header + * The header of the card. A header usually contains a title and an image. + * @type array<\Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\Section>|\Google\Protobuf\Internal\RepeatedField $sections + * Sections are separated by a line divider. + * @type array<\Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardAction>|\Google\Protobuf\Internal\RepeatedField $card_actions + * The actions of this card. + * @type string $name + * Name of the card. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\ContextualAddon::initOnce(); + parent::__construct($data); + } + + /** + * The header of the card. A header usually contains a title and an image. + * + * Generated from protobuf field .google.chat.v1.ContextualAddOnMarkup.Card.CardHeader header = 1; + * @return \Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardHeader|null + */ + public function getHeader() + { + return $this->header; + } + + public function hasHeader() + { + return isset($this->header); + } + + public function clearHeader() + { + unset($this->header); + } + + /** + * The header of the card. A header usually contains a title and an image. + * + * Generated from protobuf field .google.chat.v1.ContextualAddOnMarkup.Card.CardHeader header = 1; + * @param \Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardHeader $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardHeader::class); + $this->header = $var; + + return $this; + } + + /** + * Sections are separated by a line divider. + * + * Generated from protobuf field repeated .google.chat.v1.ContextualAddOnMarkup.Card.Section sections = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSections() + { + return $this->sections; + } + + /** + * Sections are separated by a line divider. + * + * Generated from protobuf field repeated .google.chat.v1.ContextualAddOnMarkup.Card.Section sections = 2; + * @param array<\Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\Section>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\Section::class); + $this->sections = $arr; + + return $this; + } + + /** + * The actions of this card. + * + * Generated from protobuf field repeated .google.chat.v1.ContextualAddOnMarkup.Card.CardAction card_actions = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCardActions() + { + return $this->card_actions; + } + + /** + * The actions of this card. + * + * Generated from protobuf field repeated .google.chat.v1.ContextualAddOnMarkup.Card.CardAction card_actions = 3; + * @param array<\Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardAction>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCardActions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardAction::class); + $this->card_actions = $arr; + + return $this; + } + + /** + * Name of the card. + * + * Generated from protobuf field string name = 4; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the card. + * + * Generated from protobuf field string name = 4; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/CardAction.php b/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/CardAction.php new file mode 100644 index 000000000000..671e2eaa670c --- /dev/null +++ b/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/CardAction.php @@ -0,0 +1,116 @@ +google.chat.v1.ContextualAddOnMarkup.Card.CardAction + */ +class CardAction extends \Google\Protobuf\Internal\Message +{ + /** + * The label used to be displayed in the action menu item. + * + * Generated from protobuf field string action_label = 1; + */ + protected $action_label = ''; + /** + * The onclick action for this action item. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 2; + */ + protected $on_click = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $action_label + * The label used to be displayed in the action menu item. + * @type \Google\Apps\Chat\V1\WidgetMarkup\OnClick $on_click + * The onclick action for this action item. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\ContextualAddon::initOnce(); + parent::__construct($data); + } + + /** + * The label used to be displayed in the action menu item. + * + * Generated from protobuf field string action_label = 1; + * @return string + */ + public function getActionLabel() + { + return $this->action_label; + } + + /** + * The label used to be displayed in the action menu item. + * + * Generated from protobuf field string action_label = 1; + * @param string $var + * @return $this + */ + public function setActionLabel($var) + { + GPBUtil::checkString($var, True); + $this->action_label = $var; + + return $this; + } + + /** + * The onclick action for this action item. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 2; + * @return \Google\Apps\Chat\V1\WidgetMarkup\OnClick|null + */ + public function getOnClick() + { + return $this->on_click; + } + + public function hasOnClick() + { + return isset($this->on_click); + } + + public function clearOnClick() + { + unset($this->on_click); + } + + /** + * The onclick action for this action item. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 2; + * @param \Google\Apps\Chat\V1\WidgetMarkup\OnClick $var + * @return $this + */ + public function setOnClick($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\OnClick::class); + $this->on_click = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/CardHeader.php b/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/CardHeader.php new file mode 100644 index 000000000000..2ef7eed49c07 --- /dev/null +++ b/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/CardHeader.php @@ -0,0 +1,176 @@ +google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + */ +class CardHeader extends \Google\Protobuf\Internal\Message +{ + /** + * The title must be specified. The header has a fixed height: if both a + * title and subtitle is specified, each takes up one line. If only the + * title is specified, it takes up both lines. + * + * Generated from protobuf field string title = 1; + */ + protected $title = ''; + /** + * The subtitle of the card header. + * + * Generated from protobuf field string subtitle = 2; + */ + protected $subtitle = ''; + /** + * The image's type (for example, square border or circular border). + * + * Generated from protobuf field .google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle image_style = 3; + */ + protected $image_style = 0; + /** + * The URL of the image in the card header. + * + * Generated from protobuf field string image_url = 4; + */ + protected $image_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $title + * The title must be specified. The header has a fixed height: if both a + * title and subtitle is specified, each takes up one line. If only the + * title is specified, it takes up both lines. + * @type string $subtitle + * The subtitle of the card header. + * @type int $image_style + * The image's type (for example, square border or circular border). + * @type string $image_url + * The URL of the image in the card header. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\ContextualAddon::initOnce(); + parent::__construct($data); + } + + /** + * The title must be specified. The header has a fixed height: if both a + * title and subtitle is specified, each takes up one line. If only the + * title is specified, it takes up both lines. + * + * Generated from protobuf field string title = 1; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * The title must be specified. The header has a fixed height: if both a + * title and subtitle is specified, each takes up one line. If only the + * title is specified, it takes up both lines. + * + * Generated from protobuf field string title = 1; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * The subtitle of the card header. + * + * Generated from protobuf field string subtitle = 2; + * @return string + */ + public function getSubtitle() + { + return $this->subtitle; + } + + /** + * The subtitle of the card header. + * + * Generated from protobuf field string subtitle = 2; + * @param string $var + * @return $this + */ + public function setSubtitle($var) + { + GPBUtil::checkString($var, True); + $this->subtitle = $var; + + return $this; + } + + /** + * The image's type (for example, square border or circular border). + * + * Generated from protobuf field .google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle image_style = 3; + * @return int + */ + public function getImageStyle() + { + return $this->image_style; + } + + /** + * The image's type (for example, square border or circular border). + * + * Generated from protobuf field .google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle image_style = 3; + * @param int $var + * @return $this + */ + public function setImageStyle($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardHeader\ImageStyle::class); + $this->image_style = $var; + + return $this; + } + + /** + * The URL of the image in the card header. + * + * Generated from protobuf field string image_url = 4; + * @return string + */ + public function getImageUrl() + { + return $this->image_url; + } + + /** + * The URL of the image in the card header. + * + * Generated from protobuf field string image_url = 4; + * @param string $var + * @return $this + */ + public function setImageUrl($var) + { + GPBUtil::checkString($var, True); + $this->image_url = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/CardHeader/ImageStyle.php b/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/CardHeader/ImageStyle.php new file mode 100644 index 000000000000..9c0d30510390 --- /dev/null +++ b/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/CardHeader/ImageStyle.php @@ -0,0 +1,58 @@ +google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle + */ +class ImageStyle +{ + /** + * Generated from protobuf enum IMAGE_STYLE_UNSPECIFIED = 0; + */ + const IMAGE_STYLE_UNSPECIFIED = 0; + /** + * Square border. + * + * Generated from protobuf enum IMAGE = 1; + */ + const IMAGE = 1; + /** + * Circular border. + * + * Generated from protobuf enum AVATAR = 2; + */ + const AVATAR = 2; + + private static $valueToName = [ + self::IMAGE_STYLE_UNSPECIFIED => 'IMAGE_STYLE_UNSPECIFIED', + self::IMAGE => 'IMAGE', + self::AVATAR => 'AVATAR', + ]; + + 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/ContextualAddOnMarkup/Card/Section.php b/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/Section.php new file mode 100644 index 000000000000..a625a570b0c5 --- /dev/null +++ b/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/Section.php @@ -0,0 +1,137 @@ +google.chat.v1.ContextualAddOnMarkup.Card.Section + */ +class Section extends \Google\Protobuf\Internal\Message +{ + /** + * The header of the section. Formatted text is + * supported. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string header = 1; + */ + protected $header = ''; + /** + * A section must contain at least one widget. + * + * Generated from protobuf field repeated .google.chat.v1.WidgetMarkup widgets = 2; + */ + private $widgets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $header + * The header of the section. Formatted text is + * supported. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * @type array<\Google\Apps\Chat\V1\WidgetMarkup>|\Google\Protobuf\Internal\RepeatedField $widgets + * A section must contain at least one widget. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\ContextualAddon::initOnce(); + parent::__construct($data); + } + + /** + * The header of the section. Formatted text is + * supported. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string header = 1; + * @return string + */ + public function getHeader() + { + return $this->header; + } + + /** + * The header of the section. Formatted text is + * supported. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string header = 1; + * @param string $var + * @return $this + */ + public function setHeader($var) + { + GPBUtil::checkString($var, True); + $this->header = $var; + + return $this; + } + + /** + * A section must contain at least one widget. + * + * Generated from protobuf field repeated .google.chat.v1.WidgetMarkup widgets = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWidgets() + { + return $this->widgets; + } + + /** + * A section must contain at least one widget. + * + * Generated from protobuf field repeated .google.chat.v1.WidgetMarkup widgets = 2; + * @param array<\Google\Apps\Chat\V1\WidgetMarkup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWidgets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\WidgetMarkup::class); + $this->widgets = $arr; + + return $this; + } + +} + + diff --git a/AppsChat/src/Chat/V1/CreateMembershipRequest.php b/AppsChat/src/Chat/V1/CreateMembershipRequest.php new file mode 100644 index 000000000000..78f625e2bba8 --- /dev/null +++ b/AppsChat/src/Chat/V1/CreateMembershipRequest.php @@ -0,0 +1,177 @@ +google.chat.v1.CreateMembershipRequest + */ +class CreateMembershipRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the space for which to create the + * membership. + * Format: spaces/{space} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The membership relation to create. + * The `memberType` field must contain a user with the `user.name` and + * `user.type` fields populated. The server will assign a resource name + * and overwrite anything specified. + * When a Chat app creates a membership relation for a human user, it must use + * the `chat.memberships` scope, set `user.type` to `HUMAN`, and set + * `user.name` with format `users/{user}`, where `{user}` can be the email + * address for the user. For users in the same Workspace organization `{user}` + * can also be the `id` of the + * [person](https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the user in the Directory API. For example, if + * the People API Person profile ID for `user@example.com` is `123456789`, you + * can add the user to the space by setting the `membership.member.name` to + * `users/user@example.com` or `users/123456789`. When a Chat app creates a + * membership relation for itself, it must use the `chat.memberships.app` + * scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + * + * Generated from protobuf field .google.chat.v1.Membership membership = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $membership = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the space for which to create the + * membership. + * Format: spaces/{space} + * @type \Google\Apps\Chat\V1\Membership $membership + * Required. The membership relation to create. + * The `memberType` field must contain a user with the `user.name` and + * `user.type` fields populated. The server will assign a resource name + * and overwrite anything specified. + * When a Chat app creates a membership relation for a human user, it must use + * the `chat.memberships` scope, set `user.type` to `HUMAN`, and set + * `user.name` with format `users/{user}`, where `{user}` can be the email + * address for the user. For users in the same Workspace organization `{user}` + * can also be the `id` of the + * [person](https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the user in the Directory API. For example, if + * the People API Person profile ID for `user@example.com` is `123456789`, you + * can add the user to the space by setting the `membership.member.name` to + * `users/user@example.com` or `users/123456789`. When a Chat app creates a + * membership relation for itself, it must use the `chat.memberships.app` + * scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Membership::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the space for which to create the + * membership. + * Format: spaces/{space} + * + * 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 for which to create the + * membership. + * Format: spaces/{space} + * + * 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. The membership relation to create. + * The `memberType` field must contain a user with the `user.name` and + * `user.type` fields populated. The server will assign a resource name + * and overwrite anything specified. + * When a Chat app creates a membership relation for a human user, it must use + * the `chat.memberships` scope, set `user.type` to `HUMAN`, and set + * `user.name` with format `users/{user}`, where `{user}` can be the email + * address for the user. For users in the same Workspace organization `{user}` + * can also be the `id` of the + * [person](https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the user in the Directory API. For example, if + * the People API Person profile ID for `user@example.com` is `123456789`, you + * can add the user to the space by setting the `membership.member.name` to + * `users/user@example.com` or `users/123456789`. When a Chat app creates a + * membership relation for itself, it must use the `chat.memberships.app` + * scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + * + * Generated from protobuf field .google.chat.v1.Membership membership = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Apps\Chat\V1\Membership|null + */ + public function getMembership() + { + return $this->membership; + } + + public function hasMembership() + { + return isset($this->membership); + } + + public function clearMembership() + { + unset($this->membership); + } + + /** + * Required. The membership relation to create. + * The `memberType` field must contain a user with the `user.name` and + * `user.type` fields populated. The server will assign a resource name + * and overwrite anything specified. + * When a Chat app creates a membership relation for a human user, it must use + * the `chat.memberships` scope, set `user.type` to `HUMAN`, and set + * `user.name` with format `users/{user}`, where `{user}` can be the email + * address for the user. For users in the same Workspace organization `{user}` + * can also be the `id` of the + * [person](https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the user in the Directory API. For example, if + * the People API Person profile ID for `user@example.com` is `123456789`, you + * can add the user to the space by setting the `membership.member.name` to + * `users/user@example.com` or `users/123456789`. When a Chat app creates a + * membership relation for itself, it must use the `chat.memberships.app` + * scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + * + * Generated from protobuf field .google.chat.v1.Membership membership = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Apps\Chat\V1\Membership $var + * @return $this + */ + public function setMembership($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Membership::class); + $this->membership = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/CreateMessageRequest.php b/AppsChat/src/Chat/V1/CreateMessageRequest.php new file mode 100644 index 000000000000..91b17b9c03fd --- /dev/null +++ b/AppsChat/src/Chat/V1/CreateMessageRequest.php @@ -0,0 +1,336 @@ +google.chat.v1.CreateMessageRequest + */ +class CreateMessageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the space in which to create a message. + * Format: `spaces/{space}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Message body. + * + * Generated from protobuf field .google.chat.v1.Message message = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $message = null; + /** + * Optional. Deprecated: Use + * [thread.thread_key][google.chat.v1.Thread.thread_key] instead. ID for the + * thread. Supports up to 4000 characters. To start or add to a thread, create + * a message and specify a `threadKey` or the + * [thread.name][google.chat.v1.Thread.name]. For example usage, see [Start or + * reply to a message + * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * + * Generated from protobuf field string thread_key = 6 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @deprecated + */ + protected $thread_key = ''; + /** + * Optional. A unique request ID for this message. Specifying an existing + * request ID returns the message created with that ID instead of creating a + * new message. + * + * Generated from protobuf field string request_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. Specifies whether a message starts a thread or replies to one. + * Only supported in named spaces. + * + * Generated from protobuf field .google.chat.v1.CreateMessageRequest.MessageReplyOption message_reply_option = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $message_reply_option = 0; + /** + * Optional. A custom ID for a message. Lets Chat apps get, update, or delete + * a message without needing to store the system-assigned ID in the message's + * resource name (represented in the message `name` field). + * The value for this field must meet the following requirements: + * * Begins with `client-`. For example, `client-custom-name` is a valid + * custom ID, but `custom-name` is not. + * * Contains up to 63 characters and only lowercase letters, numbers, and + * hyphens. + * * Is unique within a space. A Chat app can't use the same custom ID for + * different messages. + * For details, see [Name a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string message_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $message_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the space in which to create a message. + * Format: `spaces/{space}` + * @type \Google\Apps\Chat\V1\Message $message + * Required. Message body. + * @type string $thread_key + * Optional. Deprecated: Use + * [thread.thread_key][google.chat.v1.Thread.thread_key] instead. ID for the + * thread. Supports up to 4000 characters. To start or add to a thread, create + * a message and specify a `threadKey` or the + * [thread.name][google.chat.v1.Thread.name]. For example usage, see [Start or + * reply to a message + * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * @type string $request_id + * Optional. A unique request ID for this message. Specifying an existing + * request ID returns the message created with that ID instead of creating a + * new message. + * @type int $message_reply_option + * Optional. Specifies whether a message starts a thread or replies to one. + * Only supported in named spaces. + * @type string $message_id + * Optional. A custom ID for a message. Lets Chat apps get, update, or delete + * a message without needing to store the system-assigned ID in the message's + * resource name (represented in the message `name` field). + * The value for this field must meet the following requirements: + * * Begins with `client-`. For example, `client-custom-name` is a valid + * custom ID, but `custom-name` is not. + * * Contains up to 63 characters and only lowercase letters, numbers, and + * hyphens. + * * Is unique within a space. A Chat app can't use the same custom ID for + * different messages. + * For details, see [Name a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the space in which to create a message. + * Format: `spaces/{space}` + * + * 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 in which to create a message. + * Format: `spaces/{space}` + * + * 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. Message body. + * + * Generated from protobuf field .google.chat.v1.Message message = 4 [(.google.api.field_behavior) = REQUIRED]; + * @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); + } + + /** + * Required. Message body. + * + * Generated from protobuf field .google.chat.v1.Message message = 4 [(.google.api.field_behavior) = REQUIRED]; + * @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; + } + + /** + * Optional. Deprecated: Use + * [thread.thread_key][google.chat.v1.Thread.thread_key] instead. ID for the + * thread. Supports up to 4000 characters. To start or add to a thread, create + * a message and specify a `threadKey` or the + * [thread.name][google.chat.v1.Thread.name]. For example usage, see [Start or + * reply to a message + * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * + * Generated from protobuf field string thread_key = 6 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @return string + * @deprecated + */ + public function getThreadKey() + { + @trigger_error('thread_key is deprecated.', E_USER_DEPRECATED); + return $this->thread_key; + } + + /** + * Optional. Deprecated: Use + * [thread.thread_key][google.chat.v1.Thread.thread_key] instead. ID for the + * thread. Supports up to 4000 characters. To start or add to a thread, create + * a message and specify a `threadKey` or the + * [thread.name][google.chat.v1.Thread.name]. For example usage, see [Start or + * reply to a message + * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * + * Generated from protobuf field string thread_key = 6 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + * @deprecated + */ + public function setThreadKey($var) + { + @trigger_error('thread_key is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->thread_key = $var; + + return $this; + } + + /** + * Optional. A unique request ID for this message. Specifying an existing + * request ID returns the message created with that ID instead of creating a + * new message. + * + * Generated from protobuf field string request_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A unique request ID for this message. Specifying an existing + * request ID returns the message created with that ID instead of creating a + * new message. + * + * Generated from protobuf field string request_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. Specifies whether a message starts a thread or replies to one. + * Only supported in named spaces. + * + * Generated from protobuf field .google.chat.v1.CreateMessageRequest.MessageReplyOption message_reply_option = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMessageReplyOption() + { + return $this->message_reply_option; + } + + /** + * Optional. Specifies whether a message starts a thread or replies to one. + * Only supported in named spaces. + * + * Generated from protobuf field .google.chat.v1.CreateMessageRequest.MessageReplyOption message_reply_option = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMessageReplyOption($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\CreateMessageRequest\MessageReplyOption::class); + $this->message_reply_option = $var; + + return $this; + } + + /** + * Optional. A custom ID for a message. Lets Chat apps get, update, or delete + * a message without needing to store the system-assigned ID in the message's + * resource name (represented in the message `name` field). + * The value for this field must meet the following requirements: + * * Begins with `client-`. For example, `client-custom-name` is a valid + * custom ID, but `custom-name` is not. + * * Contains up to 63 characters and only lowercase letters, numbers, and + * hyphens. + * * Is unique within a space. A Chat app can't use the same custom ID for + * different messages. + * For details, see [Name a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string message_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMessageId() + { + return $this->message_id; + } + + /** + * Optional. A custom ID for a message. Lets Chat apps get, update, or delete + * a message without needing to store the system-assigned ID in the message's + * resource name (represented in the message `name` field). + * The value for this field must meet the following requirements: + * * Begins with `client-`. For example, `client-custom-name` is a valid + * custom ID, but `custom-name` is not. + * * Contains up to 63 characters and only lowercase letters, numbers, and + * hyphens. + * * Is unique within a space. A Chat app can't use the same custom ID for + * different messages. + * For details, see [Name a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string message_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMessageId($var) + { + GPBUtil::checkString($var, True); + $this->message_id = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/CreateMessageRequest/MessageReplyOption.php b/AppsChat/src/Chat/V1/CreateMessageRequest/MessageReplyOption.php new file mode 100644 index 000000000000..64d70a2fad81 --- /dev/null +++ b/AppsChat/src/Chat/V1/CreateMessageRequest/MessageReplyOption.php @@ -0,0 +1,72 @@ +google.chat.v1.CreateMessageRequest.MessageReplyOption + */ +class MessageReplyOption +{ + /** + * Default. Starts a new thread. Using this option ignores any [thread + * ID][google.chat.v1.Thread.name] or + * [`thread_key`][google.chat.v1.Thread.thread_key] that's included. + * + * Generated from protobuf enum MESSAGE_REPLY_OPTION_UNSPECIFIED = 0; + */ + const MESSAGE_REPLY_OPTION_UNSPECIFIED = 0; + /** + * Creates the message as a reply to the thread specified by [thread + * ID][google.chat.v1.Thread.name] or + * [`thread_key`][google.chat.v1.Thread.thread_key]. If it fails, the + * message starts a new thread instead. + * + * Generated from protobuf enum REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD = 1; + */ + const REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD = 1; + /** + * Creates the message as a reply to the thread specified by [thread + * ID][google.chat.v1.Thread.name] or + * [`thread_key`][google.chat.v1.Thread.thread_key]. If a new `thread_key` + * is used, a new thread is created. If the message creation fails, a + * `NOT_FOUND` error is returned instead. + * + * Generated from protobuf enum REPLY_MESSAGE_OR_FAIL = 2; + */ + const REPLY_MESSAGE_OR_FAIL = 2; + + private static $valueToName = [ + self::MESSAGE_REPLY_OPTION_UNSPECIFIED => 'MESSAGE_REPLY_OPTION_UNSPECIFIED', + self::REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD => 'REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD', + self::REPLY_MESSAGE_OR_FAIL => 'REPLY_MESSAGE_OR_FAIL', + ]; + + 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/CreateReactionRequest.php b/AppsChat/src/Chat/V1/CreateReactionRequest.php new file mode 100644 index 000000000000..44c48dde1b3f --- /dev/null +++ b/AppsChat/src/Chat/V1/CreateReactionRequest.php @@ -0,0 +1,115 @@ +google.chat.v1.CreateReactionRequest + */ +class CreateReactionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The message where the reaction is created. + * Format: `spaces/{space}/messages/{message}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The reaction to create. + * + * Generated from protobuf field .google.chat.v1.Reaction reaction = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $reaction = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The message where the reaction is created. + * Format: `spaces/{space}/messages/{message}` + * @type \Google\Apps\Chat\V1\Reaction $reaction + * Required. The reaction to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Reaction::initOnce(); + parent::__construct($data); + } + + /** + * Required. The message where the reaction is created. + * Format: `spaces/{space}/messages/{message}` + * + * 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 message where the reaction is created. + * Format: `spaces/{space}/messages/{message}` + * + * 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. The reaction to create. + * + * Generated from protobuf field .google.chat.v1.Reaction reaction = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Apps\Chat\V1\Reaction|null + */ + public function getReaction() + { + return $this->reaction; + } + + public function hasReaction() + { + return isset($this->reaction); + } + + public function clearReaction() + { + unset($this->reaction); + } + + /** + * Required. The reaction to create. + * + * Generated from protobuf field .google.chat.v1.Reaction reaction = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Apps\Chat\V1\Reaction $var + * @return $this + */ + public function setReaction($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Reaction::class); + $this->reaction = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/CreateSpaceRequest.php b/AppsChat/src/Chat/V1/CreateSpaceRequest.php new file mode 100644 index 000000000000..f5fbb018efa5 --- /dev/null +++ b/AppsChat/src/Chat/V1/CreateSpaceRequest.php @@ -0,0 +1,153 @@ +google.chat.v1.CreateSpaceRequest + */ +class CreateSpaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `displayName` and `spaceType` fields must be populated. Only + * `SpaceType.SPACE` is supported. + * If you receive the error message `ALREADY_EXISTS` when creating a space, + * try a different `displayName`. An existing space within the Google + * Workspace organization might already use this display name. + * The space `name` is assigned on the server so anything specified in this + * field will be ignored. + * + * Generated from protobuf field .google.chat.v1.Space space = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $space = null; + /** + * Optional. A unique identifier for this request. + * A random UUID is recommended. + * Specifying an existing request ID returns the space created with that ID + * instead of creating a new space. + * Specifying an existing request ID from the same Chat app with a different + * authenticated user returns an error. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Space $space + * Required. The `displayName` and `spaceType` fields must be populated. Only + * `SpaceType.SPACE` is supported. + * If you receive the error message `ALREADY_EXISTS` when creating a space, + * try a different `displayName`. An existing space within the Google + * Workspace organization might already use this display name. + * The space `name` is assigned on the server so anything specified in this + * field will be ignored. + * @type string $request_id + * Optional. A unique identifier for this request. + * A random UUID is recommended. + * Specifying an existing request ID returns the space created with that ID + * instead of creating a new space. + * Specifying an existing request ID from the same Chat app with a different + * authenticated user returns an error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Space::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `displayName` and `spaceType` fields must be populated. Only + * `SpaceType.SPACE` is supported. + * If you receive the error message `ALREADY_EXISTS` when creating a space, + * try a different `displayName`. An existing space within the Google + * Workspace organization might already use this display name. + * The space `name` is assigned on the server so anything specified in this + * field will be ignored. + * + * Generated from protobuf field .google.chat.v1.Space space = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Apps\Chat\V1\Space|null + */ + public function getSpace() + { + return $this->space; + } + + public function hasSpace() + { + return isset($this->space); + } + + public function clearSpace() + { + unset($this->space); + } + + /** + * Required. The `displayName` and `spaceType` fields must be populated. Only + * `SpaceType.SPACE` is supported. + * If you receive the error message `ALREADY_EXISTS` when creating a space, + * try a different `displayName`. An existing space within the Google + * Workspace organization might already use this display name. + * The space `name` is assigned on the server so anything specified in this + * field will be ignored. + * + * Generated from protobuf field .google.chat.v1.Space space = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Apps\Chat\V1\Space $var + * @return $this + */ + public function setSpace($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space::class); + $this->space = $var; + + return $this; + } + + /** + * Optional. A unique identifier for this request. + * A random UUID is recommended. + * Specifying an existing request ID returns the space created with that ID + * instead of creating a new space. + * Specifying an existing request ID from the same Chat app with a different + * authenticated user returns an error. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A unique identifier for this request. + * A random UUID is recommended. + * Specifying an existing request ID returns the space created with that ID + * instead of creating a new space. + * Specifying an existing request ID from the same Chat app with a different + * authenticated user returns an error. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/CustomEmoji.php b/AppsChat/src/Chat/V1/CustomEmoji.php new file mode 100644 index 000000000000..3b3f7b630a5e --- /dev/null +++ b/AppsChat/src/Chat/V1/CustomEmoji.php @@ -0,0 +1,67 @@ +google.chat.v1.CustomEmoji + */ +class CustomEmoji extends \Google\Protobuf\Internal\Message +{ + /** + * Unique key for the custom emoji resource. + * + * Generated from protobuf field string uid = 1; + */ + protected $uid = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uid + * Unique key for the custom emoji resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Reaction::initOnce(); + parent::__construct($data); + } + + /** + * Unique key for the custom emoji resource. + * + * Generated from protobuf field string uid = 1; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Unique key for the custom emoji resource. + * + * Generated from protobuf field string uid = 1; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/DeleteMembershipRequest.php b/AppsChat/src/Chat/V1/DeleteMembershipRequest.php new file mode 100644 index 000000000000..21330bfbad0b --- /dev/null +++ b/AppsChat/src/Chat/V1/DeleteMembershipRequest.php @@ -0,0 +1,105 @@ +google.chat.v1.DeleteMembershipRequest + */ +class DeleteMembershipRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the membership to delete. Chat apps can delete + * human users' or their own memberships. Chat apps can't delete other apps' + * memberships. + * When deleting a human membership, requires the `chat.memberships` scope and + * `spaces/{space}/members/{member}` format. You can use the email as an + * alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + * When deleting an app membership, requires the `chat.memberships.app` scope + * and `spaces/{space}/members/app` format. + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the membership to delete. Chat apps can delete + * human users' or their own memberships. Chat apps can't delete other apps' + * memberships. + * When deleting a human membership, requires the `chat.memberships` scope and + * `spaces/{space}/members/{member}` format. You can use the email as an + * alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + * When deleting an app membership, requires the `chat.memberships.app` scope + * and `spaces/{space}/members/app` format. + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Membership::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the membership to delete. Chat apps can delete + * human users' or their own memberships. Chat apps can't delete other apps' + * memberships. + * When deleting a human membership, requires the `chat.memberships` scope and + * `spaces/{space}/members/{member}` format. You can use the email as an + * alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + * When deleting an app membership, requires the `chat.memberships.app` scope + * and `spaces/{space}/members/app` format. + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the membership to delete. Chat apps can delete + * human users' or their own memberships. Chat apps can't delete other apps' + * memberships. + * When deleting a human membership, requires the `chat.memberships` scope and + * `spaces/{space}/members/{member}` format. You can use the email as an + * alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + * When deleting an app membership, requires the `chat.memberships.app` scope + * and `spaces/{space}/members/app` format. + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/DeleteMessageRequest.php b/AppsChat/src/Chat/V1/DeleteMessageRequest.php new file mode 100644 index 000000000000..31e227c56f16 --- /dev/null +++ b/AppsChat/src/Chat/V1/DeleteMessageRequest.php @@ -0,0 +1,139 @@ +google.chat.v1.DeleteMessageRequest + */ +class DeleteMessageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the message. + * Format: `spaces/{space}/messages/{message}` + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a + * message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * When `true`, deleting a message also deletes its threaded replies. When + * `false`, if a message has threaded replies, deletion fails. + * Only applies when [authenticating as a + * user](https://developers.google.com/chat/api/guides/auth/users). Has no + * effect when [authenticating as a Chat app] + * (https://developers.google.com/chat/api/guides/auth/service-accounts). + * + * Generated from protobuf field bool force = 2; + */ + protected $force = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the message. + * Format: `spaces/{space}/messages/{message}` + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a + * message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * @type bool $force + * When `true`, deleting a message also deletes its threaded replies. When + * `false`, if a message has threaded replies, deletion fails. + * Only applies when [authenticating as a + * user](https://developers.google.com/chat/api/guides/auth/users). Has no + * effect when [authenticating as a Chat app] + * (https://developers.google.com/chat/api/guides/auth/service-accounts). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the message. + * Format: `spaces/{space}/messages/{message}` + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a + * message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the message. + * Format: `spaces/{space}/messages/{message}` + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a + * message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * When `true`, deleting a message also deletes its threaded replies. When + * `false`, if a message has threaded replies, deletion fails. + * Only applies when [authenticating as a + * user](https://developers.google.com/chat/api/guides/auth/users). Has no + * effect when [authenticating as a Chat app] + * (https://developers.google.com/chat/api/guides/auth/service-accounts). + * + * Generated from protobuf field bool force = 2; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * When `true`, deleting a message also deletes its threaded replies. When + * `false`, if a message has threaded replies, deletion fails. + * Only applies when [authenticating as a + * user](https://developers.google.com/chat/api/guides/auth/users). Has no + * effect when [authenticating as a Chat app] + * (https://developers.google.com/chat/api/guides/auth/service-accounts). + * + * Generated from protobuf field bool force = 2; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/DeleteReactionRequest.php b/AppsChat/src/Chat/V1/DeleteReactionRequest.php new file mode 100644 index 000000000000..cc43076facf9 --- /dev/null +++ b/AppsChat/src/Chat/V1/DeleteReactionRequest.php @@ -0,0 +1,71 @@ +google.chat.v1.DeleteReactionRequest + */ +class DeleteReactionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the reaction to delete. + * Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the reaction to delete. + * Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Reaction::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the reaction to delete. + * Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the reaction to delete. + * Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/DeleteSpaceRequest.php b/AppsChat/src/Chat/V1/DeleteSpaceRequest.php new file mode 100644 index 000000000000..e52e3b11acac --- /dev/null +++ b/AppsChat/src/Chat/V1/DeleteSpaceRequest.php @@ -0,0 +1,71 @@ +google.chat.v1.DeleteSpaceRequest + */ +class DeleteSpaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the space to delete. + * Format: `spaces/{space}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the space to delete. + * Format: `spaces/{space}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Space::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the space to delete. + * Format: `spaces/{space}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the space to delete. + * Format: `spaces/{space}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/DeletionMetadata.php b/AppsChat/src/Chat/V1/DeletionMetadata.php new file mode 100644 index 000000000000..cd50e1dc6aa7 --- /dev/null +++ b/AppsChat/src/Chat/V1/DeletionMetadata.php @@ -0,0 +1,68 @@ +google.chat.v1.DeletionMetadata + */ +class DeletionMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates who deleted the message. + * + * Generated from protobuf field .google.chat.v1.DeletionMetadata.DeletionType deletion_type = 1; + */ + protected $deletion_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $deletion_type + * Indicates who deleted the message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\DeletionMetadata::initOnce(); + parent::__construct($data); + } + + /** + * Indicates who deleted the message. + * + * Generated from protobuf field .google.chat.v1.DeletionMetadata.DeletionType deletion_type = 1; + * @return int + */ + public function getDeletionType() + { + return $this->deletion_type; + } + + /** + * Indicates who deleted the message. + * + * Generated from protobuf field .google.chat.v1.DeletionMetadata.DeletionType deletion_type = 1; + * @param int $var + * @return $this + */ + public function setDeletionType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\DeletionMetadata\DeletionType::class); + $this->deletion_type = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/DeletionMetadata/DeletionType.php b/AppsChat/src/Chat/V1/DeletionMetadata/DeletionType.php new file mode 100644 index 000000000000..ac33dde93590 --- /dev/null +++ b/AppsChat/src/Chat/V1/DeletionMetadata/DeletionType.php @@ -0,0 +1,90 @@ +google.chat.v1.DeletionMetadata.DeletionType + */ +class DeletionType +{ + /** + * This value is unused. + * + * Generated from protobuf enum DELETION_TYPE_UNSPECIFIED = 0; + */ + const DELETION_TYPE_UNSPECIFIED = 0; + /** + * User deleted their own message. + * + * Generated from protobuf enum CREATOR = 1; + */ + const CREATOR = 1; + /** + * The space owner deleted the message. + * + * Generated from protobuf enum SPACE_OWNER = 2; + */ + const SPACE_OWNER = 2; + /** + * A Google Workspace admin deleted the message. + * + * Generated from protobuf enum ADMIN = 3; + */ + const ADMIN = 3; + /** + * A Chat app deleted its own message when it expired. + * + * Generated from protobuf enum APP_MESSAGE_EXPIRY = 4; + */ + const APP_MESSAGE_EXPIRY = 4; + /** + * A Chat app deleted the message on behalf of the user. + * + * Generated from protobuf enum CREATOR_VIA_APP = 5; + */ + const CREATOR_VIA_APP = 5; + /** + * A Chat app deleted the message on behalf of the space owner. + * + * Generated from protobuf enum SPACE_OWNER_VIA_APP = 6; + */ + const SPACE_OWNER_VIA_APP = 6; + + private static $valueToName = [ + self::DELETION_TYPE_UNSPECIFIED => 'DELETION_TYPE_UNSPECIFIED', + self::CREATOR => 'CREATOR', + self::SPACE_OWNER => 'SPACE_OWNER', + self::ADMIN => 'ADMIN', + self::APP_MESSAGE_EXPIRY => 'APP_MESSAGE_EXPIRY', + self::CREATOR_VIA_APP => 'CREATOR_VIA_APP', + self::SPACE_OWNER_VIA_APP => 'SPACE_OWNER_VIA_APP', + ]; + + 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/Dialog.php b/AppsChat/src/Chat/V1/Dialog.php new file mode 100644 index 000000000000..86434601a751 --- /dev/null +++ b/AppsChat/src/Chat/V1/Dialog.php @@ -0,0 +1,85 @@ +google.chat.v1.Dialog + */ +class Dialog extends \Google\Protobuf\Internal\Message +{ + /** + * Input only. Body of the dialog, which is rendered in a modal. + * Google Chat apps don't support the following card entities: + * `DateTimePicker`, `OnChangeAction`. + * + * Generated from protobuf field .google.apps.card.v1.Card body = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $body = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Card\V1\Card $body + * Input only. Body of the dialog, which is rendered in a modal. + * Google Chat apps don't support the following card entities: + * `DateTimePicker`, `OnChangeAction`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * Input only. Body of the dialog, which is rendered in a modal. + * Google Chat apps don't support the following card entities: + * `DateTimePicker`, `OnChangeAction`. + * + * Generated from protobuf field .google.apps.card.v1.Card body = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Apps\Card\V1\Card|null + */ + public function getBody() + { + return $this->body; + } + + public function hasBody() + { + return isset($this->body); + } + + public function clearBody() + { + unset($this->body); + } + + /** + * Input only. Body of the dialog, which is rendered in a modal. + * Google Chat apps don't support the following card entities: + * `DateTimePicker`, `OnChangeAction`. + * + * Generated from protobuf field .google.apps.card.v1.Card body = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Apps\Card\V1\Card $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\Card::class); + $this->body = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/DialogAction.php b/AppsChat/src/Chat/V1/DialogAction.php new file mode 100644 index 000000000000..3b0653745886 --- /dev/null +++ b/AppsChat/src/Chat/V1/DialogAction.php @@ -0,0 +1,136 @@ +google.chat.v1.DialogAction + */ +class DialogAction extends \Google\Protobuf\Internal\Message +{ + /** + * Input only. Status for a request to either invoke or submit a + * [dialog](https://developers.google.com/chat/how-tos/dialogs). Displays + * a status and message to users, if necessary. + * For example, in case of an error or success. + * + * Generated from protobuf field .google.chat.v1.ActionStatus action_status = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $action_status = null; + protected $action; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Dialog $dialog + * Input only. [Dialog](https://developers.google.com/chat/how-tos/dialogs) + * for the request. + * @type \Google\Apps\Chat\V1\ActionStatus $action_status + * Input only. Status for a request to either invoke or submit a + * [dialog](https://developers.google.com/chat/how-tos/dialogs). Displays + * a status and message to users, if necessary. + * For example, in case of an error or success. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * Input only. [Dialog](https://developers.google.com/chat/how-tos/dialogs) + * for the request. + * + * Generated from protobuf field .google.chat.v1.Dialog dialog = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Apps\Chat\V1\Dialog|null + */ + public function getDialog() + { + return $this->readOneof(1); + } + + public function hasDialog() + { + return $this->hasOneof(1); + } + + /** + * Input only. [Dialog](https://developers.google.com/chat/how-tos/dialogs) + * for the request. + * + * Generated from protobuf field .google.chat.v1.Dialog dialog = 1 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Apps\Chat\V1\Dialog $var + * @return $this + */ + public function setDialog($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Dialog::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Input only. Status for a request to either invoke or submit a + * [dialog](https://developers.google.com/chat/how-tos/dialogs). Displays + * a status and message to users, if necessary. + * For example, in case of an error or success. + * + * Generated from protobuf field .google.chat.v1.ActionStatus action_status = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Apps\Chat\V1\ActionStatus|null + */ + public function getActionStatus() + { + return $this->action_status; + } + + public function hasActionStatus() + { + return isset($this->action_status); + } + + public function clearActionStatus() + { + unset($this->action_status); + } + + /** + * Input only. Status for a request to either invoke or submit a + * [dialog](https://developers.google.com/chat/how-tos/dialogs). Displays + * a status and message to users, if necessary. + * For example, in case of an error or success. + * + * Generated from protobuf field .google.chat.v1.ActionStatus action_status = 2 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Apps\Chat\V1\ActionStatus $var + * @return $this + */ + public function setActionStatus($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\ActionStatus::class); + $this->action_status = $var; + + return $this; + } + + /** + * @return string + */ + public function getAction() + { + return $this->whichOneof("action"); + } + +} + diff --git a/AppsChat/src/Chat/V1/DriveDataRef.php b/AppsChat/src/Chat/V1/DriveDataRef.php new file mode 100644 index 000000000000..9c6bf3e9e6b9 --- /dev/null +++ b/AppsChat/src/Chat/V1/DriveDataRef.php @@ -0,0 +1,67 @@ +google.chat.v1.DriveDataRef + */ +class DriveDataRef extends \Google\Protobuf\Internal\Message +{ + /** + * The ID for the drive file. Use with the Drive API. + * + * Generated from protobuf field string drive_file_id = 2; + */ + protected $drive_file_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $drive_file_id + * The ID for the drive file. Use with the Drive API. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Attachment::initOnce(); + parent::__construct($data); + } + + /** + * The ID for the drive file. Use with the Drive API. + * + * Generated from protobuf field string drive_file_id = 2; + * @return string + */ + public function getDriveFileId() + { + return $this->drive_file_id; + } + + /** + * The ID for the drive file. Use with the Drive API. + * + * Generated from protobuf field string drive_file_id = 2; + * @param string $var + * @return $this + */ + public function setDriveFileId($var) + { + GPBUtil::checkString($var, True); + $this->drive_file_id = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/DriveLinkData.php b/AppsChat/src/Chat/V1/DriveLinkData.php new file mode 100644 index 000000000000..4693e82450fc --- /dev/null +++ b/AppsChat/src/Chat/V1/DriveLinkData.php @@ -0,0 +1,119 @@ +google.chat.v1.DriveLinkData + */ +class DriveLinkData extends \Google\Protobuf\Internal\Message +{ + /** + * A + * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) + * which references a Google Drive file. + * + * Generated from protobuf field .google.chat.v1.DriveDataRef drive_data_ref = 1; + */ + protected $drive_data_ref = null; + /** + * The mime type of the linked Google Drive resource. + * + * Generated from protobuf field string mime_type = 2; + */ + protected $mime_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\DriveDataRef $drive_data_ref + * A + * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) + * which references a Google Drive file. + * @type string $mime_type + * The mime type of the linked Google Drive resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Annotation::initOnce(); + parent::__construct($data); + } + + /** + * A + * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) + * which references a Google Drive file. + * + * Generated from protobuf field .google.chat.v1.DriveDataRef drive_data_ref = 1; + * @return \Google\Apps\Chat\V1\DriveDataRef|null + */ + public function getDriveDataRef() + { + return $this->drive_data_ref; + } + + public function hasDriveDataRef() + { + return isset($this->drive_data_ref); + } + + public function clearDriveDataRef() + { + unset($this->drive_data_ref); + } + + /** + * A + * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) + * which references a Google Drive file. + * + * Generated from protobuf field .google.chat.v1.DriveDataRef drive_data_ref = 1; + * @param \Google\Apps\Chat\V1\DriveDataRef $var + * @return $this + */ + public function setDriveDataRef($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\DriveDataRef::class); + $this->drive_data_ref = $var; + + return $this; + } + + /** + * The mime type of the linked Google Drive resource. + * + * Generated from protobuf field string mime_type = 2; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * The mime type of the linked Google Drive resource. + * + * Generated from protobuf field string mime_type = 2; + * @param string $var + * @return $this + */ + public function setMimeType($var) + { + GPBUtil::checkString($var, True); + $this->mime_type = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/Emoji.php b/AppsChat/src/Chat/V1/Emoji.php new file mode 100644 index 000000000000..c4efb005ee19 --- /dev/null +++ b/AppsChat/src/Chat/V1/Emoji.php @@ -0,0 +1,108 @@ +google.chat.v1.Emoji + */ +class Emoji extends \Google\Protobuf\Internal\Message +{ + protected $content; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $unicode + * A basic emoji represented by a unicode string. + * @type \Google\Apps\Chat\V1\CustomEmoji $custom_emoji + * Output only. A custom emoji. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Reaction::initOnce(); + parent::__construct($data); + } + + /** + * A basic emoji represented by a unicode string. + * + * Generated from protobuf field string unicode = 1; + * @return string + */ + public function getUnicode() + { + return $this->readOneof(1); + } + + public function hasUnicode() + { + return $this->hasOneof(1); + } + + /** + * A basic emoji represented by a unicode string. + * + * Generated from protobuf field string unicode = 1; + * @param string $var + * @return $this + */ + public function setUnicode($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Output only. A custom emoji. + * + * Generated from protobuf field .google.chat.v1.CustomEmoji custom_emoji = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Apps\Chat\V1\CustomEmoji|null + */ + public function getCustomEmoji() + { + return $this->readOneof(2); + } + + public function hasCustomEmoji() + { + return $this->hasOneof(2); + } + + /** + * Output only. A custom emoji. + * + * Generated from protobuf field .google.chat.v1.CustomEmoji custom_emoji = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Apps\Chat\V1\CustomEmoji $var + * @return $this + */ + public function setCustomEmoji($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\CustomEmoji::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getContent() + { + return $this->whichOneof("content"); + } + +} + diff --git a/AppsChat/src/Chat/V1/EmojiReactionSummary.php b/AppsChat/src/Chat/V1/EmojiReactionSummary.php new file mode 100644 index 000000000000..c607da712f81 --- /dev/null +++ b/AppsChat/src/Chat/V1/EmojiReactionSummary.php @@ -0,0 +1,121 @@ +google.chat.v1.EmojiReactionSummary + */ +class EmojiReactionSummary extends \Google\Protobuf\Internal\Message +{ + /** + * Emoji associated with the reactions. + * + * Generated from protobuf field .google.chat.v1.Emoji emoji = 1; + */ + protected $emoji = null; + /** + * The total number of reactions using the associated emoji. + * + * Generated from protobuf field optional int32 reaction_count = 2; + */ + protected $reaction_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Emoji $emoji + * Emoji associated with the reactions. + * @type int $reaction_count + * The total number of reactions using the associated emoji. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Reaction::initOnce(); + parent::__construct($data); + } + + /** + * Emoji associated with the reactions. + * + * Generated from protobuf field .google.chat.v1.Emoji emoji = 1; + * @return \Google\Apps\Chat\V1\Emoji|null + */ + public function getEmoji() + { + return $this->emoji; + } + + public function hasEmoji() + { + return isset($this->emoji); + } + + public function clearEmoji() + { + unset($this->emoji); + } + + /** + * Emoji associated with the reactions. + * + * Generated from protobuf field .google.chat.v1.Emoji emoji = 1; + * @param \Google\Apps\Chat\V1\Emoji $var + * @return $this + */ + public function setEmoji($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Emoji::class); + $this->emoji = $var; + + return $this; + } + + /** + * The total number of reactions using the associated emoji. + * + * Generated from protobuf field optional int32 reaction_count = 2; + * @return int + */ + public function getReactionCount() + { + return isset($this->reaction_count) ? $this->reaction_count : 0; + } + + public function hasReactionCount() + { + return isset($this->reaction_count); + } + + public function clearReactionCount() + { + unset($this->reaction_count); + } + + /** + * The total number of reactions using the associated emoji. + * + * Generated from protobuf field optional int32 reaction_count = 2; + * @param int $var + * @return $this + */ + public function setReactionCount($var) + { + GPBUtil::checkInt32($var); + $this->reaction_count = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/FindDirectMessageRequest.php b/AppsChat/src/Chat/V1/FindDirectMessageRequest.php new file mode 100644 index 000000000000..e3b5471f5fb6 --- /dev/null +++ b/AppsChat/src/Chat/V1/FindDirectMessageRequest.php @@ -0,0 +1,111 @@ +google.chat.v1.FindDirectMessageRequest + */ +class FindDirectMessageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the user to find direct message with. + * Format: `users/{user}`, where `{user}` is either the `id` for the + * [person](https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the + * [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) + * in the Directory API. For example, if the People API profile ID is + * `123456789`, you can find a direct message with that person by using + * `users/123456789` as the `name`. When [authenticated as a + * user](https://developers.google.com/chat/api/guides/auth/users), you can + * use the email as an alias for `{user}`. For example, + * `users/example@gmail.com` where `example@gmail.com` is the email of the + * Google Chat user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the user to find direct message with. + * Format: `users/{user}`, where `{user}` is either the `id` for the + * [person](https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the + * [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) + * in the Directory API. For example, if the People API profile ID is + * `123456789`, you can find a direct message with that person by using + * `users/123456789` as the `name`. When [authenticated as a + * user](https://developers.google.com/chat/api/guides/auth/users), you can + * use the email as an alias for `{user}`. For example, + * `users/example@gmail.com` where `example@gmail.com` is the email of the + * Google Chat user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Space::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the user to find direct message with. + * Format: `users/{user}`, where `{user}` is either the `id` for the + * [person](https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the + * [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) + * in the Directory API. For example, if the People API profile ID is + * `123456789`, you can find a direct message with that person by using + * `users/123456789` as the `name`. When [authenticated as a + * user](https://developers.google.com/chat/api/guides/auth/users), you can + * use the email as an alias for `{user}`. For example, + * `users/example@gmail.com` where `example@gmail.com` is the email of the + * Google Chat user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the user to find direct message with. + * Format: `users/{user}`, where `{user}` is either the `id` for the + * [person](https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the + * [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) + * in the Directory API. For example, if the People API profile ID is + * `123456789`, you can find a direct message with that person by using + * `users/123456789` as the `name`. When [authenticated as a + * user](https://developers.google.com/chat/api/guides/auth/users), you can + * use the email as an alias for `{user}`. For example, + * `users/example@gmail.com` where `example@gmail.com` is the email of the + * Google Chat user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/Gapic/ChatServiceGapicClient.php b/AppsChat/src/Chat/V1/Gapic/ChatServiceGapicClient.php new file mode 100644 index 000000000000..f7bb1cf7e2cf --- /dev/null +++ b/AppsChat/src/Chat/V1/Gapic/ChatServiceGapicClient.php @@ -0,0 +1,2190 @@ +spaceName('[SPACE]'); + * $response = $chatServiceClient->completeImportSpace($formattedName); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @deprecated This class will be removed in the next major version update. + */ +class ChatServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.chat.v1.ChatService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'chat.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'chat.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/chat.bot', + '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', + ]; + + private static $attachmentNameTemplate; + + private static $membershipNameTemplate; + + private static $messageNameTemplate; + + private static $quotedMessageMetadataNameTemplate; + + private static $reactionNameTemplate; + + private static $spaceNameTemplate; + + private static $threadNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/chat_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/chat_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/chat_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/chat_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getAttachmentNameTemplate() + { + if (self::$attachmentNameTemplate == null) { + self::$attachmentNameTemplate = new PathTemplate('spaces/{space}/messages/{message}/attachments/{attachment}'); + } + + return self::$attachmentNameTemplate; + } + + private static function getMembershipNameTemplate() + { + if (self::$membershipNameTemplate == null) { + self::$membershipNameTemplate = new PathTemplate('spaces/{space}/members/{member}'); + } + + return self::$membershipNameTemplate; + } + + private static function getMessageNameTemplate() + { + if (self::$messageNameTemplate == null) { + self::$messageNameTemplate = new PathTemplate('spaces/{space}/messages/{message}'); + } + + return self::$messageNameTemplate; + } + + private static function getQuotedMessageMetadataNameTemplate() + { + if (self::$quotedMessageMetadataNameTemplate == null) { + self::$quotedMessageMetadataNameTemplate = new PathTemplate('spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}'); + } + + return self::$quotedMessageMetadataNameTemplate; + } + + private static function getReactionNameTemplate() + { + if (self::$reactionNameTemplate == null) { + self::$reactionNameTemplate = new PathTemplate('spaces/{space}/messages/{message}/reactions/{reaction}'); + } + + return self::$reactionNameTemplate; + } + + private static function getSpaceNameTemplate() + { + if (self::$spaceNameTemplate == null) { + self::$spaceNameTemplate = new PathTemplate('spaces/{space}'); + } + + return self::$spaceNameTemplate; + } + + private static function getThreadNameTemplate() + { + if (self::$threadNameTemplate == null) { + self::$threadNameTemplate = new PathTemplate('spaces/{space}/threads/{thread}'); + } + + return self::$threadNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'attachment' => self::getAttachmentNameTemplate(), + 'membership' => self::getMembershipNameTemplate(), + 'message' => self::getMessageNameTemplate(), + 'quotedMessageMetadata' => self::getQuotedMessageMetadataNameTemplate(), + 'reaction' => self::getReactionNameTemplate(), + 'space' => self::getSpaceNameTemplate(), + 'thread' => self::getThreadNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a attachment + * resource. + * + * @param string $space + * @param string $message + * @param string $attachment + * + * @return string The formatted attachment resource. + */ + public static function attachmentName($space, $message, $attachment) + { + return self::getAttachmentNameTemplate()->render([ + 'space' => $space, + 'message' => $message, + 'attachment' => $attachment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a membership + * resource. + * + * @param string $space + * @param string $member + * + * @return string The formatted membership resource. + */ + public static function membershipName($space, $member) + { + return self::getMembershipNameTemplate()->render([ + 'space' => $space, + 'member' => $member, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a message + * resource. + * + * @param string $space + * @param string $message + * + * @return string The formatted message resource. + */ + public static function messageName($space, $message) + { + return self::getMessageNameTemplate()->render([ + 'space' => $space, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * quoted_message_metadata resource. + * + * @param string $space + * @param string $message + * @param string $quotedMessageMetadata + * + * @return string The formatted quoted_message_metadata resource. + */ + public static function quotedMessageMetadataName($space, $message, $quotedMessageMetadata) + { + return self::getQuotedMessageMetadataNameTemplate()->render([ + 'space' => $space, + 'message' => $message, + 'quoted_message_metadata' => $quotedMessageMetadata, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a reaction + * resource. + * + * @param string $space + * @param string $message + * @param string $reaction + * + * @return string The formatted reaction resource. + */ + public static function reactionName($space, $message, $reaction) + { + return self::getReactionNameTemplate()->render([ + 'space' => $space, + 'message' => $message, + 'reaction' => $reaction, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a space + * resource. + * + * @param string $space + * + * @return string The formatted space resource. + */ + public static function spaceName($space) + { + return self::getSpaceNameTemplate()->render([ + 'space' => $space, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a thread + * resource. + * + * @param string $space + * @param string $thread + * + * @return string The formatted thread resource. + */ + public static function threadName($space, $thread) + { + return self::getThreadNameTemplate()->render([ + 'space' => $space, + 'thread' => $thread, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - attachment: spaces/{space}/messages/{message}/attachments/{attachment} + * - membership: spaces/{space}/members/{member} + * - message: spaces/{space}/messages/{message} + * - quotedMessageMetadata: spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata} + * - reaction: spaces/{space}/messages/{message}/reactions/{reaction} + * - space: spaces/{space} + * - thread: spaces/{space}/threads/{thread} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'chat.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Completes the + * [import process](https://developers.google.com/chat/api/guides/import-data) + * for the specified space and makes it visible to users. + * Requires app authentication and domain-wide delegation. For more + * information, see [Authorize Google Chat apps to import + * data](https://developers.google.com/chat/api/guides/authorize-import). + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedName = $chatServiceClient->spaceName('[SPACE]'); + * $response = $chatServiceClient->completeImportSpace($formattedName); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the import mode space. + * + * Format: `spaces/{space}` + * @param array $optionalArgs { + * 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 \Google\Apps\Chat\V1\CompleteImportSpaceResponse + * + * @throws ApiException if the remote call fails + */ + public function completeImportSpace($name, array $optionalArgs = []) + { + $request = new CompleteImportSpaceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CompleteImportSpace', CompleteImportSpaceResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a human membership or app membership for the calling app. Creating + * memberships for other apps isn't supported. For an example, see + * [ Create a + * membership](https://developers.google.com/chat/api/guides/v1/members/create). + * When creating a membership, if the specified member has their auto-accept + * policy turned off, then they're invited, and must accept the space + * invitation before joining. Otherwise, creating a membership adds the member + * directly to the specified space. Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * To specify the member to add, set the `membership.member.name` in the + * `CreateMembershipRequest`: + * + * - To add the calling app to a space or a direct message between two human + * users, use `users/app`. Unable to add other + * apps to the space. + * + * - To add a human user, use `users/{user}`, where `{user}` can be the email + * address for the user. For users in the same Workspace organization `{user}` + * can also be the `id` for the person from the People API, or the `id` for + * the user in the Directory API. For example, if the People API Person + * profile ID for `user@example.com` is `123456789`, you can add the user to + * the space by setting the `membership.member.name` to + * `users/user@example.com` or `users/123456789`. + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedParent = $chatServiceClient->spaceName('[SPACE]'); + * $membership = new Membership(); + * $response = $chatServiceClient->createMembership($formattedParent, $membership); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the space for which to create the + * membership. + * + * Format: spaces/{space} + * @param Membership $membership Required. The membership relation to create. + * The `memberType` field must contain a user with the `user.name` and + * `user.type` fields populated. The server will assign a resource name + * and overwrite anything specified. + * When a Chat app creates a membership relation for a human user, it must use + * the `chat.memberships` scope, set `user.type` to `HUMAN`, and set + * `user.name` with format `users/{user}`, where `{user}` can be the email + * address for the user. For users in the same Workspace organization `{user}` + * can also be the `id` of the + * [person](https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the user in the Directory API. For example, if + * the People API Person profile ID for `user@example.com` is `123456789`, you + * can add the user to the space by setting the `membership.member.name` to + * `users/user@example.com` or `users/123456789`. When a Chat app creates a + * membership relation for itself, it must use the `chat.memberships.app` + * scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + * @param array $optionalArgs { + * 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 \Google\Apps\Chat\V1\Membership + * + * @throws ApiException if the remote call fails + */ + public function createMembership($parent, $membership, array $optionalArgs = []) + { + $request = new CreateMembershipRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setMembership($membership); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateMembership', Membership::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a message in a Google Chat space. For an example, see [Create a + * message](https://developers.google.com/chat/api/guides/v1/messages/create). + * + * Calling this method requires + * [authentication](https://developers.google.com/chat/api/guides/auth) and + * supports the following authentication types: + * + * - For text messages, user authentication or app authentication are + * supported. + * - For card messages, only app authentication is supported. (Only Chat apps + * can create card messages.) + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedParent = $chatServiceClient->spaceName('[SPACE]'); + * $message = new Message(); + * $response = $chatServiceClient->createMessage($formattedParent, $message); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the space in which to create a message. + * + * Format: `spaces/{space}` + * @param Message $message Required. Message body. + * @param array $optionalArgs { + * Optional. + * + * @type string $threadKey + * Optional. Deprecated: Use + * [thread.thread_key][google.chat.v1.Thread.thread_key] instead. ID for the + * thread. Supports up to 4000 characters. To start or add to a thread, create + * a message and specify a `threadKey` or the + * [thread.name][google.chat.v1.Thread.name]. For example usage, see [Start or + * reply to a message + * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * @type string $requestId + * Optional. A unique request ID for this message. Specifying an existing + * request ID returns the message created with that ID instead of creating a + * new message. + * @type int $messageReplyOption + * Optional. Specifies whether a message starts a thread or replies to one. + * Only supported in named spaces. + * For allowed values, use constants defined on {@see \Google\Apps\Chat\V1\CreateMessageRequest\MessageReplyOption} + * @type string $messageId + * Optional. A custom ID for a message. Lets Chat apps get, update, or delete + * a message without needing to store the system-assigned ID in the message's + * resource name (represented in the message `name` field). + * + * The value for this field must meet the following requirements: + * + * * Begins with `client-`. For example, `client-custom-name` is a valid + * custom ID, but `custom-name` is not. + * * Contains up to 63 characters and only lowercase letters, numbers, and + * hyphens. + * * Is unique within a space. A Chat app can't use the same custom ID for + * different messages. + * + * For details, see [Name a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * @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 \Google\Apps\Chat\V1\Message + * + * @throws ApiException if the remote call fails + */ + public function createMessage($parent, $message, array $optionalArgs = []) + { + $request = new CreateMessageRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setMessage($message); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['threadKey'])) { + $request->setThreadKey($optionalArgs['threadKey']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['messageReplyOption'])) { + $request->setMessageReplyOption($optionalArgs['messageReplyOption']); + } + + if (isset($optionalArgs['messageId'])) { + $request->setMessageId($optionalArgs['messageId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateMessage', Message::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a reaction and adds it to a message. For an example, see + * [Create a + * reaction](https://developers.google.com/chat/api/guides/v1/reactions/create). + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * Only unicode emoji are supported. + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedParent = $chatServiceClient->messageName('[SPACE]', '[MESSAGE]'); + * $reaction = new Reaction(); + * $response = $chatServiceClient->createReaction($formattedParent, $reaction); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The message where the reaction is created. + * + * Format: `spaces/{space}/messages/{message}` + * @param Reaction $reaction Required. The reaction to create. + * @param array $optionalArgs { + * 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 \Google\Apps\Chat\V1\Reaction + * + * @throws ApiException if the remote call fails + */ + public function createReaction($parent, $reaction, array $optionalArgs = []) + { + $request = new CreateReactionRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setReaction($reaction); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateReaction', Reaction::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a named space. Spaces grouped by topics aren't supported. For an + * example, see [Create a + * space](https://developers.google.com/chat/api/guides/v1/spaces/create). + * + * If you receive the error message `ALREADY_EXISTS` when creating + * a space, try a different `displayName`. An existing space within + * the Google Workspace organization might already use this display name. + * + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $space = new Space(); + * $response = $chatServiceClient->createSpace($space); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param Space $space Required. The `displayName` and `spaceType` fields must be populated. Only + * `SpaceType.SPACE` is supported. + * + * If you receive the error message `ALREADY_EXISTS` when creating a space, + * try a different `displayName`. An existing space within the Google + * Workspace organization might already use this display name. + * + * The space `name` is assigned on the server so anything specified in this + * field will be ignored. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A unique identifier for this request. + * A random UUID is recommended. + * Specifying an existing request ID returns the space created with that ID + * instead of creating a new space. + * Specifying an existing request ID from the same Chat app with a different + * authenticated user returns an error. + * @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 \Google\Apps\Chat\V1\Space + * + * @throws ApiException if the remote call fails + */ + public function createSpace($space, array $optionalArgs = []) + { + $request = new CreateSpaceRequest(); + $request->setSpace($space); + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + return $this->startCall('CreateSpace', Space::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a membership. For an example, see + * [Delete a + * membership](https://developers.google.com/chat/api/guides/v1/members/delete). + * + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedName = $chatServiceClient->membershipName('[SPACE]', '[MEMBER]'); + * $response = $chatServiceClient->deleteMembership($formattedName); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the membership to delete. Chat apps can delete + * human users' or their own memberships. Chat apps can't delete other apps' + * memberships. + * + * When deleting a human membership, requires the `chat.memberships` scope and + * `spaces/{space}/members/{member}` format. You can use the email as an + * alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + * + * When deleting an app membership, requires the `chat.memberships.app` scope + * and `spaces/{space}/members/app` format. + * + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. + * @param array $optionalArgs { + * 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 \Google\Apps\Chat\V1\Membership + * + * @throws ApiException if the remote call fails + */ + public function deleteMembership($name, array $optionalArgs = []) + { + $request = new DeleteMembershipRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteMembership', Membership::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a message. + * For an example, see [Delete a + * message](https://developers.google.com/chat/api/guides/v1/messages/delete). + * + * Requires + * [authentication](https://developers.google.com/chat/api/guides/auth). + * Supports + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * When using app authentication, requests can only delete messages + * created by the calling Chat app. + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedName = $chatServiceClient->messageName('[SPACE]', '[MESSAGE]'); + * $chatServiceClient->deleteMessage($formattedName); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the message. + * + * Format: `spaces/{space}/messages/{message}` + * + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a + * message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * @param array $optionalArgs { + * Optional. + * + * @type bool $force + * When `true`, deleting a message also deletes its threaded replies. When + * `false`, if a message has threaded replies, deletion fails. + * + * Only applies when [authenticating as a + * user](https://developers.google.com/chat/api/guides/auth/users). Has no + * effect when [authenticating as a Chat app] + * (https://developers.google.com/chat/api/guides/auth/service-accounts). + * @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. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteMessage($name, array $optionalArgs = []) + { + $request = new DeleteMessageRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['force'])) { + $request->setForce($optionalArgs['force']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteMessage', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a reaction to a message. For an example, see + * [Delete a + * reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete). + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedName = $chatServiceClient->reactionName('[SPACE]', '[MESSAGE]', '[REACTION]'); + * $chatServiceClient->deleteReaction($formattedName); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the reaction to delete. + * + * Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + * @param array $optionalArgs { + * 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. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteReaction($name, array $optionalArgs = []) + { + $request = new DeleteReactionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteReaction', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a named space. Always performs a cascading delete, which means + * that the space's child resources—like messages posted in the space and + * memberships in the space—are also deleted. For an example, see + * [Delete a + * space](https://developers.google.com/chat/api/guides/v1/spaces/delete). + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users) + * from a user who has permission to delete the space. + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedName = $chatServiceClient->spaceName('[SPACE]'); + * $chatServiceClient->deleteSpace($formattedName); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the space to delete. + * + * Format: `spaces/{space}` + * @param array $optionalArgs { + * 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. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteSpace($name, array $optionalArgs = []) + { + $request = new DeleteSpaceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteSpace', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the existing direct message with the specified user. If no direct + * message space is found, returns a `404 NOT_FOUND` error. For an example, + * see + * [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). + * + * With [user + * authentication](https://developers.google.com/chat/api/guides/auth/users), + * returns the direct message space between the specified user and the + * authenticated user. + * + * With [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), + * returns the direct message space between the specified user and the calling + * Chat app. + * + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users) + * or [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $name = 'name'; + * $response = $chatServiceClient->findDirectMessage($name); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the user to find direct message with. + * + * Format: `users/{user}`, where `{user}` is either the `id` for the + * [person](https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the + * [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) + * in the Directory API. For example, if the People API profile ID is + * `123456789`, you can find a direct message with that person by using + * `users/123456789` as the `name`. When [authenticated as a + * user](https://developers.google.com/chat/api/guides/auth/users), you can + * use the email as an alias for `{user}`. For example, + * `users/example@gmail.com` where `example@gmail.com` is the email of the + * Google Chat user. + * @param array $optionalArgs { + * 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 \Google\Apps\Chat\V1\Space + * + * @throws ApiException if the remote call fails + */ + public function findDirectMessage($name, array $optionalArgs = []) + { + $request = new FindDirectMessageRequest(); + $request->setName($name); + return $this->startCall('FindDirectMessage', Space::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the metadata of a message attachment. The attachment data is fetched + * using the [media + * API](https://developers.google.com/chat/api/reference/rest/v1/media/download). + * For an example, see + * [Get a message + * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). + * Requires [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedName = $chatServiceClient->attachmentName('[SPACE]', '[MESSAGE]', '[ATTACHMENT]'); + * $response = $chatServiceClient->getAttachment($formattedName); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the attachment, in the form + * `spaces/*/messages/*/attachments/*`. + * @param array $optionalArgs { + * 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 \Google\Apps\Chat\V1\Attachment + * + * @throws ApiException if the remote call fails + */ + public function getAttachment($name, array $optionalArgs = []) + { + $request = new GetAttachmentRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetAttachment', Attachment::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns details about a membership. For an example, see + * [Get a + * membership](https://developers.google.com/chat/api/guides/v1/members/get). + * + * Requires + * [authentication](https://developers.google.com/chat/api/guides/auth). + * Supports + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedName = $chatServiceClient->membershipName('[SPACE]', '[MEMBER]'); + * $response = $chatServiceClient->getMembership($formattedName); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the membership to retrieve. + * + * To get the app's own membership, you can optionally use + * `spaces/{space}/members/app`. + * + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` + * + * When [authenticated as a + * user](https://developers.google.com/chat/api/guides/auth/users), you can + * use the user's email as an alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + * @param array $optionalArgs { + * 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 \Google\Apps\Chat\V1\Membership + * + * @throws ApiException if the remote call fails + */ + public function getMembership($name, array $optionalArgs = []) + { + $request = new GetMembershipRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetMembership', Membership::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns details about a message. + * For an example, see [Read a + * message](https://developers.google.com/chat/api/guides/v1/messages/get). + * + * Requires + * [authentication](https://developers.google.com/chat/api/guides/auth). + * Supports + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Note: Might return a message from a blocked member or space. + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedName = $chatServiceClient->messageName('[SPACE]', '[MESSAGE]'); + * $response = $chatServiceClient->getMessage($formattedName); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the message. + * + * Format: `spaces/{space}/messages/{message}` + * + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a + * message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * @param array $optionalArgs { + * 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 \Google\Apps\Chat\V1\Message + * + * @throws ApiException if the remote call fails + */ + public function getMessage($name, array $optionalArgs = []) + { + $request = new GetMessageRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetMessage', Message::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns details about a space. For an example, see + * [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get). + * + * Requires + * [authentication](https://developers.google.com/chat/api/guides/auth). + * Supports + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedName = $chatServiceClient->spaceName('[SPACE]'); + * $response = $chatServiceClient->getSpace($formattedName); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Resource name of the space, in the form "spaces/*". + * + * Format: `spaces/{space}` + * @param array $optionalArgs { + * 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 \Google\Apps\Chat\V1\Space + * + * @throws ApiException if the remote call fails + */ + public function getSpace($name, array $optionalArgs = []) + { + $request = new GetSpaceRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetSpace', Space::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists memberships in a space. For an example, see [List + * memberships](https://developers.google.com/chat/api/guides/v1/members/list). + * Listing memberships with + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * lists memberships in spaces that the Chat app has + * access to, but excludes Chat app memberships, + * including its own. Listing memberships with + * [User + * authentication](https://developers.google.com/chat/api/guides/auth/users) + * lists memberships in spaces that the authenticated user has access to. + * + * Requires + * [authentication](https://developers.google.com/chat/api/guides/auth). + * Supports + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedParent = $chatServiceClient->spaceName('[SPACE]'); + * // Iterate over pages of elements + * $pagedResponse = $chatServiceClient->listMemberships($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $chatServiceClient->listMemberships($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the space for which to fetch a membership + * list. + * + * Format: spaces/{space} + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. A query filter. + * + * You can filter memberships by a member's role + * ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole)) + * and type + * ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)). + * + * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. + * + * To filter by type, set `member.type` to `HUMAN` or `BOT`. + * + * To filter by both role and type, use the `AND` operator. To filter by + * either role or type, use the `OR` operator. + * + * For example, the following queries are valid: + * + * ``` + * role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" + * member.type = "HUMAN" AND role = "ROLE_MANAGER" + * ``` + * + * The following queries are invalid: + * + * ``` + * member.type = "HUMAN" AND member.type = "BOT" + * role = "ROLE_MANAGER" AND role = "ROLE_MEMBER" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @type bool $showGroups + * Optional. When `true`, also returns memberships associated with a + * [Google Group][google.chat.v1.Membership.group_member], in + * addition to other types of memberships. If a + * [filter][google.chat.v1.ListMembershipsRequest.filter] is set, + * [Google Group][google.chat.v1.Membership.group_member] + * memberships that don't match the filter criteria aren't returned. + * @type bool $showInvited + * Optional. When `true`, also returns memberships associated with + * [invited][google.chat.v1.Membership.MembershipState.INVITED] members, in + * addition to other types of memberships. If a + * filter is set, + * [invited][google.chat.v1.Membership.MembershipState.INVITED] memberships + * that don't match the filter criteria aren't returned. + * + * Currently requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listMemberships($parent, array $optionalArgs = []) + { + $request = new ListMembershipsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['showGroups'])) { + $request->setShowGroups($optionalArgs['showGroups']); + } + + if (isset($optionalArgs['showInvited'])) { + $request->setShowInvited($optionalArgs['showInvited']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListMemberships', $optionalArgs, ListMembershipsResponse::class, $request); + } + + /** + * Lists messages in a space that the caller is a member of, including + * messages from blocked members and spaces. For an example, see + * [List messages](/chat/api/guides/v1/messages/list). + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedParent = $chatServiceClient->spaceName('[SPACE]'); + * // Iterate over pages of elements + * $pagedResponse = $chatServiceClient->listMessages($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $chatServiceClient->listMessages($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the space to list messages from. + * + * Format: `spaces/{space}` + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * A query filter. + * + * You can filter messages by date (`create_time`) and thread (`thread.name`). + * + * To filter messages by the date they were created, specify the `create_time` + * with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) + * format and double quotation marks. For example, + * `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to + * list messages that were created after a timestamp, or the less than + * operator `<` to list messages that were created before a timestamp. To + * filter messages within a time interval, use the `AND` operator between two + * timestamps. + * + * To filter by thread, specify the `thread.name`, formatted as + * `spaces/{space}/threads/{thread}`. You can only specify one + * `thread.name` per query. + * + * To filter by both thread and date, use the `AND` operator in your query. + * + * For example, the following queries are valid: + * + * ``` + * create_time > "2012-04-21T11:30:00-04:00" + * + * create_time > "2012-04-21T11:30:00-04:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * + * create_time > "2012-04-21T11:30:00+00:00" AND + * + * create_time < "2013-01-01T00:00:00+00:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @type string $orderBy + * Optional, if resuming from a previous query. + * + * How the list of messages is ordered. Specify a value to order by an + * ordering operation. Valid ordering operation values are as follows: + * + * - `ASC` for ascending. + * + * - `DESC` for descending. + * + * The default ordering is `create_time ASC`. + * @type bool $showDeleted + * Whether to include deleted messages. Deleted messages include deleted time + * and metadata about their deletion, but message content is unavailable. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listMessages($parent, array $optionalArgs = []) + { + $request = new ListMessagesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + if (isset($optionalArgs['showDeleted'])) { + $request->setShowDeleted($optionalArgs['showDeleted']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListMessages', $optionalArgs, ListMessagesResponse::class, $request); + } + + /** + * Lists reactions to a message. For an example, see + * [List + * reactions](https://developers.google.com/chat/api/guides/v1/reactions/list). + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedParent = $chatServiceClient->messageName('[SPACE]', '[MESSAGE]'); + * // Iterate over pages of elements + * $pagedResponse = $chatServiceClient->listReactions($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $chatServiceClient->listReactions($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The message users reacted to. + * + * Format: `spaces/{space}/messages/{message}` + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. A query filter. + * + * You can filter reactions by + * [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji) + * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and + * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * (`user.name`). + * + * To filter reactions for multiple emojis or users, join similar fields + * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = + * "ðŸ‘"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`. + * + * To filter reactions by emoji and user, use the `AND` operator, such as + * `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. + * + * If your query uses both `AND` and `OR`, group them with parentheses. + * + * For example, the following queries are valid: + * + * ``` + * user.name = "users/{user}" + * emoji.unicode = "🙂" + * emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR emoji.unicode = "ðŸ‘" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" AND user.name = "users/{user}" + * (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}") + * AND user.name = "users/{user}" + * ``` + * + * The following queries are invalid: + * + * ``` + * emoji.unicode = "🙂" AND emoji.unicode = "ðŸ‘" + * emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR + * user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * AND user.name = "users/{user}" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listReactions($parent, array $optionalArgs = []) + { + $request = new ListReactionsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListReactions', $optionalArgs, ListReactionsResponse::class, $request); + } + + /** + * Lists spaces the caller is a member of. Group chats and DMs aren't listed + * until the first message is sent. For an example, see + * [List + * spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). + * + * Requires + * [authentication](https://developers.google.com/chat/api/guides/auth). + * Supports + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Lists spaces visible to the caller or authenticated user. Group chats + * and DMs aren't listed until the first message is sent. + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $chatServiceClient->listSpaces(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $chatServiceClient->listSpaces(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. A query filter. + * + * You can filter spaces by the space type + * ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). + * + * To filter by space type, you must specify valid enum value, such as + * `SPACE` or `GROUP_CHAT` (the `space_type` can't be + * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` + * operator. + * + * For example, the following queries are valid: + * + * ``` + * space_type = "SPACE" + * spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listSpaces(array $optionalArgs = []) + { + $request = new ListSpacesRequest(); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + return $this->getPagedListResponse('ListSpaces', $optionalArgs, ListSpacesResponse::class, $request); + } + + /** + * Creates a space and adds specified users to it. The calling user is + * automatically added to the space, and shouldn't be specified as a + * membership in the request. For an example, see + * [Set up a + * space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). + * + * To specify the human members to add, add memberships with the appropriate + * `member.name` in the `SetUpSpaceRequest`. To add a human user, use + * `users/{user}`, where `{user}` can be the email address for the user. For + * users in the same Workspace organization `{user}` can also be the `id` for + * the person from the People API, or the `id` for the user in the Directory + * API. For example, if the People API Person profile ID for + * `user@example.com` is `123456789`, you can add the user to the space by + * setting the `membership.member.name` to `users/user@example.com` or + * `users/123456789`. + * + * For a space or group chat, if the caller blocks or is blocked by some + * members, then those members aren't added to the created space. + * + * To create a direct message (DM) between the calling user and another human + * user, specify exactly one membership to represent the human user. If + * one user blocks the other, the request fails and the DM isn't created. + * + * To create a DM between the calling user and the calling app, set + * `Space.singleUserBotDm` to `true` and don't specify any memberships. You + * can only use this method to set up a DM with the calling app. To add the + * calling app as a member of a space or an existing DM between two human + * users, see + * [create a + * membership](https://developers.google.com/chat/api/guides/v1/members/create). + * + * If a DM already exists between two users, even when one user blocks the + * other at the time a request is made, then the existing DM is returned. + * + * Spaces with threaded replies aren't supported. If you receive the error + * message `ALREADY_EXISTS` when setting up a space, try a different + * `displayName`. An existing space within the Google Workspace organization + * might already use this display name. + * + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $space = new Space(); + * $response = $chatServiceClient->setUpSpace($space); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param Space $space Required. The `Space.spaceType` field is required. + * + * To create a space, set `Space.spaceType` to `SPACE` and set + * `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when + * setting up a space, try a different `displayName`. An existing space + * within the Google Workspace organization might already use this display + * name. + * + * To create a group chat, set `Space.spaceType` to + * `GROUP_CHAT`. Don't set `Space.displayName`. + * + * To create a 1:1 conversation between humans, + * set `Space.spaceType` to `DIRECT_MESSAGE` and set + * `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or + * `Space.spaceDetails`. + * + * To create an 1:1 conversation between a human and the calling Chat app, set + * `Space.spaceType` to `DIRECT_MESSAGE` and + * `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or + * `Space.spaceDetails`. + * + * If a `DIRECT_MESSAGE` space already exists, that space is returned instead + * of creating a new space. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A unique identifier for this request. + * A random UUID is recommended. + * Specifying an existing request ID returns the space created with that ID + * instead of creating a new space. + * Specifying an existing request ID from the same Chat app with a different + * authenticated user returns an error. + * @type Membership[] $memberships + * Optional. The Google Chat users to invite to join the space. Omit the + * calling user, as they are added automatically. + * + * The set currently allows up to 20 memberships (in addition to the caller). + * + * The `Membership.member` field must contain a `user` with `name` populated + * (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only + * add human users when setting up a space (adding Chat apps is only supported + * for direct message setup with the calling app). You can also add members + * using the user's email as an alias for {user}. For example, the `user.name` + * can be `users/example@gmail.com`." To invite Gmail users or users from + * external Google Workspace domains, user's email must be used for + * `{user}`. + * + * Optional when setting `Space.spaceType` to `SPACE`. + * + * Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at + * least two memberships. + * + * Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human + * user, along with exactly one membership. + * + * Must be empty when creating a 1:1 conversation between a human and the + * calling Chat app (when setting `Space.spaceType` to + * `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`). + * @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 \Google\Apps\Chat\V1\Space + * + * @throws ApiException if the remote call fails + */ + public function setUpSpace($space, array $optionalArgs = []) + { + $request = new SetUpSpaceRequest(); + $request->setSpace($space); + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['memberships'])) { + $request->setMemberships($optionalArgs['memberships']); + } + + return $this->startCall('SetUpSpace', Space::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a message. There's a difference between the `patch` and `update` + * methods. The `patch` + * method uses a `patch` request while the `update` method uses a `put` + * request. We recommend using the `patch` method. For an example, see + * [Update a + * message](https://developers.google.com/chat/api/guides/v1/messages/update). + * + * Requires + * [authentication](https://developers.google.com/chat/api/guides/auth). + * Supports + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * When using app authentication, requests can only update messages + * created by the calling Chat app. + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $message = new Message(); + * $response = $chatServiceClient->updateMessage($message); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param Message $message Required. Message with fields updated. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Required. The field paths to update. Separate multiple values with commas + * or use `*` to update all field paths. + * + * Currently supported field paths: + * + * - `text` + * + * - `attachment` + * + * - `cards` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * + * - `cards_v2` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * + * - `accessory_widgets` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * @type bool $allowMissing + * Optional. If `true` and the message isn't found, a new message is created + * and `updateMask` is ignored. The specified message ID must be + * [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message) + * or the request fails. + * @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 \Google\Apps\Chat\V1\Message + * + * @throws ApiException if the remote call fails + */ + public function updateMessage($message, array $optionalArgs = []) + { + $request = new UpdateMessageRequest(); + $requestParamHeaders = []; + $request->setMessage($message); + $requestParamHeaders['message.name'] = $message->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateMessage', Message::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a space. For an example, see + * [Update a + * space](https://developers.google.com/chat/api/guides/v1/spaces/update). + * + * If you're updating the `displayName` field and receive the error message + * `ALREADY_EXISTS`, try a different display name.. An existing space within + * the Google Workspace organization might already use this display name. + * + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $space = new Space(); + * $response = $chatServiceClient->updateSpace($space); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param Space $space Required. Space with fields to be updated. `Space.name` must be + * populated in the form of `spaces/{space}`. Only fields + * specified by `update_mask` are updated. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Required. The updated field paths, comma separated if there are + * multiple. + * + * Currently supported field paths: + * + * - `display_name` (Only supports changing the display name of a space with + * the `SPACE` type, or when also including the `space_type` mask to change a + * `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a + * `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument + * error. If you receive the error message `ALREADY_EXISTS` when updating the + * `displayName`, try a different `displayName`. An existing space within the + * Google Workspace organization might already use this display name.) + * + * - `space_type` (Only supports changing a `GROUP_CHAT` space type to + * `SPACE`. Include `display_name` together with `space_type` in the update + * mask and ensure that the specified space has a non-empty display name and + * the `SPACE` space type. Including the `space_type` mask and the `SPACE` + * type in the specified space when updating the display name is optional if + * the existing space already has the `SPACE` type. Trying to update the + * space type in other ways results in an invalid argument error). + * + * - `space_details` + * + * - `space_history_state` (Supports [turning history on or off for the + * space](https://support.google.com/chat/answer/7664687) if [the organization + * allows users to change their history + * setting](https://support.google.com/a/answer/7664184). + * Warning: mutually exclusive with all other field paths.) + * - Developer Preview: `access_settings.audience` (Supports changing the + * [access setting](https://support.google.com/chat/answer/11971020) of a + * space. If no audience is specified in the access setting, the space's + * access setting is updated to restricted. Warning: mutually exclusive with + * all other field paths.) + * @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 \Google\Apps\Chat\V1\Space + * + * @throws ApiException if the remote call fails + */ + public function updateSpace($space, array $optionalArgs = []) + { + $request = new UpdateSpaceRequest(); + $requestParamHeaders = []; + $request->setSpace($space); + $requestParamHeaders['space.name'] = $space->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateSpace', Space::class, $optionalArgs, $request)->wait(); + } + + /** + * Uploads an attachment. For an example, see + * [Upload media as a file + * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload). + * Requires user + * [authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * You can upload attachments up to 200 MB. Certain file types aren't + * supported. For details, see [File types blocked by Google + * Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat). + * + * Sample code: + * ``` + * $chatServiceClient = new ChatServiceClient(); + * try { + * $formattedParent = $chatServiceClient->spaceName('[SPACE]'); + * $filename = 'filename'; + * $response = $chatServiceClient->uploadAttachment($formattedParent, $filename); + * } finally { + * $chatServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. Resource name of the Chat space in which the attachment is + * uploaded. Format "spaces/{space}". + * @param string $filename Required. The filename of the attachment, including the file extension. + * @param array $optionalArgs { + * 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 \Google\Apps\Chat\V1\UploadAttachmentResponse + * + * @throws ApiException if the remote call fails + */ + public function uploadAttachment($parent, $filename, array $optionalArgs = []) + { + $request = new UploadAttachmentRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setFilename($filename); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UploadAttachment', UploadAttachmentResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/AppsChat/src/Chat/V1/GetAttachmentRequest.php b/AppsChat/src/Chat/V1/GetAttachmentRequest.php new file mode 100644 index 000000000000..929105ce1d9e --- /dev/null +++ b/AppsChat/src/Chat/V1/GetAttachmentRequest.php @@ -0,0 +1,69 @@ +google.chat.v1.GetAttachmentRequest + */ +class GetAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the attachment, in the form + * `spaces/*/messages/*/attachments/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the attachment, in the form + * `spaces/*/messages/*/attachments/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Attachment::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the attachment, in the form + * `spaces/*/messages/*/attachments/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the attachment, in the form + * `spaces/*/messages/*/attachments/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/GetMembershipRequest.php b/AppsChat/src/Chat/V1/GetMembershipRequest.php new file mode 100644 index 000000000000..d721926fdac9 --- /dev/null +++ b/AppsChat/src/Chat/V1/GetMembershipRequest.php @@ -0,0 +1,97 @@ +google.chat.v1.GetMembershipRequest + */ +class GetMembershipRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the membership to retrieve. + * To get the app's own membership, you can optionally use + * `spaces/{space}/members/app`. + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` + * When [authenticated as a + * user](https://developers.google.com/chat/api/guides/auth/users), you can + * use the user's email as an alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the membership to retrieve. + * To get the app's own membership, you can optionally use + * `spaces/{space}/members/app`. + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` + * When [authenticated as a + * user](https://developers.google.com/chat/api/guides/auth/users), you can + * use the user's email as an alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Membership::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the membership to retrieve. + * To get the app's own membership, you can optionally use + * `spaces/{space}/members/app`. + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` + * When [authenticated as a + * user](https://developers.google.com/chat/api/guides/auth/users), you can + * use the user's email as an alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the membership to retrieve. + * To get the app's own membership, you can optionally use + * `spaces/{space}/members/app`. + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` + * When [authenticated as a + * user](https://developers.google.com/chat/api/guides/auth/users), you can + * use the user's email as an alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/GetMessageRequest.php b/AppsChat/src/Chat/V1/GetMessageRequest.php new file mode 100644 index 000000000000..8b0485df655a --- /dev/null +++ b/AppsChat/src/Chat/V1/GetMessageRequest.php @@ -0,0 +1,85 @@ +google.chat.v1.GetMessageRequest + */ +class GetMessageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the message. + * Format: `spaces/{space}/messages/{message}` + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a + * message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the message. + * Format: `spaces/{space}/messages/{message}` + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a + * message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the message. + * Format: `spaces/{space}/messages/{message}` + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a + * message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the message. + * Format: `spaces/{space}/messages/{message}` + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a + * message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/GetSpaceRequest.php b/AppsChat/src/Chat/V1/GetSpaceRequest.php new file mode 100644 index 000000000000..ad7b5827b12d --- /dev/null +++ b/AppsChat/src/Chat/V1/GetSpaceRequest.php @@ -0,0 +1,71 @@ +google.chat.v1.GetSpaceRequest + */ +class GetSpaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the space, in the form "spaces/*". + * Format: `spaces/{space}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of the space, in the form "spaces/*". + * Format: `spaces/{space}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Space::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the space, in the form "spaces/*". + * Format: `spaces/{space}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of the space, in the form "spaces/*". + * Format: `spaces/{space}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/Group.php b/AppsChat/src/Chat/V1/Group.php new file mode 100644 index 000000000000..abd3dff79c75 --- /dev/null +++ b/AppsChat/src/Chat/V1/Group.php @@ -0,0 +1,83 @@ +google.chat.v1.Group + */ +class Group extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name for a Google Group. + * Represents a + * [group](https://cloud.google.com/identity/docs/reference/rest/v1/groups) in + * Cloud Identity Groups API. + * Format: groups/{group} + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Resource name for a Google Group. + * Represents a + * [group](https://cloud.google.com/identity/docs/reference/rest/v1/groups) in + * Cloud Identity Groups API. + * Format: groups/{group} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Group::initOnce(); + parent::__construct($data); + } + + /** + * Resource name for a Google Group. + * Represents a + * [group](https://cloud.google.com/identity/docs/reference/rest/v1/groups) in + * Cloud Identity Groups API. + * Format: groups/{group} + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Resource name for a Google Group. + * Represents a + * [group](https://cloud.google.com/identity/docs/reference/rest/v1/groups) in + * Cloud Identity Groups API. + * Format: groups/{group} + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/HistoryState.php b/AppsChat/src/Chat/V1/HistoryState.php new file mode 100644 index 000000000000..2dadcbc53b5f --- /dev/null +++ b/AppsChat/src/Chat/V1/HistoryState.php @@ -0,0 +1,65 @@ +google.chat.v1.HistoryState + */ +class HistoryState +{ + /** + * Default value. Do not use. + * + * Generated from protobuf enum HISTORY_STATE_UNSPECIFIED = 0; + */ + const HISTORY_STATE_UNSPECIFIED = 0; + /** + * History off. [Messages and threads are kept for 24 + * hours](https://support.google.com/chat/answer/7664687). + * + * Generated from protobuf enum HISTORY_OFF = 1; + */ + const HISTORY_OFF = 1; + /** + * History on. The organization's [Vault retention + * rules](https://support.google.com/vault/answer/7657597) specify for + * how long messages and threads are kept. + * + * Generated from protobuf enum HISTORY_ON = 2; + */ + const HISTORY_ON = 2; + + private static $valueToName = [ + self::HISTORY_STATE_UNSPECIFIED => 'HISTORY_STATE_UNSPECIFIED', + self::HISTORY_OFF => 'HISTORY_OFF', + self::HISTORY_ON => 'HISTORY_ON', + ]; + + 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/ListMembershipsRequest.php b/AppsChat/src/Chat/V1/ListMembershipsRequest.php new file mode 100644 index 000000000000..07158c170b95 --- /dev/null +++ b/AppsChat/src/Chat/V1/ListMembershipsRequest.php @@ -0,0 +1,407 @@ +google.chat.v1.ListMembershipsRequest + */ +class ListMembershipsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the space for which to fetch a membership + * list. + * Format: spaces/{space} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of memberships to return. The service might + * return fewer than this value. + * If unspecified, at most 100 memberships are returned. + * The maximum value is 1,000. If you use a value more than 1,000, it's + * automatically changed to 1,000. + * Negative values return an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous call to list memberships. + * 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A query filter. + * You can filter memberships by a member's role + * ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole)) + * and type + * ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)). + * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. + * To filter by type, set `member.type` to `HUMAN` or `BOT`. + * To filter by both role and type, use the `AND` operator. To filter by + * either role or type, use the `OR` operator. + * For example, the following queries are valid: + * ``` + * role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" + * member.type = "HUMAN" AND role = "ROLE_MANAGER" + * ``` + * The following queries are invalid: + * ``` + * member.type = "HUMAN" AND member.type = "BOT" + * role = "ROLE_MANAGER" AND role = "ROLE_MEMBER" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. When `true`, also returns memberships associated with a + * [Google Group][google.chat.v1.Membership.group_member], in + * addition to other types of memberships. If a + * [filter][google.chat.v1.ListMembershipsRequest.filter] is set, + * [Google Group][google.chat.v1.Membership.group_member] + * memberships that don't match the filter criteria aren't returned. + * + * Generated from protobuf field bool show_groups = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $show_groups = false; + /** + * Optional. When `true`, also returns memberships associated with + * [invited][google.chat.v1.Membership.MembershipState.INVITED] members, in + * addition to other types of memberships. If a + * filter is set, + * [invited][google.chat.v1.Membership.MembershipState.INVITED] memberships + * that don't match the filter criteria aren't returned. + * Currently requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Generated from protobuf field bool show_invited = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $show_invited = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the space for which to fetch a membership + * list. + * Format: spaces/{space} + * @type int $page_size + * Optional. The maximum number of memberships to return. The service might + * return fewer than this value. + * If unspecified, at most 100 memberships are returned. + * The maximum value is 1,000. If you use a value more than 1,000, it's + * automatically changed to 1,000. + * Negative values return an `INVALID_ARGUMENT` error. + * @type string $page_token + * Optional. A page token, received from a previous call to list memberships. + * 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 $filter + * Optional. A query filter. + * You can filter memberships by a member's role + * ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole)) + * and type + * ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)). + * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. + * To filter by type, set `member.type` to `HUMAN` or `BOT`. + * To filter by both role and type, use the `AND` operator. To filter by + * either role or type, use the `OR` operator. + * For example, the following queries are valid: + * ``` + * role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" + * member.type = "HUMAN" AND role = "ROLE_MANAGER" + * ``` + * The following queries are invalid: + * ``` + * member.type = "HUMAN" AND member.type = "BOT" + * role = "ROLE_MANAGER" AND role = "ROLE_MEMBER" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @type bool $show_groups + * Optional. When `true`, also returns memberships associated with a + * [Google Group][google.chat.v1.Membership.group_member], in + * addition to other types of memberships. If a + * [filter][google.chat.v1.ListMembershipsRequest.filter] is set, + * [Google Group][google.chat.v1.Membership.group_member] + * memberships that don't match the filter criteria aren't returned. + * @type bool $show_invited + * Optional. When `true`, also returns memberships associated with + * [invited][google.chat.v1.Membership.MembershipState.INVITED] members, in + * addition to other types of memberships. If a + * filter is set, + * [invited][google.chat.v1.Membership.MembershipState.INVITED] memberships + * that don't match the filter criteria aren't returned. + * Currently requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Membership::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the space for which to fetch a membership + * list. + * Format: spaces/{space} + * + * 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 for which to fetch a membership + * list. + * Format: spaces/{space} + * + * 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; + } + + /** + * Optional. The maximum number of memberships to return. The service might + * return fewer than this value. + * If unspecified, at most 100 memberships are returned. + * The maximum value is 1,000. If you use a value more than 1,000, it's + * automatically changed to 1,000. + * Negative values return an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of memberships to return. The service might + * return fewer than this value. + * If unspecified, at most 100 memberships are returned. + * The maximum value is 1,000. If you use a value more than 1,000, it's + * automatically changed to 1,000. + * Negative values return an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field int32 page_size = 2 [(.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 page token, received from a previous call to list memberships. + * 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous call to list memberships. + * 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 = 3 [(.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. A query filter. + * You can filter memberships by a member's role + * ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole)) + * and type + * ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)). + * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. + * To filter by type, set `member.type` to `HUMAN` or `BOT`. + * To filter by both role and type, use the `AND` operator. To filter by + * either role or type, use the `OR` operator. + * For example, the following queries are valid: + * ``` + * role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" + * member.type = "HUMAN" AND role = "ROLE_MANAGER" + * ``` + * The following queries are invalid: + * ``` + * member.type = "HUMAN" AND member.type = "BOT" + * role = "ROLE_MANAGER" AND role = "ROLE_MEMBER" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A query filter. + * You can filter memberships by a member's role + * ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole)) + * and type + * ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)). + * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. + * To filter by type, set `member.type` to `HUMAN` or `BOT`. + * To filter by both role and type, use the `AND` operator. To filter by + * either role or type, use the `OR` operator. + * For example, the following queries are valid: + * ``` + * role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" + * member.type = "HUMAN" AND role = "ROLE_MANAGER" + * ``` + * The following queries are invalid: + * ``` + * member.type = "HUMAN" AND member.type = "BOT" + * role = "ROLE_MANAGER" AND role = "ROLE_MEMBER" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. When `true`, also returns memberships associated with a + * [Google Group][google.chat.v1.Membership.group_member], in + * addition to other types of memberships. If a + * [filter][google.chat.v1.ListMembershipsRequest.filter] is set, + * [Google Group][google.chat.v1.Membership.group_member] + * memberships that don't match the filter criteria aren't returned. + * + * Generated from protobuf field bool show_groups = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getShowGroups() + { + return $this->show_groups; + } + + /** + * Optional. When `true`, also returns memberships associated with a + * [Google Group][google.chat.v1.Membership.group_member], in + * addition to other types of memberships. If a + * [filter][google.chat.v1.ListMembershipsRequest.filter] is set, + * [Google Group][google.chat.v1.Membership.group_member] + * memberships that don't match the filter criteria aren't returned. + * + * Generated from protobuf field bool show_groups = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setShowGroups($var) + { + GPBUtil::checkBool($var); + $this->show_groups = $var; + + return $this; + } + + /** + * Optional. When `true`, also returns memberships associated with + * [invited][google.chat.v1.Membership.MembershipState.INVITED] members, in + * addition to other types of memberships. If a + * filter is set, + * [invited][google.chat.v1.Membership.MembershipState.INVITED] memberships + * that don't match the filter criteria aren't returned. + * Currently requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Generated from protobuf field bool show_invited = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getShowInvited() + { + return $this->show_invited; + } + + /** + * Optional. When `true`, also returns memberships associated with + * [invited][google.chat.v1.Membership.MembershipState.INVITED] members, in + * addition to other types of memberships. If a + * filter is set, + * [invited][google.chat.v1.Membership.MembershipState.INVITED] memberships + * that don't match the filter criteria aren't returned. + * Currently requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Generated from protobuf field bool show_invited = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setShowInvited($var) + { + GPBUtil::checkBool($var); + $this->show_invited = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/ListMembershipsResponse.php b/AppsChat/src/Chat/V1/ListMembershipsResponse.php new file mode 100644 index 000000000000..19e3718b6d63 --- /dev/null +++ b/AppsChat/src/Chat/V1/ListMembershipsResponse.php @@ -0,0 +1,103 @@ +google.chat.v1.ListMembershipsResponse + */ +class ListMembershipsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Unordered list. List of memberships in the requested (or first) page. + * + * Generated from protobuf field repeated .google.chat.v1.Membership memberships = 1 [(.google.api.field_behavior) = UNORDERED_LIST]; + */ + private $memberships; + /** + * A token that you can send as `pageToken` to retrieve the next page of + * results. If 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 array<\Google\Apps\Chat\V1\Membership>|\Google\Protobuf\Internal\RepeatedField $memberships + * Unordered list. List of memberships in the requested (or first) page. + * @type string $next_page_token + * A token that you can send as `pageToken` to retrieve the next page of + * results. If empty, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Membership::initOnce(); + parent::__construct($data); + } + + /** + * Unordered list. List of memberships in the requested (or first) page. + * + * Generated from protobuf field repeated .google.chat.v1.Membership memberships = 1 [(.google.api.field_behavior) = UNORDERED_LIST]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMemberships() + { + return $this->memberships; + } + + /** + * Unordered list. List of memberships in the requested (or first) page. + * + * Generated from protobuf field repeated .google.chat.v1.Membership memberships = 1 [(.google.api.field_behavior) = UNORDERED_LIST]; + * @param array<\Google\Apps\Chat\V1\Membership>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMemberships($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\Membership::class); + $this->memberships = $arr; + + return $this; + } + + /** + * A token that you can send as `pageToken` to retrieve the next page of + * results. If 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 you can send as `pageToken` to retrieve the next page of + * results. If 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/ListMessagesRequest.php b/AppsChat/src/Chat/V1/ListMessagesRequest.php new file mode 100644 index 000000000000..eff9e7ed3ba8 --- /dev/null +++ b/AppsChat/src/Chat/V1/ListMessagesRequest.php @@ -0,0 +1,405 @@ +google.chat.v1.ListMessagesRequest + */ +class ListMessagesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the space to list messages from. + * Format: `spaces/{space}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of messages returned. The service might return fewer + * messages than this value. + * If unspecified, at most 25 are returned. + * The maximum value is 1,000. If you use a value more than 1,000, it's + * automatically changed to 1,000. + * Negative values return an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * Optional, if resuming from a previous query. + * A page token received from a previous list 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 = 3; + */ + protected $page_token = ''; + /** + * A query filter. + * You can filter messages by date (`create_time`) and thread (`thread.name`). + * To filter messages by the date they were created, specify the `create_time` + * with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) + * format and double quotation marks. For example, + * `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to + * list messages that were created after a timestamp, or the less than + * operator `<` to list messages that were created before a timestamp. To + * filter messages within a time interval, use the `AND` operator between two + * timestamps. + * To filter by thread, specify the `thread.name`, formatted as + * `spaces/{space}/threads/{thread}`. You can only specify one + * `thread.name` per query. + * To filter by both thread and date, use the `AND` operator in your query. + * For example, the following queries are valid: + * ``` + * create_time > "2012-04-21T11:30:00-04:00" + * create_time > "2012-04-21T11:30:00-04:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * create_time > "2012-04-21T11:30:00+00:00" AND + * create_time < "2013-01-01T00:00:00+00:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Optional, if resuming from a previous query. + * How the list of messages is ordered. Specify a value to order by an + * ordering operation. Valid ordering operation values are as follows: + * - `ASC` for ascending. + * - `DESC` for descending. + * The default ordering is `create_time ASC`. + * + * Generated from protobuf field string order_by = 5; + */ + protected $order_by = ''; + /** + * Whether to include deleted messages. Deleted messages include deleted time + * and metadata about their deletion, but message content is unavailable. + * + * Generated from protobuf field bool show_deleted = 6; + */ + protected $show_deleted = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the space to list messages from. + * Format: `spaces/{space}` + * @type int $page_size + * The maximum number of messages returned. The service might return fewer + * messages than this value. + * If unspecified, at most 25 are returned. + * The maximum value is 1,000. If you use a value more than 1,000, it's + * automatically changed to 1,000. + * Negative values return an `INVALID_ARGUMENT` error. + * @type string $page_token + * Optional, if resuming from a previous query. + * A page token received from a previous list 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 $filter + * A query filter. + * You can filter messages by date (`create_time`) and thread (`thread.name`). + * To filter messages by the date they were created, specify the `create_time` + * with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) + * format and double quotation marks. For example, + * `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to + * list messages that were created after a timestamp, or the less than + * operator `<` to list messages that were created before a timestamp. To + * filter messages within a time interval, use the `AND` operator between two + * timestamps. + * To filter by thread, specify the `thread.name`, formatted as + * `spaces/{space}/threads/{thread}`. You can only specify one + * `thread.name` per query. + * To filter by both thread and date, use the `AND` operator in your query. + * For example, the following queries are valid: + * ``` + * create_time > "2012-04-21T11:30:00-04:00" + * create_time > "2012-04-21T11:30:00-04:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * create_time > "2012-04-21T11:30:00+00:00" AND + * create_time < "2013-01-01T00:00:00+00:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * @type string $order_by + * Optional, if resuming from a previous query. + * How the list of messages is ordered. Specify a value to order by an + * ordering operation. Valid ordering operation values are as follows: + * - `ASC` for ascending. + * - `DESC` for descending. + * The default ordering is `create_time ASC`. + * @type bool $show_deleted + * Whether to include deleted messages. Deleted messages include deleted time + * and metadata about their deletion, but message content is unavailable. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the space to list messages from. + * Format: `spaces/{space}` + * + * 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 list messages from. + * Format: `spaces/{space}` + * + * 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; + } + + /** + * The maximum number of messages returned. The service might return fewer + * messages than this value. + * If unspecified, at most 25 are returned. + * The maximum value is 1,000. If you use a value more than 1,000, it's + * automatically changed to 1,000. + * Negative values return an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of messages returned. The service might return fewer + * messages than this value. + * If unspecified, at most 25 are returned. + * The maximum value is 1,000. If you use a value more than 1,000, it's + * automatically changed to 1,000. + * Negative values return an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional, if resuming from a previous query. + * A page token received from a previous list 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 = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional, if resuming from a previous query. + * A page token received from a previous list 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 = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * A query filter. + * You can filter messages by date (`create_time`) and thread (`thread.name`). + * To filter messages by the date they were created, specify the `create_time` + * with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) + * format and double quotation marks. For example, + * `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to + * list messages that were created after a timestamp, or the less than + * operator `<` to list messages that were created before a timestamp. To + * filter messages within a time interval, use the `AND` operator between two + * timestamps. + * To filter by thread, specify the `thread.name`, formatted as + * `spaces/{space}/threads/{thread}`. You can only specify one + * `thread.name` per query. + * To filter by both thread and date, use the `AND` operator in your query. + * For example, the following queries are valid: + * ``` + * create_time > "2012-04-21T11:30:00-04:00" + * create_time > "2012-04-21T11:30:00-04:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * create_time > "2012-04-21T11:30:00+00:00" AND + * create_time < "2013-01-01T00:00:00+00:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * A query filter. + * You can filter messages by date (`create_time`) and thread (`thread.name`). + * To filter messages by the date they were created, specify the `create_time` + * with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) + * format and double quotation marks. For example, + * `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to + * list messages that were created after a timestamp, or the less than + * operator `<` to list messages that were created before a timestamp. To + * filter messages within a time interval, use the `AND` operator between two + * timestamps. + * To filter by thread, specify the `thread.name`, formatted as + * `spaces/{space}/threads/{thread}`. You can only specify one + * `thread.name` per query. + * To filter by both thread and date, use the `AND` operator in your query. + * For example, the following queries are valid: + * ``` + * create_time > "2012-04-21T11:30:00-04:00" + * create_time > "2012-04-21T11:30:00-04:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * create_time > "2012-04-21T11:30:00+00:00" AND + * create_time < "2013-01-01T00:00:00+00:00" AND + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * thread.name = spaces/AAAAAAAAAAA/threads/123 + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional, if resuming from a previous query. + * How the list of messages is ordered. Specify a value to order by an + * ordering operation. Valid ordering operation values are as follows: + * - `ASC` for ascending. + * - `DESC` for descending. + * The default ordering is `create_time ASC`. + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional, if resuming from a previous query. + * How the list of messages is ordered. Specify a value to order by an + * ordering operation. Valid ordering operation values are as follows: + * - `ASC` for ascending. + * - `DESC` for descending. + * The default ordering is `create_time ASC`. + * + * Generated from protobuf field string order_by = 5; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Whether to include deleted messages. Deleted messages include deleted time + * and metadata about their deletion, but message content is unavailable. + * + * Generated from protobuf field bool show_deleted = 6; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * Whether to include deleted messages. Deleted messages include deleted time + * and metadata about their deletion, but message content is unavailable. + * + * Generated from protobuf field bool show_deleted = 6; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/ListMessagesResponse.php b/AppsChat/src/Chat/V1/ListMessagesResponse.php new file mode 100644 index 000000000000..8fc55d01c82d --- /dev/null +++ b/AppsChat/src/Chat/V1/ListMessagesResponse.php @@ -0,0 +1,103 @@ +google.chat.v1.ListMessagesResponse + */ +class ListMessagesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of messages. + * + * Generated from protobuf field repeated .google.chat.v1.Message messages = 1; + */ + private $messages; + /** + * You can send a token as `pageToken` to retrieve the next page of + * results. If 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 array<\Google\Apps\Chat\V1\Message>|\Google\Protobuf\Internal\RepeatedField $messages + * List of messages. + * @type string $next_page_token + * You can send a token as `pageToken` to retrieve the next page of + * results. If empty, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * List of messages. + * + * Generated from protobuf field repeated .google.chat.v1.Message messages = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMessages() + { + return $this->messages; + } + + /** + * List of messages. + * + * Generated from protobuf field repeated .google.chat.v1.Message messages = 1; + * @param array<\Google\Apps\Chat\V1\Message>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\Message::class); + $this->messages = $arr; + + return $this; + } + + /** + * You can send a token as `pageToken` to retrieve the next page of + * results. If 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; + } + + /** + * You can send a token as `pageToken` to retrieve the next page of + * results. If 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/ListReactionsRequest.php b/AppsChat/src/Chat/V1/ListReactionsRequest.php new file mode 100644 index 000000000000..d63e3c09255c --- /dev/null +++ b/AppsChat/src/Chat/V1/ListReactionsRequest.php @@ -0,0 +1,333 @@ +google.chat.v1.ListReactionsRequest + */ +class ListReactionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The message users reacted to. + * Format: `spaces/{space}/messages/{message}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of reactions returned. The service can return + * fewer reactions than this value. If unspecified, the default value is 25. + * The maximum value is 200; values above 200 are changed to 200. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. (If resuming from a previous query.) + * A page token received from a previous list reactions call. Provide this + * to retrieve the subsequent page. + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value might lead to unexpected results. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A query filter. + * You can filter reactions by + * [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji) + * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and + * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * (`user.name`). + * To filter reactions for multiple emojis or users, join similar fields + * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = + * "ðŸ‘"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`. + * To filter reactions by emoji and user, use the `AND` operator, such as + * `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. + * If your query uses both `AND` and `OR`, group them with parentheses. + * For example, the following queries are valid: + * ``` + * user.name = "users/{user}" + * emoji.unicode = "🙂" + * emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR emoji.unicode = "ðŸ‘" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" AND user.name = "users/{user}" + * (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}") + * AND user.name = "users/{user}" + * ``` + * The following queries are invalid: + * ``` + * emoji.unicode = "🙂" AND emoji.unicode = "ðŸ‘" + * emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR + * user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * AND user.name = "users/{user}" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The message users reacted to. + * Format: `spaces/{space}/messages/{message}` + * @type int $page_size + * Optional. The maximum number of reactions returned. The service can return + * fewer reactions than this value. If unspecified, the default value is 25. + * The maximum value is 200; values above 200 are changed to 200. + * @type string $page_token + * Optional. (If resuming from a previous query.) + * A page token received from a previous list reactions call. Provide this + * to retrieve the subsequent page. + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value might lead to unexpected results. + * @type string $filter + * Optional. A query filter. + * You can filter reactions by + * [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji) + * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and + * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * (`user.name`). + * To filter reactions for multiple emojis or users, join similar fields + * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = + * "ðŸ‘"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`. + * To filter reactions by emoji and user, use the `AND` operator, such as + * `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. + * If your query uses both `AND` and `OR`, group them with parentheses. + * For example, the following queries are valid: + * ``` + * user.name = "users/{user}" + * emoji.unicode = "🙂" + * emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR emoji.unicode = "ðŸ‘" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" AND user.name = "users/{user}" + * (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}") + * AND user.name = "users/{user}" + * ``` + * The following queries are invalid: + * ``` + * emoji.unicode = "🙂" AND emoji.unicode = "ðŸ‘" + * emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR + * user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * AND user.name = "users/{user}" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Reaction::initOnce(); + parent::__construct($data); + } + + /** + * Required. The message users reacted to. + * Format: `spaces/{space}/messages/{message}` + * + * 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 message users reacted to. + * Format: `spaces/{space}/messages/{message}` + * + * 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; + } + + /** + * Optional. The maximum number of reactions returned. The service can return + * fewer reactions than this value. If unspecified, the default value is 25. + * The maximum value is 200; values above 200 are changed to 200. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of reactions returned. The service can return + * fewer reactions than this value. If unspecified, the default value is 25. + * The maximum value is 200; values above 200 are changed to 200. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. (If resuming from a previous query.) + * A page token received from a previous list reactions call. Provide this + * to retrieve the subsequent page. + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value might lead to unexpected results. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. (If resuming from a previous query.) + * A page token received from a previous list reactions call. Provide this + * to retrieve the subsequent page. + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value might lead to unexpected results. + * + * Generated from protobuf field string page_token = 3 [(.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. A query filter. + * You can filter reactions by + * [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji) + * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and + * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * (`user.name`). + * To filter reactions for multiple emojis or users, join similar fields + * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = + * "ðŸ‘"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`. + * To filter reactions by emoji and user, use the `AND` operator, such as + * `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. + * If your query uses both `AND` and `OR`, group them with parentheses. + * For example, the following queries are valid: + * ``` + * user.name = "users/{user}" + * emoji.unicode = "🙂" + * emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR emoji.unicode = "ðŸ‘" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" AND user.name = "users/{user}" + * (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}") + * AND user.name = "users/{user}" + * ``` + * The following queries are invalid: + * ``` + * emoji.unicode = "🙂" AND emoji.unicode = "ðŸ‘" + * emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR + * user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * AND user.name = "users/{user}" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A query filter. + * You can filter reactions by + * [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji) + * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and + * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * (`user.name`). + * To filter reactions for multiple emojis or users, join similar fields + * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = + * "ðŸ‘"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`. + * To filter reactions by emoji and user, use the `AND` operator, such as + * `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. + * If your query uses both `AND` and `OR`, group them with parentheses. + * For example, the following queries are valid: + * ``` + * user.name = "users/{user}" + * emoji.unicode = "🙂" + * emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR emoji.unicode = "ðŸ‘" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" AND user.name = "users/{user}" + * (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}") + * AND user.name = "users/{user}" + * ``` + * The following queries are invalid: + * ``` + * emoji.unicode = "🙂" AND emoji.unicode = "ðŸ‘" + * emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}" + * emoji.unicode = "🙂" OR user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR + * user.name = "users/{user}" + * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" + * AND user.name = "users/{user}" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/ListReactionsResponse.php b/AppsChat/src/Chat/V1/ListReactionsResponse.php new file mode 100644 index 000000000000..a6c58c72a9ec --- /dev/null +++ b/AppsChat/src/Chat/V1/ListReactionsResponse.php @@ -0,0 +1,103 @@ +google.chat.v1.ListReactionsResponse + */ +class ListReactionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of reactions in the requested (or first) page. + * + * Generated from protobuf field repeated .google.chat.v1.Reaction reactions = 1; + */ + private $reactions; + /** + * Continuation token to retrieve the next page of results. It's empty + * for the last page of results. + * + * 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 array<\Google\Apps\Chat\V1\Reaction>|\Google\Protobuf\Internal\RepeatedField $reactions + * List of reactions in the requested (or first) page. + * @type string $next_page_token + * Continuation token to retrieve the next page of results. It's empty + * for the last page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Reaction::initOnce(); + parent::__construct($data); + } + + /** + * List of reactions in the requested (or first) page. + * + * Generated from protobuf field repeated .google.chat.v1.Reaction reactions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReactions() + { + return $this->reactions; + } + + /** + * List of reactions in the requested (or first) page. + * + * Generated from protobuf field repeated .google.chat.v1.Reaction reactions = 1; + * @param array<\Google\Apps\Chat\V1\Reaction>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReactions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\Reaction::class); + $this->reactions = $arr; + + return $this; + } + + /** + * Continuation token to retrieve the next page of results. It's empty + * for the last page of results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Continuation token to retrieve the next page of results. It's empty + * for the last page of results. + * + * 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/ListSpacesRequest.php b/AppsChat/src/Chat/V1/ListSpacesRequest.php new file mode 100644 index 000000000000..eab3ad89dd60 --- /dev/null +++ b/AppsChat/src/Chat/V1/ListSpacesRequest.php @@ -0,0 +1,219 @@ +google.chat.v1.ListSpacesRequest + */ +class ListSpacesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The maximum number of spaces to return. The service might return + * fewer than this value. + * If unspecified, at most 100 spaces are returned. + * The maximum value is 1,000. If you use a value more than 1,000, it's + * automatically changed to 1,000. + * Negative values return an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous list spaces call. + * Provide this parameter to retrieve the subsequent page. + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value may lead to unexpected results. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A query filter. + * You can filter spaces by the space type + * ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). + * To filter by space type, you must specify valid enum value, such as + * `SPACE` or `GROUP_CHAT` (the `space_type` can't be + * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` + * operator. + * For example, the following queries are valid: + * ``` + * space_type = "SPACE" + * spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $page_size + * Optional. The maximum number of spaces to return. The service might return + * fewer than this value. + * If unspecified, at most 100 spaces are returned. + * The maximum value is 1,000. If you use a value more than 1,000, it's + * automatically changed to 1,000. + * Negative values return an `INVALID_ARGUMENT` error. + * @type string $page_token + * Optional. A page token, received from a previous list spaces call. + * Provide this parameter to retrieve the subsequent page. + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value may lead to unexpected results. + * @type string $filter + * Optional. A query filter. + * You can filter spaces by the space type + * ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). + * To filter by space type, you must specify valid enum value, such as + * `SPACE` or `GROUP_CHAT` (the `space_type` can't be + * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` + * operator. + * For example, the following queries are valid: + * ``` + * space_type = "SPACE" + * spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Space::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The maximum number of spaces to return. The service might return + * fewer than this value. + * If unspecified, at most 100 spaces are returned. + * The maximum value is 1,000. If you use a value more than 1,000, it's + * automatically changed to 1,000. + * Negative values return an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of spaces to return. The service might return + * fewer than this value. + * If unspecified, at most 100 spaces are returned. + * The maximum value is 1,000. If you use a value more than 1,000, it's + * automatically changed to 1,000. + * Negative values return an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field int32 page_size = 1 [(.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 page token, received from a previous list spaces call. + * Provide this parameter to retrieve the subsequent page. + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value may lead to unexpected results. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous list spaces call. + * Provide this parameter to retrieve the subsequent page. + * When paginating, the filter value should match the call that provided the + * page token. Passing a different value may lead to unexpected results. + * + * Generated from protobuf field string page_token = 2 [(.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. A query filter. + * You can filter spaces by the space type + * ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). + * To filter by space type, you must specify valid enum value, such as + * `SPACE` or `GROUP_CHAT` (the `space_type` can't be + * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` + * operator. + * For example, the following queries are valid: + * ``` + * space_type = "SPACE" + * spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A query filter. + * You can filter spaces by the space type + * ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). + * To filter by space type, you must specify valid enum value, such as + * `SPACE` or `GROUP_CHAT` (the `space_type` can't be + * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` + * operator. + * For example, the following queries are valid: + * ``` + * space_type = "SPACE" + * spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/ListSpacesResponse.php b/AppsChat/src/Chat/V1/ListSpacesResponse.php new file mode 100644 index 000000000000..25939f2fdc7d --- /dev/null +++ b/AppsChat/src/Chat/V1/ListSpacesResponse.php @@ -0,0 +1,103 @@ +google.chat.v1.ListSpacesResponse + */ +class ListSpacesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of spaces in the requested (or first) page. + * + * Generated from protobuf field repeated .google.chat.v1.Space spaces = 1; + */ + private $spaces; + /** + * You can send a token as `pageToken` to retrieve the next page of + * results. If 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 array<\Google\Apps\Chat\V1\Space>|\Google\Protobuf\Internal\RepeatedField $spaces + * List of spaces in the requested (or first) page. + * @type string $next_page_token + * You can send a token as `pageToken` to retrieve the next page of + * results. If empty, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Space::initOnce(); + parent::__construct($data); + } + + /** + * List of spaces in the requested (or first) page. + * + * Generated from protobuf field repeated .google.chat.v1.Space spaces = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpaces() + { + return $this->spaces; + } + + /** + * List of spaces in the requested (or first) page. + * + * Generated from protobuf field repeated .google.chat.v1.Space spaces = 1; + * @param array<\Google\Apps\Chat\V1\Space>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\Space::class); + $this->spaces = $arr; + + return $this; + } + + /** + * You can send a token as `pageToken` to retrieve the next page of + * results. If 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; + } + + /** + * You can send a token as `pageToken` to retrieve the next page of + * results. If 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/MatchedUrl.php b/AppsChat/src/Chat/V1/MatchedUrl.php new file mode 100644 index 000000000000..2500f22c05fc --- /dev/null +++ b/AppsChat/src/Chat/V1/MatchedUrl.php @@ -0,0 +1,69 @@ +google.chat.v1.MatchedUrl + */ +class MatchedUrl extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The URL that was matched. + * + * Generated from protobuf field string url = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $url + * Output only. The URL that was matched. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\MatchedUrl::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The URL that was matched. + * + * Generated from protobuf field string url = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Output only. The URL that was matched. + * + * Generated from protobuf field string url = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/Membership.php b/AppsChat/src/Chat/V1/Membership.php new file mode 100644 index 000000000000..64c57831e06b --- /dev/null +++ b/AppsChat/src/Chat/V1/Membership.php @@ -0,0 +1,352 @@ +google.chat.v1.Membership + */ +class Membership extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name of the membership, assigned by the server. + * Format: `spaces/{space}/members/{member}` + * + * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Output only. State of the membership. + * + * Generated from protobuf field .google.chat.v1.Membership.MembershipState state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. User's role within a Chat space, which determines their permitted + * actions in the space. + * [Developer Preview](https://developers.google.com/workspace/preview): + * This field can only be used as input in `UpdateMembership`. + * + * Generated from protobuf field .google.chat.v1.Membership.MembershipRole role = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $role = 0; + /** + * Optional. Immutable. The creation time of the membership, such as when a + * member joined or was invited to join a space. This field is output only, + * except when used to import historical memberships in import mode spaces. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $create_time = null; + /** + * Optional. Immutable. The deletion time of the membership, such as when a + * member left or was removed from a space. This field is output only, except + * when used to import historical memberships in import mode spaces. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $delete_time = null; + protected $memberType; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Resource name of the membership, assigned by the server. + * Format: `spaces/{space}/members/{member}` + * @type int $state + * Output only. State of the membership. + * @type int $role + * Optional. User's role within a Chat space, which determines their permitted + * actions in the space. + * [Developer Preview](https://developers.google.com/workspace/preview): + * This field can only be used as input in `UpdateMembership`. + * @type \Google\Apps\Chat\V1\User $member + * The Google Chat user or app the membership corresponds to. + * If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the + * output populates the + * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * `name` and `type`. + * @type \Google\Apps\Chat\V1\Group $group_member + * The Google Group the membership corresponds to. + * Only supports read operations. Other operations, like creating or + * updating a membership, aren't currently supported. + * @type \Google\Protobuf\Timestamp $create_time + * Optional. Immutable. The creation time of the membership, such as when a + * member joined or was invited to join a space. This field is output only, + * except when used to import historical memberships in import mode spaces. + * @type \Google\Protobuf\Timestamp $delete_time + * Optional. Immutable. The deletion time of the membership, such as when a + * member left or was removed from a space. This field is output only, except + * when used to import historical memberships in import mode spaces. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Membership::initOnce(); + parent::__construct($data); + } + + /** + * Resource name of the membership, assigned by the server. + * Format: `spaces/{space}/members/{member}` + * + * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Resource name of the membership, assigned by the server. + * Format: `spaces/{space}/members/{member}` + * + * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. State of the membership. + * + * Generated from protobuf field .google.chat.v1.Membership.MembershipState state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the membership. + * + * Generated from protobuf field .google.chat.v1.Membership.MembershipState state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\Membership\MembershipState::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. User's role within a Chat space, which determines their permitted + * actions in the space. + * [Developer Preview](https://developers.google.com/workspace/preview): + * This field can only be used as input in `UpdateMembership`. + * + * Generated from protobuf field .google.chat.v1.Membership.MembershipRole role = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getRole() + { + return $this->role; + } + + /** + * Optional. User's role within a Chat space, which determines their permitted + * actions in the space. + * [Developer Preview](https://developers.google.com/workspace/preview): + * This field can only be used as input in `UpdateMembership`. + * + * Generated from protobuf field .google.chat.v1.Membership.MembershipRole role = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\Membership\MembershipRole::class); + $this->role = $var; + + return $this; + } + + /** + * The Google Chat user or app the membership corresponds to. + * If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the + * output populates the + * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * `name` and `type`. + * + * Generated from protobuf field .google.chat.v1.User member = 3; + * @return \Google\Apps\Chat\V1\User|null + */ + public function getMember() + { + return $this->readOneof(3); + } + + public function hasMember() + { + return $this->hasOneof(3); + } + + /** + * The Google Chat user or app the membership corresponds to. + * If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the + * output populates the + * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * `name` and `type`. + * + * Generated from protobuf field .google.chat.v1.User member = 3; + * @param \Google\Apps\Chat\V1\User $var + * @return $this + */ + public function setMember($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\User::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The Google Group the membership corresponds to. + * Only supports read operations. Other operations, like creating or + * updating a membership, aren't currently supported. + * + * Generated from protobuf field .google.chat.v1.Group group_member = 5; + * @return \Google\Apps\Chat\V1\Group|null + */ + public function getGroupMember() + { + return $this->readOneof(5); + } + + public function hasGroupMember() + { + return $this->hasOneof(5); + } + + /** + * The Google Group the membership corresponds to. + * Only supports read operations. Other operations, like creating or + * updating a membership, aren't currently supported. + * + * Generated from protobuf field .google.chat.v1.Group group_member = 5; + * @param \Google\Apps\Chat\V1\Group $var + * @return $this + */ + public function setGroupMember($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Group::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. Immutable. The creation time of the membership, such as when a + * member joined or was invited to join a space. This field is output only, + * except when used to import historical memberships in import mode spaces. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Optional. Immutable. The creation time of the membership, such as when a + * member joined or was invited to join a space. This field is output only, + * except when used to import historical memberships in import mode spaces. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Optional. Immutable. The deletion time of the membership, such as when a + * member left or was removed from a space. This field is output only, except + * when used to import historical memberships in import mode spaces. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Optional. Immutable. The deletion time of the membership, such as when a + * member left or was removed from a space. This field is output only, except + * when used to import historical memberships in import mode spaces. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getMemberType() + { + return $this->whichOneof("memberType"); + } + +} + diff --git a/AppsChat/src/Chat/V1/Membership/MembershipRole.php b/AppsChat/src/Chat/V1/Membership/MembershipRole.php new file mode 100644 index 000000000000..e29f81a860bc --- /dev/null +++ b/AppsChat/src/Chat/V1/Membership/MembershipRole.php @@ -0,0 +1,71 @@ +google.chat.v1.Membership.MembershipRole + */ +class MembershipRole +{ + /** + * Default value. For [users][google.chat.v1.Membership.member]: they + * aren't a member of the space, but can be invited. For + * [Google Groups][google.chat.v1.Membership.group_member]: they're always + * assigned this role (other enum values might be used in the future). + * + * Generated from protobuf enum MEMBERSHIP_ROLE_UNSPECIFIED = 0; + */ + const MEMBERSHIP_ROLE_UNSPECIFIED = 0; + /** + * A member of the space. The user has basic permissions, like sending + * messages to the space. In 1:1 and unnamed group conversations, everyone + * has this role. + * + * Generated from protobuf enum ROLE_MEMBER = 1; + */ + const ROLE_MEMBER = 1; + /** + * A space manager. The user has all basic permissions plus administrative + * permissions that let them manage the space, like adding or removing + * members. Only supported in + * [SpaceType.SPACE][google.chat.v1.Space.SpaceType]. + * + * Generated from protobuf enum ROLE_MANAGER = 2; + */ + const ROLE_MANAGER = 2; + + private static $valueToName = [ + self::MEMBERSHIP_ROLE_UNSPECIFIED => 'MEMBERSHIP_ROLE_UNSPECIFIED', + self::ROLE_MEMBER => 'ROLE_MEMBER', + self::ROLE_MANAGER => 'ROLE_MANAGER', + ]; + + 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/Membership/MembershipState.php b/AppsChat/src/Chat/V1/Membership/MembershipState.php new file mode 100644 index 000000000000..e830b4d27258 --- /dev/null +++ b/AppsChat/src/Chat/V1/Membership/MembershipState.php @@ -0,0 +1,71 @@ +google.chat.v1.Membership.MembershipState + */ +class MembershipState +{ + /** + * Default value. Don't use. + * + * Generated from protobuf enum MEMBERSHIP_STATE_UNSPECIFIED = 0; + */ + const MEMBERSHIP_STATE_UNSPECIFIED = 0; + /** + * The user is added to the space, and can participate in the space. + * + * Generated from protobuf enum JOINED = 1; + */ + const JOINED = 1; + /** + * The user is invited to join the space, but hasn't joined it. + * + * Generated from protobuf enum INVITED = 2; + */ + const INVITED = 2; + /** + * The user doesn't belong to the space and doesn't have a pending + * invitation to join the space. + * + * Generated from protobuf enum NOT_A_MEMBER = 3; + */ + const NOT_A_MEMBER = 3; + + private static $valueToName = [ + self::MEMBERSHIP_STATE_UNSPECIFIED => 'MEMBERSHIP_STATE_UNSPECIFIED', + self::JOINED => 'JOINED', + self::INVITED => 'INVITED', + self::NOT_A_MEMBER => 'NOT_A_MEMBER', + ]; + + 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/Message.php b/AppsChat/src/Chat/V1/Message.php new file mode 100644 index 000000000000..f4952c6c6bc3 --- /dev/null +++ b/AppsChat/src/Chat/V1/Message.php @@ -0,0 +1,1618 @@ +google.chat.v1.Message + */ +class Message extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name of the message. + * Format: `spaces/{space}/messages/{message}` + * Where `{space}` is the ID of the space where the message is posted and + * `{message}` is a system-assigned ID for the message. For example, + * `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`. + * If you set a custom ID when you create a message, you can use this ID to + * specify the message in a request by replacing `{message}` with the value + * from the `clientAssignedMessageId` field. For example, + * `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name + * a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. The user who created the message. + * If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the output + * populates the + * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * `name` and `type`. + * + * Generated from protobuf field .google.chat.v1.User sender = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $sender = null; + /** + * Optional. Immutable. For spaces created in Chat, the time at which the + * message was created. This field is output only, except when used in import + * mode spaces. + * For import mode spaces, set this field to the historical timestamp at which + * the message was created in the source in order to preserve the original + * creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $create_time = null; + /** + * Output only. The time at which the message was last edited by a user. If + * the message has never been edited, this field is empty. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_update_time = null; + /** + * Output only. The time at which the message was deleted in + * Google Chat. If the message is never deleted, this field is empty. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Plain-text body of the message. The first link to an image, video, or web + * page generates a + * [preview chip](https://developers.google.com/chat/how-tos/preview-links). + * You can also [@mention a Google Chat + * user](https://developers.google.com/chat/format-messages#messages-@mention), + * or everyone in the space. + * To learn about creating text messages, see [Send a text + * message](https://developers.google.com/chat/api/guides/v1/messages/create#create-text-messages). + * + * Generated from protobuf field string text = 4; + */ + protected $text = ''; + /** + * Output only. Contains the message `text` with markups added to communicate + * formatting. This field might not capture all formatting visible in the UI, + * but includes the following: + * * [Markup + * syntax](https://developers.google.com/chat/format-messages) + * for bold, italic, strikethrough, monospace, and monospace block. + * * [User + * mentions](https://developers.google.com/chat/format-messages#messages-@mention) + * using the format ``. + * * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the + * first string is the URL and the second is the rendered text—for example, + * ``. + * * Custom emoji using the format `:{emoji_name}:`—for example, `:smile:`. + * This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning + * face emoji. + * For more information, see [View text formatting sent in a + * message](https://developers.google.com/chat/format-messages#view_text_formatting_sent_in_a_message) + * + * Generated from protobuf field string formatted_text = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $formatted_text = ''; + /** + * Deprecated: Use `cards_v2` instead. + * Rich, formatted, and interactive cards that you can use to display UI + * elements such as: formatted texts, buttons, and clickable images. Cards are + * normally displayed below the plain-text body of the message. `cards` and + * `cards_v2` can have a maximum size of 32 KB. + * + * Generated from protobuf field repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true]; + * @deprecated + */ + private $cards; + /** + * An array of + * [cards](https://developers.google.com/chat/api/reference/rest/v1/cards). + * Only Chat apps can create cards. If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the + * messages can't contain cards. + * To learn about cards and how to create them, see [Design dynamic, + * interactive, and consistent UIs with + * cards](https://developers.google.com/chat/ui). + * [Card builder](https://addons.gsuite.google.com/uikit/builder) + * + * Generated from protobuf field repeated .google.chat.v1.CardWithId cards_v2 = 22; + */ + private $cards_v2; + /** + * Output only. Annotations associated with the `text` in this message. + * + * Generated from protobuf field repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $annotations; + /** + * The thread the message belongs to. For example usage, see + * [Start or reply to a message + * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * + * Generated from protobuf field .google.chat.v1.Thread thread = 11; + */ + protected $thread = null; + /** + * If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the output + * populates the + * [space](https://developers.google.com/chat/api/reference/rest/v1/spaces) + * `name`. + * + * Generated from protobuf field .google.chat.v1.Space space = 12; + */ + protected $space = null; + /** + * A plain-text description of the message's cards, used when the actual cards + * can't be displayed—for example, mobile notifications. + * + * Generated from protobuf field string fallback_text = 13; + */ + protected $fallback_text = ''; + /** + * Input only. Parameters that a Chat app can use to configure how its + * response is posted. + * + * Generated from protobuf field .google.chat.v1.ActionResponse action_response = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $action_response = null; + /** + * Output only. Plain-text body of the message with all Chat app mentions + * stripped out. + * + * Generated from protobuf field string argument_text = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $argument_text = ''; + /** + * Output only. Slash command information, if applicable. + * + * Generated from protobuf field .google.chat.v1.SlashCommand slash_command = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $slash_command = null; + /** + * User-uploaded attachment. + * + * Generated from protobuf field repeated .google.chat.v1.Attachment attachment = 18; + */ + private $attachment; + /** + * Output only. A URL in `spaces.messages.text` that matches a link preview + * pattern. For more information, see [Preview + * links](https://developers.google.com/chat/how-tos/preview-links). + * + * Generated from protobuf field .google.chat.v1.MatchedUrl matched_url = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $matched_url = null; + /** + * Output only. When `true`, the message is a response in a reply thread. When + * `false`, the message is visible in the space's top-level conversation as + * either the first message of a thread or a message with no threaded replies. + * If the space doesn't support reply in threads, this field is always + * `false`. + * + * Generated from protobuf field bool thread_reply = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $thread_reply = false; + /** + * Optional. A custom ID for the message. You can use field to identify a + * message, or to get, delete, or update a message. To set a custom ID, + * specify the + * [`messageId`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) + * field when you create the message. For details, see [Name a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string client_assigned_message_id = 32; + */ + protected $client_assigned_message_id = ''; + /** + * Output only. The list of emoji reaction summaries on the message. + * + * Generated from protobuf field repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $emoji_reaction_summaries; + /** + * Immutable. Input for creating a message, otherwise output only. The user + * that can view the message. When set, the message is private and only + * visible to the specified user and the Chat app. Link previews and + * attachments aren't supported for private messages. + * Only Chat apps can send private messages. If your Chat app [authenticates + * as a user](https://developers.google.com/chat/api/guides/auth/users) to + * send a message, the message can't be private and must omit this field. + * For details, see [Send private messages to Google Chat + * users](https://developers.google.com/chat/api/guides/v1/messages/private). + * + * Generated from protobuf field .google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $private_message_viewer = null; + /** + * Output only. Information about a deleted message. A message is deleted when + * `delete_time` is set. + * + * Generated from protobuf field .google.chat.v1.DeletionMetadata deletion_metadata = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $deletion_metadata = null; + /** + * Output only. Information about a message that's quoted by a Google Chat + * user in a space. Google Chat users can quote a message to reply to it. + * + * Generated from protobuf field .google.chat.v1.QuotedMessageMetadata quoted_message_metadata = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $quoted_message_metadata = null; + /** + * Output only. GIF images that are attached to the message. + * + * Generated from protobuf field repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $attached_gifs; + /** + * One or more interactive widgets that appear at the bottom of a message. + * You can add accessory widgets to messages that contain text, cards, or both + * text and cards. Not supported for messages that contain dialogs. + * Creating a message with accessory widgets requires [app + * authentication] + * (https://developers.google.com/chat/api/guides/auth/service-accounts). + * The following example shows a Chat app that uses accessory widgets (thumbs + * up and thumbs down buttons) in a text message: + * ![Example accessory widgets + * message](https://developers.google.com/chat/images/message-accessory-widgets-reference.png) + * The JSON for this example message is the following: + * ``` + * { + * "text": "Rate your experience with this Chat app.", + * "accessoryWidgets": [ + * { + * "buttonList": { + * "buttons": [ + * { + * "icon": { + * "material_icon": { + * "name": "thumb_up" + * } + * }, + * "color": { + * "red": 0, + * "blue": 255, + * "green": 0 + * }, + * "onClick": { + * "action": { + * "function": "doUpvote", + * } + * } + * }, + * { + * "icon": { + * "material_icon": { + * "name": "thumb_down" + * } + * }, + * "color": { + * "red": 0, + * "blue": 255, + * "green": 0 + * }, + * "onClick": { + * "action": { + * "function": "doDownvote", + * } + * } + * } + * ] + * } + * } + * ] + * } + * ``` + * + * Generated from protobuf field repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44; + */ + private $accessory_widgets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Resource name of the message. + * Format: `spaces/{space}/messages/{message}` + * Where `{space}` is the ID of the space where the message is posted and + * `{message}` is a system-assigned ID for the message. For example, + * `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`. + * If you set a custom ID when you create a message, you can use this ID to + * specify the message in a request by replacing `{message}` with the value + * from the `clientAssignedMessageId` field. For example, + * `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name + * a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * @type \Google\Apps\Chat\V1\User $sender + * Output only. The user who created the message. + * If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the output + * populates the + * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * `name` and `type`. + * @type \Google\Protobuf\Timestamp $create_time + * Optional. Immutable. For spaces created in Chat, the time at which the + * message was created. This field is output only, except when used in import + * mode spaces. + * For import mode spaces, set this field to the historical timestamp at which + * the message was created in the source in order to preserve the original + * creation time. + * @type \Google\Protobuf\Timestamp $last_update_time + * Output only. The time at which the message was last edited by a user. If + * the message has never been edited, this field is empty. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. The time at which the message was deleted in + * Google Chat. If the message is never deleted, this field is empty. + * @type string $text + * Plain-text body of the message. The first link to an image, video, or web + * page generates a + * [preview chip](https://developers.google.com/chat/how-tos/preview-links). + * You can also [@mention a Google Chat + * user](https://developers.google.com/chat/format-messages#messages-@mention), + * or everyone in the space. + * To learn about creating text messages, see [Send a text + * message](https://developers.google.com/chat/api/guides/v1/messages/create#create-text-messages). + * @type string $formatted_text + * Output only. Contains the message `text` with markups added to communicate + * formatting. This field might not capture all formatting visible in the UI, + * but includes the following: + * * [Markup + * syntax](https://developers.google.com/chat/format-messages) + * for bold, italic, strikethrough, monospace, and monospace block. + * * [User + * mentions](https://developers.google.com/chat/format-messages#messages-@mention) + * using the format ``. + * * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the + * first string is the URL and the second is the rendered text—for example, + * ``. + * * Custom emoji using the format `:{emoji_name}:`—for example, `:smile:`. + * This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning + * face emoji. + * For more information, see [View text formatting sent in a + * message](https://developers.google.com/chat/format-messages#view_text_formatting_sent_in_a_message) + * @type array<\Google\Apps\Chat\V1\ContextualAddOnMarkup\Card>|\Google\Protobuf\Internal\RepeatedField $cards + * Deprecated: Use `cards_v2` instead. + * Rich, formatted, and interactive cards that you can use to display UI + * elements such as: formatted texts, buttons, and clickable images. Cards are + * normally displayed below the plain-text body of the message. `cards` and + * `cards_v2` can have a maximum size of 32 KB. + * @type array<\Google\Apps\Chat\V1\CardWithId>|\Google\Protobuf\Internal\RepeatedField $cards_v2 + * An array of + * [cards](https://developers.google.com/chat/api/reference/rest/v1/cards). + * Only Chat apps can create cards. If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the + * messages can't contain cards. + * To learn about cards and how to create them, see [Design dynamic, + * interactive, and consistent UIs with + * cards](https://developers.google.com/chat/ui). + * [Card builder](https://addons.gsuite.google.com/uikit/builder) + * @type array<\Google\Apps\Chat\V1\Annotation>|\Google\Protobuf\Internal\RepeatedField $annotations + * Output only. Annotations associated with the `text` in this message. + * @type \Google\Apps\Chat\V1\Thread $thread + * The thread the message belongs to. For example usage, see + * [Start or reply to a message + * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * @type \Google\Apps\Chat\V1\Space $space + * If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the output + * populates the + * [space](https://developers.google.com/chat/api/reference/rest/v1/spaces) + * `name`. + * @type string $fallback_text + * A plain-text description of the message's cards, used when the actual cards + * can't be displayed—for example, mobile notifications. + * @type \Google\Apps\Chat\V1\ActionResponse $action_response + * Input only. Parameters that a Chat app can use to configure how its + * response is posted. + * @type string $argument_text + * Output only. Plain-text body of the message with all Chat app mentions + * stripped out. + * @type \Google\Apps\Chat\V1\SlashCommand $slash_command + * Output only. Slash command information, if applicable. + * @type array<\Google\Apps\Chat\V1\Attachment>|\Google\Protobuf\Internal\RepeatedField $attachment + * 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 + * links](https://developers.google.com/chat/how-tos/preview-links). + * @type bool $thread_reply + * Output only. When `true`, the message is a response in a reply thread. When + * `false`, the message is visible in the space's top-level conversation as + * either the first message of a thread or a message with no threaded replies. + * If the space doesn't support reply in threads, this field is always + * `false`. + * @type string $client_assigned_message_id + * Optional. A custom ID for the message. You can use field to identify a + * message, or to get, delete, or update a message. To set a custom ID, + * specify the + * [`messageId`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) + * field when you create the message. For details, see [Name a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * @type array<\Google\Apps\Chat\V1\EmojiReactionSummary>|\Google\Protobuf\Internal\RepeatedField $emoji_reaction_summaries + * Output only. The list of emoji reaction summaries on the message. + * @type \Google\Apps\Chat\V1\User $private_message_viewer + * Immutable. Input for creating a message, otherwise output only. The user + * that can view the message. When set, the message is private and only + * visible to the specified user and the Chat app. Link previews and + * attachments aren't supported for private messages. + * Only Chat apps can send private messages. If your Chat app [authenticates + * as a user](https://developers.google.com/chat/api/guides/auth/users) to + * send a message, the message can't be private and must omit this field. + * For details, see [Send private messages to Google Chat + * users](https://developers.google.com/chat/api/guides/v1/messages/private). + * @type \Google\Apps\Chat\V1\DeletionMetadata $deletion_metadata + * Output only. Information about a deleted message. A message is deleted when + * `delete_time` is set. + * @type \Google\Apps\Chat\V1\QuotedMessageMetadata $quoted_message_metadata + * Output only. Information about a message that's quoted by a Google Chat + * user in a space. Google Chat users can quote a message to reply to it. + * @type array<\Google\Apps\Chat\V1\AttachedGif>|\Google\Protobuf\Internal\RepeatedField $attached_gifs + * Output only. GIF images that are attached to the message. + * @type array<\Google\Apps\Chat\V1\AccessoryWidget>|\Google\Protobuf\Internal\RepeatedField $accessory_widgets + * One or more interactive widgets that appear at the bottom of a message. + * You can add accessory widgets to messages that contain text, cards, or both + * text and cards. Not supported for messages that contain dialogs. + * Creating a message with accessory widgets requires [app + * authentication] + * (https://developers.google.com/chat/api/guides/auth/service-accounts). + * The following example shows a Chat app that uses accessory widgets (thumbs + * up and thumbs down buttons) in a text message: + * ![Example accessory widgets + * message](https://developers.google.com/chat/images/message-accessory-widgets-reference.png) + * The JSON for this example message is the following: + * ``` + * { + * "text": "Rate your experience with this Chat app.", + * "accessoryWidgets": [ + * { + * "buttonList": { + * "buttons": [ + * { + * "icon": { + * "material_icon": { + * "name": "thumb_up" + * } + * }, + * "color": { + * "red": 0, + * "blue": 255, + * "green": 0 + * }, + * "onClick": { + * "action": { + * "function": "doUpvote", + * } + * } + * }, + * { + * "icon": { + * "material_icon": { + * "name": "thumb_down" + * } + * }, + * "color": { + * "red": 0, + * "blue": 255, + * "green": 0 + * }, + * "onClick": { + * "action": { + * "function": "doDownvote", + * } + * } + * } + * ] + * } + * } + * ] + * } + * ``` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * Resource name of the message. + * Format: `spaces/{space}/messages/{message}` + * Where `{space}` is the ID of the space where the message is posted and + * `{message}` is a system-assigned ID for the message. For example, + * `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`. + * If you set a custom ID when you create a message, you can use this ID to + * specify the message in a request by replacing `{message}` with the value + * from the `clientAssignedMessageId` field. For example, + * `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name + * a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Resource name of the message. + * Format: `spaces/{space}/messages/{message}` + * Where `{space}` is the ID of the space where the message is posted and + * `{message}` is a system-assigned ID for the message. For example, + * `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`. + * If you set a custom ID when you create a message, you can use this ID to + * specify the message in a request by replacing `{message}` with the value + * from the `clientAssignedMessageId` field. For example, + * `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name + * a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The user who created the message. + * If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the output + * populates the + * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * `name` and `type`. + * + * Generated from protobuf field .google.chat.v1.User sender = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Apps\Chat\V1\User|null + */ + public function getSender() + { + return $this->sender; + } + + public function hasSender() + { + return isset($this->sender); + } + + public function clearSender() + { + unset($this->sender); + } + + /** + * Output only. The user who created the message. + * If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the output + * populates the + * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * `name` and `type`. + * + * Generated from protobuf field .google.chat.v1.User sender = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Apps\Chat\V1\User $var + * @return $this + */ + public function setSender($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\User::class); + $this->sender = $var; + + return $this; + } + + /** + * Optional. Immutable. For spaces created in Chat, the time at which the + * message was created. This field is output only, except when used in import + * mode spaces. + * For import mode spaces, set this field to the historical timestamp at which + * the message was created in the source in order to preserve the original + * creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Optional. Immutable. For spaces created in Chat, the time at which the + * message was created. This field is output only, except when used in import + * mode spaces. + * For import mode spaces, set this field to the historical timestamp at which + * the message was created in the source in order to preserve the original + * creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time at which the message was last edited by a user. If + * the message has never been edited, this field is empty. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastUpdateTime() + { + return $this->last_update_time; + } + + public function hasLastUpdateTime() + { + return isset($this->last_update_time); + } + + public function clearLastUpdateTime() + { + unset($this->last_update_time); + } + + /** + * Output only. The time at which the message was last edited by a user. If + * the message has never been edited, this field is empty. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_update_time = $var; + + return $this; + } + + /** + * Output only. The time at which the message was deleted in + * Google Chat. If the message is never deleted, this field is empty. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. The time at which the message was deleted in + * Google Chat. If the message is never deleted, this field is empty. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Plain-text body of the message. The first link to an image, video, or web + * page generates a + * [preview chip](https://developers.google.com/chat/how-tos/preview-links). + * You can also [@mention a Google Chat + * user](https://developers.google.com/chat/format-messages#messages-@mention), + * or everyone in the space. + * To learn about creating text messages, see [Send a text + * message](https://developers.google.com/chat/api/guides/v1/messages/create#create-text-messages). + * + * Generated from protobuf field string text = 4; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Plain-text body of the message. The first link to an image, video, or web + * page generates a + * [preview chip](https://developers.google.com/chat/how-tos/preview-links). + * You can also [@mention a Google Chat + * user](https://developers.google.com/chat/format-messages#messages-@mention), + * or everyone in the space. + * To learn about creating text messages, see [Send a text + * message](https://developers.google.com/chat/api/guides/v1/messages/create#create-text-messages). + * + * Generated from protobuf field string text = 4; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Output only. Contains the message `text` with markups added to communicate + * formatting. This field might not capture all formatting visible in the UI, + * but includes the following: + * * [Markup + * syntax](https://developers.google.com/chat/format-messages) + * for bold, italic, strikethrough, monospace, and monospace block. + * * [User + * mentions](https://developers.google.com/chat/format-messages#messages-@mention) + * using the format ``. + * * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the + * first string is the URL and the second is the rendered text—for example, + * ``. + * * Custom emoji using the format `:{emoji_name}:`—for example, `:smile:`. + * This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning + * face emoji. + * For more information, see [View text formatting sent in a + * message](https://developers.google.com/chat/format-messages#view_text_formatting_sent_in_a_message) + * + * Generated from protobuf field string formatted_text = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getFormattedText() + { + return $this->formatted_text; + } + + /** + * Output only. Contains the message `text` with markups added to communicate + * formatting. This field might not capture all formatting visible in the UI, + * but includes the following: + * * [Markup + * syntax](https://developers.google.com/chat/format-messages) + * for bold, italic, strikethrough, monospace, and monospace block. + * * [User + * mentions](https://developers.google.com/chat/format-messages#messages-@mention) + * using the format ``. + * * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the + * first string is the URL and the second is the rendered text—for example, + * ``. + * * Custom emoji using the format `:{emoji_name}:`—for example, `:smile:`. + * This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning + * face emoji. + * For more information, see [View text formatting sent in a + * message](https://developers.google.com/chat/format-messages#view_text_formatting_sent_in_a_message) + * + * Generated from protobuf field string formatted_text = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setFormattedText($var) + { + GPBUtil::checkString($var, True); + $this->formatted_text = $var; + + return $this; + } + + /** + * Deprecated: Use `cards_v2` instead. + * Rich, formatted, and interactive cards that you can use to display UI + * elements such as: formatted texts, buttons, and clickable images. Cards are + * normally displayed below the plain-text body of the message. `cards` and + * `cards_v2` can have a maximum size of 32 KB. + * + * Generated from protobuf field repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getCards() + { + @trigger_error('cards is deprecated.', E_USER_DEPRECATED); + return $this->cards; + } + + /** + * Deprecated: Use `cards_v2` instead. + * Rich, formatted, and interactive cards that you can use to display UI + * elements such as: formatted texts, buttons, and clickable images. Cards are + * normally displayed below the plain-text body of the message. `cards` and + * `cards_v2` can have a maximum size of 32 KB. + * + * Generated from protobuf field repeated .google.chat.v1.ContextualAddOnMarkup.Card cards = 5 [deprecated = true]; + * @param array<\Google\Apps\Chat\V1\ContextualAddOnMarkup\Card>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setCards($var) + { + @trigger_error('cards is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\ContextualAddOnMarkup\Card::class); + $this->cards = $arr; + + return $this; + } + + /** + * An array of + * [cards](https://developers.google.com/chat/api/reference/rest/v1/cards). + * Only Chat apps can create cards. If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the + * messages can't contain cards. + * To learn about cards and how to create them, see [Design dynamic, + * interactive, and consistent UIs with + * cards](https://developers.google.com/chat/ui). + * [Card builder](https://addons.gsuite.google.com/uikit/builder) + * + * Generated from protobuf field repeated .google.chat.v1.CardWithId cards_v2 = 22; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCardsV2() + { + return $this->cards_v2; + } + + /** + * An array of + * [cards](https://developers.google.com/chat/api/reference/rest/v1/cards). + * Only Chat apps can create cards. If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the + * messages can't contain cards. + * To learn about cards and how to create them, see [Design dynamic, + * interactive, and consistent UIs with + * cards](https://developers.google.com/chat/ui). + * [Card builder](https://addons.gsuite.google.com/uikit/builder) + * + * Generated from protobuf field repeated .google.chat.v1.CardWithId cards_v2 = 22; + * @param array<\Google\Apps\Chat\V1\CardWithId>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCardsV2($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\CardWithId::class); + $this->cards_v2 = $arr; + + return $this; + } + + /** + * Output only. Annotations associated with the `text` in this message. + * + * Generated from protobuf field repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Output only. Annotations associated with the `text` in this message. + * + * Generated from protobuf field repeated .google.chat.v1.Annotation annotations = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Apps\Chat\V1\Annotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\Annotation::class); + $this->annotations = $arr; + + return $this; + } + + /** + * The thread the message belongs to. For example usage, see + * [Start or reply to a message + * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * + * Generated from protobuf field .google.chat.v1.Thread thread = 11; + * @return \Google\Apps\Chat\V1\Thread|null + */ + public function getThread() + { + return $this->thread; + } + + public function hasThread() + { + return isset($this->thread); + } + + public function clearThread() + { + unset($this->thread); + } + + /** + * The thread the message belongs to. For example usage, see + * [Start or reply to a message + * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * + * Generated from protobuf field .google.chat.v1.Thread thread = 11; + * @param \Google\Apps\Chat\V1\Thread $var + * @return $this + */ + public function setThread($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Thread::class); + $this->thread = $var; + + return $this; + } + + /** + * If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the output + * populates the + * [space](https://developers.google.com/chat/api/reference/rest/v1/spaces) + * `name`. + * + * Generated from protobuf field .google.chat.v1.Space space = 12; + * @return \Google\Apps\Chat\V1\Space|null + */ + public function getSpace() + { + return $this->space; + } + + public function hasSpace() + { + return isset($this->space); + } + + public function clearSpace() + { + unset($this->space); + } + + /** + * If your Chat app [authenticates as a + * user](https://developers.google.com/chat/api/guides/auth/users), the output + * populates the + * [space](https://developers.google.com/chat/api/reference/rest/v1/spaces) + * `name`. + * + * Generated from protobuf field .google.chat.v1.Space space = 12; + * @param \Google\Apps\Chat\V1\Space $var + * @return $this + */ + public function setSpace($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space::class); + $this->space = $var; + + return $this; + } + + /** + * A plain-text description of the message's cards, used when the actual cards + * can't be displayed—for example, mobile notifications. + * + * Generated from protobuf field string fallback_text = 13; + * @return string + */ + public function getFallbackText() + { + return $this->fallback_text; + } + + /** + * A plain-text description of the message's cards, used when the actual cards + * can't be displayed—for example, mobile notifications. + * + * Generated from protobuf field string fallback_text = 13; + * @param string $var + * @return $this + */ + public function setFallbackText($var) + { + GPBUtil::checkString($var, True); + $this->fallback_text = $var; + + return $this; + } + + /** + * Input only. Parameters that a Chat app can use to configure how its + * response is posted. + * + * Generated from protobuf field .google.chat.v1.ActionResponse action_response = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Apps\Chat\V1\ActionResponse|null + */ + public function getActionResponse() + { + return $this->action_response; + } + + public function hasActionResponse() + { + return isset($this->action_response); + } + + public function clearActionResponse() + { + unset($this->action_response); + } + + /** + * Input only. Parameters that a Chat app can use to configure how its + * response is posted. + * + * Generated from protobuf field .google.chat.v1.ActionResponse action_response = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Apps\Chat\V1\ActionResponse $var + * @return $this + */ + public function setActionResponse($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\ActionResponse::class); + $this->action_response = $var; + + return $this; + } + + /** + * Output only. Plain-text body of the message with all Chat app mentions + * stripped out. + * + * Generated from protobuf field string argument_text = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getArgumentText() + { + return $this->argument_text; + } + + /** + * Output only. Plain-text body of the message with all Chat app mentions + * stripped out. + * + * Generated from protobuf field string argument_text = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setArgumentText($var) + { + GPBUtil::checkString($var, True); + $this->argument_text = $var; + + return $this; + } + + /** + * Output only. Slash command information, if applicable. + * + * Generated from protobuf field .google.chat.v1.SlashCommand slash_command = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Apps\Chat\V1\SlashCommand|null + */ + public function getSlashCommand() + { + return $this->slash_command; + } + + public function hasSlashCommand() + { + return isset($this->slash_command); + } + + public function clearSlashCommand() + { + unset($this->slash_command); + } + + /** + * Output only. Slash command information, if applicable. + * + * Generated from protobuf field .google.chat.v1.SlashCommand slash_command = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Apps\Chat\V1\SlashCommand $var + * @return $this + */ + public function setSlashCommand($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\SlashCommand::class); + $this->slash_command = $var; + + return $this; + } + + /** + * User-uploaded attachment. + * + * Generated from protobuf field repeated .google.chat.v1.Attachment attachment = 18; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttachment() + { + return $this->attachment; + } + + /** + * User-uploaded attachment. + * + * Generated from protobuf field repeated .google.chat.v1.Attachment attachment = 18; + * @param array<\Google\Apps\Chat\V1\Attachment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttachment($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\Attachment::class); + $this->attachment = $arr; + + return $this; + } + + /** + * Output only. A URL in `spaces.messages.text` that matches a link preview + * pattern. For more information, see [Preview + * links](https://developers.google.com/chat/how-tos/preview-links). + * + * Generated from protobuf field .google.chat.v1.MatchedUrl matched_url = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Apps\Chat\V1\MatchedUrl|null + */ + public function getMatchedUrl() + { + return $this->matched_url; + } + + public function hasMatchedUrl() + { + return isset($this->matched_url); + } + + public function clearMatchedUrl() + { + unset($this->matched_url); + } + + /** + * Output only. A URL in `spaces.messages.text` that matches a link preview + * pattern. For more information, see [Preview + * links](https://developers.google.com/chat/how-tos/preview-links). + * + * Generated from protobuf field .google.chat.v1.MatchedUrl matched_url = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Apps\Chat\V1\MatchedUrl $var + * @return $this + */ + public function setMatchedUrl($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\MatchedUrl::class); + $this->matched_url = $var; + + return $this; + } + + /** + * Output only. When `true`, the message is a response in a reply thread. When + * `false`, the message is visible in the space's top-level conversation as + * either the first message of a thread or a message with no threaded replies. + * If the space doesn't support reply in threads, this field is always + * `false`. + * + * Generated from protobuf field bool thread_reply = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getThreadReply() + { + return $this->thread_reply; + } + + /** + * Output only. When `true`, the message is a response in a reply thread. When + * `false`, the message is visible in the space's top-level conversation as + * either the first message of a thread or a message with no threaded replies. + * If the space doesn't support reply in threads, this field is always + * `false`. + * + * Generated from protobuf field bool thread_reply = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setThreadReply($var) + { + GPBUtil::checkBool($var); + $this->thread_reply = $var; + + return $this; + } + + /** + * Optional. A custom ID for the message. You can use field to identify a + * message, or to get, delete, or update a message. To set a custom ID, + * specify the + * [`messageId`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) + * field when you create the message. For details, see [Name a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string client_assigned_message_id = 32; + * @return string + */ + public function getClientAssignedMessageId() + { + return $this->client_assigned_message_id; + } + + /** + * Optional. A custom ID for the message. You can use field to identify a + * message, or to get, delete, or update a message. To set a custom ID, + * specify the + * [`messageId`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) + * field when you create the message. For details, see [Name a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * Generated from protobuf field string client_assigned_message_id = 32; + * @param string $var + * @return $this + */ + public function setClientAssignedMessageId($var) + { + GPBUtil::checkString($var, True); + $this->client_assigned_message_id = $var; + + return $this; + } + + /** + * Output only. The list of emoji reaction summaries on the message. + * + * Generated from protobuf field repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEmojiReactionSummaries() + { + return $this->emoji_reaction_summaries; + } + + /** + * Output only. The list of emoji reaction summaries on the message. + * + * Generated from protobuf field repeated .google.chat.v1.EmojiReactionSummary emoji_reaction_summaries = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Apps\Chat\V1\EmojiReactionSummary>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEmojiReactionSummaries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\EmojiReactionSummary::class); + $this->emoji_reaction_summaries = $arr; + + return $this; + } + + /** + * Immutable. Input for creating a message, otherwise output only. The user + * that can view the message. When set, the message is private and only + * visible to the specified user and the Chat app. Link previews and + * attachments aren't supported for private messages. + * Only Chat apps can send private messages. If your Chat app [authenticates + * as a user](https://developers.google.com/chat/api/guides/auth/users) to + * send a message, the message can't be private and must omit this field. + * For details, see [Send private messages to Google Chat + * users](https://developers.google.com/chat/api/guides/v1/messages/private). + * + * Generated from protobuf field .google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Apps\Chat\V1\User|null + */ + public function getPrivateMessageViewer() + { + return $this->private_message_viewer; + } + + public function hasPrivateMessageViewer() + { + return isset($this->private_message_viewer); + } + + public function clearPrivateMessageViewer() + { + unset($this->private_message_viewer); + } + + /** + * Immutable. Input for creating a message, otherwise output only. The user + * that can view the message. When set, the message is private and only + * visible to the specified user and the Chat app. Link previews and + * attachments aren't supported for private messages. + * Only Chat apps can send private messages. If your Chat app [authenticates + * as a user](https://developers.google.com/chat/api/guides/auth/users) to + * send a message, the message can't be private and must omit this field. + * For details, see [Send private messages to Google Chat + * users](https://developers.google.com/chat/api/guides/v1/messages/private). + * + * Generated from protobuf field .google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Apps\Chat\V1\User $var + * @return $this + */ + public function setPrivateMessageViewer($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\User::class); + $this->private_message_viewer = $var; + + return $this; + } + + /** + * Output only. Information about a deleted message. A message is deleted when + * `delete_time` is set. + * + * Generated from protobuf field .google.chat.v1.DeletionMetadata deletion_metadata = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Apps\Chat\V1\DeletionMetadata|null + */ + public function getDeletionMetadata() + { + return $this->deletion_metadata; + } + + public function hasDeletionMetadata() + { + return isset($this->deletion_metadata); + } + + public function clearDeletionMetadata() + { + unset($this->deletion_metadata); + } + + /** + * Output only. Information about a deleted message. A message is deleted when + * `delete_time` is set. + * + * Generated from protobuf field .google.chat.v1.DeletionMetadata deletion_metadata = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Apps\Chat\V1\DeletionMetadata $var + * @return $this + */ + public function setDeletionMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\DeletionMetadata::class); + $this->deletion_metadata = $var; + + return $this; + } + + /** + * Output only. Information about a message that's quoted by a Google Chat + * user in a space. Google Chat users can quote a message to reply to it. + * + * Generated from protobuf field .google.chat.v1.QuotedMessageMetadata quoted_message_metadata = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Apps\Chat\V1\QuotedMessageMetadata|null + */ + public function getQuotedMessageMetadata() + { + return $this->quoted_message_metadata; + } + + public function hasQuotedMessageMetadata() + { + return isset($this->quoted_message_metadata); + } + + public function clearQuotedMessageMetadata() + { + unset($this->quoted_message_metadata); + } + + /** + * Output only. Information about a message that's quoted by a Google Chat + * user in a space. Google Chat users can quote a message to reply to it. + * + * Generated from protobuf field .google.chat.v1.QuotedMessageMetadata quoted_message_metadata = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Apps\Chat\V1\QuotedMessageMetadata $var + * @return $this + */ + public function setQuotedMessageMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\QuotedMessageMetadata::class); + $this->quoted_message_metadata = $var; + + return $this; + } + + /** + * Output only. GIF images that are attached to the message. + * + * Generated from protobuf field repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttachedGifs() + { + return $this->attached_gifs; + } + + /** + * Output only. GIF images that are attached to the message. + * + * Generated from protobuf field repeated .google.chat.v1.AttachedGif attached_gifs = 42 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Apps\Chat\V1\AttachedGif>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttachedGifs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\AttachedGif::class); + $this->attached_gifs = $arr; + + return $this; + } + + /** + * One or more interactive widgets that appear at the bottom of a message. + * You can add accessory widgets to messages that contain text, cards, or both + * text and cards. Not supported for messages that contain dialogs. + * Creating a message with accessory widgets requires [app + * authentication] + * (https://developers.google.com/chat/api/guides/auth/service-accounts). + * The following example shows a Chat app that uses accessory widgets (thumbs + * up and thumbs down buttons) in a text message: + * ![Example accessory widgets + * message](https://developers.google.com/chat/images/message-accessory-widgets-reference.png) + * The JSON for this example message is the following: + * ``` + * { + * "text": "Rate your experience with this Chat app.", + * "accessoryWidgets": [ + * { + * "buttonList": { + * "buttons": [ + * { + * "icon": { + * "material_icon": { + * "name": "thumb_up" + * } + * }, + * "color": { + * "red": 0, + * "blue": 255, + * "green": 0 + * }, + * "onClick": { + * "action": { + * "function": "doUpvote", + * } + * } + * }, + * { + * "icon": { + * "material_icon": { + * "name": "thumb_down" + * } + * }, + * "color": { + * "red": 0, + * "blue": 255, + * "green": 0 + * }, + * "onClick": { + * "action": { + * "function": "doDownvote", + * } + * } + * } + * ] + * } + * } + * ] + * } + * ``` + * + * Generated from protobuf field repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccessoryWidgets() + { + return $this->accessory_widgets; + } + + /** + * One or more interactive widgets that appear at the bottom of a message. + * You can add accessory widgets to messages that contain text, cards, or both + * text and cards. Not supported for messages that contain dialogs. + * Creating a message with accessory widgets requires [app + * authentication] + * (https://developers.google.com/chat/api/guides/auth/service-accounts). + * The following example shows a Chat app that uses accessory widgets (thumbs + * up and thumbs down buttons) in a text message: + * ![Example accessory widgets + * message](https://developers.google.com/chat/images/message-accessory-widgets-reference.png) + * The JSON for this example message is the following: + * ``` + * { + * "text": "Rate your experience with this Chat app.", + * "accessoryWidgets": [ + * { + * "buttonList": { + * "buttons": [ + * { + * "icon": { + * "material_icon": { + * "name": "thumb_up" + * } + * }, + * "color": { + * "red": 0, + * "blue": 255, + * "green": 0 + * }, + * "onClick": { + * "action": { + * "function": "doUpvote", + * } + * } + * }, + * { + * "icon": { + * "material_icon": { + * "name": "thumb_down" + * } + * }, + * "color": { + * "red": 0, + * "blue": 255, + * "green": 0 + * }, + * "onClick": { + * "action": { + * "function": "doDownvote", + * } + * } + * } + * ] + * } + * } + * ] + * } + * ``` + * + * Generated from protobuf field repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44; + * @param array<\Google\Apps\Chat\V1\AccessoryWidget>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccessoryWidgets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\AccessoryWidget::class); + $this->accessory_widgets = $arr; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/QuotedMessageMetadata.php b/AppsChat/src/Chat/V1/QuotedMessageMetadata.php new file mode 100644 index 000000000000..776a4ab987d7 --- /dev/null +++ b/AppsChat/src/Chat/V1/QuotedMessageMetadata.php @@ -0,0 +1,119 @@ +google.chat.v1.QuotedMessageMetadata + */ +class QuotedMessageMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Resource name of the quoted message. + * Format: `spaces/{space}/messages/{message}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Output only. The timestamp when the quoted message was created or when the + * quoted message was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Resource name of the quoted message. + * Format: `spaces/{space}/messages/{message}` + * @type \Google\Protobuf\Timestamp $last_update_time + * Output only. The timestamp when the quoted message was created or when the + * quoted message was last updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Resource name of the quoted message. + * Format: `spaces/{space}/messages/{message}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Resource name of the quoted message. + * Format: `spaces/{space}/messages/{message}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The timestamp when the quoted message was created or when the + * quoted message was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastUpdateTime() + { + return $this->last_update_time; + } + + public function hasLastUpdateTime() + { + return isset($this->last_update_time); + } + + public function clearLastUpdateTime() + { + unset($this->last_update_time); + } + + /** + * Output only. The timestamp when the quoted message was created or when the + * quoted message was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_update_time = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/Reaction.php b/AppsChat/src/Chat/V1/Reaction.php new file mode 100644 index 000000000000..373aec899eaf --- /dev/null +++ b/AppsChat/src/Chat/V1/Reaction.php @@ -0,0 +1,159 @@ +google.chat.v1.Reaction + */ +class Reaction extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the reaction. + * Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. The user who created the reaction. + * + * Generated from protobuf field .google.chat.v1.User user = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $user = null; + /** + * The emoji used in the reaction. + * + * Generated from protobuf field .google.chat.v1.Emoji emoji = 3; + */ + protected $emoji = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the reaction. + * Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + * @type \Google\Apps\Chat\V1\User $user + * Output only. The user who created the reaction. + * @type \Google\Apps\Chat\V1\Emoji $emoji + * The emoji used in the reaction. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Reaction::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the reaction. + * Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the reaction. + * Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The user who created the reaction. + * + * Generated from protobuf field .google.chat.v1.User user = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Apps\Chat\V1\User|null + */ + public function getUser() + { + return $this->user; + } + + public function hasUser() + { + return isset($this->user); + } + + public function clearUser() + { + unset($this->user); + } + + /** + * Output only. The user who created the reaction. + * + * Generated from protobuf field .google.chat.v1.User user = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Apps\Chat\V1\User $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\User::class); + $this->user = $var; + + return $this; + } + + /** + * The emoji used in the reaction. + * + * Generated from protobuf field .google.chat.v1.Emoji emoji = 3; + * @return \Google\Apps\Chat\V1\Emoji|null + */ + public function getEmoji() + { + return $this->emoji; + } + + public function hasEmoji() + { + return isset($this->emoji); + } + + public function clearEmoji() + { + unset($this->emoji); + } + + /** + * The emoji used in the reaction. + * + * Generated from protobuf field .google.chat.v1.Emoji emoji = 3; + * @param \Google\Apps\Chat\V1\Emoji $var + * @return $this + */ + public function setEmoji($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Emoji::class); + $this->emoji = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/RichLinkMetadata.php b/AppsChat/src/Chat/V1/RichLinkMetadata.php new file mode 100644 index 000000000000..bd348864d3a0 --- /dev/null +++ b/AppsChat/src/Chat/V1/RichLinkMetadata.php @@ -0,0 +1,143 @@ +google.chat.v1.RichLinkMetadata + */ +class RichLinkMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The URI of this link. + * + * Generated from protobuf field string uri = 1; + */ + protected $uri = ''; + /** + * The rich link type. + * + * Generated from protobuf field .google.chat.v1.RichLinkMetadata.RichLinkType rich_link_type = 2; + */ + protected $rich_link_type = 0; + protected $data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * The URI of this link. + * @type int $rich_link_type + * The rich link type. + * @type \Google\Apps\Chat\V1\DriveLinkData $drive_link_data + * Data for a drive link. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Annotation::initOnce(); + parent::__construct($data); + } + + /** + * The URI of this link. + * + * Generated from protobuf field string uri = 1; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * The URI of this link. + * + * Generated from protobuf field string uri = 1; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * The rich link type. + * + * Generated from protobuf field .google.chat.v1.RichLinkMetadata.RichLinkType rich_link_type = 2; + * @return int + */ + public function getRichLinkType() + { + return $this->rich_link_type; + } + + /** + * The rich link type. + * + * Generated from protobuf field .google.chat.v1.RichLinkMetadata.RichLinkType rich_link_type = 2; + * @param int $var + * @return $this + */ + public function setRichLinkType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\RichLinkMetadata\RichLinkType::class); + $this->rich_link_type = $var; + + return $this; + } + + /** + * Data for a drive link. + * + * Generated from protobuf field .google.chat.v1.DriveLinkData drive_link_data = 3; + * @return \Google\Apps\Chat\V1\DriveLinkData|null + */ + public function getDriveLinkData() + { + return $this->readOneof(3); + } + + public function hasDriveLinkData() + { + return $this->hasOneof(3); + } + + /** + * Data for a drive link. + * + * Generated from protobuf field .google.chat.v1.DriveLinkData drive_link_data = 3; + * @param \Google\Apps\Chat\V1\DriveLinkData $var + * @return $this + */ + public function setDriveLinkData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\DriveLinkData::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getData() + { + return $this->whichOneof("data"); + } + +} + diff --git a/AppsChat/src/Chat/V1/RichLinkMetadata/RichLinkType.php b/AppsChat/src/Chat/V1/RichLinkMetadata/RichLinkType.php new file mode 100644 index 000000000000..f77ded10b072 --- /dev/null +++ b/AppsChat/src/Chat/V1/RichLinkMetadata/RichLinkType.php @@ -0,0 +1,55 @@ +google.chat.v1.RichLinkMetadata.RichLinkType + */ +class RichLinkType +{ + /** + * Default value for the enum. Don't use. + * + * Generated from protobuf enum RICH_LINK_TYPE_UNSPECIFIED = 0; + */ + const RICH_LINK_TYPE_UNSPECIFIED = 0; + /** + * A Google Drive rich link type. + * + * Generated from protobuf enum DRIVE_FILE = 1; + */ + const DRIVE_FILE = 1; + + private static $valueToName = [ + self::RICH_LINK_TYPE_UNSPECIFIED => 'RICH_LINK_TYPE_UNSPECIFIED', + self::DRIVE_FILE => 'DRIVE_FILE', + ]; + + 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/SetUpSpaceRequest.php b/AppsChat/src/Chat/V1/SetUpSpaceRequest.php new file mode 100644 index 000000000000..e26dc3ee59c7 --- /dev/null +++ b/AppsChat/src/Chat/V1/SetUpSpaceRequest.php @@ -0,0 +1,303 @@ +google.chat.v1.SetUpSpaceRequest + */ +class SetUpSpaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `Space.spaceType` field is required. + * To create a space, set `Space.spaceType` to `SPACE` and set + * `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when + * setting up a space, try a different `displayName`. An existing space + * within the Google Workspace organization might already use this display + * name. + * To create a group chat, set `Space.spaceType` to + * `GROUP_CHAT`. Don't set `Space.displayName`. + * To create a 1:1 conversation between humans, + * set `Space.spaceType` to `DIRECT_MESSAGE` and set + * `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or + * `Space.spaceDetails`. + * To create an 1:1 conversation between a human and the calling Chat app, set + * `Space.spaceType` to `DIRECT_MESSAGE` and + * `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or + * `Space.spaceDetails`. + * If a `DIRECT_MESSAGE` space already exists, that space is returned instead + * of creating a new space. + * + * Generated from protobuf field .google.chat.v1.Space space = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $space = null; + /** + * Optional. A unique identifier for this request. + * A random UUID is recommended. + * Specifying an existing request ID returns the space created with that ID + * instead of creating a new space. + * Specifying an existing request ID from the same Chat app with a different + * authenticated user returns an error. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. The Google Chat users to invite to join the space. Omit the + * calling user, as they are added automatically. + * The set currently allows up to 20 memberships (in addition to the caller). + * The `Membership.member` field must contain a `user` with `name` populated + * (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only + * add human users when setting up a space (adding Chat apps is only supported + * for direct message setup with the calling app). You can also add members + * using the user's email as an alias for {user}. For example, the `user.name` + * can be `users/example@gmail.com`." To invite Gmail users or users from + * external Google Workspace domains, user's email must be used for + * `{user}`. + * Optional when setting `Space.spaceType` to `SPACE`. + * Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at + * least two memberships. + * Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human + * user, along with exactly one membership. + * Must be empty when creating a 1:1 conversation between a human and the + * calling Chat app (when setting `Space.spaceType` to + * `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`). + * + * Generated from protobuf field repeated .google.chat.v1.Membership memberships = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $memberships; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Space $space + * Required. The `Space.spaceType` field is required. + * To create a space, set `Space.spaceType` to `SPACE` and set + * `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when + * setting up a space, try a different `displayName`. An existing space + * within the Google Workspace organization might already use this display + * name. + * To create a group chat, set `Space.spaceType` to + * `GROUP_CHAT`. Don't set `Space.displayName`. + * To create a 1:1 conversation between humans, + * set `Space.spaceType` to `DIRECT_MESSAGE` and set + * `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or + * `Space.spaceDetails`. + * To create an 1:1 conversation between a human and the calling Chat app, set + * `Space.spaceType` to `DIRECT_MESSAGE` and + * `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or + * `Space.spaceDetails`. + * If a `DIRECT_MESSAGE` space already exists, that space is returned instead + * of creating a new space. + * @type string $request_id + * Optional. A unique identifier for this request. + * A random UUID is recommended. + * Specifying an existing request ID returns the space created with that ID + * instead of creating a new space. + * Specifying an existing request ID from the same Chat app with a different + * authenticated user returns an error. + * @type array<\Google\Apps\Chat\V1\Membership>|\Google\Protobuf\Internal\RepeatedField $memberships + * Optional. The Google Chat users to invite to join the space. Omit the + * calling user, as they are added automatically. + * The set currently allows up to 20 memberships (in addition to the caller). + * The `Membership.member` field must contain a `user` with `name` populated + * (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only + * add human users when setting up a space (adding Chat apps is only supported + * for direct message setup with the calling app). You can also add members + * using the user's email as an alias for {user}. For example, the `user.name` + * can be `users/example@gmail.com`." To invite Gmail users or users from + * external Google Workspace domains, user's email must be used for + * `{user}`. + * Optional when setting `Space.spaceType` to `SPACE`. + * Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at + * least two memberships. + * Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human + * user, along with exactly one membership. + * Must be empty when creating a 1:1 conversation between a human and the + * calling Chat app (when setting `Space.spaceType` to + * `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\SpaceSetup::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `Space.spaceType` field is required. + * To create a space, set `Space.spaceType` to `SPACE` and set + * `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when + * setting up a space, try a different `displayName`. An existing space + * within the Google Workspace organization might already use this display + * name. + * To create a group chat, set `Space.spaceType` to + * `GROUP_CHAT`. Don't set `Space.displayName`. + * To create a 1:1 conversation between humans, + * set `Space.spaceType` to `DIRECT_MESSAGE` and set + * `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or + * `Space.spaceDetails`. + * To create an 1:1 conversation between a human and the calling Chat app, set + * `Space.spaceType` to `DIRECT_MESSAGE` and + * `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or + * `Space.spaceDetails`. + * If a `DIRECT_MESSAGE` space already exists, that space is returned instead + * of creating a new space. + * + * Generated from protobuf field .google.chat.v1.Space space = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Apps\Chat\V1\Space|null + */ + public function getSpace() + { + return $this->space; + } + + public function hasSpace() + { + return isset($this->space); + } + + public function clearSpace() + { + unset($this->space); + } + + /** + * Required. The `Space.spaceType` field is required. + * To create a space, set `Space.spaceType` to `SPACE` and set + * `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when + * setting up a space, try a different `displayName`. An existing space + * within the Google Workspace organization might already use this display + * name. + * To create a group chat, set `Space.spaceType` to + * `GROUP_CHAT`. Don't set `Space.displayName`. + * To create a 1:1 conversation between humans, + * set `Space.spaceType` to `DIRECT_MESSAGE` and set + * `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or + * `Space.spaceDetails`. + * To create an 1:1 conversation between a human and the calling Chat app, set + * `Space.spaceType` to `DIRECT_MESSAGE` and + * `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or + * `Space.spaceDetails`. + * If a `DIRECT_MESSAGE` space already exists, that space is returned instead + * of creating a new space. + * + * Generated from protobuf field .google.chat.v1.Space space = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Apps\Chat\V1\Space $var + * @return $this + */ + public function setSpace($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space::class); + $this->space = $var; + + return $this; + } + + /** + * Optional. A unique identifier for this request. + * A random UUID is recommended. + * Specifying an existing request ID returns the space created with that ID + * instead of creating a new space. + * Specifying an existing request ID from the same Chat app with a different + * authenticated user returns an error. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A unique identifier for this request. + * A random UUID is recommended. + * Specifying an existing request ID returns the space created with that ID + * instead of creating a new space. + * Specifying an existing request ID from the same Chat app with a different + * authenticated user returns an error. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. The Google Chat users to invite to join the space. Omit the + * calling user, as they are added automatically. + * The set currently allows up to 20 memberships (in addition to the caller). + * The `Membership.member` field must contain a `user` with `name` populated + * (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only + * add human users when setting up a space (adding Chat apps is only supported + * for direct message setup with the calling app). You can also add members + * using the user's email as an alias for {user}. For example, the `user.name` + * can be `users/example@gmail.com`." To invite Gmail users or users from + * external Google Workspace domains, user's email must be used for + * `{user}`. + * Optional when setting `Space.spaceType` to `SPACE`. + * Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at + * least two memberships. + * Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human + * user, along with exactly one membership. + * Must be empty when creating a 1:1 conversation between a human and the + * calling Chat app (when setting `Space.spaceType` to + * `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`). + * + * Generated from protobuf field repeated .google.chat.v1.Membership memberships = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMemberships() + { + return $this->memberships; + } + + /** + * Optional. The Google Chat users to invite to join the space. Omit the + * calling user, as they are added automatically. + * The set currently allows up to 20 memberships (in addition to the caller). + * The `Membership.member` field must contain a `user` with `name` populated + * (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only + * add human users when setting up a space (adding Chat apps is only supported + * for direct message setup with the calling app). You can also add members + * using the user's email as an alias for {user}. For example, the `user.name` + * can be `users/example@gmail.com`." To invite Gmail users or users from + * external Google Workspace domains, user's email must be used for + * `{user}`. + * Optional when setting `Space.spaceType` to `SPACE`. + * Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at + * least two memberships. + * Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human + * user, along with exactly one membership. + * Must be empty when creating a 1:1 conversation between a human and the + * calling Chat app (when setting `Space.spaceType` to + * `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`). + * + * Generated from protobuf field repeated .google.chat.v1.Membership memberships = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Apps\Chat\V1\Membership>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMemberships($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\Membership::class); + $this->memberships = $arr; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/SlashCommand.php b/AppsChat/src/Chat/V1/SlashCommand.php new file mode 100644 index 000000000000..e06d30be2cb2 --- /dev/null +++ b/AppsChat/src/Chat/V1/SlashCommand.php @@ -0,0 +1,68 @@ +google.chat.v1.SlashCommand + */ +class SlashCommand extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of the slash command invoked. + * + * Generated from protobuf field int64 command_id = 1; + */ + protected $command_id = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $command_id + * The ID of the slash command invoked. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\SlashCommand::initOnce(); + parent::__construct($data); + } + + /** + * The ID of the slash command invoked. + * + * Generated from protobuf field int64 command_id = 1; + * @return int|string + */ + public function getCommandId() + { + return $this->command_id; + } + + /** + * The ID of the slash command invoked. + * + * Generated from protobuf field int64 command_id = 1; + * @param int|string $var + * @return $this + */ + public function setCommandId($var) + { + GPBUtil::checkInt64($var); + $this->command_id = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/SlashCommandMetadata.php b/AppsChat/src/Chat/V1/SlashCommandMetadata.php new file mode 100644 index 000000000000..316532e5b3ee --- /dev/null +++ b/AppsChat/src/Chat/V1/SlashCommandMetadata.php @@ -0,0 +1,213 @@ +google.chat.v1.SlashCommandMetadata + */ +class SlashCommandMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The Chat app whose command was invoked. + * + * Generated from protobuf field .google.chat.v1.User bot = 1; + */ + protected $bot = null; + /** + * The type of slash command. + * + * Generated from protobuf field .google.chat.v1.SlashCommandMetadata.Type type = 2; + */ + protected $type = 0; + /** + * The name of the invoked slash command. + * + * Generated from protobuf field string command_name = 3; + */ + protected $command_name = ''; + /** + * The command ID of the invoked slash command. + * + * Generated from protobuf field int64 command_id = 4; + */ + protected $command_id = 0; + /** + * Indicates whether the slash command is for a dialog. + * + * Generated from protobuf field bool triggers_dialog = 5; + */ + protected $triggers_dialog = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\User $bot + * The Chat app whose command was invoked. + * @type int $type + * The type of slash command. + * @type string $command_name + * The name of the invoked slash command. + * @type int|string $command_id + * The command ID of the invoked slash command. + * @type bool $triggers_dialog + * Indicates whether the slash command is for a dialog. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Annotation::initOnce(); + parent::__construct($data); + } + + /** + * The Chat app whose command was invoked. + * + * Generated from protobuf field .google.chat.v1.User bot = 1; + * @return \Google\Apps\Chat\V1\User|null + */ + public function getBot() + { + return $this->bot; + } + + public function hasBot() + { + return isset($this->bot); + } + + public function clearBot() + { + unset($this->bot); + } + + /** + * The Chat app whose command was invoked. + * + * Generated from protobuf field .google.chat.v1.User bot = 1; + * @param \Google\Apps\Chat\V1\User $var + * @return $this + */ + public function setBot($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\User::class); + $this->bot = $var; + + return $this; + } + + /** + * The type of slash command. + * + * Generated from protobuf field .google.chat.v1.SlashCommandMetadata.Type type = 2; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of slash command. + * + * Generated from protobuf field .google.chat.v1.SlashCommandMetadata.Type type = 2; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\SlashCommandMetadata\Type::class); + $this->type = $var; + + return $this; + } + + /** + * The name of the invoked slash command. + * + * Generated from protobuf field string command_name = 3; + * @return string + */ + public function getCommandName() + { + return $this->command_name; + } + + /** + * The name of the invoked slash command. + * + * Generated from protobuf field string command_name = 3; + * @param string $var + * @return $this + */ + public function setCommandName($var) + { + GPBUtil::checkString($var, True); + $this->command_name = $var; + + return $this; + } + + /** + * The command ID of the invoked slash command. + * + * Generated from protobuf field int64 command_id = 4; + * @return int|string + */ + public function getCommandId() + { + return $this->command_id; + } + + /** + * The command ID of the invoked slash command. + * + * Generated from protobuf field int64 command_id = 4; + * @param int|string $var + * @return $this + */ + public function setCommandId($var) + { + GPBUtil::checkInt64($var); + $this->command_id = $var; + + return $this; + } + + /** + * Indicates whether the slash command is for a dialog. + * + * Generated from protobuf field bool triggers_dialog = 5; + * @return bool + */ + public function getTriggersDialog() + { + return $this->triggers_dialog; + } + + /** + * Indicates whether the slash command is for a dialog. + * + * Generated from protobuf field bool triggers_dialog = 5; + * @param bool $var + * @return $this + */ + public function setTriggersDialog($var) + { + GPBUtil::checkBool($var); + $this->triggers_dialog = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/SlashCommandMetadata/Type.php b/AppsChat/src/Chat/V1/SlashCommandMetadata/Type.php new file mode 100644 index 000000000000..b96b8e408023 --- /dev/null +++ b/AppsChat/src/Chat/V1/SlashCommandMetadata/Type.php @@ -0,0 +1,60 @@ +google.chat.v1.SlashCommandMetadata.Type + */ +class Type +{ + /** + * Default value for the enum. Don't use. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Add Chat app to space. + * + * Generated from protobuf enum ADD = 1; + */ + const ADD = 1; + /** + * Invoke slash command in space. + * + * Generated from protobuf enum INVOKE = 2; + */ + const INVOKE = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::ADD => 'ADD', + self::INVOKE => 'INVOKE', + ]; + + 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/Space.php b/AppsChat/src/Chat/V1/Space.php new file mode 100644 index 000000000000..1816e0517f7e --- /dev/null +++ b/AppsChat/src/Chat/V1/Space.php @@ -0,0 +1,638 @@ +google.chat.v1.Space + */ +class Space extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name of the space. + * Format: `spaces/{space}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. Deprecated: Use `space_type` instead. + * The type of a space. + * + * Generated from protobuf field .google.chat.v1.Space.Type type = 2 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated + */ + protected $type = 0; + /** + * The type of space. Required when creating a space or updating the space + * type of a space. Output only for other usage. + * + * Generated from protobuf field .google.chat.v1.Space.SpaceType space_type = 10; + */ + protected $space_type = 0; + /** + * Optional. Whether the space is a DM between a Chat app and a single + * human. + * + * Generated from protobuf field bool single_user_bot_dm = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $single_user_bot_dm = false; + /** + * Output only. Deprecated: Use `spaceThreadingState` instead. + * Whether messages are threaded in this space. + * + * Generated from protobuf field bool threaded = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated + */ + protected $threaded = false; + /** + * The space's display name. Required when [creating a + * space](https://developers.google.com/chat/api/reference/rest/v1/spaces/create). + * If you receive the error message `ALREADY_EXISTS` when creating a space or + * updating the `displayName`, try a different `displayName`. An + * existing space within the Google Workspace organization might already use + * this display name. + * For direct messages, this field might be empty. + * Supports up to 128 characters. + * + * Generated from protobuf field string display_name = 3; + */ + protected $display_name = ''; + /** + * Immutable. Whether this space permits any Google Chat user as a member. + * Input when creating a space in a Google Workspace organization. Omit this + * field when creating spaces in the following conditions: + * * The authenticated user uses a Google Account. By default, + * the space permits any Google Chat user. + * * The space is used to [import data to Google Chat] + * (https://developers.google.com/chat/api/guides/import-data-overview). + * Import mode spaces must only permit members from the same Google + * Workspace organization. + * For existing spaces, this field is output only. + * + * Generated from protobuf field bool external_user_allowed = 8 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $external_user_allowed = false; + /** + * Output only. The threading state in the Chat space. + * + * Generated from protobuf field .google.chat.v1.Space.SpaceThreadingState space_threading_state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $space_threading_state = 0; + /** + * Details about the space including description and rules. + * + * Generated from protobuf field .google.chat.v1.Space.SpaceDetails space_details = 11; + */ + protected $space_details = null; + /** + * The message history state for messages and threads in this space. + * + * Generated from protobuf field .google.chat.v1.HistoryState space_history_state = 13; + */ + protected $space_history_state = 0; + /** + * Optional. Whether this space is created in `Import Mode` as part of a data + * migration into Google Workspace. While spaces are being imported, they + * aren't visible to users until the import is complete. + * + * Generated from protobuf field bool import_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $import_mode = false; + /** + * Optional. Immutable. For spaces created in Chat, the time the space was + * created. This field is output only, except when used in import mode spaces. + * For import mode spaces, set this field to the historical timestamp at which + * the space was created in the source in order to preserve the original + * creation time. + * Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 17 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $create_time = null; + /** + * Output only. Whether the Chat app was installed by a Google Workspace + * administrator. Administrators can install a Chat app for their domain, + * organizational unit, or a group of users. + * Administrators can only install Chat apps for direct messaging between + * users and the app. To support admin install, your app must feature direct + * messaging. + * + * Generated from protobuf field bool admin_installed = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $admin_installed = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Resource name of the space. + * Format: `spaces/{space}` + * @type int $type + * Output only. Deprecated: Use `space_type` instead. + * The type of a space. + * @type int $space_type + * The type of space. Required when creating a space or updating the space + * type of a space. Output only for other usage. + * @type bool $single_user_bot_dm + * Optional. Whether the space is a DM between a Chat app and a single + * human. + * @type bool $threaded + * Output only. Deprecated: Use `spaceThreadingState` instead. + * Whether messages are threaded in this space. + * @type string $display_name + * The space's display name. Required when [creating a + * space](https://developers.google.com/chat/api/reference/rest/v1/spaces/create). + * If you receive the error message `ALREADY_EXISTS` when creating a space or + * updating the `displayName`, try a different `displayName`. An + * existing space within the Google Workspace organization might already use + * this display name. + * For direct messages, this field might be empty. + * Supports up to 128 characters. + * @type bool $external_user_allowed + * Immutable. Whether this space permits any Google Chat user as a member. + * Input when creating a space in a Google Workspace organization. Omit this + * field when creating spaces in the following conditions: + * * The authenticated user uses a Google Account. By default, + * the space permits any Google Chat user. + * * The space is used to [import data to Google Chat] + * (https://developers.google.com/chat/api/guides/import-data-overview). + * Import mode spaces must only permit members from the same Google + * Workspace organization. + * For existing spaces, this field is output only. + * @type int $space_threading_state + * Output only. The threading state in the Chat space. + * @type \Google\Apps\Chat\V1\Space\SpaceDetails $space_details + * Details about the space including description and rules. + * @type int $space_history_state + * The message history state for messages and threads in this space. + * @type bool $import_mode + * Optional. Whether this space is created in `Import Mode` as part of a data + * migration into Google Workspace. While spaces are being imported, they + * aren't visible to users until the import is complete. + * @type \Google\Protobuf\Timestamp $create_time + * Optional. Immutable. For spaces created in Chat, the time the space was + * created. This field is output only, except when used in import mode spaces. + * For import mode spaces, set this field to the historical timestamp at which + * the space was created in the source in order to preserve the original + * creation time. + * Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`. + * @type bool $admin_installed + * Output only. Whether the Chat app was installed by a Google Workspace + * administrator. Administrators can install a Chat app for their domain, + * organizational unit, or a group of users. + * Administrators can only install Chat apps for direct messaging between + * users and the app. To support admin install, your app must feature direct + * messaging. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Space::initOnce(); + parent::__construct($data); + } + + /** + * Resource name of the space. + * Format: `spaces/{space}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Resource name of the space. + * Format: `spaces/{space}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Deprecated: Use `space_type` instead. + * The type of a space. + * + * Generated from protobuf field .google.chat.v1.Space.Type type = 2 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + * @deprecated + */ + public function getType() + { + @trigger_error('type is deprecated.', E_USER_DEPRECATED); + return $this->type; + } + + /** + * Output only. Deprecated: Use `space_type` instead. + * The type of a space. + * + * Generated from protobuf field .google.chat.v1.Space.Type type = 2 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + * @deprecated + */ + public function setType($var) + { + @trigger_error('type is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\Space\Type::class); + $this->type = $var; + + return $this; + } + + /** + * The type of space. Required when creating a space or updating the space + * type of a space. Output only for other usage. + * + * Generated from protobuf field .google.chat.v1.Space.SpaceType space_type = 10; + * @return int + */ + public function getSpaceType() + { + return $this->space_type; + } + + /** + * The type of space. Required when creating a space or updating the space + * type of a space. Output only for other usage. + * + * Generated from protobuf field .google.chat.v1.Space.SpaceType space_type = 10; + * @param int $var + * @return $this + */ + public function setSpaceType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\Space\SpaceType::class); + $this->space_type = $var; + + return $this; + } + + /** + * Optional. Whether the space is a DM between a Chat app and a single + * human. + * + * Generated from protobuf field bool single_user_bot_dm = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSingleUserBotDm() + { + return $this->single_user_bot_dm; + } + + /** + * Optional. Whether the space is a DM between a Chat app and a single + * human. + * + * Generated from protobuf field bool single_user_bot_dm = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSingleUserBotDm($var) + { + GPBUtil::checkBool($var); + $this->single_user_bot_dm = $var; + + return $this; + } + + /** + * Output only. Deprecated: Use `spaceThreadingState` instead. + * Whether messages are threaded in this space. + * + * Generated from protobuf field bool threaded = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + * @deprecated + */ + public function getThreaded() + { + @trigger_error('threaded is deprecated.', E_USER_DEPRECATED); + return $this->threaded; + } + + /** + * Output only. Deprecated: Use `spaceThreadingState` instead. + * Whether messages are threaded in this space. + * + * Generated from protobuf field bool threaded = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setThreaded($var) + { + @trigger_error('threaded is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->threaded = $var; + + return $this; + } + + /** + * The space's display name. Required when [creating a + * space](https://developers.google.com/chat/api/reference/rest/v1/spaces/create). + * If you receive the error message `ALREADY_EXISTS` when creating a space or + * updating the `displayName`, try a different `displayName`. An + * existing space within the Google Workspace organization might already use + * this display name. + * For direct messages, this field might be empty. + * Supports up to 128 characters. + * + * Generated from protobuf field string display_name = 3; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The space's display name. Required when [creating a + * space](https://developers.google.com/chat/api/reference/rest/v1/spaces/create). + * If you receive the error message `ALREADY_EXISTS` when creating a space or + * updating the `displayName`, try a different `displayName`. An + * existing space within the Google Workspace organization might already use + * this display name. + * For direct messages, this field might be empty. + * Supports up to 128 characters. + * + * Generated from protobuf field string display_name = 3; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Immutable. Whether this space permits any Google Chat user as a member. + * Input when creating a space in a Google Workspace organization. Omit this + * field when creating spaces in the following conditions: + * * The authenticated user uses a Google Account. By default, + * the space permits any Google Chat user. + * * The space is used to [import data to Google Chat] + * (https://developers.google.com/chat/api/guides/import-data-overview). + * Import mode spaces must only permit members from the same Google + * Workspace organization. + * For existing spaces, this field is output only. + * + * Generated from protobuf field bool external_user_allowed = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * @return bool + */ + public function getExternalUserAllowed() + { + return $this->external_user_allowed; + } + + /** + * Immutable. Whether this space permits any Google Chat user as a member. + * Input when creating a space in a Google Workspace organization. Omit this + * field when creating spaces in the following conditions: + * * The authenticated user uses a Google Account. By default, + * the space permits any Google Chat user. + * * The space is used to [import data to Google Chat] + * (https://developers.google.com/chat/api/guides/import-data-overview). + * Import mode spaces must only permit members from the same Google + * Workspace organization. + * For existing spaces, this field is output only. + * + * Generated from protobuf field bool external_user_allowed = 8 [(.google.api.field_behavior) = IMMUTABLE]; + * @param bool $var + * @return $this + */ + public function setExternalUserAllowed($var) + { + GPBUtil::checkBool($var); + $this->external_user_allowed = $var; + + return $this; + } + + /** + * Output only. The threading state in the Chat space. + * + * Generated from protobuf field .google.chat.v1.Space.SpaceThreadingState space_threading_state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSpaceThreadingState() + { + return $this->space_threading_state; + } + + /** + * Output only. The threading state in the Chat space. + * + * Generated from protobuf field .google.chat.v1.Space.SpaceThreadingState space_threading_state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSpaceThreadingState($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\Space\SpaceThreadingState::class); + $this->space_threading_state = $var; + + return $this; + } + + /** + * Details about the space including description and rules. + * + * Generated from protobuf field .google.chat.v1.Space.SpaceDetails space_details = 11; + * @return \Google\Apps\Chat\V1\Space\SpaceDetails|null + */ + public function getSpaceDetails() + { + return $this->space_details; + } + + public function hasSpaceDetails() + { + return isset($this->space_details); + } + + public function clearSpaceDetails() + { + unset($this->space_details); + } + + /** + * Details about the space including description and rules. + * + * Generated from protobuf field .google.chat.v1.Space.SpaceDetails space_details = 11; + * @param \Google\Apps\Chat\V1\Space\SpaceDetails $var + * @return $this + */ + public function setSpaceDetails($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space\SpaceDetails::class); + $this->space_details = $var; + + return $this; + } + + /** + * The message history state for messages and threads in this space. + * + * Generated from protobuf field .google.chat.v1.HistoryState space_history_state = 13; + * @return int + */ + public function getSpaceHistoryState() + { + return $this->space_history_state; + } + + /** + * The message history state for messages and threads in this space. + * + * Generated from protobuf field .google.chat.v1.HistoryState space_history_state = 13; + * @param int $var + * @return $this + */ + public function setSpaceHistoryState($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\HistoryState::class); + $this->space_history_state = $var; + + return $this; + } + + /** + * Optional. Whether this space is created in `Import Mode` as part of a data + * migration into Google Workspace. While spaces are being imported, they + * aren't visible to users until the import is complete. + * + * Generated from protobuf field bool import_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getImportMode() + { + return $this->import_mode; + } + + /** + * Optional. Whether this space is created in `Import Mode` as part of a data + * migration into Google Workspace. While spaces are being imported, they + * aren't visible to users until the import is complete. + * + * Generated from protobuf field bool import_mode = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setImportMode($var) + { + GPBUtil::checkBool($var); + $this->import_mode = $var; + + return $this; + } + + /** + * Optional. Immutable. For spaces created in Chat, the time the space was + * created. This field is output only, except when used in import mode spaces. + * For import mode spaces, set this field to the historical timestamp at which + * the space was created in the source in order to preserve the original + * creation time. + * Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 17 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Optional. Immutable. For spaces created in Chat, the time the space was + * created. This field is output only, except when used in import mode spaces. + * For import mode spaces, set this field to the historical timestamp at which + * the space was created in the source in order to preserve the original + * creation time. + * Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 17 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Whether the Chat app was installed by a Google Workspace + * administrator. Administrators can install a Chat app for their domain, + * organizational unit, or a group of users. + * Administrators can only install Chat apps for direct messaging between + * users and the app. To support admin install, your app must feature direct + * messaging. + * + * Generated from protobuf field bool admin_installed = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getAdminInstalled() + { + return $this->admin_installed; + } + + /** + * Output only. Whether the Chat app was installed by a Google Workspace + * administrator. Administrators can install a Chat app for their domain, + * organizational unit, or a group of users. + * Administrators can only install Chat apps for direct messaging between + * users and the app. To support admin install, your app must feature direct + * messaging. + * + * Generated from protobuf field bool admin_installed = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setAdminInstalled($var) + { + GPBUtil::checkBool($var); + $this->admin_installed = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/Space/SpaceDetails.php b/AppsChat/src/Chat/V1/Space/SpaceDetails.php new file mode 100644 index 000000000000..92ae7537b62c --- /dev/null +++ b/AppsChat/src/Chat/V1/Space/SpaceDetails.php @@ -0,0 +1,114 @@ +google.chat.v1.Space.SpaceDetails + */ +class SpaceDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A description of the space. For example, describe the space's + * discussion topic, functional purpose, or participants. + * Supports up to 150 characters. + * + * Generated from protobuf field string description = 1; + */ + protected $description = ''; + /** + * Optional. The space's rules, expectations, and etiquette. + * Supports up to 5,000 characters. + * + * Generated from protobuf field string guidelines = 2; + */ + protected $guidelines = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * Optional. A description of the space. For example, describe the space's + * discussion topic, functional purpose, or participants. + * Supports up to 150 characters. + * @type string $guidelines + * Optional. The space's rules, expectations, and etiquette. + * Supports up to 5,000 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Space::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A description of the space. For example, describe the space's + * discussion topic, functional purpose, or participants. + * Supports up to 150 characters. + * + * Generated from protobuf field string description = 1; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A description of the space. For example, describe the space's + * discussion topic, functional purpose, or participants. + * Supports up to 150 characters. + * + * Generated from protobuf field string description = 1; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. The space's rules, expectations, and etiquette. + * Supports up to 5,000 characters. + * + * Generated from protobuf field string guidelines = 2; + * @return string + */ + public function getGuidelines() + { + return $this->guidelines; + } + + /** + * Optional. The space's rules, expectations, and etiquette. + * Supports up to 5,000 characters. + * + * Generated from protobuf field string guidelines = 2; + * @param string $var + * @return $this + */ + public function setGuidelines($var) + { + GPBUtil::checkString($var, True); + $this->guidelines = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Chat/V1/Space/SpaceThreadingState.php b/AppsChat/src/Chat/V1/Space/SpaceThreadingState.php new file mode 100644 index 000000000000..445c079d953a --- /dev/null +++ b/AppsChat/src/Chat/V1/Space/SpaceThreadingState.php @@ -0,0 +1,73 @@ +google.chat.v1.Space.SpaceThreadingState + */ +class SpaceThreadingState +{ + /** + * Reserved. + * + * Generated from protobuf enum SPACE_THREADING_STATE_UNSPECIFIED = 0; + */ + 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. + * + * Generated from protobuf enum THREADED_MESSAGES = 2; + */ + const THREADED_MESSAGES = 2; + /** + * Named spaces where the conversation is organized by topic. Topics and + * their replies are grouped together. + * + * Generated from protobuf enum GROUPED_MESSAGES = 3; + */ + const GROUPED_MESSAGES = 3; + /** + * Direct messages (DMs) between two people and group conversations between + * 3 or more people. + * + * Generated from protobuf enum UNTHREADED_MESSAGES = 4; + */ + const UNTHREADED_MESSAGES = 4; + + private static $valueToName = [ + self::SPACE_THREADING_STATE_UNSPECIFIED => 'SPACE_THREADING_STATE_UNSPECIFIED', + self::THREADED_MESSAGES => 'THREADED_MESSAGES', + self::GROUPED_MESSAGES => 'GROUPED_MESSAGES', + self::UNTHREADED_MESSAGES => 'UNTHREADED_MESSAGES', + ]; + + 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/Space/SpaceType.php b/AppsChat/src/Chat/V1/Space/SpaceType.php new file mode 100644 index 000000000000..88e12bba4c49 --- /dev/null +++ b/AppsChat/src/Chat/V1/Space/SpaceType.php @@ -0,0 +1,72 @@ +google.chat.v1.Space.SpaceType + */ +class SpaceType +{ + /** + * Reserved. + * + * Generated from protobuf enum SPACE_TYPE_UNSPECIFIED = 0; + */ + const SPACE_TYPE_UNSPECIFIED = 0; + /** + * A place where people send messages, share files, and collaborate. + * A `SPACE` can include Chat apps. + * + * Generated from protobuf enum SPACE = 1; + */ + const SPACE = 1; + /** + * Group conversations between 3 or more people. + * A `GROUP_CHAT` can include Chat apps. + * + * Generated from protobuf enum GROUP_CHAT = 2; + */ + const GROUP_CHAT = 2; + /** + * 1:1 messages between two humans or a human and a Chat app. + * + * Generated from protobuf enum DIRECT_MESSAGE = 3; + */ + const DIRECT_MESSAGE = 3; + + private static $valueToName = [ + self::SPACE_TYPE_UNSPECIFIED => 'SPACE_TYPE_UNSPECIFIED', + self::SPACE => 'SPACE', + self::GROUP_CHAT => 'GROUP_CHAT', + self::DIRECT_MESSAGE => 'DIRECT_MESSAGE', + ]; + + 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/Space/Type.php b/AppsChat/src/Chat/V1/Space/Type.php new file mode 100644 index 000000000000..0971ff19b78e --- /dev/null +++ b/AppsChat/src/Chat/V1/Space/Type.php @@ -0,0 +1,61 @@ +google.chat.v1.Space.Type + */ +class Type +{ + /** + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Conversations between two or more humans. + * + * Generated from protobuf enum ROOM = 1; + */ + const ROOM = 1; + /** + * 1:1 Direct Message between a human and a Chat app, where all messages are + * flat. Note that this doesn't include direct messages between two humans. + * + * Generated from protobuf enum DM = 2; + */ + const DM = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::ROOM => 'ROOM', + self::DM => 'DM', + ]; + + 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/Thread.php b/AppsChat/src/Chat/V1/Thread.php new file mode 100644 index 000000000000..978edec93ea8 --- /dev/null +++ b/AppsChat/src/Chat/V1/Thread.php @@ -0,0 +1,134 @@ +google.chat.v1.Thread + */ +class Thread extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Resource name of the thread. + * Example: `spaces/{space}/threads/{thread}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Optional. Input for creating or updating a thread. Otherwise, output only. + * ID for the thread. Supports up to 4000 characters. + * This ID is unique to the Chat app that sets it. For example, if + * multiple Chat apps create a message using the same thread key, + * the messages are posted in different threads. To reply in a + * thread created by a person or another Chat app, specify the thread `name` + * field instead. + * + * Generated from protobuf field string thread_key = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $thread_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Resource name of the thread. + * Example: `spaces/{space}/threads/{thread}` + * @type string $thread_key + * Optional. Input for creating or updating a thread. Otherwise, output only. + * ID for the thread. Supports up to 4000 characters. + * This ID is unique to the Chat app that sets it. For example, if + * multiple Chat apps create a message using the same thread key, + * the messages are posted in different threads. To reply in a + * thread created by a person or another Chat app, specify the thread `name` + * field instead. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Resource name of the thread. + * Example: `spaces/{space}/threads/{thread}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Resource name of the thread. + * Example: `spaces/{space}/threads/{thread}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Input for creating or updating a thread. Otherwise, output only. + * ID for the thread. Supports up to 4000 characters. + * This ID is unique to the Chat app that sets it. For example, if + * multiple Chat apps create a message using the same thread key, + * the messages are posted in different threads. To reply in a + * thread created by a person or another Chat app, specify the thread `name` + * field instead. + * + * Generated from protobuf field string thread_key = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getThreadKey() + { + return $this->thread_key; + } + + /** + * Optional. Input for creating or updating a thread. Otherwise, output only. + * ID for the thread. Supports up to 4000 characters. + * This ID is unique to the Chat app that sets it. For example, if + * multiple Chat apps create a message using the same thread key, + * the messages are posted in different threads. To reply in a + * thread created by a person or another Chat app, specify the thread `name` + * field instead. + * + * Generated from protobuf field string thread_key = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setThreadKey($var) + { + GPBUtil::checkString($var, True); + $this->thread_key = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/UpdateMessageRequest.php b/AppsChat/src/Chat/V1/UpdateMessageRequest.php new file mode 100644 index 000000000000..c91181951678 --- /dev/null +++ b/AppsChat/src/Chat/V1/UpdateMessageRequest.php @@ -0,0 +1,205 @@ +google.chat.v1.UpdateMessageRequest + */ +class UpdateMessageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Message with fields updated. + * + * Generated from protobuf field .google.chat.v1.Message message = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $message = null; + /** + * Required. The field paths to update. Separate multiple values with commas + * or use `*` to update all field paths. + * Currently supported field paths: + * - `text` + * - `attachment` + * - `cards` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * - `cards_v2` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * - `accessory_widgets` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + /** + * Optional. If `true` and the message isn't found, a new message is created + * and `updateMask` is ignored. The specified message ID must be + * [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message) + * or the request fails. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Message $message + * Required. Message with fields updated. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The field paths to update. Separate multiple values with commas + * or use `*` to update all field paths. + * Currently supported field paths: + * - `text` + * - `attachment` + * - `cards` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * - `cards_v2` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * - `accessory_widgets` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * @type bool $allow_missing + * Optional. If `true` and the message isn't found, a new message is created + * and `updateMask` is ignored. The specified message ID must be + * [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message) + * or the request fails. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Message::initOnce(); + parent::__construct($data); + } + + /** + * Required. Message with fields updated. + * + * Generated from protobuf field .google.chat.v1.Message message = 1 [(.google.api.field_behavior) = REQUIRED]; + * @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); + } + + /** + * Required. Message with fields updated. + * + * Generated from protobuf field .google.chat.v1.Message message = 1 [(.google.api.field_behavior) = REQUIRED]; + * @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; + } + + /** + * Required. The field paths to update. Separate multiple values with commas + * or use `*` to update all field paths. + * Currently supported field paths: + * - `text` + * - `attachment` + * - `cards` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * - `cards_v2` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * - `accessory_widgets` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The field paths to update. Separate multiple values with commas + * or use `*` to update all field paths. + * Currently supported field paths: + * - `text` + * - `attachment` + * - `cards` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * - `cards_v2` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * - `accessory_widgets` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Optional. If `true` and the message isn't found, a new message is created + * and `updateMask` is ignored. The specified message ID must be + * [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message) + * or the request fails. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If `true` and the message isn't found, a new message is created + * and `updateMask` is ignored. The specified message ID must be + * [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message) + * or the request fails. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/UpdateSpaceRequest.php b/AppsChat/src/Chat/V1/UpdateSpaceRequest.php new file mode 100644 index 000000000000..825402abb8f5 --- /dev/null +++ b/AppsChat/src/Chat/V1/UpdateSpaceRequest.php @@ -0,0 +1,237 @@ +google.chat.v1.UpdateSpaceRequest + */ +class UpdateSpaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Space with fields to be updated. `Space.name` must be + * populated in the form of `spaces/{space}`. Only fields + * specified by `update_mask` are updated. + * + * Generated from protobuf field .google.chat.v1.Space space = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $space = null; + /** + * Required. The updated field paths, comma separated if there are + * multiple. + * Currently supported field paths: + * - `display_name` (Only supports changing the display name of a space with + * the `SPACE` type, or when also including the `space_type` mask to change a + * `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a + * `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument + * error. If you receive the error message `ALREADY_EXISTS` when updating the + * `displayName`, try a different `displayName`. An existing space within the + * Google Workspace organization might already use this display name.) + * - `space_type` (Only supports changing a `GROUP_CHAT` space type to + * `SPACE`. Include `display_name` together with `space_type` in the update + * mask and ensure that the specified space has a non-empty display name and + * the `SPACE` space type. Including the `space_type` mask and the `SPACE` + * type in the specified space when updating the display name is optional if + * the existing space already has the `SPACE` type. Trying to update the + * space type in other ways results in an invalid argument error). + * - `space_details` + * - `space_history_state` (Supports [turning history on or off for the + * space](https://support.google.com/chat/answer/7664687) if [the organization + * allows users to change their history + * setting](https://support.google.com/a/answer/7664184). + * Warning: mutually exclusive with all other field paths.) + * - Developer Preview: `access_settings.audience` (Supports changing the + * [access setting](https://support.google.com/chat/answer/11971020) of a + * space. If no audience is specified in the access setting, the space's + * access setting is updated to restricted. Warning: mutually exclusive with + * all other field paths.) + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Space $space + * Required. Space with fields to be updated. `Space.name` must be + * populated in the form of `spaces/{space}`. Only fields + * specified by `update_mask` are updated. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The updated field paths, comma separated if there are + * multiple. + * Currently supported field paths: + * - `display_name` (Only supports changing the display name of a space with + * the `SPACE` type, or when also including the `space_type` mask to change a + * `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a + * `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument + * error. If you receive the error message `ALREADY_EXISTS` when updating the + * `displayName`, try a different `displayName`. An existing space within the + * Google Workspace organization might already use this display name.) + * - `space_type` (Only supports changing a `GROUP_CHAT` space type to + * `SPACE`. Include `display_name` together with `space_type` in the update + * mask and ensure that the specified space has a non-empty display name and + * the `SPACE` space type. Including the `space_type` mask and the `SPACE` + * type in the specified space when updating the display name is optional if + * the existing space already has the `SPACE` type. Trying to update the + * space type in other ways results in an invalid argument error). + * - `space_details` + * - `space_history_state` (Supports [turning history on or off for the + * space](https://support.google.com/chat/answer/7664687) if [the organization + * allows users to change their history + * setting](https://support.google.com/a/answer/7664184). + * Warning: mutually exclusive with all other field paths.) + * - Developer Preview: `access_settings.audience` (Supports changing the + * [access setting](https://support.google.com/chat/answer/11971020) of a + * space. If no audience is specified in the access setting, the space's + * access setting is updated to restricted. Warning: mutually exclusive with + * all other field paths.) + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Space::initOnce(); + parent::__construct($data); + } + + /** + * Required. Space with fields to be updated. `Space.name` must be + * populated in the form of `spaces/{space}`. Only fields + * specified by `update_mask` are updated. + * + * Generated from protobuf field .google.chat.v1.Space space = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Apps\Chat\V1\Space|null + */ + public function getSpace() + { + return $this->space; + } + + public function hasSpace() + { + return isset($this->space); + } + + public function clearSpace() + { + unset($this->space); + } + + /** + * Required. Space with fields to be updated. `Space.name` must be + * populated in the form of `spaces/{space}`. Only fields + * specified by `update_mask` are updated. + * + * Generated from protobuf field .google.chat.v1.Space space = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Apps\Chat\V1\Space $var + * @return $this + */ + public function setSpace($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space::class); + $this->space = $var; + + return $this; + } + + /** + * Required. The updated field paths, comma separated if there are + * multiple. + * Currently supported field paths: + * - `display_name` (Only supports changing the display name of a space with + * the `SPACE` type, or when also including the `space_type` mask to change a + * `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a + * `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument + * error. If you receive the error message `ALREADY_EXISTS` when updating the + * `displayName`, try a different `displayName`. An existing space within the + * Google Workspace organization might already use this display name.) + * - `space_type` (Only supports changing a `GROUP_CHAT` space type to + * `SPACE`. Include `display_name` together with `space_type` in the update + * mask and ensure that the specified space has a non-empty display name and + * the `SPACE` space type. Including the `space_type` mask and the `SPACE` + * type in the specified space when updating the display name is optional if + * the existing space already has the `SPACE` type. Trying to update the + * space type in other ways results in an invalid argument error). + * - `space_details` + * - `space_history_state` (Supports [turning history on or off for the + * space](https://support.google.com/chat/answer/7664687) if [the organization + * allows users to change their history + * setting](https://support.google.com/a/answer/7664184). + * Warning: mutually exclusive with all other field paths.) + * - Developer Preview: `access_settings.audience` (Supports changing the + * [access setting](https://support.google.com/chat/answer/11971020) of a + * space. If no audience is specified in the access setting, the space's + * access setting is updated to restricted. Warning: mutually exclusive with + * all other field paths.) + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The updated field paths, comma separated if there are + * multiple. + * Currently supported field paths: + * - `display_name` (Only supports changing the display name of a space with + * the `SPACE` type, or when also including the `space_type` mask to change a + * `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a + * `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument + * error. If you receive the error message `ALREADY_EXISTS` when updating the + * `displayName`, try a different `displayName`. An existing space within the + * Google Workspace organization might already use this display name.) + * - `space_type` (Only supports changing a `GROUP_CHAT` space type to + * `SPACE`. Include `display_name` together with `space_type` in the update + * mask and ensure that the specified space has a non-empty display name and + * the `SPACE` space type. Including the `space_type` mask and the `SPACE` + * type in the specified space when updating the display name is optional if + * the existing space already has the `SPACE` type. Trying to update the + * space type in other ways results in an invalid argument error). + * - `space_details` + * - `space_history_state` (Supports [turning history on or off for the + * space](https://support.google.com/chat/answer/7664687) if [the organization + * allows users to change their history + * setting](https://support.google.com/a/answer/7664184). + * Warning: mutually exclusive with all other field paths.) + * - Developer Preview: `access_settings.audience` (Supports changing the + * [access setting](https://support.google.com/chat/answer/11971020) of a + * space. If no audience is specified in the access setting, the space's + * access setting is updated to restricted. Warning: mutually exclusive with + * all other field paths.) + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/UploadAttachmentRequest.php b/AppsChat/src/Chat/V1/UploadAttachmentRequest.php new file mode 100644 index 000000000000..c5710da1988e --- /dev/null +++ b/AppsChat/src/Chat/V1/UploadAttachmentRequest.php @@ -0,0 +1,103 @@ +google.chat.v1.UploadAttachmentRequest + */ +class UploadAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the Chat space in which the attachment is + * uploaded. Format "spaces/{space}". + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The filename of the attachment, including the file extension. + * + * Generated from protobuf field string filename = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filename = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the Chat space in which the attachment is + * uploaded. Format "spaces/{space}". + * @type string $filename + * Required. The filename of the attachment, including the file extension. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Attachment::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the Chat space in which the attachment is + * uploaded. Format "spaces/{space}". + * + * 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. Resource name of the Chat space in which the attachment is + * uploaded. Format "spaces/{space}". + * + * 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. The filename of the attachment, including the file extension. + * + * Generated from protobuf field string filename = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilename() + { + return $this->filename; + } + + /** + * Required. The filename of the attachment, including the file extension. + * + * Generated from protobuf field string filename = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilename($var) + { + GPBUtil::checkString($var, True); + $this->filename = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/UploadAttachmentResponse.php b/AppsChat/src/Chat/V1/UploadAttachmentResponse.php new file mode 100644 index 000000000000..2c691fed6225 --- /dev/null +++ b/AppsChat/src/Chat/V1/UploadAttachmentResponse.php @@ -0,0 +1,75 @@ +google.chat.v1.UploadAttachmentResponse + */ +class UploadAttachmentResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Reference to the uploaded attachment. + * + * Generated from protobuf field .google.chat.v1.AttachmentDataRef attachment_data_ref = 1; + */ + protected $attachment_data_ref = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\AttachmentDataRef $attachment_data_ref + * Reference to the uploaded attachment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Attachment::initOnce(); + parent::__construct($data); + } + + /** + * Reference to the uploaded attachment. + * + * Generated from protobuf field .google.chat.v1.AttachmentDataRef attachment_data_ref = 1; + * @return \Google\Apps\Chat\V1\AttachmentDataRef|null + */ + public function getAttachmentDataRef() + { + return $this->attachment_data_ref; + } + + public function hasAttachmentDataRef() + { + return isset($this->attachment_data_ref); + } + + public function clearAttachmentDataRef() + { + unset($this->attachment_data_ref); + } + + /** + * Reference to the uploaded attachment. + * + * Generated from protobuf field .google.chat.v1.AttachmentDataRef attachment_data_ref = 1; + * @param \Google\Apps\Chat\V1\AttachmentDataRef $var + * @return $this + */ + public function setAttachmentDataRef($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\AttachmentDataRef::class); + $this->attachment_data_ref = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/User.php b/AppsChat/src/Chat/V1/User.php new file mode 100644 index 000000000000..24b1f16affe1 --- /dev/null +++ b/AppsChat/src/Chat/V1/User.php @@ -0,0 +1,274 @@ +google.chat.v1.User + */ +class User extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name for a Google Chat [user][google.chat.v1.User]. + * Format: `users/{user}`. `users/app` can be used as an alias for the calling + * app [bot][google.chat.v1.User.Type.BOT] user. + * For [human users][google.chat.v1.User.Type.HUMAN], `{user}` is the same + * user identifier as: + * - the `id` for the + * [Person](https://developers.google.com/people/api/rest/v1/people) in the + * People API. For example, `users/123456789` in Chat API represents the same + * person as the `123456789` Person profile ID in People API. + * - the `id` for a + * [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) + * in the Admin SDK Directory API. + * - the user's email address can be used as an alias for `{user}` in API + * requests. For example, if the People API Person profile ID for + * `user@example.com` is `123456789`, you can use `users/user@example.com` as + * an alias to reference `users/123456789`. Only the canonical resource name + * (for example `users/123456789`) will be returned from the API. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. The user's display name. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $display_name = ''; + /** + * Unique identifier of the user's Google Workspace domain. + * + * Generated from protobuf field string domain_id = 6; + */ + protected $domain_id = ''; + /** + * User type. + * + * Generated from protobuf field .google.chat.v1.User.Type type = 5; + */ + protected $type = 0; + /** + * Output only. When `true`, the user is deleted or their profile is not + * visible. + * + * Generated from protobuf field bool is_anonymous = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $is_anonymous = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Resource name for a Google Chat [user][google.chat.v1.User]. + * Format: `users/{user}`. `users/app` can be used as an alias for the calling + * app [bot][google.chat.v1.User.Type.BOT] user. + * For [human users][google.chat.v1.User.Type.HUMAN], `{user}` is the same + * user identifier as: + * - the `id` for the + * [Person](https://developers.google.com/people/api/rest/v1/people) in the + * People API. For example, `users/123456789` in Chat API represents the same + * person as the `123456789` Person profile ID in People API. + * - the `id` for a + * [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) + * in the Admin SDK Directory API. + * - the user's email address can be used as an alias for `{user}` in API + * requests. For example, if the People API Person profile ID for + * `user@example.com` is `123456789`, you can use `users/user@example.com` as + * an alias to reference `users/123456789`. Only the canonical resource name + * (for example `users/123456789`) will be returned from the API. + * @type string $display_name + * Output only. The user's display name. + * @type string $domain_id + * Unique identifier of the user's Google Workspace domain. + * @type int $type + * User type. + * @type bool $is_anonymous + * Output only. When `true`, the user is deleted or their profile is not + * visible. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\User::initOnce(); + parent::__construct($data); + } + + /** + * Resource name for a Google Chat [user][google.chat.v1.User]. + * Format: `users/{user}`. `users/app` can be used as an alias for the calling + * app [bot][google.chat.v1.User.Type.BOT] user. + * For [human users][google.chat.v1.User.Type.HUMAN], `{user}` is the same + * user identifier as: + * - the `id` for the + * [Person](https://developers.google.com/people/api/rest/v1/people) in the + * People API. For example, `users/123456789` in Chat API represents the same + * person as the `123456789` Person profile ID in People API. + * - the `id` for a + * [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) + * in the Admin SDK Directory API. + * - the user's email address can be used as an alias for `{user}` in API + * requests. For example, if the People API Person profile ID for + * `user@example.com` is `123456789`, you can use `users/user@example.com` as + * an alias to reference `users/123456789`. Only the canonical resource name + * (for example `users/123456789`) will be returned from the API. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Resource name for a Google Chat [user][google.chat.v1.User]. + * Format: `users/{user}`. `users/app` can be used as an alias for the calling + * app [bot][google.chat.v1.User.Type.BOT] user. + * For [human users][google.chat.v1.User.Type.HUMAN], `{user}` is the same + * user identifier as: + * - the `id` for the + * [Person](https://developers.google.com/people/api/rest/v1/people) in the + * People API. For example, `users/123456789` in Chat API represents the same + * person as the `123456789` Person profile ID in People API. + * - the `id` for a + * [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) + * in the Admin SDK Directory API. + * - the user's email address can be used as an alias for `{user}` in API + * requests. For example, if the People API Person profile ID for + * `user@example.com` is `123456789`, you can use `users/user@example.com` as + * an alias to reference `users/123456789`. Only the canonical resource name + * (for example `users/123456789`) will be returned from the API. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The user's display name. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Output only. The user's display name. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Unique identifier of the user's Google Workspace domain. + * + * Generated from protobuf field string domain_id = 6; + * @return string + */ + public function getDomainId() + { + return $this->domain_id; + } + + /** + * Unique identifier of the user's Google Workspace domain. + * + * Generated from protobuf field string domain_id = 6; + * @param string $var + * @return $this + */ + public function setDomainId($var) + { + GPBUtil::checkString($var, True); + $this->domain_id = $var; + + return $this; + } + + /** + * User type. + * + * Generated from protobuf field .google.chat.v1.User.Type type = 5; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * User type. + * + * Generated from protobuf field .google.chat.v1.User.Type type = 5; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\User\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Output only. When `true`, the user is deleted or their profile is not + * visible. + * + * Generated from protobuf field bool is_anonymous = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getIsAnonymous() + { + return $this->is_anonymous; + } + + /** + * Output only. When `true`, the user is deleted or their profile is not + * visible. + * + * Generated from protobuf field bool is_anonymous = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setIsAnonymous($var) + { + GPBUtil::checkBool($var); + $this->is_anonymous = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/User/Type.php b/AppsChat/src/Chat/V1/User/Type.php new file mode 100644 index 000000000000..7d1767886f98 --- /dev/null +++ b/AppsChat/src/Chat/V1/User/Type.php @@ -0,0 +1,60 @@ +google.chat.v1.User.Type + */ +class Type +{ + /** + * Default value for the enum. DO NOT USE. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Human user. + * + * Generated from protobuf enum HUMAN = 1; + */ + const HUMAN = 1; + /** + * Chat app user. + * + * Generated from protobuf enum BOT = 2; + */ + const BOT = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::HUMAN => 'HUMAN', + self::BOT => 'BOT', + ]; + + 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/UserMentionMetadata.php b/AppsChat/src/Chat/V1/UserMentionMetadata.php new file mode 100644 index 000000000000..2ac7ee99c979 --- /dev/null +++ b/AppsChat/src/Chat/V1/UserMentionMetadata.php @@ -0,0 +1,111 @@ +google.chat.v1.UserMentionMetadata + */ +class UserMentionMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The user mentioned. + * + * Generated from protobuf field .google.chat.v1.User user = 1; + */ + protected $user = null; + /** + * The type of user mention. + * + * Generated from protobuf field .google.chat.v1.UserMentionMetadata.Type type = 2; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\User $user + * The user mentioned. + * @type int $type + * The type of user mention. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Annotation::initOnce(); + parent::__construct($data); + } + + /** + * The user mentioned. + * + * Generated from protobuf field .google.chat.v1.User user = 1; + * @return \Google\Apps\Chat\V1\User|null + */ + public function getUser() + { + return $this->user; + } + + public function hasUser() + { + return isset($this->user); + } + + public function clearUser() + { + unset($this->user); + } + + /** + * The user mentioned. + * + * Generated from protobuf field .google.chat.v1.User user = 1; + * @param \Google\Apps\Chat\V1\User $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\User::class); + $this->user = $var; + + return $this; + } + + /** + * The type of user mention. + * + * Generated from protobuf field .google.chat.v1.UserMentionMetadata.Type type = 2; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of user mention. + * + * Generated from protobuf field .google.chat.v1.UserMentionMetadata.Type type = 2; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\UserMentionMetadata\Type::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/UserMentionMetadata/Type.php b/AppsChat/src/Chat/V1/UserMentionMetadata/Type.php new file mode 100644 index 000000000000..d49e4e9330a3 --- /dev/null +++ b/AppsChat/src/Chat/V1/UserMentionMetadata/Type.php @@ -0,0 +1,60 @@ +google.chat.v1.UserMentionMetadata.Type + */ +class Type +{ + /** + * Default value for the enum. Don't use. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Add user to space. + * + * Generated from protobuf enum ADD = 1; + */ + const ADD = 1; + /** + * Mention user in space. + * + * Generated from protobuf enum MENTION = 2; + */ + const MENTION = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::ADD => 'ADD', + self::MENTION => 'MENTION', + ]; + + 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/WidgetMarkup.php b/AppsChat/src/Chat/V1/WidgetMarkup.php new file mode 100644 index 000000000000..e247cc73adae --- /dev/null +++ b/AppsChat/src/Chat/V1/WidgetMarkup.php @@ -0,0 +1,179 @@ +google.chat.v1.WidgetMarkup + */ +class WidgetMarkup extends \Google\Protobuf\Internal\Message +{ + /** + * A list of buttons. Buttons is also `oneof data` and only one of these + * fields should be set. + * + * Generated from protobuf field repeated .google.chat.v1.WidgetMarkup.Button buttons = 6; + */ + private $buttons; + protected $data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\WidgetMarkup\TextParagraph $text_paragraph + * Display a text paragraph in this widget. + * @type \Google\Apps\Chat\V1\WidgetMarkup\Image $image + * Display an image in this widget. + * @type \Google\Apps\Chat\V1\WidgetMarkup\KeyValue $key_value + * Display a key value item in this widget. + * @type array<\Google\Apps\Chat\V1\WidgetMarkup\Button>|\Google\Protobuf\Internal\RepeatedField $buttons + * A list of buttons. Buttons is also `oneof data` and only one of these + * fields should be set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Widgets::initOnce(); + parent::__construct($data); + } + + /** + * Display a text paragraph in this widget. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.TextParagraph text_paragraph = 1; + * @return \Google\Apps\Chat\V1\WidgetMarkup\TextParagraph|null + */ + public function getTextParagraph() + { + return $this->readOneof(1); + } + + public function hasTextParagraph() + { + return $this->hasOneof(1); + } + + /** + * Display a text paragraph in this widget. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.TextParagraph text_paragraph = 1; + * @param \Google\Apps\Chat\V1\WidgetMarkup\TextParagraph $var + * @return $this + */ + public function setTextParagraph($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\TextParagraph::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Display an image in this widget. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.Image image = 2; + * @return \Google\Apps\Chat\V1\WidgetMarkup\Image|null + */ + public function getImage() + { + return $this->readOneof(2); + } + + public function hasImage() + { + return $this->hasOneof(2); + } + + /** + * Display an image in this widget. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.Image image = 2; + * @param \Google\Apps\Chat\V1\WidgetMarkup\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\Image::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Display a key value item in this widget. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.KeyValue key_value = 3; + * @return \Google\Apps\Chat\V1\WidgetMarkup\KeyValue|null + */ + public function getKeyValue() + { + return $this->readOneof(3); + } + + public function hasKeyValue() + { + return $this->hasOneof(3); + } + + /** + * Display a key value item in this widget. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.KeyValue key_value = 3; + * @param \Google\Apps\Chat\V1\WidgetMarkup\KeyValue $var + * @return $this + */ + public function setKeyValue($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\KeyValue::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A list of buttons. Buttons is also `oneof data` and only one of these + * fields should be set. + * + * Generated from protobuf field repeated .google.chat.v1.WidgetMarkup.Button buttons = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getButtons() + { + return $this->buttons; + } + + /** + * A list of buttons. Buttons is also `oneof data` and only one of these + * fields should be set. + * + * Generated from protobuf field repeated .google.chat.v1.WidgetMarkup.Button buttons = 6; + * @param array<\Google\Apps\Chat\V1\WidgetMarkup\Button>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setButtons($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\WidgetMarkup\Button::class); + $this->buttons = $arr; + + return $this; + } + + /** + * @return string + */ + public function getData() + { + return $this->whichOneof("data"); + } + +} + diff --git a/AppsChat/src/Chat/V1/WidgetMarkup/Button.php b/AppsChat/src/Chat/V1/WidgetMarkup/Button.php new file mode 100644 index 000000000000..1a89528a0894 --- /dev/null +++ b/AppsChat/src/Chat/V1/WidgetMarkup/Button.php @@ -0,0 +1,109 @@ +google.chat.v1.WidgetMarkup.Button + */ +class Button extends \Google\Protobuf\Internal\Message +{ + protected $type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\WidgetMarkup\TextButton $text_button + * A button with text and `onclick` action. + * @type \Google\Apps\Chat\V1\WidgetMarkup\ImageButton $image_button + * A button with image and `onclick` action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Widgets::initOnce(); + parent::__construct($data); + } + + /** + * A button with text and `onclick` action. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.TextButton text_button = 1; + * @return \Google\Apps\Chat\V1\WidgetMarkup\TextButton|null + */ + public function getTextButton() + { + return $this->readOneof(1); + } + + public function hasTextButton() + { + return $this->hasOneof(1); + } + + /** + * A button with text and `onclick` action. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.TextButton text_button = 1; + * @param \Google\Apps\Chat\V1\WidgetMarkup\TextButton $var + * @return $this + */ + public function setTextButton($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\TextButton::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A button with image and `onclick` action. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.ImageButton image_button = 2; + * @return \Google\Apps\Chat\V1\WidgetMarkup\ImageButton|null + */ + public function getImageButton() + { + return $this->readOneof(2); + } + + public function hasImageButton() + { + return $this->hasOneof(2); + } + + /** + * A button with image and `onclick` action. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.ImageButton image_button = 2; + * @param \Google\Apps\Chat\V1\WidgetMarkup\ImageButton $var + * @return $this + */ + public function setImageButton($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\ImageButton::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->whichOneof("type"); + } + +} + + diff --git a/AppsChat/src/Chat/V1/WidgetMarkup/FormAction.php b/AppsChat/src/Chat/V1/WidgetMarkup/FormAction.php new file mode 100644 index 000000000000..8d8e7aa7cebe --- /dev/null +++ b/AppsChat/src/Chat/V1/WidgetMarkup/FormAction.php @@ -0,0 +1,115 @@ +google.chat.v1.WidgetMarkup.FormAction + */ +class FormAction extends \Google\Protobuf\Internal\Message +{ + /** + * The method name is used to identify which part of the form triggered the + * form submission. This information is echoed back to the Chat app as part + * of the card click event. You can use the same method name for several + * elements that trigger a common behavior. + * + * Generated from protobuf field string action_method_name = 1; + */ + protected $action_method_name = ''; + /** + * List of action parameters. + * + * Generated from protobuf field repeated .google.chat.v1.WidgetMarkup.FormAction.ActionParameter parameters = 2; + */ + private $parameters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $action_method_name + * The method name is used to identify which part of the form triggered the + * form submission. This information is echoed back to the Chat app as part + * of the card click event. You can use the same method name for several + * elements that trigger a common behavior. + * @type array<\Google\Apps\Chat\V1\WidgetMarkup\FormAction\ActionParameter>|\Google\Protobuf\Internal\RepeatedField $parameters + * List of action parameters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Widgets::initOnce(); + parent::__construct($data); + } + + /** + * The method name is used to identify which part of the form triggered the + * form submission. This information is echoed back to the Chat app as part + * of the card click event. You can use the same method name for several + * elements that trigger a common behavior. + * + * Generated from protobuf field string action_method_name = 1; + * @return string + */ + public function getActionMethodName() + { + return $this->action_method_name; + } + + /** + * The method name is used to identify which part of the form triggered the + * form submission. This information is echoed back to the Chat app as part + * of the card click event. You can use the same method name for several + * elements that trigger a common behavior. + * + * Generated from protobuf field string action_method_name = 1; + * @param string $var + * @return $this + */ + public function setActionMethodName($var) + { + GPBUtil::checkString($var, True); + $this->action_method_name = $var; + + return $this; + } + + /** + * List of action parameters. + * + * Generated from protobuf field repeated .google.chat.v1.WidgetMarkup.FormAction.ActionParameter parameters = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * List of action parameters. + * + * Generated from protobuf field repeated .google.chat.v1.WidgetMarkup.FormAction.ActionParameter parameters = 2; + * @param array<\Google\Apps\Chat\V1\WidgetMarkup\FormAction\ActionParameter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParameters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\WidgetMarkup\FormAction\ActionParameter::class); + $this->parameters = $arr; + + return $this; + } + +} + + diff --git a/AppsChat/src/Chat/V1/WidgetMarkup/FormAction/ActionParameter.php b/AppsChat/src/Chat/V1/WidgetMarkup/FormAction/ActionParameter.php new file mode 100644 index 000000000000..2777a10e24c4 --- /dev/null +++ b/AppsChat/src/Chat/V1/WidgetMarkup/FormAction/ActionParameter.php @@ -0,0 +1,105 @@ +google.chat.v1.WidgetMarkup.FormAction.ActionParameter + */ +class ActionParameter extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the parameter for the action script. + * + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + /** + * The value of the parameter. + * + * Generated from protobuf field string value = 2; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * The name of the parameter for the action script. + * @type string $value + * The value of the parameter. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Widgets::initOnce(); + parent::__construct($data); + } + + /** + * The name of the parameter for the action script. + * + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * The name of the parameter for the action script. + * + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * The value of the parameter. + * + * Generated from protobuf field string value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The value of the parameter. + * + * Generated from protobuf field string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Chat/V1/WidgetMarkup/Icon.php b/AppsChat/src/Chat/V1/WidgetMarkup/Icon.php new file mode 100644 index 000000000000..19bc217126ef --- /dev/null +++ b/AppsChat/src/Chat/V1/WidgetMarkup/Icon.php @@ -0,0 +1,196 @@ +google.chat.v1.WidgetMarkup.Icon + */ +class Icon +{ + /** + * Generated from protobuf enum ICON_UNSPECIFIED = 0; + */ + const ICON_UNSPECIFIED = 0; + /** + * Generated from protobuf enum AIRPLANE = 1; + */ + const AIRPLANE = 1; + /** + * Generated from protobuf enum BOOKMARK = 26; + */ + const BOOKMARK = 26; + /** + * Generated from protobuf enum BUS = 25; + */ + const BUS = 25; + /** + * Generated from protobuf enum CAR = 9; + */ + const CAR = 9; + /** + * Generated from protobuf enum CLOCK = 2; + */ + const CLOCK = 2; + /** + * Generated from protobuf enum CONFIRMATION_NUMBER_ICON = 12; + */ + const CONFIRMATION_NUMBER_ICON = 12; + /** + * Generated from protobuf enum DOLLAR = 14; + */ + const DOLLAR = 14; + /** + * Generated from protobuf enum DESCRIPTION = 27; + */ + const DESCRIPTION = 27; + /** + * Generated from protobuf enum EMAIL = 10; + */ + const EMAIL = 10; + /** + * Generated from protobuf enum EVENT_PERFORMER = 20; + */ + const EVENT_PERFORMER = 20; + /** + * Generated from protobuf enum EVENT_SEAT = 21; + */ + const EVENT_SEAT = 21; + /** + * Generated from protobuf enum FLIGHT_ARRIVAL = 16; + */ + const FLIGHT_ARRIVAL = 16; + /** + * Generated from protobuf enum FLIGHT_DEPARTURE = 15; + */ + const FLIGHT_DEPARTURE = 15; + /** + * Generated from protobuf enum HOTEL = 6; + */ + const HOTEL = 6; + /** + * Generated from protobuf enum HOTEL_ROOM_TYPE = 17; + */ + const HOTEL_ROOM_TYPE = 17; + /** + * Generated from protobuf enum INVITE = 19; + */ + const INVITE = 19; + /** + * Generated from protobuf enum MAP_PIN = 3; + */ + const MAP_PIN = 3; + /** + * Generated from protobuf enum MEMBERSHIP = 24; + */ + const MEMBERSHIP = 24; + /** + * Generated from protobuf enum MULTIPLE_PEOPLE = 18; + */ + const MULTIPLE_PEOPLE = 18; + /** + * Generated from protobuf enum OFFER = 30; + */ + const OFFER = 30; + /** + * Generated from protobuf enum PERSON = 11; + */ + const PERSON = 11; + /** + * Generated from protobuf enum PHONE = 13; + */ + const PHONE = 13; + /** + * Generated from protobuf enum RESTAURANT_ICON = 7; + */ + const RESTAURANT_ICON = 7; + /** + * Generated from protobuf enum SHOPPING_CART = 8; + */ + const SHOPPING_CART = 8; + /** + * Generated from protobuf enum STAR = 5; + */ + const STAR = 5; + /** + * Generated from protobuf enum STORE = 22; + */ + const STORE = 22; + /** + * Generated from protobuf enum TICKET = 4; + */ + const TICKET = 4; + /** + * Generated from protobuf enum TRAIN = 23; + */ + const TRAIN = 23; + /** + * Generated from protobuf enum VIDEO_CAMERA = 28; + */ + const VIDEO_CAMERA = 28; + /** + * Generated from protobuf enum VIDEO_PLAY = 29; + */ + const VIDEO_PLAY = 29; + + private static $valueToName = [ + self::ICON_UNSPECIFIED => 'ICON_UNSPECIFIED', + self::AIRPLANE => 'AIRPLANE', + self::BOOKMARK => 'BOOKMARK', + self::BUS => 'BUS', + self::CAR => 'CAR', + self::CLOCK => 'CLOCK', + self::CONFIRMATION_NUMBER_ICON => 'CONFIRMATION_NUMBER_ICON', + self::DOLLAR => 'DOLLAR', + self::DESCRIPTION => 'DESCRIPTION', + self::EMAIL => 'EMAIL', + self::EVENT_PERFORMER => 'EVENT_PERFORMER', + self::EVENT_SEAT => 'EVENT_SEAT', + self::FLIGHT_ARRIVAL => 'FLIGHT_ARRIVAL', + self::FLIGHT_DEPARTURE => 'FLIGHT_DEPARTURE', + self::HOTEL => 'HOTEL', + self::HOTEL_ROOM_TYPE => 'HOTEL_ROOM_TYPE', + self::INVITE => 'INVITE', + self::MAP_PIN => 'MAP_PIN', + self::MEMBERSHIP => 'MEMBERSHIP', + self::MULTIPLE_PEOPLE => 'MULTIPLE_PEOPLE', + self::OFFER => 'OFFER', + self::PERSON => 'PERSON', + self::PHONE => 'PHONE', + self::RESTAURANT_ICON => 'RESTAURANT_ICON', + self::SHOPPING_CART => 'SHOPPING_CART', + self::STAR => 'STAR', + self::STORE => 'STORE', + self::TICKET => 'TICKET', + self::TRAIN => 'TRAIN', + self::VIDEO_CAMERA => 'VIDEO_CAMERA', + self::VIDEO_PLAY => 'VIDEO_PLAY', + ]; + + 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/WidgetMarkup/Image.php b/AppsChat/src/Chat/V1/WidgetMarkup/Image.php new file mode 100644 index 000000000000..e73d78caa4c1 --- /dev/null +++ b/AppsChat/src/Chat/V1/WidgetMarkup/Image.php @@ -0,0 +1,158 @@ +google.chat.v1.WidgetMarkup.Image + */ +class Image extends \Google\Protobuf\Internal\Message +{ + /** + * The URL of the image. + * + * Generated from protobuf field string image_url = 1; + */ + protected $image_url = ''; + /** + * The `onclick` action. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 2; + */ + protected $on_click = null; + /** + * The aspect ratio of this image (width and height). This field lets you + * reserve the right height for the image while waiting for it to load. + * It's not meant to override the built-in aspect ratio of the image. + * If unset, the server fills it by prefetching the image. + * + * Generated from protobuf field double aspect_ratio = 3; + */ + protected $aspect_ratio = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image_url + * The URL of the image. + * @type \Google\Apps\Chat\V1\WidgetMarkup\OnClick $on_click + * The `onclick` action. + * @type float $aspect_ratio + * The aspect ratio of this image (width and height). This field lets you + * reserve the right height for the image while waiting for it to load. + * It's not meant to override the built-in aspect ratio of the image. + * If unset, the server fills it by prefetching the image. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Widgets::initOnce(); + parent::__construct($data); + } + + /** + * The URL of the image. + * + * Generated from protobuf field string image_url = 1; + * @return string + */ + public function getImageUrl() + { + return $this->image_url; + } + + /** + * The URL of the image. + * + * Generated from protobuf field string image_url = 1; + * @param string $var + * @return $this + */ + public function setImageUrl($var) + { + GPBUtil::checkString($var, True); + $this->image_url = $var; + + return $this; + } + + /** + * The `onclick` action. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 2; + * @return \Google\Apps\Chat\V1\WidgetMarkup\OnClick|null + */ + public function getOnClick() + { + return $this->on_click; + } + + public function hasOnClick() + { + return isset($this->on_click); + } + + public function clearOnClick() + { + unset($this->on_click); + } + + /** + * The `onclick` action. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 2; + * @param \Google\Apps\Chat\V1\WidgetMarkup\OnClick $var + * @return $this + */ + public function setOnClick($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\OnClick::class); + $this->on_click = $var; + + return $this; + } + + /** + * The aspect ratio of this image (width and height). This field lets you + * reserve the right height for the image while waiting for it to load. + * It's not meant to override the built-in aspect ratio of the image. + * If unset, the server fills it by prefetching the image. + * + * Generated from protobuf field double aspect_ratio = 3; + * @return float + */ + public function getAspectRatio() + { + return $this->aspect_ratio; + } + + /** + * The aspect ratio of this image (width and height). This field lets you + * reserve the right height for the image while waiting for it to load. + * It's not meant to override the built-in aspect ratio of the image. + * If unset, the server fills it by prefetching the image. + * + * Generated from protobuf field double aspect_ratio = 3; + * @param float $var + * @return $this + */ + public function setAspectRatio($var) + { + GPBUtil::checkDouble($var); + $this->aspect_ratio = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Chat/V1/WidgetMarkup/ImageButton.php b/AppsChat/src/Chat/V1/WidgetMarkup/ImageButton.php new file mode 100644 index 000000000000..b53e4aafde23 --- /dev/null +++ b/AppsChat/src/Chat/V1/WidgetMarkup/ImageButton.php @@ -0,0 +1,194 @@ +google.chat.v1.WidgetMarkup.ImageButton + */ +class ImageButton extends \Google\Protobuf\Internal\Message +{ + /** + * The `onclick` action. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 2; + */ + protected $on_click = null; + /** + * The name of this `image_button` that's used for accessibility. + * Default value is provided if this name isn't specified. + * + * Generated from protobuf field string name = 4; + */ + protected $name = ''; + protected $icons; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $icon + * The icon specified by an `enum` that indices to an icon provided by + * Chat API. + * @type string $icon_url + * The icon specified by a URL. + * @type \Google\Apps\Chat\V1\WidgetMarkup\OnClick $on_click + * The `onclick` action. + * @type string $name + * The name of this `image_button` that's used for accessibility. + * Default value is provided if this name isn't specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Widgets::initOnce(); + parent::__construct($data); + } + + /** + * The icon specified by an `enum` that indices to an icon provided by + * Chat API. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.Icon icon = 1; + * @return int + */ + public function getIcon() + { + return $this->readOneof(1); + } + + public function hasIcon() + { + return $this->hasOneof(1); + } + + /** + * The icon specified by an `enum` that indices to an icon provided by + * Chat API. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.Icon icon = 1; + * @param int $var + * @return $this + */ + public function setIcon($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\WidgetMarkup\Icon::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The icon specified by a URL. + * + * Generated from protobuf field string icon_url = 3; + * @return string + */ + public function getIconUrl() + { + return $this->readOneof(3); + } + + public function hasIconUrl() + { + return $this->hasOneof(3); + } + + /** + * The icon specified by a URL. + * + * Generated from protobuf field string icon_url = 3; + * @param string $var + * @return $this + */ + public function setIconUrl($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The `onclick` action. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 2; + * @return \Google\Apps\Chat\V1\WidgetMarkup\OnClick|null + */ + public function getOnClick() + { + return $this->on_click; + } + + public function hasOnClick() + { + return isset($this->on_click); + } + + public function clearOnClick() + { + unset($this->on_click); + } + + /** + * The `onclick` action. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 2; + * @param \Google\Apps\Chat\V1\WidgetMarkup\OnClick $var + * @return $this + */ + public function setOnClick($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\OnClick::class); + $this->on_click = $var; + + return $this; + } + + /** + * The name of this `image_button` that's used for accessibility. + * Default value is provided if this name isn't specified. + * + * Generated from protobuf field string name = 4; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of this `image_button` that's used for accessibility. + * Default value is provided if this name isn't specified. + * + * Generated from protobuf field string name = 4; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * @return string + */ + public function getIcons() + { + return $this->whichOneof("icons"); + } + +} + + diff --git a/AppsChat/src/Chat/V1/WidgetMarkup/KeyValue.php b/AppsChat/src/Chat/V1/WidgetMarkup/KeyValue.php new file mode 100644 index 000000000000..052eb523f7c1 --- /dev/null +++ b/AppsChat/src/Chat/V1/WidgetMarkup/KeyValue.php @@ -0,0 +1,423 @@ +google.chat.v1.WidgetMarkup.KeyValue + */ +class KeyValue extends \Google\Protobuf\Internal\Message +{ + /** + * The text of the top label. Formatted text supported. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string top_label = 3; + */ + protected $top_label = ''; + /** + * The text of the content. Formatted text supported and always required. + * For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string content = 4; + */ + protected $content = ''; + /** + * If the content should be multiline. + * + * Generated from protobuf field bool content_multiline = 9; + */ + protected $content_multiline = false; + /** + * The text of the bottom label. Formatted text supported. For more + * information about formatting text, see [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string bottom_label = 5; + */ + protected $bottom_label = ''; + /** + * The `onclick` action. Only the top label, bottom label, and content + * region are clickable. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 6; + */ + protected $on_click = null; + protected $icons; + protected $control; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $icon + * An enum value that's replaced by the Chat API with the + * corresponding icon image. + * @type string $icon_url + * The icon specified by a URL. + * @type string $top_label + * The text of the top label. Formatted text supported. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * @type string $content + * The text of the content. Formatted text supported and always required. + * For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * @type bool $content_multiline + * If the content should be multiline. + * @type string $bottom_label + * The text of the bottom label. Formatted text supported. For more + * information about formatting text, see [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * @type \Google\Apps\Chat\V1\WidgetMarkup\OnClick $on_click + * The `onclick` action. Only the top label, bottom label, and content + * region are clickable. + * @type \Google\Apps\Chat\V1\WidgetMarkup\Button $button + * A button that can be clicked to trigger an action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Widgets::initOnce(); + parent::__construct($data); + } + + /** + * An enum value that's replaced by the Chat API with the + * corresponding icon image. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.Icon icon = 1; + * @return int + */ + public function getIcon() + { + return $this->readOneof(1); + } + + public function hasIcon() + { + return $this->hasOneof(1); + } + + /** + * An enum value that's replaced by the Chat API with the + * corresponding icon image. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.Icon icon = 1; + * @param int $var + * @return $this + */ + public function setIcon($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\WidgetMarkup\Icon::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The icon specified by a URL. + * + * Generated from protobuf field string icon_url = 2; + * @return string + */ + public function getIconUrl() + { + return $this->readOneof(2); + } + + public function hasIconUrl() + { + return $this->hasOneof(2); + } + + /** + * The icon specified by a URL. + * + * Generated from protobuf field string icon_url = 2; + * @param string $var + * @return $this + */ + public function setIconUrl($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The text of the top label. Formatted text supported. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string top_label = 3; + * @return string + */ + public function getTopLabel() + { + return $this->top_label; + } + + /** + * The text of the top label. Formatted text supported. For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string top_label = 3; + * @param string $var + * @return $this + */ + public function setTopLabel($var) + { + GPBUtil::checkString($var, True); + $this->top_label = $var; + + return $this; + } + + /** + * The text of the content. Formatted text supported and always required. + * For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string content = 4; + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * The text of the content. Formatted text supported and always required. + * For more information + * about formatting text, see + * [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string content = 4; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * If the content should be multiline. + * + * Generated from protobuf field bool content_multiline = 9; + * @return bool + */ + public function getContentMultiline() + { + return $this->content_multiline; + } + + /** + * If the content should be multiline. + * + * Generated from protobuf field bool content_multiline = 9; + * @param bool $var + * @return $this + */ + public function setContentMultiline($var) + { + GPBUtil::checkBool($var); + $this->content_multiline = $var; + + return $this; + } + + /** + * The text of the bottom label. Formatted text supported. For more + * information about formatting text, see [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string bottom_label = 5; + * @return string + */ + public function getBottomLabel() + { + return $this->bottom_label; + } + + /** + * The text of the bottom label. Formatted text supported. For more + * information about formatting text, see [Formatting text in Google Chat + * apps](https://developers.google.com/chat/format-messages#card-formatting) + * and + * [Formatting + * text in Google Workspace + * Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * + * Generated from protobuf field string bottom_label = 5; + * @param string $var + * @return $this + */ + public function setBottomLabel($var) + { + GPBUtil::checkString($var, True); + $this->bottom_label = $var; + + return $this; + } + + /** + * The `onclick` action. Only the top label, bottom label, and content + * region are clickable. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 6; + * @return \Google\Apps\Chat\V1\WidgetMarkup\OnClick|null + */ + public function getOnClick() + { + return $this->on_click; + } + + public function hasOnClick() + { + return isset($this->on_click); + } + + public function clearOnClick() + { + unset($this->on_click); + } + + /** + * The `onclick` action. Only the top label, bottom label, and content + * region are clickable. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 6; + * @param \Google\Apps\Chat\V1\WidgetMarkup\OnClick $var + * @return $this + */ + public function setOnClick($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\OnClick::class); + $this->on_click = $var; + + return $this; + } + + /** + * A button that can be clicked to trigger an action. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.Button button = 7; + * @return \Google\Apps\Chat\V1\WidgetMarkup\Button|null + */ + public function getButton() + { + return $this->readOneof(7); + } + + public function hasButton() + { + return $this->hasOneof(7); + } + + /** + * A button that can be clicked to trigger an action. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.Button button = 7; + * @param \Google\Apps\Chat\V1\WidgetMarkup\Button $var + * @return $this + */ + public function setButton($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\Button::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getIcons() + { + return $this->whichOneof("icons"); + } + + /** + * @return string + */ + public function getControl() + { + return $this->whichOneof("control"); + } + +} + + diff --git a/AppsChat/src/Chat/V1/WidgetMarkup/OnClick.php b/AppsChat/src/Chat/V1/WidgetMarkup/OnClick.php new file mode 100644 index 000000000000..12acdb4d9ed7 --- /dev/null +++ b/AppsChat/src/Chat/V1/WidgetMarkup/OnClick.php @@ -0,0 +1,109 @@ +google.chat.v1.WidgetMarkup.OnClick + */ +class OnClick extends \Google\Protobuf\Internal\Message +{ + protected $data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\WidgetMarkup\FormAction $action + * A form action is triggered by this `onclick` action if specified. + * @type \Google\Apps\Chat\V1\WidgetMarkup\OpenLink $open_link + * This `onclick` action triggers an open link action if specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Widgets::initOnce(); + parent::__construct($data); + } + + /** + * A form action is triggered by this `onclick` action if specified. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.FormAction action = 1; + * @return \Google\Apps\Chat\V1\WidgetMarkup\FormAction|null + */ + public function getAction() + { + return $this->readOneof(1); + } + + public function hasAction() + { + return $this->hasOneof(1); + } + + /** + * A form action is triggered by this `onclick` action if specified. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.FormAction action = 1; + * @param \Google\Apps\Chat\V1\WidgetMarkup\FormAction $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\FormAction::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * This `onclick` action triggers an open link action if specified. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OpenLink open_link = 2; + * @return \Google\Apps\Chat\V1\WidgetMarkup\OpenLink|null + */ + public function getOpenLink() + { + return $this->readOneof(2); + } + + public function hasOpenLink() + { + return $this->hasOneof(2); + } + + /** + * This `onclick` action triggers an open link action if specified. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OpenLink open_link = 2; + * @param \Google\Apps\Chat\V1\WidgetMarkup\OpenLink $var + * @return $this + */ + public function setOpenLink($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\OpenLink::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getData() + { + return $this->whichOneof("data"); + } + +} + + diff --git a/AppsChat/src/Chat/V1/WidgetMarkup/OpenLink.php b/AppsChat/src/Chat/V1/WidgetMarkup/OpenLink.php new file mode 100644 index 000000000000..3f7fca309f7d --- /dev/null +++ b/AppsChat/src/Chat/V1/WidgetMarkup/OpenLink.php @@ -0,0 +1,68 @@ +google.chat.v1.WidgetMarkup.OpenLink + */ +class OpenLink extends \Google\Protobuf\Internal\Message +{ + /** + * The URL to open. + * + * Generated from protobuf field string url = 1; + */ + protected $url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $url + * The URL to open. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Widgets::initOnce(); + parent::__construct($data); + } + + /** + * The URL to open. + * + * Generated from protobuf field string url = 1; + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * The URL to open. + * + * Generated from protobuf field string url = 1; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Chat/V1/WidgetMarkup/TextButton.php b/AppsChat/src/Chat/V1/WidgetMarkup/TextButton.php new file mode 100644 index 000000000000..7a6b10d65b94 --- /dev/null +++ b/AppsChat/src/Chat/V1/WidgetMarkup/TextButton.php @@ -0,0 +1,112 @@ +google.chat.v1.WidgetMarkup.TextButton + */ +class TextButton extends \Google\Protobuf\Internal\Message +{ + /** + * The text of the button. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * The `onclick` action of the button. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 2; + */ + protected $on_click = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The text of the button. + * @type \Google\Apps\Chat\V1\WidgetMarkup\OnClick $on_click + * The `onclick` action of the button. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Widgets::initOnce(); + parent::__construct($data); + } + + /** + * The text of the button. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * The text of the button. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * The `onclick` action of the button. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 2; + * @return \Google\Apps\Chat\V1\WidgetMarkup\OnClick|null + */ + public function getOnClick() + { + return $this->on_click; + } + + public function hasOnClick() + { + return isset($this->on_click); + } + + public function clearOnClick() + { + unset($this->on_click); + } + + /** + * The `onclick` action of the button. + * + * Generated from protobuf field .google.chat.v1.WidgetMarkup.OnClick on_click = 2; + * @param \Google\Apps\Chat\V1\WidgetMarkup\OnClick $var + * @return $this + */ + public function setOnClick($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\WidgetMarkup\OnClick::class); + $this->on_click = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Chat/V1/WidgetMarkup/TextParagraph.php b/AppsChat/src/Chat/V1/WidgetMarkup/TextParagraph.php new file mode 100644 index 000000000000..f5cbeffb1b15 --- /dev/null +++ b/AppsChat/src/Chat/V1/WidgetMarkup/TextParagraph.php @@ -0,0 +1,68 @@ +google.chat.v1.WidgetMarkup.TextParagraph + */ +class TextParagraph extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Widgets::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Chat/V1/gapic_metadata.json b/AppsChat/src/Chat/V1/gapic_metadata.json new file mode 100644 index 000000000000..8d2fed5a4092 --- /dev/null +++ b/AppsChat/src/Chat/V1/gapic_metadata.json @@ -0,0 +1,128 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.chat.v1", + "libraryPackage": "Google\\Apps\\Chat\\V1", + "services": { + "ChatService": { + "clients": { + "grpc": { + "libraryClient": "ChatServiceGapicClient", + "rpcs": { + "CompleteImportSpace": { + "methods": [ + "completeImportSpace" + ] + }, + "CreateMembership": { + "methods": [ + "createMembership" + ] + }, + "CreateMessage": { + "methods": [ + "createMessage" + ] + }, + "CreateReaction": { + "methods": [ + "createReaction" + ] + }, + "CreateSpace": { + "methods": [ + "createSpace" + ] + }, + "DeleteMembership": { + "methods": [ + "deleteMembership" + ] + }, + "DeleteMessage": { + "methods": [ + "deleteMessage" + ] + }, + "DeleteReaction": { + "methods": [ + "deleteReaction" + ] + }, + "DeleteSpace": { + "methods": [ + "deleteSpace" + ] + }, + "FindDirectMessage": { + "methods": [ + "findDirectMessage" + ] + }, + "GetAttachment": { + "methods": [ + "getAttachment" + ] + }, + "GetMembership": { + "methods": [ + "getMembership" + ] + }, + "GetMessage": { + "methods": [ + "getMessage" + ] + }, + "GetSpace": { + "methods": [ + "getSpace" + ] + }, + "ListMemberships": { + "methods": [ + "listMemberships" + ] + }, + "ListMessages": { + "methods": [ + "listMessages" + ] + }, + "ListReactions": { + "methods": [ + "listReactions" + ] + }, + "ListSpaces": { + "methods": [ + "listSpaces" + ] + }, + "SetUpSpace": { + "methods": [ + "setUpSpace" + ] + }, + "UpdateMessage": { + "methods": [ + "updateMessage" + ] + }, + "UpdateSpace": { + "methods": [ + "updateSpace" + ] + }, + "UploadAttachment": { + "methods": [ + "uploadAttachment" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AppsChat/src/Chat/V1/resources/chat_service_client_config.json b/AppsChat/src/Chat/V1/resources/chat_service_client_config.json new file mode 100644 index 000000000000..dfc25d11fb1d --- /dev/null +++ b/AppsChat/src/Chat/V1/resources/chat_service_client_config.json @@ -0,0 +1,144 @@ +{ + "interfaces": { + "google.chat.v1.ChatService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 30000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 30000, + "total_timeout_millis": 30000 + } + }, + "methods": { + "CompleteImportSpace": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateMembership": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateMessage": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateReaction": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateSpace": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteMembership": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteMessage": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteReaction": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteSpace": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "FindDirectMessage": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetAttachment": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetMembership": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetMessage": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetSpace": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListMemberships": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListMessages": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListReactions": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSpaces": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetUpSpace": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateMessage": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateSpace": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UploadAttachment": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/AppsChat/src/Chat/V1/resources/chat_service_descriptor_config.php b/AppsChat/src/Chat/V1/resources/chat_service_descriptor_config.php new file mode 100644 index 000000000000..ef5e325284e4 --- /dev/null +++ b/AppsChat/src/Chat/V1/resources/chat_service_descriptor_config.php @@ -0,0 +1,48 @@ + [ + 'google.chat.v1.ChatService' => [ + 'ListMemberships' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMemberships', + ], + ], + 'ListMessages' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMessages', + ], + ], + 'ListReactions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getReactions', + ], + ], + 'ListSpaces' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSpaces', + ], + ], + ], + ], +]; 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 new file mode 100644 index 000000000000..74a11c80c11c --- /dev/null +++ b/AppsChat/src/Chat/V1/resources/chat_service_rest_client_config.php @@ -0,0 +1,241 @@ + [ + 'google.chat.v1.ChatService' => [ + 'CompleteImportSpace' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=spaces/*}:completeImport', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateMembership' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=spaces/*}/members', + 'body' => 'membership', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateMessage' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=spaces/*}/messages', + 'body' => 'message', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateReaction' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=spaces/*/messages/*}/reactions', + 'body' => 'reaction', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSpace' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/spaces', + 'body' => 'space', + ], + 'DeleteMembership' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=spaces/*/members/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteMessage' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=spaces/*/messages/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteReaction' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=spaces/*/messages/*/reactions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSpace' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=spaces/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'FindDirectMessage' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/spaces:findDirectMessage', + ], + 'GetAttachment' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=spaces/*/messages/*/attachments/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetMembership' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=spaces/*/members/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetMessage' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=spaces/*/messages/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSpace' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=spaces/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListMemberships' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=spaces/*}/members', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListMessages' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=spaces/*}/messages', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListReactions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=spaces/*/messages/*}/reactions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListSpaces' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/spaces', + ], + 'SetUpSpace' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/spaces:setup', + 'body' => '*', + ], + 'UpdateMessage' => [ + 'method' => 'put', + 'uriTemplate' => '/v1/{message.name=spaces/*/messages/*}', + 'body' => 'message', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{message.name=spaces/*/messages/*}', + 'body' => 'message', + ], + ], + 'placeholders' => [ + 'message.name' => [ + 'getters' => [ + 'getMessage', + 'getName', + ], + ], + ], + ], + 'UpdateSpace' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{space.name=spaces/*}', + 'body' => 'space', + 'placeholders' => [ + 'space.name' => [ + 'getters' => [ + 'getSpace', + 'getName', + ], + ], + ], + ], + 'UploadAttachment' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=spaces/*}/attachments:upload', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AppsChat/tests/Unit/V1/ChatServiceClientTest.php b/AppsChat/tests/Unit/V1/ChatServiceClientTest.php new file mode 100644 index 000000000000..1b29d93a4403 --- /dev/null +++ b/AppsChat/tests/Unit/V1/ChatServiceClientTest.php @@ -0,0 +1,1525 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ChatServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ChatServiceClient($options); + } + + /** @test */ + public function completeImportSpaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new CompleteImportSpaceResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->spaceName('[SPACE]'); + $response = $gapicClient->completeImportSpace($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/CompleteImportSpace', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function completeImportSpaceExceptionTest() + { + $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 + $formattedName = $gapicClient->spaceName('[SPACE]'); + try { + $gapicClient->completeImportSpace($formattedName); + // 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 createMembershipTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Membership(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->spaceName('[SPACE]'); + $membership = new Membership(); + $response = $gapicClient->createMembership($formattedParent, $membership); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/CreateMembership', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getMembership(); + $this->assertProtobufEquals($membership, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createMembershipExceptionTest() + { + $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]'); + $membership = new Membership(); + try { + $gapicClient->createMembership($formattedParent, $membership); + // 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 createMessageTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $text = 'text3556653'; + $formattedText = 'formattedText-1686936880'; + $fallbackText = 'fallbackText563106922'; + $argumentText = 'argumentText-39826065'; + $threadReply = false; + $clientAssignedMessageId = 'clientAssignedMessageId-1116632848'; + $expectedResponse = new Message(); + $expectedResponse->setName($name); + $expectedResponse->setText($text); + $expectedResponse->setFormattedText($formattedText); + $expectedResponse->setFallbackText($fallbackText); + $expectedResponse->setArgumentText($argumentText); + $expectedResponse->setThreadReply($threadReply); + $expectedResponse->setClientAssignedMessageId($clientAssignedMessageId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->spaceName('[SPACE]'); + $message = new Message(); + $response = $gapicClient->createMessage($formattedParent, $message); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/CreateMessage', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getMessage(); + $this->assertProtobufEquals($message, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createMessageExceptionTest() + { + $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]'); + $message = new Message(); + try { + $gapicClient->createMessage($formattedParent, $message); + // 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 createReactionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Reaction(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->messageName('[SPACE]', '[MESSAGE]'); + $reaction = new Reaction(); + $response = $gapicClient->createReaction($formattedParent, $reaction); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/CreateReaction', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getReaction(); + $this->assertProtobufEquals($reaction, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createReactionExceptionTest() + { + $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->messageName('[SPACE]', '[MESSAGE]'); + $reaction = new Reaction(); + try { + $gapicClient->createReaction($formattedParent, $reaction); + // 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 createSpaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $singleUserBotDm = true; + $threaded = false; + $displayName = 'displayName1615086568'; + $externalUserAllowed = true; + $importMode = false; + $adminInstalled = true; + $expectedResponse = new Space(); + $expectedResponse->setName($name); + $expectedResponse->setSingleUserBotDm($singleUserBotDm); + $expectedResponse->setThreaded($threaded); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setExternalUserAllowed($externalUserAllowed); + $expectedResponse->setImportMode($importMode); + $expectedResponse->setAdminInstalled($adminInstalled); + $transport->addResponse($expectedResponse); + // Mock request + $space = new Space(); + $response = $gapicClient->createSpace($space); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/CreateSpace', $actualFuncCall); + $actualValue = $actualRequestObject->getSpace(); + $this->assertProtobufEquals($space, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createSpaceExceptionTest() + { + $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 + $space = new Space(); + try { + $gapicClient->createSpace($space); + // 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 deleteMembershipTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Membership(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->membershipName('[SPACE]', '[MEMBER]'); + $response = $gapicClient->deleteMembership($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/DeleteMembership', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteMembershipExceptionTest() + { + $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 + $formattedName = $gapicClient->membershipName('[SPACE]', '[MEMBER]'); + try { + $gapicClient->deleteMembership($formattedName); + // 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 deleteMessageTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->messageName('[SPACE]', '[MESSAGE]'); + $gapicClient->deleteMessage($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/DeleteMessage', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteMessageExceptionTest() + { + $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 + $formattedName = $gapicClient->messageName('[SPACE]', '[MESSAGE]'); + try { + $gapicClient->deleteMessage($formattedName); + // 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 deleteReactionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->reactionName('[SPACE]', '[MESSAGE]', '[REACTION]'); + $gapicClient->deleteReaction($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/DeleteReaction', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteReactionExceptionTest() + { + $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 + $formattedName = $gapicClient->reactionName('[SPACE]', '[MESSAGE]', '[REACTION]'); + try { + $gapicClient->deleteReaction($formattedName); + // 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 deleteSpaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->spaceName('[SPACE]'); + $gapicClient->deleteSpace($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/DeleteSpace', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteSpaceExceptionTest() + { + $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 + $formattedName = $gapicClient->spaceName('[SPACE]'); + try { + $gapicClient->deleteSpace($formattedName); + // 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 findDirectMessageTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $singleUserBotDm = true; + $threaded = false; + $displayName = 'displayName1615086568'; + $externalUserAllowed = true; + $importMode = false; + $adminInstalled = true; + $expectedResponse = new Space(); + $expectedResponse->setName($name2); + $expectedResponse->setSingleUserBotDm($singleUserBotDm); + $expectedResponse->setThreaded($threaded); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setExternalUserAllowed($externalUserAllowed); + $expectedResponse->setImportMode($importMode); + $expectedResponse->setAdminInstalled($adminInstalled); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $response = $gapicClient->findDirectMessage($name); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/FindDirectMessage', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function findDirectMessageExceptionTest() + { + $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 + $name = 'name3373707'; + try { + $gapicClient->findDirectMessage($name); + // 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 getAttachmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $contentName = 'contentName831644305'; + $contentType = 'contentType831846208'; + $thumbnailUri = 'thumbnailUri1825632153'; + $downloadUri = 'downloadUri1109408053'; + $expectedResponse = new Attachment(); + $expectedResponse->setName($name2); + $expectedResponse->setContentName($contentName); + $expectedResponse->setContentType($contentType); + $expectedResponse->setThumbnailUri($thumbnailUri); + $expectedResponse->setDownloadUri($downloadUri); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->attachmentName('[SPACE]', '[MESSAGE]', '[ATTACHMENT]'); + $response = $gapicClient->getAttachment($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/GetAttachment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAttachmentExceptionTest() + { + $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 + $formattedName = $gapicClient->attachmentName('[SPACE]', '[MESSAGE]', '[ATTACHMENT]'); + try { + $gapicClient->getAttachment($formattedName); + // 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 getMembershipTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Membership(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->membershipName('[SPACE]', '[MEMBER]'); + $response = $gapicClient->getMembership($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/GetMembership', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMembershipExceptionTest() + { + $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 + $formattedName = $gapicClient->membershipName('[SPACE]', '[MEMBER]'); + try { + $gapicClient->getMembership($formattedName); + // 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 getMessageTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $text = 'text3556653'; + $formattedText = 'formattedText-1686936880'; + $fallbackText = 'fallbackText563106922'; + $argumentText = 'argumentText-39826065'; + $threadReply = false; + $clientAssignedMessageId = 'clientAssignedMessageId-1116632848'; + $expectedResponse = new Message(); + $expectedResponse->setName($name2); + $expectedResponse->setText($text); + $expectedResponse->setFormattedText($formattedText); + $expectedResponse->setFallbackText($fallbackText); + $expectedResponse->setArgumentText($argumentText); + $expectedResponse->setThreadReply($threadReply); + $expectedResponse->setClientAssignedMessageId($clientAssignedMessageId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->messageName('[SPACE]', '[MESSAGE]'); + $response = $gapicClient->getMessage($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/GetMessage', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMessageExceptionTest() + { + $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 + $formattedName = $gapicClient->messageName('[SPACE]', '[MESSAGE]'); + try { + $gapicClient->getMessage($formattedName); + // 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 getSpaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $singleUserBotDm = true; + $threaded = false; + $displayName = 'displayName1615086568'; + $externalUserAllowed = true; + $importMode = false; + $adminInstalled = true; + $expectedResponse = new Space(); + $expectedResponse->setName($name2); + $expectedResponse->setSingleUserBotDm($singleUserBotDm); + $expectedResponse->setThreaded($threaded); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setExternalUserAllowed($externalUserAllowed); + $expectedResponse->setImportMode($importMode); + $expectedResponse->setAdminInstalled($adminInstalled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->spaceName('[SPACE]'); + $response = $gapicClient->getSpace($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/GetSpace', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSpaceExceptionTest() + { + $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 + $formattedName = $gapicClient->spaceName('[SPACE]'); + try { + $gapicClient->getSpace($formattedName); + // 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 listMembershipsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $membershipsElement = new Membership(); + $memberships = [ + $membershipsElement, + ]; + $expectedResponse = new ListMembershipsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setMemberships($memberships); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->spaceName('[SPACE]'); + $response = $gapicClient->listMemberships($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getMemberships()[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/ListMemberships', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMembershipsExceptionTest() + { + $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]'); + try { + $gapicClient->listMemberships($formattedParent); + // 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 listMessagesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $messagesElement = new Message(); + $messages = [ + $messagesElement, + ]; + $expectedResponse = new ListMessagesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setMessages($messages); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->spaceName('[SPACE]'); + $response = $gapicClient->listMessages($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getMessages()[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/ListMessages', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMessagesExceptionTest() + { + $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]'); + try { + $gapicClient->listMessages($formattedParent); + // 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 listReactionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $reactionsElement = new Reaction(); + $reactions = [ + $reactionsElement, + ]; + $expectedResponse = new ListReactionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setReactions($reactions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->messageName('[SPACE]', '[MESSAGE]'); + $response = $gapicClient->listReactions($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getReactions()[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/ListReactions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listReactionsExceptionTest() + { + $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->messageName('[SPACE]', '[MESSAGE]'); + try { + $gapicClient->listReactions($formattedParent); + // 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 listSpacesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $spacesElement = new Space(); + $spaces = [ + $spacesElement, + ]; + $expectedResponse = new ListSpacesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSpaces($spaces); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listSpaces(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSpaces()[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/ListSpaces', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSpacesExceptionTest() + { + $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); + try { + $gapicClient->listSpaces(); + // 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 setUpSpaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $singleUserBotDm = true; + $threaded = false; + $displayName = 'displayName1615086568'; + $externalUserAllowed = true; + $importMode = false; + $adminInstalled = true; + $expectedResponse = new Space(); + $expectedResponse->setName($name); + $expectedResponse->setSingleUserBotDm($singleUserBotDm); + $expectedResponse->setThreaded($threaded); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setExternalUserAllowed($externalUserAllowed); + $expectedResponse->setImportMode($importMode); + $expectedResponse->setAdminInstalled($adminInstalled); + $transport->addResponse($expectedResponse); + // Mock request + $space = new Space(); + $response = $gapicClient->setUpSpace($space); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/SetUpSpace', $actualFuncCall); + $actualValue = $actualRequestObject->getSpace(); + $this->assertProtobufEquals($space, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setUpSpaceExceptionTest() + { + $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 + $space = new Space(); + try { + $gapicClient->setUpSpace($space); + // 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 updateMessageTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $text = 'text3556653'; + $formattedText = 'formattedText-1686936880'; + $fallbackText = 'fallbackText563106922'; + $argumentText = 'argumentText-39826065'; + $threadReply = false; + $clientAssignedMessageId = 'clientAssignedMessageId-1116632848'; + $expectedResponse = new Message(); + $expectedResponse->setName($name); + $expectedResponse->setText($text); + $expectedResponse->setFormattedText($formattedText); + $expectedResponse->setFallbackText($fallbackText); + $expectedResponse->setArgumentText($argumentText); + $expectedResponse->setThreadReply($threadReply); + $expectedResponse->setClientAssignedMessageId($clientAssignedMessageId); + $transport->addResponse($expectedResponse); + // Mock request + $message = new Message(); + $response = $gapicClient->updateMessage($message); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/UpdateMessage', $actualFuncCall); + $actualValue = $actualRequestObject->getMessage(); + $this->assertProtobufEquals($message, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateMessageExceptionTest() + { + $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 + $message = new Message(); + try { + $gapicClient->updateMessage($message); + // 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 updateSpaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $singleUserBotDm = true; + $threaded = false; + $displayName = 'displayName1615086568'; + $externalUserAllowed = true; + $importMode = false; + $adminInstalled = true; + $expectedResponse = new Space(); + $expectedResponse->setName($name); + $expectedResponse->setSingleUserBotDm($singleUserBotDm); + $expectedResponse->setThreaded($threaded); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setExternalUserAllowed($externalUserAllowed); + $expectedResponse->setImportMode($importMode); + $expectedResponse->setAdminInstalled($adminInstalled); + $transport->addResponse($expectedResponse); + // Mock request + $space = new Space(); + $response = $gapicClient->updateSpace($space); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/UpdateSpace', $actualFuncCall); + $actualValue = $actualRequestObject->getSpace(); + $this->assertProtobufEquals($space, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateSpaceExceptionTest() + { + $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 + $space = new Space(); + try { + $gapicClient->updateSpace($space); + // 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 uploadAttachmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new UploadAttachmentResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->spaceName('[SPACE]'); + $filename = 'filename-734768633'; + $response = $gapicClient->uploadAttachment($formattedParent, $filename); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/UploadAttachment', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getFilename(); + $this->assertProtobufEquals($filename, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function uploadAttachmentExceptionTest() + { + $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]'); + $filename = 'filename-734768633'; + try { + $gapicClient->uploadAttachment($formattedParent, $filename); + // 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()); + } +} diff --git a/composer.json b/composer.json index 7c936f7989eb..8d91e6dbeab8 100644 --- a/composer.json +++ b/composer.json @@ -74,6 +74,7 @@ "google/analytics-admin": "0.22.2", "google/analytics-data": "0.16.2", "google/apps-events-subscriptions": "0.1.0", + "google/apps-chat": "0.0.0", "google/apps-meet": "0.2.0", "google/cloud-access-approval": "1.2.2", "google/cloud-advisorynotifications": "0.8.0", @@ -264,6 +265,8 @@ "GPBMetadata\\Google\\Apps\\Meet\\": "AppsMeet/metadata", "GPBMetadata\\Google\\Apps\\Script\\Type\\": "GSuiteAddOns/external/metadata", "GPBMetadata\\Google\\Bigtable\\": "Bigtable/metadata", + "GPBMetadata\\Google\\Chat\\": "AppsChat/metadata/Chat", + "GPBMetadata\\Google\\Apps\\Card\\": "AppsChat/metadata/Card", "GPBMetadata\\Google\\Cloud\\Accessapproval\\": "AccessApproval/metadata", "GPBMetadata\\Google\\Cloud\\Advisorynotifications\\": "AdvisoryNotifications/metadata", "GPBMetadata\\Google\\Cloud\\Aiplatform\\": "AiPlatform/metadata", @@ -436,6 +439,8 @@ "Google\\Analytics\\Admin\\": "AnalyticsAdmin/src", "Google\\Analytics\\Data\\": "AnalyticsData/src", "Google\\ApiCore\\LongRunning\\": "LongRunning/src/ApiCore/LongRunning", + "Google\\Apps\\Chat\\": "AppsChat/src/Chat", + "Google\\Apps\\Card\\": "AppsChat/src/Card", "Google\\Apps\\Events\\Subscriptions\\": "AppsEventsSubscriptions/src", "Google\\Apps\\Meet\\": "AppsMeet/src", "Google\\Apps\\Script\\Type\\": "GSuiteAddOns/external/protos", From ce63f618009da38491eea1843b77e54c13aebfe7 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Fri, 12 Apr 2024 22:59:53 +0000 Subject: [PATCH 2/3] update to new client surface --- .../complete_import_space.php | 9 +- .../ChatServiceClient/create_membership.php | 10 +- .../V1/ChatServiceClient/create_message.php | 10 +- .../V1/ChatServiceClient/create_reaction.php | 10 +- .../V1/ChatServiceClient/create_space.php | 9 +- .../ChatServiceClient/delete_membership.php | 9 +- .../V1/ChatServiceClient/delete_message.php | 9 +- .../V1/ChatServiceClient/delete_reaction.php | 9 +- .../V1/ChatServiceClient/delete_space.php | 9 +- .../ChatServiceClient/find_direct_message.php | 9 +- .../V1/ChatServiceClient/get_attachment.php | 9 +- .../V1/ChatServiceClient/get_membership.php | 9 +- .../V1/ChatServiceClient/get_message.php | 9 +- .../V1/ChatServiceClient/get_space.php | 9 +- .../V1/ChatServiceClient/list_memberships.php | 9 +- .../V1/ChatServiceClient/list_messages.php | 9 +- .../V1/ChatServiceClient/list_reactions.php | 9 +- .../V1/ChatServiceClient/list_spaces.php | 8 +- .../V1/ChatServiceClient/set_up_space.php | 9 +- .../V1/ChatServiceClient/update_message.php | 9 +- .../V1/ChatServiceClient/update_space.php | 9 +- .../ChatServiceClient/upload_attachment.php | 10 +- AppsChat/src/Chat/V1/ChatServiceClient.php | 34 - .../src/Chat/V1/Client/ChatServiceClient.php | 1208 +++++++++ .../src/Chat/V1/CreateMembershipRequest.php | 34 + AppsChat/src/Chat/V1/CreateMessageRequest.php | 34 + .../src/Chat/V1/CreateReactionRequest.php | 18 + AppsChat/src/Chat/V1/CreateSpaceRequest.php | 21 + .../src/Chat/V1/DeleteMembershipRequest.php | 27 + AppsChat/src/Chat/V1/DeleteMessageRequest.php | 21 + .../src/Chat/V1/DeleteReactionRequest.php | 16 + AppsChat/src/Chat/V1/DeleteSpaceRequest.php | 16 + .../Chat/V1/Gapic/ChatServiceGapicClient.php | 2190 ----------------- AppsChat/src/Chat/V1/GetAttachmentRequest.php | 15 + AppsChat/src/Chat/V1/GetMembershipRequest.php | 25 + AppsChat/src/Chat/V1/GetMessageRequest.php | 21 + AppsChat/src/Chat/V1/GetSpaceRequest.php | 16 + .../src/Chat/V1/ListMembershipsRequest.php | 17 + AppsChat/src/Chat/V1/ListMessagesRequest.php | 16 + AppsChat/src/Chat/V1/ListReactionsRequest.php | 16 + AppsChat/src/Chat/V1/UpdateMessageRequest.php | 31 + AppsChat/src/Chat/V1/UpdateSpaceRequest.php | 49 + .../chat_service_descriptor_config.php | 255 ++ .../chat_service_rest_client_config.php | 20 + .../V1/{ => Client}/ChatServiceClientTest.php | 534 ++-- 45 files changed, 2369 insertions(+), 2466 deletions(-) delete mode 100644 AppsChat/src/Chat/V1/ChatServiceClient.php create mode 100644 AppsChat/src/Chat/V1/Client/ChatServiceClient.php delete mode 100644 AppsChat/src/Chat/V1/Gapic/ChatServiceGapicClient.php rename AppsChat/tests/Unit/V1/{ => Client}/ChatServiceClientTest.php (79%) diff --git a/AppsChat/samples/V1/ChatServiceClient/complete_import_space.php b/AppsChat/samples/V1/ChatServiceClient/complete_import_space.php index 2e7db871affc..4c9b651f7f6d 100644 --- a/AppsChat/samples/V1/ChatServiceClient/complete_import_space.php +++ b/AppsChat/samples/V1/ChatServiceClient/complete_import_space.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_CompleteImportSpace_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\CompleteImportSpaceRequest; use Google\Apps\Chat\V1\CompleteImportSpaceResponse; /** @@ -45,10 +46,14 @@ function complete_import_space_sample(string $formattedName): void // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = (new CompleteImportSpaceRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { /** @var CompleteImportSpaceResponse $response */ - $response = $chatServiceClient->completeImportSpace($formattedName); + $response = $chatServiceClient->completeImportSpace($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/create_membership.php b/AppsChat/samples/V1/ChatServiceClient/create_membership.php index 23ea151ed81b..367abe4382f2 100644 --- a/AppsChat/samples/V1/ChatServiceClient/create_membership.php +++ b/AppsChat/samples/V1/ChatServiceClient/create_membership.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_CreateMembership_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\CreateMembershipRequest; use Google\Apps\Chat\V1\Membership; /** @@ -64,13 +65,16 @@ function create_membership_sample(string $formattedParent): void // Create a client. $chatServiceClient = new ChatServiceClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $membership = new Membership(); + $request = (new CreateMembershipRequest()) + ->setParent($formattedParent) + ->setMembership($membership); // Call the API and handle any network failures. try { /** @var Membership $response */ - $response = $chatServiceClient->createMembership($formattedParent, $membership); + $response = $chatServiceClient->createMembership($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/create_message.php b/AppsChat/samples/V1/ChatServiceClient/create_message.php index df8c1af8faaf..72f54846507c 100644 --- a/AppsChat/samples/V1/ChatServiceClient/create_message.php +++ b/AppsChat/samples/V1/ChatServiceClient/create_message.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_CreateMessage_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\CreateMessageRequest; use Google\Apps\Chat\V1\Message; /** @@ -50,13 +51,16 @@ function create_message_sample(string $formattedParent): void // Create a client. $chatServiceClient = new ChatServiceClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $message = new Message(); + $request = (new CreateMessageRequest()) + ->setParent($formattedParent) + ->setMessage($message); // Call the API and handle any network failures. try { /** @var Message $response */ - $response = $chatServiceClient->createMessage($formattedParent, $message); + $response = $chatServiceClient->createMessage($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/create_reaction.php b/AppsChat/samples/V1/ChatServiceClient/create_reaction.php index 3c5827ff9499..702d7bc387be 100644 --- a/AppsChat/samples/V1/ChatServiceClient/create_reaction.php +++ b/AppsChat/samples/V1/ChatServiceClient/create_reaction.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_CreateReaction_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\CreateReactionRequest; use Google\Apps\Chat\V1\Reaction; /** @@ -45,13 +46,16 @@ function create_reaction_sample(string $formattedParent): void // Create a client. $chatServiceClient = new ChatServiceClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $reaction = new Reaction(); + $request = (new CreateReactionRequest()) + ->setParent($formattedParent) + ->setReaction($reaction); // Call the API and handle any network failures. try { /** @var Reaction $response */ - $response = $chatServiceClient->createReaction($formattedParent, $reaction); + $response = $chatServiceClient->createReaction($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/create_space.php b/AppsChat/samples/V1/ChatServiceClient/create_space.php index 11ed07c06bf8..53d69113e46c 100644 --- a/AppsChat/samples/V1/ChatServiceClient/create_space.php +++ b/AppsChat/samples/V1/ChatServiceClient/create_space.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_CreateSpace_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\CreateSpaceRequest; use Google\Apps\Chat\V1\Space; /** @@ -50,13 +51,15 @@ function create_space_sample(): void // Create a client. $chatServiceClient = new ChatServiceClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $space = new Space(); + $request = (new CreateSpaceRequest()) + ->setSpace($space); // Call the API and handle any network failures. try { /** @var Space $response */ - $response = $chatServiceClient->createSpace($space); + $response = $chatServiceClient->createSpace($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/delete_membership.php b/AppsChat/samples/V1/ChatServiceClient/delete_membership.php index 37ae5df2c18c..aa4c1c22632e 100644 --- a/AppsChat/samples/V1/ChatServiceClient/delete_membership.php +++ b/AppsChat/samples/V1/ChatServiceClient/delete_membership.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_DeleteMembership_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\DeleteMembershipRequest; use Google\Apps\Chat\V1\Membership; /** @@ -56,10 +57,14 @@ function delete_membership_sample(string $formattedName): void // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = (new DeleteMembershipRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { /** @var Membership $response */ - $response = $chatServiceClient->deleteMembership($formattedName); + $response = $chatServiceClient->deleteMembership($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/delete_message.php b/AppsChat/samples/V1/ChatServiceClient/delete_message.php index 11dc48456c3f..913a833d5d8a 100644 --- a/AppsChat/samples/V1/ChatServiceClient/delete_message.php +++ b/AppsChat/samples/V1/ChatServiceClient/delete_message.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_DeleteMessage_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\DeleteMessageRequest; /** * Deletes a message. @@ -56,9 +57,13 @@ function delete_message_sample(string $formattedName): void // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = (new DeleteMessageRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { - $chatServiceClient->deleteMessage($formattedName); + $chatServiceClient->deleteMessage($request); printf('Call completed successfully.' . PHP_EOL); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/delete_reaction.php b/AppsChat/samples/V1/ChatServiceClient/delete_reaction.php index b021f18a4c6d..d8df09b4d126 100644 --- a/AppsChat/samples/V1/ChatServiceClient/delete_reaction.php +++ b/AppsChat/samples/V1/ChatServiceClient/delete_reaction.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_DeleteReaction_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\DeleteReactionRequest; /** * Deletes a reaction to a message. For an example, see @@ -43,9 +44,13 @@ function delete_reaction_sample(string $formattedName): void // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = (new DeleteReactionRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { - $chatServiceClient->deleteReaction($formattedName); + $chatServiceClient->deleteReaction($request); printf('Call completed successfully.' . PHP_EOL); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/delete_space.php b/AppsChat/samples/V1/ChatServiceClient/delete_space.php index 488b4846c86a..3692d848c117 100644 --- a/AppsChat/samples/V1/ChatServiceClient/delete_space.php +++ b/AppsChat/samples/V1/ChatServiceClient/delete_space.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_DeleteSpace_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\DeleteSpaceRequest; /** * Deletes a named space. Always performs a cascading delete, which means @@ -46,9 +47,13 @@ function delete_space_sample(string $formattedName): void // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = (new DeleteSpaceRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { - $chatServiceClient->deleteSpace($formattedName); + $chatServiceClient->deleteSpace($request); printf('Call completed successfully.' . PHP_EOL); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/find_direct_message.php b/AppsChat/samples/V1/ChatServiceClient/find_direct_message.php index 4bea324a9c95..9c88f52d448e 100644 --- a/AppsChat/samples/V1/ChatServiceClient/find_direct_message.php +++ b/AppsChat/samples/V1/ChatServiceClient/find_direct_message.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_FindDirectMessage_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\FindDirectMessageRequest; use Google\Apps\Chat\V1\Space; /** @@ -67,10 +68,14 @@ function find_direct_message_sample(string $name): void // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = (new FindDirectMessageRequest()) + ->setName($name); + // Call the API and handle any network failures. try { /** @var Space $response */ - $response = $chatServiceClient->findDirectMessage($name); + $response = $chatServiceClient->findDirectMessage($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/get_attachment.php b/AppsChat/samples/V1/ChatServiceClient/get_attachment.php index 83ae101a778d..3b2c1585e38b 100644 --- a/AppsChat/samples/V1/ChatServiceClient/get_attachment.php +++ b/AppsChat/samples/V1/ChatServiceClient/get_attachment.php @@ -25,7 +25,8 @@ // [START chat_v1_generated_ChatService_GetAttachment_sync] use Google\ApiCore\ApiException; use Google\Apps\Chat\V1\Attachment; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\GetAttachmentRequest; /** * Gets the metadata of a message attachment. The attachment data is fetched @@ -46,10 +47,14 @@ function get_attachment_sample(string $formattedName): void // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = (new GetAttachmentRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { /** @var Attachment $response */ - $response = $chatServiceClient->getAttachment($formattedName); + $response = $chatServiceClient->getAttachment($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/get_membership.php b/AppsChat/samples/V1/ChatServiceClient/get_membership.php index a8f698dd3ad5..51d610ad755c 100644 --- a/AppsChat/samples/V1/ChatServiceClient/get_membership.php +++ b/AppsChat/samples/V1/ChatServiceClient/get_membership.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_GetMembership_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\GetMembershipRequest; use Google\Apps\Chat\V1\Membership; /** @@ -59,10 +60,14 @@ function get_membership_sample(string $formattedName): void // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = (new GetMembershipRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { /** @var Membership $response */ - $response = $chatServiceClient->getMembership($formattedName); + $response = $chatServiceClient->getMembership($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/get_message.php b/AppsChat/samples/V1/ChatServiceClient/get_message.php index a0845f506d79..32edfa81d76b 100644 --- a/AppsChat/samples/V1/ChatServiceClient/get_message.php +++ b/AppsChat/samples/V1/ChatServiceClient/get_message.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_GetMessage_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\GetMessageRequest; use Google\Apps\Chat\V1\Message; /** @@ -57,10 +58,14 @@ function get_message_sample(string $formattedName): void // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = (new GetMessageRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { /** @var Message $response */ - $response = $chatServiceClient->getMessage($formattedName); + $response = $chatServiceClient->getMessage($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/get_space.php b/AppsChat/samples/V1/ChatServiceClient/get_space.php index 2f9ccac58b2e..c39069d8a628 100644 --- a/AppsChat/samples/V1/ChatServiceClient/get_space.php +++ b/AppsChat/samples/V1/ChatServiceClient/get_space.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_GetSpace_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\GetSpaceRequest; use Google\Apps\Chat\V1\Space; /** @@ -49,10 +50,14 @@ function get_space_sample(string $formattedName): void // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = (new GetSpaceRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { /** @var Space $response */ - $response = $chatServiceClient->getSpace($formattedName); + $response = $chatServiceClient->getSpace($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/list_memberships.php b/AppsChat/samples/V1/ChatServiceClient/list_memberships.php index 6711ea92f4ed..c2df7453ab5d 100644 --- a/AppsChat/samples/V1/ChatServiceClient/list_memberships.php +++ b/AppsChat/samples/V1/ChatServiceClient/list_memberships.php @@ -25,7 +25,8 @@ // [START chat_v1_generated_ChatService_ListMemberships_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\ListMembershipsRequest; use Google\Apps\Chat\V1\Membership; /** @@ -60,10 +61,14 @@ function list_memberships_sample(string $formattedParent): void // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = (new ListMembershipsRequest()) + ->setParent($formattedParent); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $chatServiceClient->listMemberships($formattedParent); + $response = $chatServiceClient->listMemberships($request); /** @var Membership $element */ foreach ($response as $element) { diff --git a/AppsChat/samples/V1/ChatServiceClient/list_messages.php b/AppsChat/samples/V1/ChatServiceClient/list_messages.php index 6df222ba8af2..e7696f55bdd5 100644 --- a/AppsChat/samples/V1/ChatServiceClient/list_messages.php +++ b/AppsChat/samples/V1/ChatServiceClient/list_messages.php @@ -25,7 +25,8 @@ // [START chat_v1_generated_ChatService_ListMessages_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\ListMessagesRequest; use Google\Apps\Chat\V1\Message; /** @@ -45,10 +46,14 @@ function list_messages_sample(string $formattedParent): void // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = (new ListMessagesRequest()) + ->setParent($formattedParent); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $chatServiceClient->listMessages($formattedParent); + $response = $chatServiceClient->listMessages($request); /** @var Message $element */ foreach ($response as $element) { diff --git a/AppsChat/samples/V1/ChatServiceClient/list_reactions.php b/AppsChat/samples/V1/ChatServiceClient/list_reactions.php index a1a21598f12d..77249e9acd53 100644 --- a/AppsChat/samples/V1/ChatServiceClient/list_reactions.php +++ b/AppsChat/samples/V1/ChatServiceClient/list_reactions.php @@ -25,7 +25,8 @@ // [START chat_v1_generated_ChatService_ListReactions_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\ListReactionsRequest; use Google\Apps\Chat\V1\Reaction; /** @@ -45,10 +46,14 @@ function list_reactions_sample(string $formattedParent): void // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = (new ListReactionsRequest()) + ->setParent($formattedParent); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $chatServiceClient->listReactions($formattedParent); + $response = $chatServiceClient->listReactions($request); /** @var Reaction $element */ foreach ($response as $element) { diff --git a/AppsChat/samples/V1/ChatServiceClient/list_spaces.php b/AppsChat/samples/V1/ChatServiceClient/list_spaces.php index 80928d7e0cc3..92ca4eef9b19 100644 --- a/AppsChat/samples/V1/ChatServiceClient/list_spaces.php +++ b/AppsChat/samples/V1/ChatServiceClient/list_spaces.php @@ -25,7 +25,8 @@ // [START chat_v1_generated_ChatService_ListSpaces_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\ListSpacesRequest; use Google\Apps\Chat\V1\Space; /** @@ -56,10 +57,13 @@ function list_spaces_sample(): void // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = new ListSpacesRequest(); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $chatServiceClient->listSpaces(); + $response = $chatServiceClient->listSpaces($request); /** @var Space $element */ foreach ($response as $element) { diff --git a/AppsChat/samples/V1/ChatServiceClient/set_up_space.php b/AppsChat/samples/V1/ChatServiceClient/set_up_space.php index 6571f4115bde..82b1975f99b6 100644 --- a/AppsChat/samples/V1/ChatServiceClient/set_up_space.php +++ b/AppsChat/samples/V1/ChatServiceClient/set_up_space.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_SetUpSpace_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\SetUpSpaceRequest; use Google\Apps\Chat\V1\Space; /** @@ -81,13 +82,15 @@ function set_up_space_sample(): void // Create a client. $chatServiceClient = new ChatServiceClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $space = new Space(); + $request = (new SetUpSpaceRequest()) + ->setSpace($space); // Call the API and handle any network failures. try { /** @var Space $response */ - $response = $chatServiceClient->setUpSpace($space); + $response = $chatServiceClient->setUpSpace($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/update_message.php b/AppsChat/samples/V1/ChatServiceClient/update_message.php index 9881280c3df6..d95d61610d21 100644 --- a/AppsChat/samples/V1/ChatServiceClient/update_message.php +++ b/AppsChat/samples/V1/ChatServiceClient/update_message.php @@ -24,8 +24,9 @@ // [START chat_v1_generated_ChatService_UpdateMessage_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; use Google\Apps\Chat\V1\Message; +use Google\Apps\Chat\V1\UpdateMessageRequest; /** * Updates a message. There's a difference between the `patch` and `update` @@ -56,13 +57,15 @@ function update_message_sample(): void // Create a client. $chatServiceClient = new ChatServiceClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $message = new Message(); + $request = (new UpdateMessageRequest()) + ->setMessage($message); // Call the API and handle any network failures. try { /** @var Message $response */ - $response = $chatServiceClient->updateMessage($message); + $response = $chatServiceClient->updateMessage($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/update_space.php b/AppsChat/samples/V1/ChatServiceClient/update_space.php index 63f73ab7f1ae..c886524a6b00 100644 --- a/AppsChat/samples/V1/ChatServiceClient/update_space.php +++ b/AppsChat/samples/V1/ChatServiceClient/update_space.php @@ -24,8 +24,9 @@ // [START chat_v1_generated_ChatService_UpdateSpace_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; use Google\Apps\Chat\V1\Space; +use Google\Apps\Chat\V1\UpdateSpaceRequest; /** * Updates a space. For an example, see @@ -50,13 +51,15 @@ function update_space_sample(): void // Create a client. $chatServiceClient = new ChatServiceClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $space = new Space(); + $request = (new UpdateSpaceRequest()) + ->setSpace($space); // Call the API and handle any network failures. try { /** @var Space $response */ - $response = $chatServiceClient->updateSpace($space); + $response = $chatServiceClient->updateSpace($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/samples/V1/ChatServiceClient/upload_attachment.php b/AppsChat/samples/V1/ChatServiceClient/upload_attachment.php index dbb05fac90b6..437e34819ba4 100644 --- a/AppsChat/samples/V1/ChatServiceClient/upload_attachment.php +++ b/AppsChat/samples/V1/ChatServiceClient/upload_attachment.php @@ -24,7 +24,8 @@ // [START chat_v1_generated_ChatService_UploadAttachment_sync] use Google\ApiCore\ApiException; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\UploadAttachmentRequest; use Google\Apps\Chat\V1\UploadAttachmentResponse; /** @@ -48,10 +49,15 @@ function upload_attachment_sample(string $formattedParent, string $filename): vo // Create a client. $chatServiceClient = new ChatServiceClient(); + // Prepare the request message. + $request = (new UploadAttachmentRequest()) + ->setParent($formattedParent) + ->setFilename($filename); + // Call the API and handle any network failures. try { /** @var UploadAttachmentResponse $response */ - $response = $chatServiceClient->uploadAttachment($formattedParent, $filename); + $response = $chatServiceClient->uploadAttachment($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/AppsChat/src/Chat/V1/ChatServiceClient.php b/AppsChat/src/Chat/V1/ChatServiceClient.php deleted file mode 100644 index 9d334642ab7c..000000000000 --- a/AppsChat/src/Chat/V1/ChatServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ - self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/chat_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/chat_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/chat_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/chat_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a attachment + * resource. + * + * @param string $space + * @param string $message + * @param string $attachment + * + * @return string The formatted attachment resource. + */ + public static function attachmentName(string $space, string $message, string $attachment): string + { + return self::getPathTemplate('attachment')->render([ + 'space' => $space, + 'message' => $message, + 'attachment' => $attachment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a membership + * resource. + * + * @param string $space + * @param string $member + * + * @return string The formatted membership resource. + */ + public static function membershipName(string $space, string $member): string + { + return self::getPathTemplate('membership')->render([ + 'space' => $space, + 'member' => $member, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a message + * resource. + * + * @param string $space + * @param string $message + * + * @return string The formatted message resource. + */ + public static function messageName(string $space, string $message): string + { + return self::getPathTemplate('message')->render([ + 'space' => $space, + 'message' => $message, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * quoted_message_metadata resource. + * + * @param string $space + * @param string $message + * @param string $quotedMessageMetadata + * + * @return string The formatted quoted_message_metadata resource. + */ + public static function quotedMessageMetadataName( + string $space, + string $message, + string $quotedMessageMetadata + ): string { + return self::getPathTemplate('quotedMessageMetadata')->render([ + 'space' => $space, + 'message' => $message, + 'quoted_message_metadata' => $quotedMessageMetadata, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a reaction + * resource. + * + * @param string $space + * @param string $message + * @param string $reaction + * + * @return string The formatted reaction resource. + */ + public static function reactionName(string $space, string $message, string $reaction): string + { + return self::getPathTemplate('reaction')->render([ + 'space' => $space, + 'message' => $message, + 'reaction' => $reaction, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a space + * resource. + * + * @param string $space + * + * @return string The formatted space resource. + */ + public static function spaceName(string $space): string + { + return self::getPathTemplate('space')->render([ + 'space' => $space, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a thread + * resource. + * + * @param string $space + * @param string $thread + * + * @return string The formatted thread resource. + */ + public static function threadName(string $space, string $thread): string + { + return self::getPathTemplate('thread')->render([ + 'space' => $space, + 'thread' => $thread, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - attachment: spaces/{space}/messages/{message}/attachments/{attachment} + * - membership: spaces/{space}/members/{member} + * - message: spaces/{space}/messages/{message} + * - quotedMessageMetadata: spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata} + * - reaction: spaces/{space}/messages/{message}/reactions/{reaction} + * - space: spaces/{space} + * - thread: spaces/{space}/threads/{thread} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'chat.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Completes the + * [import process](https://developers.google.com/chat/api/guides/import-data) + * for the specified space and makes it visible to users. + * Requires app authentication and domain-wide delegation. For more + * information, see [Authorize Google Chat apps to import + * data](https://developers.google.com/chat/api/guides/authorize-import). + * + * The async variant is {@see ChatServiceClient::completeImportSpaceAsync()} . + * + * @example samples/V1/ChatServiceClient/complete_import_space.php + * + * @param CompleteImportSpaceRequest $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 CompleteImportSpaceResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function completeImportSpace( + CompleteImportSpaceRequest $request, + array $callOptions = [] + ): CompleteImportSpaceResponse { + return $this->startApiCall('CompleteImportSpace', $request, $callOptions)->wait(); + } + + /** + * Creates a human membership or app membership for the calling app. Creating + * memberships for other apps isn't supported. For an example, see + * [ Create a + * membership](https://developers.google.com/chat/api/guides/v1/members/create). + * When creating a membership, if the specified member has their auto-accept + * policy turned off, then they're invited, and must accept the space + * invitation before joining. Otherwise, creating a membership adds the member + * directly to the specified space. Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * To specify the member to add, set the `membership.member.name` in the + * `CreateMembershipRequest`: + * + * - To add the calling app to a space or a direct message between two human + * users, use `users/app`. Unable to add other + * apps to the space. + * + * - To add a human user, use `users/{user}`, where `{user}` can be the email + * address for the user. For users in the same Workspace organization `{user}` + * can also be the `id` for the person from the People API, or the `id` for + * the user in the Directory API. For example, if the People API Person + * profile ID for `user@example.com` is `123456789`, you can add the user to + * the space by setting the `membership.member.name` to + * `users/user@example.com` or `users/123456789`. + * + * The async variant is {@see ChatServiceClient::createMembershipAsync()} . + * + * @example samples/V1/ChatServiceClient/create_membership.php + * + * @param CreateMembershipRequest $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 Membership + * + * @throws ApiException Thrown if the API call fails. + */ + public function createMembership(CreateMembershipRequest $request, array $callOptions = []): Membership + { + return $this->startApiCall('CreateMembership', $request, $callOptions)->wait(); + } + + /** + * Creates a message in a Google Chat space. For an example, see [Create a + * message](https://developers.google.com/chat/api/guides/v1/messages/create). + * + * Calling this method requires + * [authentication](https://developers.google.com/chat/api/guides/auth) and + * supports the following authentication types: + * + * - For text messages, user authentication or app authentication are + * supported. + * - For card messages, only app authentication is supported. (Only Chat apps + * can create card messages.) + * + * The async variant is {@see ChatServiceClient::createMessageAsync()} . + * + * @example samples/V1/ChatServiceClient/create_message.php + * + * @param CreateMessageRequest $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 Message + * + * @throws ApiException Thrown if the API call fails. + */ + public function createMessage(CreateMessageRequest $request, array $callOptions = []): Message + { + return $this->startApiCall('CreateMessage', $request, $callOptions)->wait(); + } + + /** + * Creates a reaction and adds it to a message. For an example, see + * [Create a + * reaction](https://developers.google.com/chat/api/guides/v1/reactions/create). + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * Only unicode emoji are supported. + * + * The async variant is {@see ChatServiceClient::createReactionAsync()} . + * + * @example samples/V1/ChatServiceClient/create_reaction.php + * + * @param CreateReactionRequest $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 Reaction + * + * @throws ApiException Thrown if the API call fails. + */ + public function createReaction(CreateReactionRequest $request, array $callOptions = []): Reaction + { + return $this->startApiCall('CreateReaction', $request, $callOptions)->wait(); + } + + /** + * Creates a named space. Spaces grouped by topics aren't supported. For an + * example, see [Create a + * space](https://developers.google.com/chat/api/guides/v1/spaces/create). + * + * If you receive the error message `ALREADY_EXISTS` when creating + * a space, try a different `displayName`. An existing space within + * the Google Workspace organization might already use this display name. + * + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * The async variant is {@see ChatServiceClient::createSpaceAsync()} . + * + * @example samples/V1/ChatServiceClient/create_space.php + * + * @param CreateSpaceRequest $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 Space + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSpace(CreateSpaceRequest $request, array $callOptions = []): Space + { + return $this->startApiCall('CreateSpace', $request, $callOptions)->wait(); + } + + /** + * Deletes a membership. For an example, see + * [Delete a + * membership](https://developers.google.com/chat/api/guides/v1/members/delete). + * + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * The async variant is {@see ChatServiceClient::deleteMembershipAsync()} . + * + * @example samples/V1/ChatServiceClient/delete_membership.php + * + * @param DeleteMembershipRequest $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 Membership + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteMembership(DeleteMembershipRequest $request, array $callOptions = []): Membership + { + return $this->startApiCall('DeleteMembership', $request, $callOptions)->wait(); + } + + /** + * Deletes a message. + * For an example, see [Delete a + * message](https://developers.google.com/chat/api/guides/v1/messages/delete). + * + * Requires + * [authentication](https://developers.google.com/chat/api/guides/auth). + * Supports + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * When using app authentication, requests can only delete messages + * created by the calling Chat app. + * + * The async variant is {@see ChatServiceClient::deleteMessageAsync()} . + * + * @example samples/V1/ChatServiceClient/delete_message.php + * + * @param DeleteMessageRequest $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. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteMessage(DeleteMessageRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteMessage', $request, $callOptions)->wait(); + } + + /** + * Deletes a reaction to a message. For an example, see + * [Delete a + * reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete). + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * The async variant is {@see ChatServiceClient::deleteReactionAsync()} . + * + * @example samples/V1/ChatServiceClient/delete_reaction.php + * + * @param DeleteReactionRequest $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. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteReaction(DeleteReactionRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteReaction', $request, $callOptions)->wait(); + } + + /** + * Deletes a named space. Always performs a cascading delete, which means + * that the space's child resources—like messages posted in the space and + * memberships in the space—are also deleted. For an example, see + * [Delete a + * space](https://developers.google.com/chat/api/guides/v1/spaces/delete). + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users) + * from a user who has permission to delete the space. + * + * The async variant is {@see ChatServiceClient::deleteSpaceAsync()} . + * + * @example samples/V1/ChatServiceClient/delete_space.php + * + * @param DeleteSpaceRequest $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. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteSpace(DeleteSpaceRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteSpace', $request, $callOptions)->wait(); + } + + /** + * Returns the existing direct message with the specified user. If no direct + * message space is found, returns a `404 NOT_FOUND` error. For an example, + * see + * [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). + * + * With [user + * authentication](https://developers.google.com/chat/api/guides/auth/users), + * returns the direct message space between the specified user and the + * authenticated user. + * + * With [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), + * returns the direct message space between the specified user and the calling + * Chat app. + * + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users) + * or [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + * + * The async variant is {@see ChatServiceClient::findDirectMessageAsync()} . + * + * @example samples/V1/ChatServiceClient/find_direct_message.php + * + * @param FindDirectMessageRequest $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 Space + * + * @throws ApiException Thrown if the API call fails. + */ + public function findDirectMessage(FindDirectMessageRequest $request, array $callOptions = []): Space + { + return $this->startApiCall('FindDirectMessage', $request, $callOptions)->wait(); + } + + /** + * Gets the metadata of a message attachment. The attachment data is fetched + * using the [media + * API](https://developers.google.com/chat/api/reference/rest/v1/media/download). + * For an example, see + * [Get a message + * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). + * Requires [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + * + * The async variant is {@see ChatServiceClient::getAttachmentAsync()} . + * + * @example samples/V1/ChatServiceClient/get_attachment.php + * + * @param GetAttachmentRequest $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 Attachment + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAttachment(GetAttachmentRequest $request, array $callOptions = []): Attachment + { + return $this->startApiCall('GetAttachment', $request, $callOptions)->wait(); + } + + /** + * Returns details about a membership. For an example, see + * [Get a + * membership](https://developers.google.com/chat/api/guides/v1/members/get). + * + * Requires + * [authentication](https://developers.google.com/chat/api/guides/auth). + * Supports + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * The async variant is {@see ChatServiceClient::getMembershipAsync()} . + * + * @example samples/V1/ChatServiceClient/get_membership.php + * + * @param GetMembershipRequest $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 Membership + * + * @throws ApiException Thrown if the API call fails. + */ + public function getMembership(GetMembershipRequest $request, array $callOptions = []): Membership + { + return $this->startApiCall('GetMembership', $request, $callOptions)->wait(); + } + + /** + * Returns details about a message. + * For an example, see [Read a + * message](https://developers.google.com/chat/api/guides/v1/messages/get). + * + * Requires + * [authentication](https://developers.google.com/chat/api/guides/auth). + * Supports + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Note: Might return a message from a blocked member or space. + * + * The async variant is {@see ChatServiceClient::getMessageAsync()} . + * + * @example samples/V1/ChatServiceClient/get_message.php + * + * @param GetMessageRequest $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 Message + * + * @throws ApiException Thrown if the API call fails. + */ + public function getMessage(GetMessageRequest $request, array $callOptions = []): Message + { + return $this->startApiCall('GetMessage', $request, $callOptions)->wait(); + } + + /** + * Returns details about a space. For an example, see + * [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get). + * + * Requires + * [authentication](https://developers.google.com/chat/api/guides/auth). + * Supports + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * The async variant is {@see ChatServiceClient::getSpaceAsync()} . + * + * @example samples/V1/ChatServiceClient/get_space.php + * + * @param GetSpaceRequest $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 Space + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSpace(GetSpaceRequest $request, array $callOptions = []): Space + { + return $this->startApiCall('GetSpace', $request, $callOptions)->wait(); + } + + /** + * Lists memberships in a space. For an example, see [List + * memberships](https://developers.google.com/chat/api/guides/v1/members/list). + * Listing memberships with + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * lists memberships in spaces that the Chat app has + * access to, but excludes Chat app memberships, + * including its own. Listing memberships with + * [User + * authentication](https://developers.google.com/chat/api/guides/auth/users) + * lists memberships in spaces that the authenticated user has access to. + * + * Requires + * [authentication](https://developers.google.com/chat/api/guides/auth). + * Supports + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * The async variant is {@see ChatServiceClient::listMembershipsAsync()} . + * + * @example samples/V1/ChatServiceClient/list_memberships.php + * + * @param ListMembershipsRequest $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 listMemberships(ListMembershipsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListMemberships', $request, $callOptions); + } + + /** + * Lists messages in a space that the caller is a member of, including + * messages from blocked members and spaces. For an example, see + * [List messages](/chat/api/guides/v1/messages/list). + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * The async variant is {@see ChatServiceClient::listMessagesAsync()} . + * + * @example samples/V1/ChatServiceClient/list_messages.php + * + * @param ListMessagesRequest $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 listMessages(ListMessagesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListMessages', $request, $callOptions); + } + + /** + * Lists reactions to a message. For an example, see + * [List + * reactions](https://developers.google.com/chat/api/guides/v1/reactions/list). + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * The async variant is {@see ChatServiceClient::listReactionsAsync()} . + * + * @example samples/V1/ChatServiceClient/list_reactions.php + * + * @param ListReactionsRequest $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 listReactions(ListReactionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListReactions', $request, $callOptions); + } + + /** + * Lists spaces the caller is a member of. Group chats and DMs aren't listed + * until the first message is sent. For an example, see + * [List + * spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). + * + * Requires + * [authentication](https://developers.google.com/chat/api/guides/auth). + * Supports + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * Lists spaces visible to the caller or authenticated user. Group chats + * and DMs aren't listed until the first message is sent. + * + * The async variant is {@see ChatServiceClient::listSpacesAsync()} . + * + * @example samples/V1/ChatServiceClient/list_spaces.php + * + * @param ListSpacesRequest $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 listSpaces(ListSpacesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSpaces', $request, $callOptions); + } + + /** + * Creates a space and adds specified users to it. The calling user is + * automatically added to the space, and shouldn't be specified as a + * membership in the request. For an example, see + * [Set up a + * space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). + * + * To specify the human members to add, add memberships with the appropriate + * `member.name` in the `SetUpSpaceRequest`. To add a human user, use + * `users/{user}`, where `{user}` can be the email address for the user. For + * users in the same Workspace organization `{user}` can also be the `id` for + * the person from the People API, or the `id` for the user in the Directory + * API. For example, if the People API Person profile ID for + * `user@example.com` is `123456789`, you can add the user to the space by + * setting the `membership.member.name` to `users/user@example.com` or + * `users/123456789`. + * + * For a space or group chat, if the caller blocks or is blocked by some + * members, then those members aren't added to the created space. + * + * To create a direct message (DM) between the calling user and another human + * user, specify exactly one membership to represent the human user. If + * one user blocks the other, the request fails and the DM isn't created. + * + * To create a DM between the calling user and the calling app, set + * `Space.singleUserBotDm` to `true` and don't specify any memberships. You + * can only use this method to set up a DM with the calling app. To add the + * calling app as a member of a space or an existing DM between two human + * users, see + * [create a + * membership](https://developers.google.com/chat/api/guides/v1/members/create). + * + * If a DM already exists between two users, even when one user blocks the + * other at the time a request is made, then the existing DM is returned. + * + * Spaces with threaded replies aren't supported. If you receive the error + * message `ALREADY_EXISTS` when setting up a space, try a different + * `displayName`. An existing space within the Google Workspace organization + * might already use this display name. + * + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * The async variant is {@see ChatServiceClient::setUpSpaceAsync()} . + * + * @example samples/V1/ChatServiceClient/set_up_space.php + * + * @param SetUpSpaceRequest $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 Space + * + * @throws ApiException Thrown if the API call fails. + */ + public function setUpSpace(SetUpSpaceRequest $request, array $callOptions = []): Space + { + return $this->startApiCall('SetUpSpace', $request, $callOptions)->wait(); + } + + /** + * Updates a message. There's a difference between the `patch` and `update` + * methods. The `patch` + * method uses a `patch` request while the `update` method uses a `put` + * request. We recommend using the `patch` method. For an example, see + * [Update a + * message](https://developers.google.com/chat/api/guides/v1/messages/update). + * + * Requires + * [authentication](https://developers.google.com/chat/api/guides/auth). + * Supports + * [app + * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * and [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * When using app authentication, requests can only update messages + * created by the calling Chat app. + * + * The async variant is {@see ChatServiceClient::updateMessageAsync()} . + * + * @example samples/V1/ChatServiceClient/update_message.php + * + * @param UpdateMessageRequest $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 Message + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateMessage(UpdateMessageRequest $request, array $callOptions = []): Message + { + return $this->startApiCall('UpdateMessage', $request, $callOptions)->wait(); + } + + /** + * Updates a space. For an example, see + * [Update a + * space](https://developers.google.com/chat/api/guides/v1/spaces/update). + * + * If you're updating the `displayName` field and receive the error message + * `ALREADY_EXISTS`, try a different display name.. An existing space within + * the Google Workspace organization might already use this display name. + * + * Requires [user + * authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * The async variant is {@see ChatServiceClient::updateSpaceAsync()} . + * + * @example samples/V1/ChatServiceClient/update_space.php + * + * @param UpdateSpaceRequest $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 Space + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateSpace(UpdateSpaceRequest $request, array $callOptions = []): Space + { + return $this->startApiCall('UpdateSpace', $request, $callOptions)->wait(); + } + + /** + * Uploads an attachment. For an example, see + * [Upload media as a file + * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload). + * Requires user + * [authentication](https://developers.google.com/chat/api/guides/auth/users). + * + * You can upload attachments up to 200 MB. Certain file types aren't + * supported. For details, see [File types blocked by Google + * Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat). + * + * The async variant is {@see ChatServiceClient::uploadAttachmentAsync()} . + * + * @example samples/V1/ChatServiceClient/upload_attachment.php + * + * @param UploadAttachmentRequest $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 UploadAttachmentResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function uploadAttachment( + UploadAttachmentRequest $request, + array $callOptions = [] + ): UploadAttachmentResponse { + return $this->startApiCall('UploadAttachment', $request, $callOptions)->wait(); + } +} diff --git a/AppsChat/src/Chat/V1/CreateMembershipRequest.php b/AppsChat/src/Chat/V1/CreateMembershipRequest.php index 78f625e2bba8..010da124cbf0 100644 --- a/AppsChat/src/Chat/V1/CreateMembershipRequest.php +++ b/AppsChat/src/Chat/V1/CreateMembershipRequest.php @@ -43,6 +43,40 @@ class CreateMembershipRequest extends \Google\Protobuf\Internal\Message */ protected $membership = null; + /** + * @param string $parent Required. The resource name of the space for which to create the + * membership. + * + * Format: spaces/{space} + * Please see {@see ChatServiceClient::spaceName()} for help formatting this field. + * @param \Google\Apps\Chat\V1\Membership $membership Required. The membership relation to create. + * The `memberType` field must contain a user with the `user.name` and + * `user.type` fields populated. The server will assign a resource name + * and overwrite anything specified. + * When a Chat app creates a membership relation for a human user, it must use + * the `chat.memberships` scope, set `user.type` to `HUMAN`, and set + * `user.name` with format `users/{user}`, where `{user}` can be the email + * address for the user. For users in the same Workspace organization `{user}` + * can also be the `id` of the + * [person](https://developers.google.com/people/api/rest/v1/people) from the + * People API, or the `id` for the user in the Directory API. For example, if + * the People API Person profile ID for `user@example.com` is `123456789`, you + * can add the user to the space by setting the `membership.member.name` to + * `users/user@example.com` or `users/123456789`. When a Chat app creates a + * membership relation for itself, it must use the `chat.memberships.app` + * scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + * + * @return \Google\Apps\Chat\V1\CreateMembershipRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Apps\Chat\V1\Membership $membership): self + { + return (new self()) + ->setParent($parent) + ->setMembership($membership); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/CreateMessageRequest.php b/AppsChat/src/Chat/V1/CreateMessageRequest.php index 91b17b9c03fd..06b6b8d756f4 100644 --- a/AppsChat/src/Chat/V1/CreateMessageRequest.php +++ b/AppsChat/src/Chat/V1/CreateMessageRequest.php @@ -74,6 +74,40 @@ class CreateMessageRequest extends \Google\Protobuf\Internal\Message */ protected $message_id = ''; + /** + * @param string $parent Required. The resource name of the space in which to create a message. + * + * Format: `spaces/{space}` + * Please see {@see ChatServiceClient::spaceName()} for help formatting this field. + * @param \Google\Apps\Chat\V1\Message $message Required. Message body. + * @param string $messageId Optional. A custom ID for a message. Lets Chat apps get, update, or delete + * a message without needing to store the system-assigned ID in the message's + * resource name (represented in the message `name` field). + * + * The value for this field must meet the following requirements: + * + * * Begins with `client-`. For example, `client-custom-name` is a valid + * custom ID, but `custom-name` is not. + * * Contains up to 63 characters and only lowercase letters, numbers, and + * hyphens. + * * Is unique within a space. A Chat app can't use the same custom ID for + * different messages. + * + * For details, see [Name a + * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * + * @return \Google\Apps\Chat\V1\CreateMessageRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Apps\Chat\V1\Message $message, string $messageId): self + { + return (new self()) + ->setParent($parent) + ->setMessage($message) + ->setMessageId($messageId); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/CreateReactionRequest.php b/AppsChat/src/Chat/V1/CreateReactionRequest.php index 44c48dde1b3f..97555cae7e06 100644 --- a/AppsChat/src/Chat/V1/CreateReactionRequest.php +++ b/AppsChat/src/Chat/V1/CreateReactionRequest.php @@ -29,6 +29,24 @@ class CreateReactionRequest extends \Google\Protobuf\Internal\Message */ protected $reaction = null; + /** + * @param string $parent Required. The message where the reaction is created. + * + * Format: `spaces/{space}/messages/{message}` + * Please see {@see ChatServiceClient::messageName()} for help formatting this field. + * @param \Google\Apps\Chat\V1\Reaction $reaction Required. The reaction to create. + * + * @return \Google\Apps\Chat\V1\CreateReactionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Apps\Chat\V1\Reaction $reaction): self + { + return (new self()) + ->setParent($parent) + ->setReaction($reaction); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/CreateSpaceRequest.php b/AppsChat/src/Chat/V1/CreateSpaceRequest.php index f5fbb018efa5..a5e5f59870ca 100644 --- a/AppsChat/src/Chat/V1/CreateSpaceRequest.php +++ b/AppsChat/src/Chat/V1/CreateSpaceRequest.php @@ -37,6 +37,27 @@ class CreateSpaceRequest extends \Google\Protobuf\Internal\Message */ protected $request_id = ''; + /** + * @param \Google\Apps\Chat\V1\Space $space Required. The `displayName` and `spaceType` fields must be populated. Only + * `SpaceType.SPACE` is supported. + * + * If you receive the error message `ALREADY_EXISTS` when creating a space, + * try a different `displayName`. An existing space within the Google + * Workspace organization might already use this display name. + * + * The space `name` is assigned on the server so anything specified in this + * field will be ignored. + * + * @return \Google\Apps\Chat\V1\CreateSpaceRequest + * + * @experimental + */ + public static function build(\Google\Apps\Chat\V1\Space $space): self + { + return (new self()) + ->setSpace($space); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/DeleteMembershipRequest.php b/AppsChat/src/Chat/V1/DeleteMembershipRequest.php index 21330bfbad0b..596d7060d7f4 100644 --- a/AppsChat/src/Chat/V1/DeleteMembershipRequest.php +++ b/AppsChat/src/Chat/V1/DeleteMembershipRequest.php @@ -30,6 +30,33 @@ class DeleteMembershipRequest extends \Google\Protobuf\Internal\Message */ protected $name = ''; + /** + * @param string $name Required. Resource name of the membership to delete. Chat apps can delete + * human users' or their own memberships. Chat apps can't delete other apps' + * memberships. + * + * When deleting a human membership, requires the `chat.memberships` scope and + * `spaces/{space}/members/{member}` format. You can use the email as an + * alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. + * + * When deleting an app membership, requires the `chat.memberships.app` scope + * and `spaces/{space}/members/app` format. + * + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. Please see + * {@see ChatServiceClient::membershipName()} for help formatting this field. + * + * @return \Google\Apps\Chat\V1\DeleteMembershipRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/DeleteMessageRequest.php b/AppsChat/src/Chat/V1/DeleteMessageRequest.php index 31e227c56f16..0fdd22bab913 100644 --- a/AppsChat/src/Chat/V1/DeleteMessageRequest.php +++ b/AppsChat/src/Chat/V1/DeleteMessageRequest.php @@ -36,6 +36,27 @@ class DeleteMessageRequest extends \Google\Protobuf\Internal\Message */ protected $force = false; + /** + * @param string $name Required. Resource name of the message. + * + * Format: `spaces/{space}/messages/{message}` + * + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a + * message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). Please see + * {@see ChatServiceClient::messageName()} for help formatting this field. + * + * @return \Google\Apps\Chat\V1\DeleteMessageRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/DeleteReactionRequest.php b/AppsChat/src/Chat/V1/DeleteReactionRequest.php index cc43076facf9..c7557ad1c0e4 100644 --- a/AppsChat/src/Chat/V1/DeleteReactionRequest.php +++ b/AppsChat/src/Chat/V1/DeleteReactionRequest.php @@ -23,6 +23,22 @@ class DeleteReactionRequest extends \Google\Protobuf\Internal\Message */ protected $name = ''; + /** + * @param string $name Required. Name of the reaction to delete. + * + * Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + * Please see {@see ChatServiceClient::reactionName()} for help formatting this field. + * + * @return \Google\Apps\Chat\V1\DeleteReactionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/DeleteSpaceRequest.php b/AppsChat/src/Chat/V1/DeleteSpaceRequest.php index e52e3b11acac..62c7dedb9781 100644 --- a/AppsChat/src/Chat/V1/DeleteSpaceRequest.php +++ b/AppsChat/src/Chat/V1/DeleteSpaceRequest.php @@ -23,6 +23,22 @@ class DeleteSpaceRequest extends \Google\Protobuf\Internal\Message */ protected $name = ''; + /** + * @param string $name Required. Resource name of the space to delete. + * + * Format: `spaces/{space}` + * Please see {@see ChatServiceClient::spaceName()} for help formatting this field. + * + * @return \Google\Apps\Chat\V1\DeleteSpaceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/Gapic/ChatServiceGapicClient.php b/AppsChat/src/Chat/V1/Gapic/ChatServiceGapicClient.php deleted file mode 100644 index f7bb1cf7e2cf..000000000000 --- a/AppsChat/src/Chat/V1/Gapic/ChatServiceGapicClient.php +++ /dev/null @@ -1,2190 +0,0 @@ -spaceName('[SPACE]'); - * $response = $chatServiceClient->completeImportSpace($formattedName); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated This class will be removed in the next major version update. - */ -class ChatServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.chat.v1.ChatService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'chat.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'chat.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/chat.bot', - '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', - ]; - - private static $attachmentNameTemplate; - - private static $membershipNameTemplate; - - private static $messageNameTemplate; - - private static $quotedMessageMetadataNameTemplate; - - private static $reactionNameTemplate; - - private static $spaceNameTemplate; - - private static $threadNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/chat_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/chat_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/chat_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/chat_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getAttachmentNameTemplate() - { - if (self::$attachmentNameTemplate == null) { - self::$attachmentNameTemplate = new PathTemplate('spaces/{space}/messages/{message}/attachments/{attachment}'); - } - - return self::$attachmentNameTemplate; - } - - private static function getMembershipNameTemplate() - { - if (self::$membershipNameTemplate == null) { - self::$membershipNameTemplate = new PathTemplate('spaces/{space}/members/{member}'); - } - - return self::$membershipNameTemplate; - } - - private static function getMessageNameTemplate() - { - if (self::$messageNameTemplate == null) { - self::$messageNameTemplate = new PathTemplate('spaces/{space}/messages/{message}'); - } - - return self::$messageNameTemplate; - } - - private static function getQuotedMessageMetadataNameTemplate() - { - if (self::$quotedMessageMetadataNameTemplate == null) { - self::$quotedMessageMetadataNameTemplate = new PathTemplate('spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}'); - } - - return self::$quotedMessageMetadataNameTemplate; - } - - private static function getReactionNameTemplate() - { - if (self::$reactionNameTemplate == null) { - self::$reactionNameTemplate = new PathTemplate('spaces/{space}/messages/{message}/reactions/{reaction}'); - } - - return self::$reactionNameTemplate; - } - - private static function getSpaceNameTemplate() - { - if (self::$spaceNameTemplate == null) { - self::$spaceNameTemplate = new PathTemplate('spaces/{space}'); - } - - return self::$spaceNameTemplate; - } - - private static function getThreadNameTemplate() - { - if (self::$threadNameTemplate == null) { - self::$threadNameTemplate = new PathTemplate('spaces/{space}/threads/{thread}'); - } - - return self::$threadNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'attachment' => self::getAttachmentNameTemplate(), - 'membership' => self::getMembershipNameTemplate(), - 'message' => self::getMessageNameTemplate(), - 'quotedMessageMetadata' => self::getQuotedMessageMetadataNameTemplate(), - 'reaction' => self::getReactionNameTemplate(), - 'space' => self::getSpaceNameTemplate(), - 'thread' => self::getThreadNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a attachment - * resource. - * - * @param string $space - * @param string $message - * @param string $attachment - * - * @return string The formatted attachment resource. - */ - public static function attachmentName($space, $message, $attachment) - { - return self::getAttachmentNameTemplate()->render([ - 'space' => $space, - 'message' => $message, - 'attachment' => $attachment, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a membership - * resource. - * - * @param string $space - * @param string $member - * - * @return string The formatted membership resource. - */ - public static function membershipName($space, $member) - { - return self::getMembershipNameTemplate()->render([ - 'space' => $space, - 'member' => $member, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a message - * resource. - * - * @param string $space - * @param string $message - * - * @return string The formatted message resource. - */ - public static function messageName($space, $message) - { - return self::getMessageNameTemplate()->render([ - 'space' => $space, - 'message' => $message, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * quoted_message_metadata resource. - * - * @param string $space - * @param string $message - * @param string $quotedMessageMetadata - * - * @return string The formatted quoted_message_metadata resource. - */ - public static function quotedMessageMetadataName($space, $message, $quotedMessageMetadata) - { - return self::getQuotedMessageMetadataNameTemplate()->render([ - 'space' => $space, - 'message' => $message, - 'quoted_message_metadata' => $quotedMessageMetadata, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a reaction - * resource. - * - * @param string $space - * @param string $message - * @param string $reaction - * - * @return string The formatted reaction resource. - */ - public static function reactionName($space, $message, $reaction) - { - return self::getReactionNameTemplate()->render([ - 'space' => $space, - 'message' => $message, - 'reaction' => $reaction, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a space - * resource. - * - * @param string $space - * - * @return string The formatted space resource. - */ - public static function spaceName($space) - { - return self::getSpaceNameTemplate()->render([ - 'space' => $space, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a thread - * resource. - * - * @param string $space - * @param string $thread - * - * @return string The formatted thread resource. - */ - public static function threadName($space, $thread) - { - return self::getThreadNameTemplate()->render([ - 'space' => $space, - 'thread' => $thread, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - attachment: spaces/{space}/messages/{message}/attachments/{attachment} - * - membership: spaces/{space}/members/{member} - * - message: spaces/{space}/messages/{message} - * - quotedMessageMetadata: spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata} - * - reaction: spaces/{space}/messages/{message}/reactions/{reaction} - * - space: spaces/{space} - * - thread: spaces/{space}/threads/{thread} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'chat.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Completes the - * [import process](https://developers.google.com/chat/api/guides/import-data) - * for the specified space and makes it visible to users. - * Requires app authentication and domain-wide delegation. For more - * information, see [Authorize Google Chat apps to import - * data](https://developers.google.com/chat/api/guides/authorize-import). - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedName = $chatServiceClient->spaceName('[SPACE]'); - * $response = $chatServiceClient->completeImportSpace($formattedName); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the import mode space. - * - * Format: `spaces/{space}` - * @param array $optionalArgs { - * 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 \Google\Apps\Chat\V1\CompleteImportSpaceResponse - * - * @throws ApiException if the remote call fails - */ - public function completeImportSpace($name, array $optionalArgs = []) - { - $request = new CompleteImportSpaceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CompleteImportSpace', CompleteImportSpaceResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a human membership or app membership for the calling app. Creating - * memberships for other apps isn't supported. For an example, see - * [ Create a - * membership](https://developers.google.com/chat/api/guides/v1/members/create). - * When creating a membership, if the specified member has their auto-accept - * policy turned off, then they're invited, and must accept the space - * invitation before joining. Otherwise, creating a membership adds the member - * directly to the specified space. Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * - * To specify the member to add, set the `membership.member.name` in the - * `CreateMembershipRequest`: - * - * - To add the calling app to a space or a direct message between two human - * users, use `users/app`. Unable to add other - * apps to the space. - * - * - To add a human user, use `users/{user}`, where `{user}` can be the email - * address for the user. For users in the same Workspace organization `{user}` - * can also be the `id` for the person from the People API, or the `id` for - * the user in the Directory API. For example, if the People API Person - * profile ID for `user@example.com` is `123456789`, you can add the user to - * the space by setting the `membership.member.name` to - * `users/user@example.com` or `users/123456789`. - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedParent = $chatServiceClient->spaceName('[SPACE]'); - * $membership = new Membership(); - * $response = $chatServiceClient->createMembership($formattedParent, $membership); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the space for which to create the - * membership. - * - * Format: spaces/{space} - * @param Membership $membership Required. The membership relation to create. - * The `memberType` field must contain a user with the `user.name` and - * `user.type` fields populated. The server will assign a resource name - * and overwrite anything specified. - * When a Chat app creates a membership relation for a human user, it must use - * the `chat.memberships` scope, set `user.type` to `HUMAN`, and set - * `user.name` with format `users/{user}`, where `{user}` can be the email - * address for the user. For users in the same Workspace organization `{user}` - * can also be the `id` of the - * [person](https://developers.google.com/people/api/rest/v1/people) from the - * People API, or the `id` for the user in the Directory API. For example, if - * the People API Person profile ID for `user@example.com` is `123456789`, you - * can add the user to the space by setting the `membership.member.name` to - * `users/user@example.com` or `users/123456789`. When a Chat app creates a - * membership relation for itself, it must use the `chat.memberships.app` - * scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. - * @param array $optionalArgs { - * 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 \Google\Apps\Chat\V1\Membership - * - * @throws ApiException if the remote call fails - */ - public function createMembership($parent, $membership, array $optionalArgs = []) - { - $request = new CreateMembershipRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setMembership($membership); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateMembership', Membership::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a message in a Google Chat space. For an example, see [Create a - * message](https://developers.google.com/chat/api/guides/v1/messages/create). - * - * Calling this method requires - * [authentication](https://developers.google.com/chat/api/guides/auth) and - * supports the following authentication types: - * - * - For text messages, user authentication or app authentication are - * supported. - * - For card messages, only app authentication is supported. (Only Chat apps - * can create card messages.) - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedParent = $chatServiceClient->spaceName('[SPACE]'); - * $message = new Message(); - * $response = $chatServiceClient->createMessage($formattedParent, $message); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the space in which to create a message. - * - * Format: `spaces/{space}` - * @param Message $message Required. Message body. - * @param array $optionalArgs { - * Optional. - * - * @type string $threadKey - * Optional. Deprecated: Use - * [thread.thread_key][google.chat.v1.Thread.thread_key] instead. ID for the - * thread. Supports up to 4000 characters. To start or add to a thread, create - * a message and specify a `threadKey` or the - * [thread.name][google.chat.v1.Thread.name]. For example usage, see [Start or - * reply to a message - * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). - * @type string $requestId - * Optional. A unique request ID for this message. Specifying an existing - * request ID returns the message created with that ID instead of creating a - * new message. - * @type int $messageReplyOption - * Optional. Specifies whether a message starts a thread or replies to one. - * Only supported in named spaces. - * For allowed values, use constants defined on {@see \Google\Apps\Chat\V1\CreateMessageRequest\MessageReplyOption} - * @type string $messageId - * Optional. A custom ID for a message. Lets Chat apps get, update, or delete - * a message without needing to store the system-assigned ID in the message's - * resource name (represented in the message `name` field). - * - * The value for this field must meet the following requirements: - * - * * Begins with `client-`. For example, `client-custom-name` is a valid - * custom ID, but `custom-name` is not. - * * Contains up to 63 characters and only lowercase letters, numbers, and - * hyphens. - * * Is unique within a space. A Chat app can't use the same custom ID for - * different messages. - * - * For details, see [Name a - * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). - * @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 \Google\Apps\Chat\V1\Message - * - * @throws ApiException if the remote call fails - */ - public function createMessage($parent, $message, array $optionalArgs = []) - { - $request = new CreateMessageRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setMessage($message); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['threadKey'])) { - $request->setThreadKey($optionalArgs['threadKey']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['messageReplyOption'])) { - $request->setMessageReplyOption($optionalArgs['messageReplyOption']); - } - - if (isset($optionalArgs['messageId'])) { - $request->setMessageId($optionalArgs['messageId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateMessage', Message::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a reaction and adds it to a message. For an example, see - * [Create a - * reaction](https://developers.google.com/chat/api/guides/v1/reactions/create). - * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * Only unicode emoji are supported. - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedParent = $chatServiceClient->messageName('[SPACE]', '[MESSAGE]'); - * $reaction = new Reaction(); - * $response = $chatServiceClient->createReaction($formattedParent, $reaction); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The message where the reaction is created. - * - * Format: `spaces/{space}/messages/{message}` - * @param Reaction $reaction Required. The reaction to create. - * @param array $optionalArgs { - * 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 \Google\Apps\Chat\V1\Reaction - * - * @throws ApiException if the remote call fails - */ - public function createReaction($parent, $reaction, array $optionalArgs = []) - { - $request = new CreateReactionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setReaction($reaction); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateReaction', Reaction::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a named space. Spaces grouped by topics aren't supported. For an - * example, see [Create a - * space](https://developers.google.com/chat/api/guides/v1/spaces/create). - * - * If you receive the error message `ALREADY_EXISTS` when creating - * a space, try a different `displayName`. An existing space within - * the Google Workspace organization might already use this display name. - * - * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $space = new Space(); - * $response = $chatServiceClient->createSpace($space); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param Space $space Required. The `displayName` and `spaceType` fields must be populated. Only - * `SpaceType.SPACE` is supported. - * - * If you receive the error message `ALREADY_EXISTS` when creating a space, - * try a different `displayName`. An existing space within the Google - * Workspace organization might already use this display name. - * - * The space `name` is assigned on the server so anything specified in this - * field will be ignored. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A unique identifier for this request. - * A random UUID is recommended. - * Specifying an existing request ID returns the space created with that ID - * instead of creating a new space. - * Specifying an existing request ID from the same Chat app with a different - * authenticated user returns an error. - * @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 \Google\Apps\Chat\V1\Space - * - * @throws ApiException if the remote call fails - */ - public function createSpace($space, array $optionalArgs = []) - { - $request = new CreateSpaceRequest(); - $request->setSpace($space); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - return $this->startCall('CreateSpace', Space::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a membership. For an example, see - * [Delete a - * membership](https://developers.google.com/chat/api/guides/v1/members/delete). - * - * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedName = $chatServiceClient->membershipName('[SPACE]', '[MEMBER]'); - * $response = $chatServiceClient->deleteMembership($formattedName); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the membership to delete. Chat apps can delete - * human users' or their own memberships. Chat apps can't delete other apps' - * memberships. - * - * When deleting a human membership, requires the `chat.memberships` scope and - * `spaces/{space}/members/{member}` format. You can use the email as an - * alias for `{member}`. For example, - * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the - * email of the Google Chat user. - * - * When deleting an app membership, requires the `chat.memberships.app` scope - * and `spaces/{space}/members/app` format. - * - * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. - * @param array $optionalArgs { - * 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 \Google\Apps\Chat\V1\Membership - * - * @throws ApiException if the remote call fails - */ - public function deleteMembership($name, array $optionalArgs = []) - { - $request = new DeleteMembershipRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteMembership', Membership::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a message. - * For an example, see [Delete a - * message](https://developers.google.com/chat/api/guides/v1/messages/delete). - * - * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). - * Supports - * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) - * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * When using app authentication, requests can only delete messages - * created by the calling Chat app. - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedName = $chatServiceClient->messageName('[SPACE]', '[MESSAGE]'); - * $chatServiceClient->deleteMessage($formattedName); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the message. - * - * Format: `spaces/{space}/messages/{message}` - * - * If you've set a custom ID for your message, you can use the value from the - * `clientAssignedMessageId` field for `{message}`. For details, see [Name a - * message] - * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * When `true`, deleting a message also deletes its threaded replies. When - * `false`, if a message has threaded replies, deletion fails. - * - * Only applies when [authenticating as a - * user](https://developers.google.com/chat/api/guides/auth/users). Has no - * effect when [authenticating as a Chat app] - * (https://developers.google.com/chat/api/guides/auth/service-accounts). - * @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. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteMessage($name, array $optionalArgs = []) - { - $request = new DeleteMessageRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteMessage', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a reaction to a message. For an example, see - * [Delete a - * reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete). - * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedName = $chatServiceClient->reactionName('[SPACE]', '[MESSAGE]', '[REACTION]'); - * $chatServiceClient->deleteReaction($formattedName); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the reaction to delete. - * - * Format: `spaces/{space}/messages/{message}/reactions/{reaction}` - * @param array $optionalArgs { - * 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. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteReaction($name, array $optionalArgs = []) - { - $request = new DeleteReactionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteReaction', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a named space. Always performs a cascading delete, which means - * that the space's child resources—like messages posted in the space and - * memberships in the space—are also deleted. For an example, see - * [Delete a - * space](https://developers.google.com/chat/api/guides/v1/spaces/delete). - * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users) - * from a user who has permission to delete the space. - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedName = $chatServiceClient->spaceName('[SPACE]'); - * $chatServiceClient->deleteSpace($formattedName); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the space to delete. - * - * Format: `spaces/{space}` - * @param array $optionalArgs { - * 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. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteSpace($name, array $optionalArgs = []) - { - $request = new DeleteSpaceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteSpace', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns the existing direct message with the specified user. If no direct - * message space is found, returns a `404 NOT_FOUND` error. For an example, - * see - * [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). - * - * With [user - * authentication](https://developers.google.com/chat/api/guides/auth/users), - * returns the direct message space between the specified user and the - * authenticated user. - * - * With [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), - * returns the direct message space between the specified user and the calling - * Chat app. - * - * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users) - * or [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $name = 'name'; - * $response = $chatServiceClient->findDirectMessage($name); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the user to find direct message with. - * - * Format: `users/{user}`, where `{user}` is either the `id` for the - * [person](https://developers.google.com/people/api/rest/v1/people) from the - * People API, or the `id` for the - * [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) - * in the Directory API. For example, if the People API profile ID is - * `123456789`, you can find a direct message with that person by using - * `users/123456789` as the `name`. When [authenticated as a - * user](https://developers.google.com/chat/api/guides/auth/users), you can - * use the email as an alias for `{user}`. For example, - * `users/example@gmail.com` where `example@gmail.com` is the email of the - * Google Chat user. - * @param array $optionalArgs { - * 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 \Google\Apps\Chat\V1\Space - * - * @throws ApiException if the remote call fails - */ - public function findDirectMessage($name, array $optionalArgs = []) - { - $request = new FindDirectMessageRequest(); - $request->setName($name); - return $this->startCall('FindDirectMessage', Space::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the metadata of a message attachment. The attachment data is fetched - * using the [media - * API](https://developers.google.com/chat/api/reference/rest/v1/media/download). - * For an example, see - * [Get a message - * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). - * Requires [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedName = $chatServiceClient->attachmentName('[SPACE]', '[MESSAGE]', '[ATTACHMENT]'); - * $response = $chatServiceClient->getAttachment($formattedName); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the attachment, in the form - * `spaces/*/messages/*/attachments/*`. - * @param array $optionalArgs { - * 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 \Google\Apps\Chat\V1\Attachment - * - * @throws ApiException if the remote call fails - */ - public function getAttachment($name, array $optionalArgs = []) - { - $request = new GetAttachmentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetAttachment', Attachment::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns details about a membership. For an example, see - * [Get a - * membership](https://developers.google.com/chat/api/guides/v1/members/get). - * - * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). - * Supports - * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) - * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedName = $chatServiceClient->membershipName('[SPACE]', '[MEMBER]'); - * $response = $chatServiceClient->getMembership($formattedName); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the membership to retrieve. - * - * To get the app's own membership, you can optionally use - * `spaces/{space}/members/app`. - * - * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` - * - * When [authenticated as a - * user](https://developers.google.com/chat/api/guides/auth/users), you can - * use the user's email as an alias for `{member}`. For example, - * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the - * email of the Google Chat user. - * @param array $optionalArgs { - * 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 \Google\Apps\Chat\V1\Membership - * - * @throws ApiException if the remote call fails - */ - public function getMembership($name, array $optionalArgs = []) - { - $request = new GetMembershipRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetMembership', Membership::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns details about a message. - * For an example, see [Read a - * message](https://developers.google.com/chat/api/guides/v1/messages/get). - * - * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). - * Supports - * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) - * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * - * Note: Might return a message from a blocked member or space. - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedName = $chatServiceClient->messageName('[SPACE]', '[MESSAGE]'); - * $response = $chatServiceClient->getMessage($formattedName); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the message. - * - * Format: `spaces/{space}/messages/{message}` - * - * If you've set a custom ID for your message, you can use the value from the - * `clientAssignedMessageId` field for `{message}`. For details, see [Name a - * message] - * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). - * @param array $optionalArgs { - * 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 \Google\Apps\Chat\V1\Message - * - * @throws ApiException if the remote call fails - */ - public function getMessage($name, array $optionalArgs = []) - { - $request = new GetMessageRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetMessage', Message::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns details about a space. For an example, see - * [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get). - * - * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). - * Supports - * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) - * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedName = $chatServiceClient->spaceName('[SPACE]'); - * $response = $chatServiceClient->getSpace($formattedName); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the space, in the form "spaces/*". - * - * Format: `spaces/{space}` - * @param array $optionalArgs { - * 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 \Google\Apps\Chat\V1\Space - * - * @throws ApiException if the remote call fails - */ - public function getSpace($name, array $optionalArgs = []) - { - $request = new GetSpaceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetSpace', Space::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists memberships in a space. For an example, see [List - * memberships](https://developers.google.com/chat/api/guides/v1/members/list). - * Listing memberships with - * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) - * lists memberships in spaces that the Chat app has - * access to, but excludes Chat app memberships, - * including its own. Listing memberships with - * [User - * authentication](https://developers.google.com/chat/api/guides/auth/users) - * lists memberships in spaces that the authenticated user has access to. - * - * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). - * Supports - * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) - * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedParent = $chatServiceClient->spaceName('[SPACE]'); - * // Iterate over pages of elements - * $pagedResponse = $chatServiceClient->listMemberships($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $chatServiceClient->listMemberships($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the space for which to fetch a membership - * list. - * - * Format: spaces/{space} - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. A query filter. - * - * You can filter memberships by a member's role - * ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole)) - * and type - * ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)). - * - * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. - * - * To filter by type, set `member.type` to `HUMAN` or `BOT`. - * - * To filter by both role and type, use the `AND` operator. To filter by - * either role or type, use the `OR` operator. - * - * For example, the following queries are valid: - * - * ``` - * role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" - * member.type = "HUMAN" AND role = "ROLE_MANAGER" - * ``` - * - * The following queries are invalid: - * - * ``` - * member.type = "HUMAN" AND member.type = "BOT" - * role = "ROLE_MANAGER" AND role = "ROLE_MEMBER" - * ``` - * - * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` - * error. - * @type bool $showGroups - * Optional. When `true`, also returns memberships associated with a - * [Google Group][google.chat.v1.Membership.group_member], in - * addition to other types of memberships. If a - * [filter][google.chat.v1.ListMembershipsRequest.filter] is set, - * [Google Group][google.chat.v1.Membership.group_member] - * memberships that don't match the filter criteria aren't returned. - * @type bool $showInvited - * Optional. When `true`, also returns memberships associated with - * [invited][google.chat.v1.Membership.MembershipState.INVITED] members, in - * addition to other types of memberships. If a - * filter is set, - * [invited][google.chat.v1.Membership.MembershipState.INVITED] memberships - * that don't match the filter criteria aren't returned. - * - * Currently requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listMemberships($parent, array $optionalArgs = []) - { - $request = new ListMembershipsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['showGroups'])) { - $request->setShowGroups($optionalArgs['showGroups']); - } - - if (isset($optionalArgs['showInvited'])) { - $request->setShowInvited($optionalArgs['showInvited']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListMemberships', $optionalArgs, ListMembershipsResponse::class, $request); - } - - /** - * Lists messages in a space that the caller is a member of, including - * messages from blocked members and spaces. For an example, see - * [List messages](/chat/api/guides/v1/messages/list). - * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedParent = $chatServiceClient->spaceName('[SPACE]'); - * // Iterate over pages of elements - * $pagedResponse = $chatServiceClient->listMessages($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $chatServiceClient->listMessages($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the space to list messages from. - * - * Format: `spaces/{space}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * A query filter. - * - * You can filter messages by date (`create_time`) and thread (`thread.name`). - * - * To filter messages by the date they were created, specify the `create_time` - * with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) - * format and double quotation marks. For example, - * `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to - * list messages that were created after a timestamp, or the less than - * operator `<` to list messages that were created before a timestamp. To - * filter messages within a time interval, use the `AND` operator between two - * timestamps. - * - * To filter by thread, specify the `thread.name`, formatted as - * `spaces/{space}/threads/{thread}`. You can only specify one - * `thread.name` per query. - * - * To filter by both thread and date, use the `AND` operator in your query. - * - * For example, the following queries are valid: - * - * ``` - * create_time > "2012-04-21T11:30:00-04:00" - * - * create_time > "2012-04-21T11:30:00-04:00" AND - * thread.name = spaces/AAAAAAAAAAA/threads/123 - * - * create_time > "2012-04-21T11:30:00+00:00" AND - * - * create_time < "2013-01-01T00:00:00+00:00" AND - * thread.name = spaces/AAAAAAAAAAA/threads/123 - * - * thread.name = spaces/AAAAAAAAAAA/threads/123 - * ``` - * - * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` - * error. - * @type string $orderBy - * Optional, if resuming from a previous query. - * - * How the list of messages is ordered. Specify a value to order by an - * ordering operation. Valid ordering operation values are as follows: - * - * - `ASC` for ascending. - * - * - `DESC` for descending. - * - * The default ordering is `create_time ASC`. - * @type bool $showDeleted - * Whether to include deleted messages. Deleted messages include deleted time - * and metadata about their deletion, but message content is unavailable. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listMessages($parent, array $optionalArgs = []) - { - $request = new ListMessagesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['showDeleted'])) { - $request->setShowDeleted($optionalArgs['showDeleted']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListMessages', $optionalArgs, ListMessagesResponse::class, $request); - } - - /** - * Lists reactions to a message. For an example, see - * [List - * reactions](https://developers.google.com/chat/api/guides/v1/reactions/list). - * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedParent = $chatServiceClient->messageName('[SPACE]', '[MESSAGE]'); - * // Iterate over pages of elements - * $pagedResponse = $chatServiceClient->listReactions($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $chatServiceClient->listReactions($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The message users reacted to. - * - * Format: `spaces/{space}/messages/{message}` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. A query filter. - * - * You can filter reactions by - * [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji) - * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and - * [user](https://developers.google.com/chat/api/reference/rest/v1/User) - * (`user.name`). - * - * To filter reactions for multiple emojis or users, join similar fields - * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = - * "ðŸ‘"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`. - * - * To filter reactions by emoji and user, use the `AND` operator, such as - * `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. - * - * If your query uses both `AND` and `OR`, group them with parentheses. - * - * For example, the following queries are valid: - * - * ``` - * user.name = "users/{user}" - * emoji.unicode = "🙂" - * emoji.custom_emoji.uid = "{uid}" - * emoji.unicode = "🙂" OR emoji.unicode = "ðŸ‘" - * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" - * emoji.unicode = "🙂" AND user.name = "users/{user}" - * (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}") - * AND user.name = "users/{user}" - * ``` - * - * The following queries are invalid: - * - * ``` - * emoji.unicode = "🙂" AND emoji.unicode = "ðŸ‘" - * emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}" - * emoji.unicode = "🙂" OR user.name = "users/{user}" - * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR - * user.name = "users/{user}" - * emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" - * AND user.name = "users/{user}" - * ``` - * - * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` - * error. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listReactions($parent, array $optionalArgs = []) - { - $request = new ListReactionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListReactions', $optionalArgs, ListReactionsResponse::class, $request); - } - - /** - * Lists spaces the caller is a member of. Group chats and DMs aren't listed - * until the first message is sent. For an example, see - * [List - * spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). - * - * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). - * Supports - * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) - * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * - * Lists spaces visible to the caller or authenticated user. Group chats - * and DMs aren't listed until the first message is sent. - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $chatServiceClient->listSpaces(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $chatServiceClient->listSpaces(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. A query filter. - * - * You can filter spaces by the space type - * ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). - * - * To filter by space type, you must specify valid enum value, such as - * `SPACE` or `GROUP_CHAT` (the `space_type` can't be - * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` - * operator. - * - * For example, the following queries are valid: - * - * ``` - * space_type = "SPACE" - * spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" - * ``` - * - * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` - * error. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listSpaces(array $optionalArgs = []) - { - $request = new ListSpacesRequest(); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - return $this->getPagedListResponse('ListSpaces', $optionalArgs, ListSpacesResponse::class, $request); - } - - /** - * Creates a space and adds specified users to it. The calling user is - * automatically added to the space, and shouldn't be specified as a - * membership in the request. For an example, see - * [Set up a - * space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). - * - * To specify the human members to add, add memberships with the appropriate - * `member.name` in the `SetUpSpaceRequest`. To add a human user, use - * `users/{user}`, where `{user}` can be the email address for the user. For - * users in the same Workspace organization `{user}` can also be the `id` for - * the person from the People API, or the `id` for the user in the Directory - * API. For example, if the People API Person profile ID for - * `user@example.com` is `123456789`, you can add the user to the space by - * setting the `membership.member.name` to `users/user@example.com` or - * `users/123456789`. - * - * For a space or group chat, if the caller blocks or is blocked by some - * members, then those members aren't added to the created space. - * - * To create a direct message (DM) between the calling user and another human - * user, specify exactly one membership to represent the human user. If - * one user blocks the other, the request fails and the DM isn't created. - * - * To create a DM between the calling user and the calling app, set - * `Space.singleUserBotDm` to `true` and don't specify any memberships. You - * can only use this method to set up a DM with the calling app. To add the - * calling app as a member of a space or an existing DM between two human - * users, see - * [create a - * membership](https://developers.google.com/chat/api/guides/v1/members/create). - * - * If a DM already exists between two users, even when one user blocks the - * other at the time a request is made, then the existing DM is returned. - * - * Spaces with threaded replies aren't supported. If you receive the error - * message `ALREADY_EXISTS` when setting up a space, try a different - * `displayName`. An existing space within the Google Workspace organization - * might already use this display name. - * - * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $space = new Space(); - * $response = $chatServiceClient->setUpSpace($space); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param Space $space Required. The `Space.spaceType` field is required. - * - * To create a space, set `Space.spaceType` to `SPACE` and set - * `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when - * setting up a space, try a different `displayName`. An existing space - * within the Google Workspace organization might already use this display - * name. - * - * To create a group chat, set `Space.spaceType` to - * `GROUP_CHAT`. Don't set `Space.displayName`. - * - * To create a 1:1 conversation between humans, - * set `Space.spaceType` to `DIRECT_MESSAGE` and set - * `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or - * `Space.spaceDetails`. - * - * To create an 1:1 conversation between a human and the calling Chat app, set - * `Space.spaceType` to `DIRECT_MESSAGE` and - * `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or - * `Space.spaceDetails`. - * - * If a `DIRECT_MESSAGE` space already exists, that space is returned instead - * of creating a new space. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. A unique identifier for this request. - * A random UUID is recommended. - * Specifying an existing request ID returns the space created with that ID - * instead of creating a new space. - * Specifying an existing request ID from the same Chat app with a different - * authenticated user returns an error. - * @type Membership[] $memberships - * Optional. The Google Chat users to invite to join the space. Omit the - * calling user, as they are added automatically. - * - * The set currently allows up to 20 memberships (in addition to the caller). - * - * The `Membership.member` field must contain a `user` with `name` populated - * (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only - * add human users when setting up a space (adding Chat apps is only supported - * for direct message setup with the calling app). You can also add members - * using the user's email as an alias for {user}. For example, the `user.name` - * can be `users/example@gmail.com`." To invite Gmail users or users from - * external Google Workspace domains, user's email must be used for - * `{user}`. - * - * Optional when setting `Space.spaceType` to `SPACE`. - * - * Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at - * least two memberships. - * - * Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human - * user, along with exactly one membership. - * - * Must be empty when creating a 1:1 conversation between a human and the - * calling Chat app (when setting `Space.spaceType` to - * `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`). - * @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 \Google\Apps\Chat\V1\Space - * - * @throws ApiException if the remote call fails - */ - public function setUpSpace($space, array $optionalArgs = []) - { - $request = new SetUpSpaceRequest(); - $request->setSpace($space); - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['memberships'])) { - $request->setMemberships($optionalArgs['memberships']); - } - - return $this->startCall('SetUpSpace', Space::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a message. There's a difference between the `patch` and `update` - * methods. The `patch` - * method uses a `patch` request while the `update` method uses a `put` - * request. We recommend using the `patch` method. For an example, see - * [Update a - * message](https://developers.google.com/chat/api/guides/v1/messages/update). - * - * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). - * Supports - * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) - * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * When using app authentication, requests can only update messages - * created by the calling Chat app. - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $message = new Message(); - * $response = $chatServiceClient->updateMessage($message); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param Message $message Required. Message with fields updated. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Required. The field paths to update. Separate multiple values with commas - * or use `*` to update all field paths. - * - * Currently supported field paths: - * - * - `text` - * - * - `attachment` - * - * - `cards` (Requires [app - * authentication](/chat/api/guides/auth/service-accounts).) - * - * - `cards_v2` (Requires [app - * authentication](/chat/api/guides/auth/service-accounts).) - * - * - `accessory_widgets` (Requires [app - * authentication](/chat/api/guides/auth/service-accounts).) - * @type bool $allowMissing - * Optional. If `true` and the message isn't found, a new message is created - * and `updateMask` is ignored. The specified message ID must be - * [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message) - * or the request fails. - * @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 \Google\Apps\Chat\V1\Message - * - * @throws ApiException if the remote call fails - */ - public function updateMessage($message, array $optionalArgs = []) - { - $request = new UpdateMessageRequest(); - $requestParamHeaders = []; - $request->setMessage($message); - $requestParamHeaders['message.name'] = $message->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateMessage', Message::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a space. For an example, see - * [Update a - * space](https://developers.google.com/chat/api/guides/v1/spaces/update). - * - * If you're updating the `displayName` field and receive the error message - * `ALREADY_EXISTS`, try a different display name.. An existing space within - * the Google Workspace organization might already use this display name. - * - * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $space = new Space(); - * $response = $chatServiceClient->updateSpace($space); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param Space $space Required. Space with fields to be updated. `Space.name` must be - * populated in the form of `spaces/{space}`. Only fields - * specified by `update_mask` are updated. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Required. The updated field paths, comma separated if there are - * multiple. - * - * Currently supported field paths: - * - * - `display_name` (Only supports changing the display name of a space with - * the `SPACE` type, or when also including the `space_type` mask to change a - * `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a - * `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument - * error. If you receive the error message `ALREADY_EXISTS` when updating the - * `displayName`, try a different `displayName`. An existing space within the - * Google Workspace organization might already use this display name.) - * - * - `space_type` (Only supports changing a `GROUP_CHAT` space type to - * `SPACE`. Include `display_name` together with `space_type` in the update - * mask and ensure that the specified space has a non-empty display name and - * the `SPACE` space type. Including the `space_type` mask and the `SPACE` - * type in the specified space when updating the display name is optional if - * the existing space already has the `SPACE` type. Trying to update the - * space type in other ways results in an invalid argument error). - * - * - `space_details` - * - * - `space_history_state` (Supports [turning history on or off for the - * space](https://support.google.com/chat/answer/7664687) if [the organization - * allows users to change their history - * setting](https://support.google.com/a/answer/7664184). - * Warning: mutually exclusive with all other field paths.) - * - Developer Preview: `access_settings.audience` (Supports changing the - * [access setting](https://support.google.com/chat/answer/11971020) of a - * space. If no audience is specified in the access setting, the space's - * access setting is updated to restricted. Warning: mutually exclusive with - * all other field paths.) - * @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 \Google\Apps\Chat\V1\Space - * - * @throws ApiException if the remote call fails - */ - public function updateSpace($space, array $optionalArgs = []) - { - $request = new UpdateSpaceRequest(); - $requestParamHeaders = []; - $request->setSpace($space); - $requestParamHeaders['space.name'] = $space->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateSpace', Space::class, $optionalArgs, $request)->wait(); - } - - /** - * Uploads an attachment. For an example, see - * [Upload media as a file - * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload). - * Requires user - * [authentication](https://developers.google.com/chat/api/guides/auth/users). - * - * You can upload attachments up to 200 MB. Certain file types aren't - * supported. For details, see [File types blocked by Google - * Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat). - * - * Sample code: - * ``` - * $chatServiceClient = new ChatServiceClient(); - * try { - * $formattedParent = $chatServiceClient->spaceName('[SPACE]'); - * $filename = 'filename'; - * $response = $chatServiceClient->uploadAttachment($formattedParent, $filename); - * } finally { - * $chatServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Resource name of the Chat space in which the attachment is - * uploaded. Format "spaces/{space}". - * @param string $filename Required. The filename of the attachment, including the file extension. - * @param array $optionalArgs { - * 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 \Google\Apps\Chat\V1\UploadAttachmentResponse - * - * @throws ApiException if the remote call fails - */ - public function uploadAttachment($parent, $filename, array $optionalArgs = []) - { - $request = new UploadAttachmentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFilename($filename); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UploadAttachment', UploadAttachmentResponse::class, $optionalArgs, $request)->wait(); - } -} diff --git a/AppsChat/src/Chat/V1/GetAttachmentRequest.php b/AppsChat/src/Chat/V1/GetAttachmentRequest.php index 929105ce1d9e..b47f06ae75fd 100644 --- a/AppsChat/src/Chat/V1/GetAttachmentRequest.php +++ b/AppsChat/src/Chat/V1/GetAttachmentRequest.php @@ -21,6 +21,21 @@ class GetAttachmentRequest extends \Google\Protobuf\Internal\Message */ protected $name = ''; + /** + * @param string $name Required. Resource name of the attachment, in the form + * `spaces/*/messages/*/attachments/*`. Please see + * {@see ChatServiceClient::attachmentName()} for help formatting this field. + * + * @return \Google\Apps\Chat\V1\GetAttachmentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/GetMembershipRequest.php b/AppsChat/src/Chat/V1/GetMembershipRequest.php index d721926fdac9..68515ab95913 100644 --- a/AppsChat/src/Chat/V1/GetMembershipRequest.php +++ b/AppsChat/src/Chat/V1/GetMembershipRequest.php @@ -28,6 +28,31 @@ class GetMembershipRequest extends \Google\Protobuf\Internal\Message */ protected $name = ''; + /** + * @param string $name Required. Resource name of the membership to retrieve. + * + * To get the app's own membership, you can optionally use + * `spaces/{space}/members/app`. + * + * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` + * + * When [authenticated as a + * user](https://developers.google.com/chat/api/guides/auth/users), you can + * use the user's email as an alias for `{member}`. For example, + * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the + * email of the Google Chat user. Please see + * {@see ChatServiceClient::membershipName()} for help formatting this field. + * + * @return \Google\Apps\Chat\V1\GetMembershipRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/GetMessageRequest.php b/AppsChat/src/Chat/V1/GetMessageRequest.php index 8b0485df655a..ebef334059f2 100644 --- a/AppsChat/src/Chat/V1/GetMessageRequest.php +++ b/AppsChat/src/Chat/V1/GetMessageRequest.php @@ -25,6 +25,27 @@ class GetMessageRequest extends \Google\Protobuf\Internal\Message */ protected $name = ''; + /** + * @param string $name Required. Resource name of the message. + * + * Format: `spaces/{space}/messages/{message}` + * + * If you've set a custom ID for your message, you can use the value from the + * `clientAssignedMessageId` field for `{message}`. For details, see [Name a + * message] + * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). Please see + * {@see ChatServiceClient::messageName()} for help formatting this field. + * + * @return \Google\Apps\Chat\V1\GetMessageRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/GetSpaceRequest.php b/AppsChat/src/Chat/V1/GetSpaceRequest.php index ad7b5827b12d..834cb7758444 100644 --- a/AppsChat/src/Chat/V1/GetSpaceRequest.php +++ b/AppsChat/src/Chat/V1/GetSpaceRequest.php @@ -23,6 +23,22 @@ class GetSpaceRequest extends \Google\Protobuf\Internal\Message */ protected $name = ''; + /** + * @param string $name Required. Resource name of the space, in the form "spaces/*". + * + * Format: `spaces/{space}` + * Please see {@see ChatServiceClient::spaceName()} for help formatting this field. + * + * @return \Google\Apps\Chat\V1\GetSpaceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/ListMembershipsRequest.php b/AppsChat/src/Chat/V1/ListMembershipsRequest.php index 07158c170b95..3070f5a2e566 100644 --- a/AppsChat/src/Chat/V1/ListMembershipsRequest.php +++ b/AppsChat/src/Chat/V1/ListMembershipsRequest.php @@ -93,6 +93,23 @@ class ListMembershipsRequest extends \Google\Protobuf\Internal\Message */ protected $show_invited = false; + /** + * @param string $parent Required. The resource name of the space for which to fetch a membership + * list. + * + * Format: spaces/{space} + * Please see {@see ChatServiceClient::spaceName()} for help formatting this field. + * + * @return \Google\Apps\Chat\V1\ListMembershipsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/ListMessagesRequest.php b/AppsChat/src/Chat/V1/ListMessagesRequest.php index eff9e7ed3ba8..cb966ab70e15 100644 --- a/AppsChat/src/Chat/V1/ListMessagesRequest.php +++ b/AppsChat/src/Chat/V1/ListMessagesRequest.php @@ -94,6 +94,22 @@ class ListMessagesRequest extends \Google\Protobuf\Internal\Message */ protected $show_deleted = false; + /** + * @param string $parent Required. The resource name of the space to list messages from. + * + * Format: `spaces/{space}` + * Please see {@see ChatServiceClient::spaceName()} for help formatting this field. + * + * @return \Google\Apps\Chat\V1\ListMessagesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/ListReactionsRequest.php b/AppsChat/src/Chat/V1/ListReactionsRequest.php index d63e3c09255c..1b88deaddaa8 100644 --- a/AppsChat/src/Chat/V1/ListReactionsRequest.php +++ b/AppsChat/src/Chat/V1/ListReactionsRequest.php @@ -81,6 +81,22 @@ class ListReactionsRequest extends \Google\Protobuf\Internal\Message */ protected $filter = ''; + /** + * @param string $parent Required. The message users reacted to. + * + * Format: `spaces/{space}/messages/{message}` + * Please see {@see ChatServiceClient::messageName()} for help formatting this field. + * + * @return \Google\Apps\Chat\V1\ListReactionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/UpdateMessageRequest.php b/AppsChat/src/Chat/V1/UpdateMessageRequest.php index c91181951678..487d069bb4ee 100644 --- a/AppsChat/src/Chat/V1/UpdateMessageRequest.php +++ b/AppsChat/src/Chat/V1/UpdateMessageRequest.php @@ -45,6 +45,37 @@ class UpdateMessageRequest extends \Google\Protobuf\Internal\Message */ protected $allow_missing = false; + /** + * @param \Google\Apps\Chat\V1\Message $message Required. Message with fields updated. + * @param \Google\Protobuf\FieldMask $updateMask Required. The field paths to update. Separate multiple values with commas + * or use `*` to update all field paths. + * + * Currently supported field paths: + * + * - `text` + * + * - `attachment` + * + * - `cards` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * + * - `cards_v2` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * + * - `accessory_widgets` (Requires [app + * authentication](/chat/api/guides/auth/service-accounts).) + * + * @return \Google\Apps\Chat\V1\UpdateMessageRequest + * + * @experimental + */ + public static function build(\Google\Apps\Chat\V1\Message $message, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setMessage($message) + ->setUpdateMask($updateMask); + } + /** * Constructor. * diff --git a/AppsChat/src/Chat/V1/UpdateSpaceRequest.php b/AppsChat/src/Chat/V1/UpdateSpaceRequest.php index 825402abb8f5..e7f71686d7a7 100644 --- a/AppsChat/src/Chat/V1/UpdateSpaceRequest.php +++ b/AppsChat/src/Chat/V1/UpdateSpaceRequest.php @@ -57,6 +57,55 @@ class UpdateSpaceRequest extends \Google\Protobuf\Internal\Message */ protected $update_mask = null; + /** + * @param \Google\Apps\Chat\V1\Space $space Required. Space with fields to be updated. `Space.name` must be + * populated in the form of `spaces/{space}`. Only fields + * specified by `update_mask` are updated. + * @param \Google\Protobuf\FieldMask $updateMask Required. The updated field paths, comma separated if there are + * multiple. + * + * Currently supported field paths: + * + * - `display_name` (Only supports changing the display name of a space with + * the `SPACE` type, or when also including the `space_type` mask to change a + * `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a + * `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument + * error. If you receive the error message `ALREADY_EXISTS` when updating the + * `displayName`, try a different `displayName`. An existing space within the + * Google Workspace organization might already use this display name.) + * + * - `space_type` (Only supports changing a `GROUP_CHAT` space type to + * `SPACE`. Include `display_name` together with `space_type` in the update + * mask and ensure that the specified space has a non-empty display name and + * the `SPACE` space type. Including the `space_type` mask and the `SPACE` + * type in the specified space when updating the display name is optional if + * the existing space already has the `SPACE` type. Trying to update the + * space type in other ways results in an invalid argument error). + * + * - `space_details` + * + * - `space_history_state` (Supports [turning history on or off for the + * space](https://support.google.com/chat/answer/7664687) if [the organization + * allows users to change their history + * setting](https://support.google.com/a/answer/7664184). + * Warning: mutually exclusive with all other field paths.) + * - Developer Preview: `access_settings.audience` (Supports changing the + * [access setting](https://support.google.com/chat/answer/11971020) of a + * space. If no audience is specified in the access setting, the space's + * access setting is updated to restricted. Warning: mutually exclusive with + * all other field paths.) + * + * @return \Google\Apps\Chat\V1\UpdateSpaceRequest + * + * @experimental + */ + public static function build(\Google\Apps\Chat\V1\Space $space, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setSpace($space) + ->setUpdateMask($updateMask); + } + /** * Constructor. * 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 ef5e325284e4..9e77fdd75081 100644 --- a/AppsChat/src/Chat/V1/resources/chat_service_descriptor_config.php +++ b/AppsChat/src/Chat/V1/resources/chat_service_descriptor_config.php @@ -1,8 +1,180 @@ [ 'google.chat.v1.ChatService' => [ + 'CompleteImportSpace' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\CompleteImportSpaceResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateMembership' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\Membership', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateMessage' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\Message', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateReaction' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\Reaction', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSpace' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\Space', + ], + 'DeleteMembership' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\Membership', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteMessage' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteReaction' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSpace' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'FindDirectMessage' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\Space', + ], + 'GetAttachment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\Attachment', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetMembership' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\Membership', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetMessage' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\Message', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetSpace' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\Space', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'ListMemberships' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -12,6 +184,16 @@ 'responsePageTokenGetMethod' => 'getNextPageToken', 'resourcesGetMethod' => 'getMemberships', ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Apps\Chat\V1\ListMembershipsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], ], 'ListMessages' => [ 'pageStreaming' => [ @@ -22,6 +204,16 @@ 'responsePageTokenGetMethod' => 'getNextPageToken', 'resourcesGetMethod' => 'getMessages', ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Apps\Chat\V1\ListMessagesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], ], 'ListReactions' => [ 'pageStreaming' => [ @@ -32,6 +224,16 @@ 'responsePageTokenGetMethod' => 'getNextPageToken', 'resourcesGetMethod' => 'getReactions', ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Apps\Chat\V1\ListReactionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], ], 'ListSpaces' => [ 'pageStreaming' => [ @@ -42,6 +244,59 @@ 'responsePageTokenGetMethod' => 'getNextPageToken', 'resourcesGetMethod' => 'getSpaces', ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Apps\Chat\V1\ListSpacesResponse', + ], + 'SetUpSpace' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\Space', + ], + 'UpdateMessage' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\Message', + 'headerParams' => [ + [ + 'keyName' => 'message.name', + 'fieldAccessors' => [ + 'getMessage', + 'getName', + ], + ], + ], + ], + 'UpdateSpace' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\Space', + 'headerParams' => [ + [ + 'keyName' => 'space.name', + 'fieldAccessors' => [ + 'getSpace', + 'getName', + ], + ], + ], + ], + 'UploadAttachment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\UploadAttachmentResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'attachment' => 'spaces/{space}/messages/{message}/attachments/{attachment}', + 'membership' => 'spaces/{space}/members/{member}', + 'message' => 'spaces/{space}/messages/{message}', + 'quotedMessageMetadata' => 'spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}', + 'reaction' => 'spaces/{space}/messages/{message}/reactions/{reaction}', + 'space' => 'spaces/{space}', + 'thread' => 'spaces/{space}/threads/{thread}', ], ], ], 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 74a11c80c11c..591234af557b 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 @@ -1,4 +1,24 @@ [ diff --git a/AppsChat/tests/Unit/V1/ChatServiceClientTest.php b/AppsChat/tests/Unit/V1/Client/ChatServiceClientTest.php similarity index 79% rename from AppsChat/tests/Unit/V1/ChatServiceClientTest.php rename to AppsChat/tests/Unit/V1/Client/ChatServiceClientTest.php index 1b29d93a4403..39b216d86be8 100644 --- a/AppsChat/tests/Unit/V1/ChatServiceClientTest.php +++ b/AppsChat/tests/Unit/V1/Client/ChatServiceClientTest.php @@ -20,23 +20,45 @@ * This file was automatically generated - do not edit! */ -namespace Google\Apps\Chat\Tests\Unit\V1; +namespace Google\Apps\Chat\Tests\Unit\V1\Client; use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Apps\Chat\V1\Attachment; -use Google\Apps\Chat\V1\ChatServiceClient; +use Google\Apps\Chat\V1\Client\ChatServiceClient; +use Google\Apps\Chat\V1\CompleteImportSpaceRequest; use Google\Apps\Chat\V1\CompleteImportSpaceResponse; +use Google\Apps\Chat\V1\CreateMembershipRequest; +use Google\Apps\Chat\V1\CreateMessageRequest; +use Google\Apps\Chat\V1\CreateReactionRequest; +use Google\Apps\Chat\V1\CreateSpaceRequest; +use Google\Apps\Chat\V1\DeleteMembershipRequest; +use Google\Apps\Chat\V1\DeleteMessageRequest; +use Google\Apps\Chat\V1\DeleteReactionRequest; +use Google\Apps\Chat\V1\DeleteSpaceRequest; +use Google\Apps\Chat\V1\FindDirectMessageRequest; +use Google\Apps\Chat\V1\GetAttachmentRequest; +use Google\Apps\Chat\V1\GetMembershipRequest; +use Google\Apps\Chat\V1\GetMessageRequest; +use Google\Apps\Chat\V1\GetSpaceRequest; +use Google\Apps\Chat\V1\ListMembershipsRequest; use Google\Apps\Chat\V1\ListMembershipsResponse; +use Google\Apps\Chat\V1\ListMessagesRequest; use Google\Apps\Chat\V1\ListMessagesResponse; +use Google\Apps\Chat\V1\ListReactionsRequest; use Google\Apps\Chat\V1\ListReactionsResponse; +use Google\Apps\Chat\V1\ListSpacesRequest; use Google\Apps\Chat\V1\ListSpacesResponse; use Google\Apps\Chat\V1\Membership; use Google\Apps\Chat\V1\Message; use Google\Apps\Chat\V1\Reaction; +use Google\Apps\Chat\V1\SetUpSpaceRequest; use Google\Apps\Chat\V1\Space; +use Google\Apps\Chat\V1\UpdateMessageRequest; +use Google\Apps\Chat\V1\UpdateSpaceRequest; +use Google\Apps\Chat\V1\UploadAttachmentRequest; use Google\Apps\Chat\V1\UploadAttachmentResponse; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; @@ -58,7 +80,9 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return ChatServiceClient */ @@ -83,7 +107,8 @@ public function completeImportSpaceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->spaceName('[SPACE]'); - $response = $gapicClient->completeImportSpace($formattedName); + $request = (new CompleteImportSpaceRequest())->setName($formattedName); + $response = $gapicClient->completeImportSpace($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -106,17 +131,21 @@ public function completeImportSpaceExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->spaceName('[SPACE]'); + $request = (new CompleteImportSpaceRequest())->setName($formattedName); try { - $gapicClient->completeImportSpace($formattedName); + $gapicClient->completeImportSpace($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) { @@ -144,7 +173,8 @@ public function createMembershipTest() // Mock request $formattedParent = $gapicClient->spaceName('[SPACE]'); $membership = new Membership(); - $response = $gapicClient->createMembership($formattedParent, $membership); + $request = (new CreateMembershipRequest())->setParent($formattedParent)->setMembership($membership); + $response = $gapicClient->createMembership($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -169,18 +199,22 @@ public function createMembershipExceptionTest() $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); + $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]'); $membership = new Membership(); + $request = (new CreateMembershipRequest())->setParent($formattedParent)->setMembership($membership); try { - $gapicClient->createMembership($formattedParent, $membership); + $gapicClient->createMembership($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) { @@ -220,7 +254,8 @@ public function createMessageTest() // Mock request $formattedParent = $gapicClient->spaceName('[SPACE]'); $message = new Message(); - $response = $gapicClient->createMessage($formattedParent, $message); + $request = (new CreateMessageRequest())->setParent($formattedParent)->setMessage($message); + $response = $gapicClient->createMessage($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -245,18 +280,22 @@ public function createMessageExceptionTest() $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); + $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]'); $message = new Message(); + $request = (new CreateMessageRequest())->setParent($formattedParent)->setMessage($message); try { - $gapicClient->createMessage($formattedParent, $message); + $gapicClient->createMessage($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) { @@ -284,7 +323,8 @@ public function createReactionTest() // Mock request $formattedParent = $gapicClient->messageName('[SPACE]', '[MESSAGE]'); $reaction = new Reaction(); - $response = $gapicClient->createReaction($formattedParent, $reaction); + $request = (new CreateReactionRequest())->setParent($formattedParent)->setReaction($reaction); + $response = $gapicClient->createReaction($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -309,18 +349,22 @@ public function createReactionExceptionTest() $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); + $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->messageName('[SPACE]', '[MESSAGE]'); $reaction = new Reaction(); + $request = (new CreateReactionRequest())->setParent($formattedParent)->setReaction($reaction); try { - $gapicClient->createReaction($formattedParent, $reaction); + $gapicClient->createReaction($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) { @@ -359,7 +403,8 @@ public function createSpaceTest() $transport->addResponse($expectedResponse); // Mock request $space = new Space(); - $response = $gapicClient->createSpace($space); + $request = (new CreateSpaceRequest())->setSpace($space); + $response = $gapicClient->createSpace($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -382,17 +427,21 @@ public function createSpaceExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $space = new Space(); + $request = (new CreateSpaceRequest())->setSpace($space); try { - $gapicClient->createSpace($space); + $gapicClient->createSpace($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) { @@ -419,7 +468,8 @@ public function deleteMembershipTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->membershipName('[SPACE]', '[MEMBER]'); - $response = $gapicClient->deleteMembership($formattedName); + $request = (new DeleteMembershipRequest())->setName($formattedName); + $response = $gapicClient->deleteMembership($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -442,17 +492,21 @@ public function deleteMembershipExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->membershipName('[SPACE]', '[MEMBER]'); + $request = (new DeleteMembershipRequest())->setName($formattedName); try { - $gapicClient->deleteMembership($formattedName); + $gapicClient->deleteMembership($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) { @@ -477,7 +531,8 @@ public function deleteMessageTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->messageName('[SPACE]', '[MESSAGE]'); - $gapicClient->deleteMessage($formattedName); + $request = (new DeleteMessageRequest())->setName($formattedName); + $gapicClient->deleteMessage($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); @@ -499,17 +554,21 @@ public function deleteMessageExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->messageName('[SPACE]', '[MESSAGE]'); + $request = (new DeleteMessageRequest())->setName($formattedName); try { - $gapicClient->deleteMessage($formattedName); + $gapicClient->deleteMessage($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) { @@ -534,7 +593,8 @@ public function deleteReactionTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->reactionName('[SPACE]', '[MESSAGE]', '[REACTION]'); - $gapicClient->deleteReaction($formattedName); + $request = (new DeleteReactionRequest())->setName($formattedName); + $gapicClient->deleteReaction($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); @@ -556,17 +616,21 @@ public function deleteReactionExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->reactionName('[SPACE]', '[MESSAGE]', '[REACTION]'); + $request = (new DeleteReactionRequest())->setName($formattedName); try { - $gapicClient->deleteReaction($formattedName); + $gapicClient->deleteReaction($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) { @@ -591,7 +655,8 @@ public function deleteSpaceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->spaceName('[SPACE]'); - $gapicClient->deleteSpace($formattedName); + $request = (new DeleteSpaceRequest())->setName($formattedName); + $gapicClient->deleteSpace($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); @@ -613,17 +678,21 @@ public function deleteSpaceExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->spaceName('[SPACE]'); + $request = (new DeleteSpaceRequest())->setName($formattedName); try { - $gapicClient->deleteSpace($formattedName); + $gapicClient->deleteSpace($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) { @@ -662,7 +731,8 @@ public function findDirectMessageTest() $transport->addResponse($expectedResponse); // Mock request $name = 'name3373707'; - $response = $gapicClient->findDirectMessage($name); + $request = (new FindDirectMessageRequest())->setName($name); + $response = $gapicClient->findDirectMessage($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -685,17 +755,21 @@ public function findDirectMessageExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $name = 'name3373707'; + $request = (new FindDirectMessageRequest())->setName($name); try { - $gapicClient->findDirectMessage($name); + $gapicClient->findDirectMessage($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) { @@ -730,7 +804,8 @@ public function getAttachmentTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->attachmentName('[SPACE]', '[MESSAGE]', '[ATTACHMENT]'); - $response = $gapicClient->getAttachment($formattedName); + $request = (new GetAttachmentRequest())->setName($formattedName); + $response = $gapicClient->getAttachment($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -753,17 +828,21 @@ public function getAttachmentExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->attachmentName('[SPACE]', '[MESSAGE]', '[ATTACHMENT]'); + $request = (new GetAttachmentRequest())->setName($formattedName); try { - $gapicClient->getAttachment($formattedName); + $gapicClient->getAttachment($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) { @@ -790,7 +869,8 @@ public function getMembershipTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->membershipName('[SPACE]', '[MEMBER]'); - $response = $gapicClient->getMembership($formattedName); + $request = (new GetMembershipRequest())->setName($formattedName); + $response = $gapicClient->getMembership($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -813,17 +893,21 @@ public function getMembershipExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->membershipName('[SPACE]', '[MEMBER]'); + $request = (new GetMembershipRequest())->setName($formattedName); try { - $gapicClient->getMembership($formattedName); + $gapicClient->getMembership($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) { @@ -862,7 +946,8 @@ public function getMessageTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->messageName('[SPACE]', '[MESSAGE]'); - $response = $gapicClient->getMessage($formattedName); + $request = (new GetMessageRequest())->setName($formattedName); + $response = $gapicClient->getMessage($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -885,17 +970,21 @@ public function getMessageExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->messageName('[SPACE]', '[MESSAGE]'); + $request = (new GetMessageRequest())->setName($formattedName); try { - $gapicClient->getMessage($formattedName); + $gapicClient->getMessage($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) { @@ -934,7 +1023,8 @@ public function getSpaceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->spaceName('[SPACE]'); - $response = $gapicClient->getSpace($formattedName); + $request = (new GetSpaceRequest())->setName($formattedName); + $response = $gapicClient->getSpace($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -957,17 +1047,21 @@ public function getSpaceExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->spaceName('[SPACE]'); + $request = (new GetSpaceRequest())->setName($formattedName); try { - $gapicClient->getSpace($formattedName); + $gapicClient->getSpace($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) { @@ -990,16 +1084,15 @@ public function listMembershipsTest() // Mock response $nextPageToken = ''; $membershipsElement = new Membership(); - $memberships = [ - $membershipsElement, - ]; + $memberships = [$membershipsElement]; $expectedResponse = new ListMembershipsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setMemberships($memberships); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->spaceName('[SPACE]'); - $response = $gapicClient->listMemberships($formattedParent); + $request = (new ListMembershipsRequest())->setParent($formattedParent); + $response = $gapicClient->listMemberships($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); @@ -1025,17 +1118,21 @@ public function listMembershipsExceptionTest() $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); + $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]'); + $request = (new ListMembershipsRequest())->setParent($formattedParent); try { - $gapicClient->listMemberships($formattedParent); + $gapicClient->listMemberships($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) { @@ -1058,16 +1155,15 @@ public function listMessagesTest() // Mock response $nextPageToken = ''; $messagesElement = new Message(); - $messages = [ - $messagesElement, - ]; + $messages = [$messagesElement]; $expectedResponse = new ListMessagesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setMessages($messages); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->spaceName('[SPACE]'); - $response = $gapicClient->listMessages($formattedParent); + $request = (new ListMessagesRequest())->setParent($formattedParent); + $response = $gapicClient->listMessages($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); @@ -1093,17 +1189,21 @@ public function listMessagesExceptionTest() $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); + $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]'); + $request = (new ListMessagesRequest())->setParent($formattedParent); try { - $gapicClient->listMessages($formattedParent); + $gapicClient->listMessages($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) { @@ -1126,16 +1226,15 @@ public function listReactionsTest() // Mock response $nextPageToken = ''; $reactionsElement = new Reaction(); - $reactions = [ - $reactionsElement, - ]; + $reactions = [$reactionsElement]; $expectedResponse = new ListReactionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setReactions($reactions); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->messageName('[SPACE]', '[MESSAGE]'); - $response = $gapicClient->listReactions($formattedParent); + $request = (new ListReactionsRequest())->setParent($formattedParent); + $response = $gapicClient->listReactions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); @@ -1161,17 +1260,21 @@ public function listReactionsExceptionTest() $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); + $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->messageName('[SPACE]', '[MESSAGE]'); + $request = (new ListReactionsRequest())->setParent($formattedParent); try { - $gapicClient->listReactions($formattedParent); + $gapicClient->listReactions($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) { @@ -1194,14 +1297,13 @@ public function listSpacesTest() // Mock response $nextPageToken = ''; $spacesElement = new Space(); - $spaces = [ - $spacesElement, - ]; + $spaces = [$spacesElement]; $expectedResponse = new ListSpacesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setSpaces($spaces); $transport->addResponse($expectedResponse); - $response = $gapicClient->listSpaces(); + $request = new ListSpacesRequest(); + $response = $gapicClient->listSpaces($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); @@ -1225,15 +1327,19 @@ public function listSpacesExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); + $request = new ListSpacesRequest(); try { - $gapicClient->listSpaces(); + $gapicClient->listSpaces($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) { @@ -1272,7 +1378,8 @@ public function setUpSpaceTest() $transport->addResponse($expectedResponse); // Mock request $space = new Space(); - $response = $gapicClient->setUpSpace($space); + $request = (new SetUpSpaceRequest())->setSpace($space); + $response = $gapicClient->setUpSpace($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1295,17 +1402,21 @@ public function setUpSpaceExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $space = new Space(); + $request = (new SetUpSpaceRequest())->setSpace($space); try { - $gapicClient->setUpSpace($space); + $gapicClient->setUpSpace($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) { @@ -1344,7 +1455,8 @@ public function updateMessageTest() $transport->addResponse($expectedResponse); // Mock request $message = new Message(); - $response = $gapicClient->updateMessage($message); + $request = (new UpdateMessageRequest())->setMessage($message); + $response = $gapicClient->updateMessage($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1367,17 +1479,21 @@ public function updateMessageExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $message = new Message(); + $request = (new UpdateMessageRequest())->setMessage($message); try { - $gapicClient->updateMessage($message); + $gapicClient->updateMessage($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) { @@ -1416,7 +1532,8 @@ public function updateSpaceTest() $transport->addResponse($expectedResponse); // Mock request $space = new Space(); - $response = $gapicClient->updateSpace($space); + $request = (new UpdateSpaceRequest())->setSpace($space); + $response = $gapicClient->updateSpace($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1439,17 +1556,21 @@ public function updateSpaceExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $space = new Space(); + $request = (new UpdateSpaceRequest())->setSpace($space); try { - $gapicClient->updateSpace($space); + $gapicClient->updateSpace($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) { @@ -1475,7 +1596,8 @@ public function uploadAttachmentTest() // Mock request $formattedParent = $gapicClient->spaceName('[SPACE]'); $filename = 'filename-734768633'; - $response = $gapicClient->uploadAttachment($formattedParent, $filename); + $request = (new UploadAttachmentRequest())->setParent($formattedParent)->setFilename($filename); + $response = $gapicClient->uploadAttachment($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1500,18 +1622,22 @@ public function uploadAttachmentExceptionTest() $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); + $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]'); $filename = 'filename-734768633'; + $request = (new UploadAttachmentRequest())->setParent($formattedParent)->setFilename($filename); try { - $gapicClient->uploadAttachment($formattedParent, $filename); + $gapicClient->uploadAttachment($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) { @@ -1522,4 +1648,30 @@ public function uploadAttachmentExceptionTest() $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); } + + /** @test */ + public function completeImportSpaceAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new CompleteImportSpaceResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->spaceName('[SPACE]'); + $request = (new CompleteImportSpaceRequest())->setName($formattedName); + $response = $gapicClient->completeImportSpaceAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.chat.v1.ChatService/CompleteImportSpace', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } } From 70964391bae5324c23fed8d728e702a4d13ad87c Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 16 Apr 2024 13:49:57 +0000 Subject: [PATCH 3/3] owlbot updates --- AppsChat/metadata/Card/V1/Card.php | Bin 8477 -> 8612 bytes .../complete_import_space.php | 4 +- .../ChatServiceClient/create_membership.php | 6 +- .../V1/ChatServiceClient/create_message.php | 8 +- .../V1/ChatServiceClient/create_reaction.php | 10 +- .../V1/ChatServiceClient/create_space.php | 4 +- .../ChatServiceClient/delete_membership.php | 6 +- .../V1/ChatServiceClient/delete_message.php | 10 +- .../V1/ChatServiceClient/delete_reaction.php | 7 +- .../V1/ChatServiceClient/delete_space.php | 4 +- .../ChatServiceClient/find_direct_message.php | 12 +- .../V1/ChatServiceClient/get_attachment.php | 8 +- .../V1/ChatServiceClient/get_membership.php | 14 +- .../V1/ChatServiceClient/get_message.php | 12 +- .../V1/ChatServiceClient/get_space.php | 9 +- .../V1/ChatServiceClient/list_memberships.php | 18 +- .../V1/ChatServiceClient/list_messages.php | 2 +- .../V1/ChatServiceClient/list_reactions.php | 6 +- .../V1/ChatServiceClient/list_spaces.php | 8 +- .../V1/ChatServiceClient/set_up_space.php | 10 +- .../V1/ChatServiceClient/update_message.php | 8 +- .../V1/ChatServiceClient/update_space.php | 4 +- .../ChatServiceClient/upload_attachment.php | 4 +- AppsChat/src/Card/V1/Action.php | 64 +-- .../src/Card/V1/Action/ActionParameter.php | 2 +- AppsChat/src/Card/V1/Action/Interaction.php | 10 +- AppsChat/src/Card/V1/Button.php | 11 +- AppsChat/src/Card/V1/ButtonList.php | 3 +- AppsChat/src/Card/V1/Card.php | 176 +++---- AppsChat/src/Card/V1/Card/CardFixedFooter.php | 8 +- AppsChat/src/Card/V1/Card/CardHeader.php | 4 +- AppsChat/src/Card/V1/Card/Section.php | 8 +- AppsChat/src/Card/V1/Columns.php | 5 +- AppsChat/src/Card/V1/Columns/Column.php | 13 +- .../V1/Columns/Column/HorizontalSizeStyle.php | 5 +- .../V1/Columns/Column/VerticalAlignment.php | 5 +- .../src/Card/V1/Columns/Column/Widgets.php | 5 +- AppsChat/src/Card/V1/DateTimePicker.php | 12 +- AppsChat/src/Card/V1/DecoratedText.php | 24 +- .../Card/V1/DecoratedText/SwitchControl.php | 16 +- AppsChat/src/Card/V1/Divider.php | 3 +- AppsChat/src/Card/V1/Grid.php | 3 +- AppsChat/src/Card/V1/Icon.php | 90 +++- AppsChat/src/Card/V1/Image.php | 11 +- AppsChat/src/Card/V1/MaterialIcon.php | 250 +++++++++ AppsChat/src/Card/V1/SelectionInput.php | 30 +- .../V1/SelectionInput/PlatformDataSource.php | 2 +- .../PlatformDataSource/CommonDataSource.php | 4 +- .../Card/V1/SelectionInput/SelectionItem.php | 16 +- .../Card/V1/SelectionInput/SelectionType.php | 10 +- AppsChat/src/Card/V1/TextInput.php | 39 +- AppsChat/src/Card/V1/TextParagraph.php | 6 +- AppsChat/src/Card/V1/Widget.php | 12 +- .../Card/V1/Widget/HorizontalAlignment.php | 2 +- AppsChat/src/Chat/V1/AccessoryWidget.php | 10 +- AppsChat/src/Chat/V1/ActionResponse.php | 8 +- .../Chat/V1/ActionResponse/ResponseType.php | 2 +- AppsChat/src/Chat/V1/ActionStatus.php | 2 +- AppsChat/src/Chat/V1/Annotation.php | 2 +- AppsChat/src/Chat/V1/Attachment/Source.php | 8 + AppsChat/src/Chat/V1/AttachmentDataRef.php | 2 + AppsChat/src/Chat/V1/CardWithId.php | 9 +- .../src/Chat/V1/Client/ChatServiceClient.php | 162 +++--- .../Chat/V1/CompleteImportSpaceResponse.php | 2 + .../V1/ContextualAddOnMarkup/Card/Section.php | 8 +- .../src/Chat/V1/CreateMembershipRequest.php | 2 + AppsChat/src/Chat/V1/CreateMessageRequest.php | 18 +- AppsChat/src/Chat/V1/CreateSpaceRequest.php | 2 + .../src/Chat/V1/DeleteMembershipRequest.php | 2 + AppsChat/src/Chat/V1/DeleteMessageRequest.php | 36 +- AppsChat/src/Chat/V1/DialogAction.php | 25 +- AppsChat/src/Chat/V1/DriveLinkData.php | 8 +- .../src/Chat/V1/FindDirectMessageRequest.php | 16 +- AppsChat/src/Chat/V1/GetAttachmentRequest.php | 2 + AppsChat/src/Chat/V1/GetMembershipRequest.php | 22 +- AppsChat/src/Chat/V1/GetMessageRequest.php | 12 +- .../src/Chat/V1/ListMembershipsRequest.php | 42 +- .../src/Chat/V1/ListMembershipsResponse.php | 2 + AppsChat/src/Chat/V1/ListMessagesRequest.php | 16 +- AppsChat/src/Chat/V1/ListMessagesResponse.php | 2 + AppsChat/src/Chat/V1/ListReactionsRequest.php | 16 +- .../src/Chat/V1/ListReactionsResponse.php | 2 + AppsChat/src/Chat/V1/ListSpacesRequest.php | 24 +- AppsChat/src/Chat/V1/ListSpacesResponse.php | 2 + AppsChat/src/Chat/V1/Membership.php | 18 +- AppsChat/src/Chat/V1/Message.php | 484 ++++++------------ AppsChat/src/Chat/V1/SetUpSpaceRequest.php | 2 + AppsChat/src/Chat/V1/SlashCommand.php | 5 +- AppsChat/src/Chat/V1/Space.php | 68 ++- AppsChat/src/Chat/V1/Space/Type.php | 2 + AppsChat/src/Chat/V1/Thread.php | 4 +- AppsChat/src/Chat/V1/UpdateMessageRequest.php | 10 +- AppsChat/src/Chat/V1/UpdateSpaceRequest.php | 66 +-- .../src/Chat/V1/UploadAttachmentRequest.php | 2 + .../src/Chat/V1/UploadAttachmentResponse.php | 2 + AppsChat/src/Chat/V1/User.php | 5 +- .../src/Chat/V1/WidgetMarkup/KeyValue.php | 24 +- .../Chat/V1/WidgetMarkup/TextParagraph.php | 2 +- 98 files changed, 1198 insertions(+), 985 deletions(-) create mode 100644 AppsChat/src/Card/V1/MaterialIcon.php diff --git a/AppsChat/metadata/Card/V1/Card.php b/AppsChat/metadata/Card/V1/Card.php index feffa0a802d322466a9f0ba20dabf989a795bf24..2b741a7e434713f65e36108693fe4b643097aeab 100644 GIT binary patch delta 147 zcmbR1w8VMCUq+@IcANh*nh7x;nrtRwBw@wHo10jYT9lcX6Q7x!pC`epz^K7(q&PW{ zS(L{YD&q;1n4BsS>E+3VA|}Mc#gdnpn<~Kw)WiwmrDf*iNH76;9723tY~`t$=@}&w a%s@V?5HA;NdQoCZsssy&yLqoj0uKP<8z+VU delta 30 mcmZ4DJlAQ%Uq+^jwwwPmnh7zsO*RuTn!H3LY_qFqJP!cDI}0xW diff --git a/AppsChat/samples/V1/ChatServiceClient/complete_import_space.php b/AppsChat/samples/V1/ChatServiceClient/complete_import_space.php index 4c9b651f7f6d..3a70907c0c48 100644 --- a/AppsChat/samples/V1/ChatServiceClient/complete_import_space.php +++ b/AppsChat/samples/V1/ChatServiceClient/complete_import_space.php @@ -30,11 +30,11 @@ /** * Completes the - * [import process](https://developers.google.com/chat/api/guides/import-data) + * [import process](https://developers.google.com/workspace/chat/import-data) * for the specified space and makes it visible to users. * Requires app authentication and domain-wide delegation. For more * information, see [Authorize Google Chat apps to import - * data](https://developers.google.com/chat/api/guides/authorize-import). + * data](https://developers.google.com/workspace/chat/authorize-import). * * @param string $formattedName Resource name of the import mode space. * diff --git a/AppsChat/samples/V1/ChatServiceClient/create_membership.php b/AppsChat/samples/V1/ChatServiceClient/create_membership.php index 367abe4382f2..35d568d65268 100644 --- a/AppsChat/samples/V1/ChatServiceClient/create_membership.php +++ b/AppsChat/samples/V1/ChatServiceClient/create_membership.php @@ -31,13 +31,13 @@ /** * Creates a human membership or app membership for the calling app. Creating * memberships for other apps isn't supported. For an example, see - * [ Create a - * membership](https://developers.google.com/chat/api/guides/v1/members/create). + * [Invite or add a user or a Google Chat app to a + * space](https://developers.google.com/workspace/chat/create-members). * When creating a membership, if the specified member has their auto-accept * policy turned off, then they're invited, and must accept the space * invitation before joining. Otherwise, creating a membership adds the member * directly to the specified space. Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * To specify the member to add, set the `membership.member.name` in the * `CreateMembershipRequest`: diff --git a/AppsChat/samples/V1/ChatServiceClient/create_message.php b/AppsChat/samples/V1/ChatServiceClient/create_message.php index 72f54846507c..e3b75029111e 100644 --- a/AppsChat/samples/V1/ChatServiceClient/create_message.php +++ b/AppsChat/samples/V1/ChatServiceClient/create_message.php @@ -29,12 +29,12 @@ use Google\Apps\Chat\V1\Message; /** - * Creates a message in a Google Chat space. For an example, see [Create a - * message](https://developers.google.com/chat/api/guides/v1/messages/create). + * Creates a message in a Google Chat space. For an example, see [Send a + * message](https://developers.google.com/workspace/chat/create-messages). * * Calling this method requires - * [authentication](https://developers.google.com/chat/api/guides/auth) and - * supports the following authentication types: + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) + * and supports the following authentication types: * * - For text messages, user authentication or app authentication are * supported. diff --git a/AppsChat/samples/V1/ChatServiceClient/create_reaction.php b/AppsChat/samples/V1/ChatServiceClient/create_reaction.php index 702d7bc387be..708a409cecff 100644 --- a/AppsChat/samples/V1/ChatServiceClient/create_reaction.php +++ b/AppsChat/samples/V1/ChatServiceClient/create_reaction.php @@ -29,12 +29,12 @@ use Google\Apps\Chat\V1\Reaction; /** - * Creates a reaction and adds it to a message. For an example, see - * [Create a - * reaction](https://developers.google.com/chat/api/guides/v1/reactions/create). + * Creates a reaction and adds it to a message. Only unicode emojis are + * supported. For an example, see + * [Add a reaction to a + * message](https://developers.google.com/workspace/chat/create-reactions). * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * Only unicode emoji are supported. + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * @param string $formattedParent The message where the reaction is created. * diff --git a/AppsChat/samples/V1/ChatServiceClient/create_space.php b/AppsChat/samples/V1/ChatServiceClient/create_space.php index 53d69113e46c..bd8d809c8ed3 100644 --- a/AppsChat/samples/V1/ChatServiceClient/create_space.php +++ b/AppsChat/samples/V1/ChatServiceClient/create_space.php @@ -31,14 +31,14 @@ /** * Creates a named space. Spaces grouped by topics aren't supported. For an * example, see [Create a - * space](https://developers.google.com/chat/api/guides/v1/spaces/create). + * space](https://developers.google.com/workspace/chat/create-spaces). * * If you receive the error message `ALREADY_EXISTS` when creating * a space, try a different `displayName`. An existing space within * the Google Workspace organization might already use this display name. * * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: diff --git a/AppsChat/samples/V1/ChatServiceClient/delete_membership.php b/AppsChat/samples/V1/ChatServiceClient/delete_membership.php index aa4c1c22632e..cb6d26d75502 100644 --- a/AppsChat/samples/V1/ChatServiceClient/delete_membership.php +++ b/AppsChat/samples/V1/ChatServiceClient/delete_membership.php @@ -30,11 +30,11 @@ /** * Deletes a membership. For an example, see - * [Delete a - * membership](https://developers.google.com/chat/api/guides/v1/members/delete). + * [Remove a user or a Google Chat app from a + * space](https://developers.google.com/workspace/chat/delete-members). * * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * @param string $formattedName Resource name of the membership to delete. Chat apps can delete * human users' or their own memberships. Chat apps can't delete other apps' diff --git a/AppsChat/samples/V1/ChatServiceClient/delete_message.php b/AppsChat/samples/V1/ChatServiceClient/delete_message.php index 913a833d5d8a..4cba6f6cda36 100644 --- a/AppsChat/samples/V1/ChatServiceClient/delete_message.php +++ b/AppsChat/samples/V1/ChatServiceClient/delete_message.php @@ -30,15 +30,15 @@ /** * Deletes a message. * For an example, see [Delete a - * message](https://developers.google.com/chat/api/guides/v1/messages/delete). + * message](https://developers.google.com/workspace/chat/delete-messages). * * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). * Supports * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * When using app authentication, requests can only delete messages * created by the calling Chat app. * @@ -49,7 +49,7 @@ * If you've set a custom ID for your message, you can use the value from the * `clientAssignedMessageId` field for `{message}`. For details, see [Name a * message] - * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). Please see + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). Please see * {@see ChatServiceClient::messageName()} for help formatting this field. */ function delete_message_sample(string $formattedName): void diff --git a/AppsChat/samples/V1/ChatServiceClient/delete_reaction.php b/AppsChat/samples/V1/ChatServiceClient/delete_reaction.php index d8df09b4d126..ff8e837d34a5 100644 --- a/AppsChat/samples/V1/ChatServiceClient/delete_reaction.php +++ b/AppsChat/samples/V1/ChatServiceClient/delete_reaction.php @@ -28,11 +28,12 @@ use Google\Apps\Chat\V1\DeleteReactionRequest; /** - * Deletes a reaction to a message. For an example, see + * Deletes a reaction to a message. Only unicode emojis are supported. + * For an example, see * [Delete a - * reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete). + * reaction](https://developers.google.com/workspace/chat/delete-reactions). * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * @param string $formattedName Name of the reaction to delete. * diff --git a/AppsChat/samples/V1/ChatServiceClient/delete_space.php b/AppsChat/samples/V1/ChatServiceClient/delete_space.php index 3692d848c117..d5cb8b8e282c 100644 --- a/AppsChat/samples/V1/ChatServiceClient/delete_space.php +++ b/AppsChat/samples/V1/ChatServiceClient/delete_space.php @@ -32,9 +32,9 @@ * that the space's child resources—like messages posted in the space and * memberships in the space—are also deleted. For an example, see * [Delete a - * space](https://developers.google.com/chat/api/guides/v1/spaces/delete). + * space](https://developers.google.com/workspace/chat/delete-spaces). * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) * from a user who has permission to delete the space. * * @param string $formattedName Resource name of the space to delete. diff --git a/AppsChat/samples/V1/ChatServiceClient/find_direct_message.php b/AppsChat/samples/V1/ChatServiceClient/find_direct_message.php index 9c88f52d448e..db4dd111f3d3 100644 --- a/AppsChat/samples/V1/ChatServiceClient/find_direct_message.php +++ b/AppsChat/samples/V1/ChatServiceClient/find_direct_message.php @@ -35,19 +35,19 @@ * [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). * * With [user - * authentication](https://developers.google.com/chat/api/guides/auth/users), + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), * returns the direct message space between the specified user and the * authenticated user. * * With [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), * returns the direct message space between the specified user and the calling * Chat app. * * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) * or [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * * @param string $name Resource name of the user to find direct message with. * @@ -58,8 +58,8 @@ * in the Directory API. For example, if the People API profile ID is * `123456789`, you can find a direct message with that person by using * `users/123456789` as the `name`. When [authenticated as a - * user](https://developers.google.com/chat/api/guides/auth/users), you can - * use the email as an alias for `{user}`. For example, + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the email as an alias for `{user}`. For example, * `users/example@gmail.com` where `example@gmail.com` is the email of the * Google Chat user. */ diff --git a/AppsChat/samples/V1/ChatServiceClient/get_attachment.php b/AppsChat/samples/V1/ChatServiceClient/get_attachment.php index 3b2c1585e38b..85ee10dc3ee9 100644 --- a/AppsChat/samples/V1/ChatServiceClient/get_attachment.php +++ b/AppsChat/samples/V1/ChatServiceClient/get_attachment.php @@ -31,12 +31,12 @@ /** * Gets the metadata of a message attachment. The attachment data is fetched * using the [media - * API](https://developers.google.com/chat/api/reference/rest/v1/media/download). + * API](https://developers.google.com/workspace/chat/api/reference/rest/v1/media/download). * For an example, see - * [Get a message - * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). + * [Get metadata about a message + * attachment](https://developers.google.com/workspace/chat/get-media-attachments). * Requires [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * * @param string $formattedName Resource name of the attachment, in the form * `spaces/*/messages/*/attachments/*`. Please see diff --git a/AppsChat/samples/V1/ChatServiceClient/get_membership.php b/AppsChat/samples/V1/ChatServiceClient/get_membership.php index 51d610ad755c..9465db39e203 100644 --- a/AppsChat/samples/V1/ChatServiceClient/get_membership.php +++ b/AppsChat/samples/V1/ChatServiceClient/get_membership.php @@ -30,16 +30,16 @@ /** * Returns details about a membership. For an example, see - * [Get a - * membership](https://developers.google.com/chat/api/guides/v1/members/get). + * [Get details about a user's or Google Chat app's + * membership](https://developers.google.com/workspace/chat/get-members). * * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). * Supports * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * @param string $formattedName Resource name of the membership to retrieve. * @@ -49,8 +49,8 @@ * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` * * When [authenticated as a - * user](https://developers.google.com/chat/api/guides/auth/users), you can - * use the user's email as an alias for `{member}`. For example, + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the user's email as an alias for `{member}`. For example, * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the * email of the Google Chat user. Please see * {@see ChatServiceClient::membershipName()} for help formatting this field. diff --git a/AppsChat/samples/V1/ChatServiceClient/get_message.php b/AppsChat/samples/V1/ChatServiceClient/get_message.php index 32edfa81d76b..b37e14eb6ae3 100644 --- a/AppsChat/samples/V1/ChatServiceClient/get_message.php +++ b/AppsChat/samples/V1/ChatServiceClient/get_message.php @@ -30,16 +30,16 @@ /** * Returns details about a message. - * For an example, see [Read a - * message](https://developers.google.com/chat/api/guides/v1/messages/get). + * For an example, see [Get details about a + * message](https://developers.google.com/workspace/chat/get-messages). * * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). * Supports * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * Note: Might return a message from a blocked member or space. * @@ -50,7 +50,7 @@ * If you've set a custom ID for your message, you can use the value from the * `clientAssignedMessageId` field for `{message}`. For details, see [Name a * message] - * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). Please see + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). Please see * {@see ChatServiceClient::messageName()} for help formatting this field. */ function get_message_sample(string $formattedName): void diff --git a/AppsChat/samples/V1/ChatServiceClient/get_space.php b/AppsChat/samples/V1/ChatServiceClient/get_space.php index c39069d8a628..ab28f86398dc 100644 --- a/AppsChat/samples/V1/ChatServiceClient/get_space.php +++ b/AppsChat/samples/V1/ChatServiceClient/get_space.php @@ -30,15 +30,16 @@ /** * Returns details about a space. For an example, see - * [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get). + * [Get details about a + * space](https://developers.google.com/workspace/chat/get-spaces). * * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). * Supports * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * @param string $formattedName Resource name of the space, in the form "spaces/*". * diff --git a/AppsChat/samples/V1/ChatServiceClient/list_memberships.php b/AppsChat/samples/V1/ChatServiceClient/list_memberships.php index c2df7453ab5d..2b1320f8efb4 100644 --- a/AppsChat/samples/V1/ChatServiceClient/list_memberships.php +++ b/AppsChat/samples/V1/ChatServiceClient/list_memberships.php @@ -30,25 +30,25 @@ use Google\Apps\Chat\V1\Membership; /** - * Lists memberships in a space. For an example, see [List - * memberships](https://developers.google.com/chat/api/guides/v1/members/list). - * Listing memberships with - * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * Lists memberships in a space. For an example, see [List users and Google + * Chat apps in a + * space](https://developers.google.com/workspace/chat/list-members). Listing + * memberships with [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * lists memberships in spaces that the Chat app has * access to, but excludes Chat app memberships, * including its own. Listing memberships with * [User - * authentication](https://developers.google.com/chat/api/guides/auth/users) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) * lists memberships in spaces that the authenticated user has access to. * * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). * Supports * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * @param string $formattedParent The resource name of the space for which to fetch a membership * list. diff --git a/AppsChat/samples/V1/ChatServiceClient/list_messages.php b/AppsChat/samples/V1/ChatServiceClient/list_messages.php index e7696f55bdd5..ad08845a872f 100644 --- a/AppsChat/samples/V1/ChatServiceClient/list_messages.php +++ b/AppsChat/samples/V1/ChatServiceClient/list_messages.php @@ -34,7 +34,7 @@ * messages from blocked members and spaces. For an example, see * [List messages](/chat/api/guides/v1/messages/list). * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * @param string $formattedParent The resource name of the space to list messages from. * diff --git a/AppsChat/samples/V1/ChatServiceClient/list_reactions.php b/AppsChat/samples/V1/ChatServiceClient/list_reactions.php index 77249e9acd53..316b53751c4d 100644 --- a/AppsChat/samples/V1/ChatServiceClient/list_reactions.php +++ b/AppsChat/samples/V1/ChatServiceClient/list_reactions.php @@ -31,10 +31,10 @@ /** * Lists reactions to a message. For an example, see - * [List - * reactions](https://developers.google.com/chat/api/guides/v1/reactions/list). + * [List reactions for a + * message](https://developers.google.com/workspace/chat/list-reactions). * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * @param string $formattedParent The message users reacted to. * diff --git a/AppsChat/samples/V1/ChatServiceClient/list_spaces.php b/AppsChat/samples/V1/ChatServiceClient/list_spaces.php index 92ca4eef9b19..5dcafd1f2f21 100644 --- a/AppsChat/samples/V1/ChatServiceClient/list_spaces.php +++ b/AppsChat/samples/V1/ChatServiceClient/list_spaces.php @@ -33,15 +33,15 @@ * Lists spaces the caller is a member of. Group chats and DMs aren't listed * until the first message is sent. For an example, see * [List - * spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). + * spaces](https://developers.google.com/workspace/chat/list-spaces). * * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). * Supports * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * Lists spaces visible to the caller or authenticated user. Group chats * and DMs aren't listed until the first message is sent. diff --git a/AppsChat/samples/V1/ChatServiceClient/set_up_space.php b/AppsChat/samples/V1/ChatServiceClient/set_up_space.php index 82b1975f99b6..c78a70abfe24 100644 --- a/AppsChat/samples/V1/ChatServiceClient/set_up_space.php +++ b/AppsChat/samples/V1/ChatServiceClient/set_up_space.php @@ -32,8 +32,8 @@ * Creates a space and adds specified users to it. The calling user is * automatically added to the space, and shouldn't be specified as a * membership in the request. For an example, see - * [Set up a - * space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). + * [Set up a space with initial + * members](https://developers.google.com/workspace/chat/set-up-spaces). * * To specify the human members to add, add memberships with the appropriate * `member.name` in the `SetUpSpaceRequest`. To add a human user, use @@ -57,8 +57,8 @@ * can only use this method to set up a DM with the calling app. To add the * calling app as a member of a space or an existing DM between two human * users, see - * [create a - * membership](https://developers.google.com/chat/api/guides/v1/members/create). + * [Invite or add a user or app to a + * space](https://developers.google.com/workspace/chat/create-members). * * If a DM already exists between two users, even when one user blocks the * other at the time a request is made, then the existing DM is returned. @@ -69,7 +69,7 @@ * might already use this display name. * * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: diff --git a/AppsChat/samples/V1/ChatServiceClient/update_message.php b/AppsChat/samples/V1/ChatServiceClient/update_message.php index d95d61610d21..1f748c1d8a50 100644 --- a/AppsChat/samples/V1/ChatServiceClient/update_message.php +++ b/AppsChat/samples/V1/ChatServiceClient/update_message.php @@ -34,15 +34,15 @@ * method uses a `patch` request while the `update` method uses a `put` * request. We recommend using the `patch` method. For an example, see * [Update a - * message](https://developers.google.com/chat/api/guides/v1/messages/update). + * message](https://developers.google.com/workspace/chat/update-messages). * * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). * Supports * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * When using app authentication, requests can only update messages * created by the calling Chat app. * diff --git a/AppsChat/samples/V1/ChatServiceClient/update_space.php b/AppsChat/samples/V1/ChatServiceClient/update_space.php index c886524a6b00..a50b3fcfbeff 100644 --- a/AppsChat/samples/V1/ChatServiceClient/update_space.php +++ b/AppsChat/samples/V1/ChatServiceClient/update_space.php @@ -31,14 +31,14 @@ /** * Updates a space. For an example, see * [Update a - * space](https://developers.google.com/chat/api/guides/v1/spaces/update). + * space](https://developers.google.com/workspace/chat/update-spaces). * * If you're updating the `displayName` field and receive the error message * `ALREADY_EXISTS`, try a different display name.. An existing space within * the Google Workspace organization might already use this display name. * * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: diff --git a/AppsChat/samples/V1/ChatServiceClient/upload_attachment.php b/AppsChat/samples/V1/ChatServiceClient/upload_attachment.php index 437e34819ba4..5312833b0722 100644 --- a/AppsChat/samples/V1/ChatServiceClient/upload_attachment.php +++ b/AppsChat/samples/V1/ChatServiceClient/upload_attachment.php @@ -31,9 +31,9 @@ /** * Uploads an attachment. For an example, see * [Upload media as a file - * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload). + * attachment](https://developers.google.com/workspace/chat/upload-media-attachments). * Requires user - * [authentication](https://developers.google.com/chat/api/guides/auth/users). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * You can upload attachments up to 200 MB. Certain file types aren't * supported. For details, see [File types blocked by Google diff --git a/AppsChat/src/Card/V1/Action.php b/AppsChat/src/Card/V1/Action.php index df7032c28a01..b580ebad2ebc 100644 --- a/AppsChat/src/Card/V1/Action.php +++ b/AppsChat/src/Card/V1/Action.php @@ -22,8 +22,8 @@ class Action extends \Google\Protobuf\Internal\Message /** * A custom function to invoke when the containing element is * clicked or othrwise activated. - * For example usage, see [Create interactive - * cards](https://developers.google.com/chat/how-tos/cards-onclick). + * For example usage, see [Read form + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string function = 1; */ @@ -48,11 +48,11 @@ class Action extends \Google\Protobuf\Internal\Message * user make changes while the action is being processed, set * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) * to `NONE`. For [card - * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create) + * messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create) * in Chat apps, you must also set the action's - * [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype) + * [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype) * to `UPDATE_MESSAGE` and use the same - * [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId) + * [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId) * from the card that contained the action. * If `false`, the form values are cleared when the action is triggered. * To prevent the user from making changes while the action is being @@ -65,17 +65,17 @@ class Action extends \Google\Protobuf\Internal\Message protected $persist_values = false; /** * Optional. Required when opening a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). + * [dialog](https://developers.google.com/workspace/chat/dialogs). * What to do in response to an interaction with a user, such as a user * clicking a button in a card message. * If unspecified, the app responds by executing an `action`—like opening a * link or running a function—as normal. * By specifying an `interaction`, the app can respond in special interactive * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can - * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When + * open a [dialog](https://developers.google.com/workspace/chat/dialogs). When * specified, a loading indicator isn't shown. If specified for * an add-on, the entire card is stripped and nothing is shown in the client. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Chat apps](https://developers.google.com/workspace/chat): * * Generated from protobuf field .google.apps.card.v1.Action.Interaction interaction = 5; */ @@ -90,8 +90,8 @@ class Action extends \Google\Protobuf\Internal\Message * @type string $function * A custom function to invoke when the containing element is * clicked or othrwise activated. - * For example usage, see [Create interactive - * cards](https://developers.google.com/chat/how-tos/cards-onclick). + * For example usage, see [Read form + * data](https://developers.google.com/workspace/chat/read-form-data). * @type array<\Google\Apps\Card\V1\Action\ActionParameter>|\Google\Protobuf\Internal\RepeatedField $parameters * List of action parameters. * @type int $load_indicator @@ -104,11 +104,11 @@ class Action extends \Google\Protobuf\Internal\Message * user make changes while the action is being processed, set * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) * to `NONE`. For [card - * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create) + * messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create) * in Chat apps, you must also set the action's - * [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype) + * [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype) * to `UPDATE_MESSAGE` and use the same - * [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId) + * [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId) * from the card that contained the action. * If `false`, the form values are cleared when the action is triggered. * To prevent the user from making changes while the action is being @@ -117,17 +117,17 @@ class Action extends \Google\Protobuf\Internal\Message * to `SPINNER`. * @type int $interaction * Optional. Required when opening a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). + * [dialog](https://developers.google.com/workspace/chat/dialogs). * What to do in response to an interaction with a user, such as a user * clicking a button in a card message. * If unspecified, the app responds by executing an `action`—like opening a * link or running a function—as normal. * By specifying an `interaction`, the app can respond in special interactive * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can - * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When + * open a [dialog](https://developers.google.com/workspace/chat/dialogs). When * specified, a loading indicator isn't shown. If specified for * an add-on, the entire card is stripped and nothing is shown in the client. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Chat apps](https://developers.google.com/workspace/chat): * } */ public function __construct($data = NULL) { @@ -138,8 +138,8 @@ public function __construct($data = NULL) { /** * A custom function to invoke when the containing element is * clicked or othrwise activated. - * For example usage, see [Create interactive - * cards](https://developers.google.com/chat/how-tos/cards-onclick). + * For example usage, see [Read form + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string function = 1; * @return string @@ -152,8 +152,8 @@ public function getFunction() /** * A custom function to invoke when the containing element is * clicked or othrwise activated. - * For example usage, see [Create interactive - * cards](https://developers.google.com/chat/how-tos/cards-onclick). + * For example usage, see [Read form + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string function = 1; * @param string $var @@ -228,11 +228,11 @@ public function setLoadIndicator($var) * user make changes while the action is being processed, set * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) * to `NONE`. For [card - * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create) + * messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create) * in Chat apps, you must also set the action's - * [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype) + * [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype) * to `UPDATE_MESSAGE` and use the same - * [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId) + * [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId) * from the card that contained the action. * If `false`, the form values are cleared when the action is triggered. * To prevent the user from making changes while the action is being @@ -255,11 +255,11 @@ public function getPersistValues() * user make changes while the action is being processed, set * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) * to `NONE`. For [card - * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create) + * messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create) * in Chat apps, you must also set the action's - * [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype) + * [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype) * to `UPDATE_MESSAGE` and use the same - * [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId) + * [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId) * from the card that contained the action. * If `false`, the form values are cleared when the action is triggered. * To prevent the user from making changes while the action is being @@ -281,17 +281,17 @@ public function setPersistValues($var) /** * Optional. Required when opening a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). + * [dialog](https://developers.google.com/workspace/chat/dialogs). * What to do in response to an interaction with a user, such as a user * clicking a button in a card message. * If unspecified, the app responds by executing an `action`—like opening a * link or running a function—as normal. * By specifying an `interaction`, the app can respond in special interactive * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can - * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When + * open a [dialog](https://developers.google.com/workspace/chat/dialogs). When * specified, a loading indicator isn't shown. If specified for * an add-on, the entire card is stripped and nothing is shown in the client. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Chat apps](https://developers.google.com/workspace/chat): * * Generated from protobuf field .google.apps.card.v1.Action.Interaction interaction = 5; * @return int @@ -303,17 +303,17 @@ public function getInteraction() /** * Optional. Required when opening a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). + * [dialog](https://developers.google.com/workspace/chat/dialogs). * What to do in response to an interaction with a user, such as a user * clicking a button in a card message. * If unspecified, the app responds by executing an `action`—like opening a * link or running a function—as normal. * By specifying an `interaction`, the app can respond in special interactive * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can - * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When + * open a [dialog](https://developers.google.com/workspace/chat/dialogs). When * specified, a loading indicator isn't shown. If specified for * an add-on, the entire card is stripped and nothing is shown in the client. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Chat apps](https://developers.google.com/workspace/chat): * * Generated from protobuf field .google.apps.card.v1.Action.Interaction interaction = 5; * @param int $var diff --git a/AppsChat/src/Card/V1/Action/ActionParameter.php b/AppsChat/src/Card/V1/Action/ActionParameter.php index a6ecb8540ade..f9e28abd76d6 100644 --- a/AppsChat/src/Card/V1/Action/ActionParameter.php +++ b/AppsChat/src/Card/V1/Action/ActionParameter.php @@ -14,7 +14,7 @@ * or snooze next week. You might use `action method = snooze()`, passing the * snooze type and snooze time in the list of string parameters. * To learn more, see - * [`CommonEventObject`](https://developers.google.com/chat/api/reference/rest/v1/Event#commoneventobject). + * [`CommonEventObject`](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#commoneventobject). * [Google Workspace Add-ons and Chat * apps](https://developers.google.com/workspace/extend): * diff --git a/AppsChat/src/Card/V1/Action/Interaction.php b/AppsChat/src/Card/V1/Action/Interaction.php index f5dde517e34d..8e173f078cbe 100644 --- a/AppsChat/src/Card/V1/Action/Interaction.php +++ b/AppsChat/src/Card/V1/Action/Interaction.php @@ -8,17 +8,17 @@ /** * Optional. Required when opening a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). + * [dialog](https://developers.google.com/workspace/chat/dialogs). * What to do in response to an interaction with a user, such as a user * clicking a button in a card message. * If unspecified, the app responds by executing an `action`—like opening a * link or running a function—as normal. * By specifying an `interaction`, the app can respond in special interactive * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can - * open a [dialog](https://developers.google.com/chat/how-tos/dialogs). + * open a [dialog](https://developers.google.com/workspace/chat/dialogs). * When specified, a loading indicator isn't shown. If specified for * an add-on, the entire card is stripped and nothing is shown in the client. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Chat apps](https://developers.google.com/workspace/chat): * * Protobuf type google.apps.card.v1.Action.Interaction */ @@ -31,13 +31,13 @@ class Interaction */ const INTERACTION_UNSPECIFIED = 0; /** - * Opens a [dialog](https://developers.google.com/chat/how-tos/dialogs), a + * Opens a [dialog](https://developers.google.com/workspace/chat/dialogs), a * windowed, card-based interface that Chat apps use to interact with users. * Only supported by Chat apps in response to button-clicks on card * messages. If specified for * an add-on, the entire card is stripped and nothing is shown in the * client. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Chat apps](https://developers.google.com/workspace/chat): * * Generated from protobuf enum OPEN_DIALOG = 1; */ diff --git a/AppsChat/src/Card/V1/Button.php b/AppsChat/src/Card/V1/Button.php index 2dc25b88e340..8e966b18cf47 100644 --- a/AppsChat/src/Card/V1/Button.php +++ b/AppsChat/src/Card/V1/Button.php @@ -11,7 +11,8 @@ /** * A text, icon, or text and icon button that users can click. For an example in * Google Chat apps, see - * [Button list](https://developers.google.com/chat/ui/widgets/button-list). + * [Add a + * button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). * To make an image a clickable button, specify an * [`Image`][google.apps.card.v1.Image] (not an * [`ImageComponent`][google.apps.card.v1.ImageComponent]) and set an @@ -85,7 +86,7 @@ class Button extends \Google\Protobuf\Internal\Message * Set descriptive text that lets users know what the button does. For * example, if a button opens a hyperlink, you might write: "Opens a new * browser tab and navigates to the Google Chat developer documentation at - * https://developers.google.com/chat". + * https://developers.google.com/workspace/chat". * * Generated from protobuf field string alt_text = 6; */ @@ -139,7 +140,7 @@ class Button extends \Google\Protobuf\Internal\Message * Set descriptive text that lets users know what the button does. For * example, if a button opens a hyperlink, you might write: "Opens a new * browser tab and navigates to the Google Chat developer documentation at - * https://developers.google.com/chat". + * https://developers.google.com/workspace/chat". * } */ public function __construct($data = NULL) { @@ -366,7 +367,7 @@ public function setDisabled($var) * Set descriptive text that lets users know what the button does. For * example, if a button opens a hyperlink, you might write: "Opens a new * browser tab and navigates to the Google Chat developer documentation at - * https://developers.google.com/chat". + * https://developers.google.com/workspace/chat". * * Generated from protobuf field string alt_text = 6; * @return string @@ -381,7 +382,7 @@ public function getAltText() * Set descriptive text that lets users know what the button does. For * example, if a button opens a hyperlink, you might write: "Opens a new * browser tab and navigates to the Google Chat developer documentation at - * https://developers.google.com/chat". + * https://developers.google.com/workspace/chat". * * Generated from protobuf field string alt_text = 6; * @param string $var diff --git a/AppsChat/src/Card/V1/ButtonList.php b/AppsChat/src/Card/V1/ButtonList.php index 1f9596193798..10b74b56debe 100644 --- a/AppsChat/src/Card/V1/ButtonList.php +++ b/AppsChat/src/Card/V1/ButtonList.php @@ -11,7 +11,8 @@ /** * A list of buttons layed out horizontally. For an example in * Google Chat apps, see - * [Button list](https://developers.google.com/chat/ui/widgets/button-list). + * [Add a + * button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). * [Google Workspace Add-ons and Chat * apps](https://developers.google.com/workspace/extend): * diff --git a/AppsChat/src/Card/V1/Card.php b/AppsChat/src/Card/V1/Card.php index b6d0bea549d1..75ffe057a2b8 100644 --- a/AppsChat/src/Card/V1/Card.php +++ b/AppsChat/src/Card/V1/Card.php @@ -17,13 +17,13 @@ * [Card builder](https://addons.gsuite.google.com/uikit/builder) * To learn how * to build cards, see the following documentation: - * * For Google Chat apps, see [Design dynamic, interactive, and consistent UIs - * with cards](https://developers.google.com/chat/ui). + * * For Google Chat apps, see [Design the components of a card or + * dialog](https://developers.google.com/workspace/chat/design-components-card-dialog). * * For Google Workspace Add-ons, see [Card-based * interfaces](https://developers.google.com/apps-script/add-ons/concepts/cards). * **Example: Card message for a Google Chat app** * ![Example contact - * card](https://developers.google.com/chat/images/card_api_reference.png) + * card](https://developers.google.com/workspace/chat/images/card_api_reference.png) * To create the sample card message in Google Chat, use the following JSON: * ``` * { @@ -32,77 +32,77 @@ * "cardId": "unique-card-id", * "card": { * "header": { - * "title": "Sasha", - * "subtitle": "Software Engineer", - * "imageUrl": - * "https://developers.google.com/chat/images/quickstart-app-avatar.png", - * "imageType": "CIRCLE", - * "imageAltText": "Avatar for Sasha", - * }, - * "sections": [ - * { - * "header": "Contact Info", - * "collapsible": true, - * "uncollapsibleWidgetsCount": 1, - * "widgets": [ - * { - * "decoratedText": { - * "startIcon": { - * "knownIcon": "EMAIL", - * }, - * "text": "sasha@example.com", - * } - * }, - * { - * "decoratedText": { - * "startIcon": { - * "knownIcon": "PERSON", - * }, - * "text": "Online", - * }, - * }, - * { - * "decoratedText": { - * "startIcon": { - * "knownIcon": "PHONE", - * }, - * "text": "+1 (555) 555-1234", - * } - * }, - * { - * "buttonList": { - * "buttons": [ - * { - * "text": "Share", - * "onClick": { + * "title": "Sasha", + * "subtitle": "Software Engineer", + * "imageUrl": + * "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", + * "imageType": "CIRCLE", + * "imageAltText": "Avatar for Sasha" + * }, + * "sections": [ + * { + * "header": "Contact Info", + * "collapsible": true, + * "uncollapsibleWidgetsCount": 1, + * "widgets": [ + * { + * "decoratedText": { + * "startIcon": { + * "knownIcon": "EMAIL" + * }, + * "text": "sasha@example.com" + * } + * }, + * { + * "decoratedText": { + * "startIcon": { + * "knownIcon": "PERSON" + * }, + * "text": "Online" + * } + * }, + * { + * "decoratedText": { + * "startIcon": { + * "knownIcon": "PHONE" + * }, + * "text": "+1 (555) 555-1234" + * } + * }, + * { + * "buttonList": { + * "buttons": [ + * { + * "text": "Share", + * "onClick": { * "openLink": { - * "url": "https://example.com/share", - * } - * } - * }, - * { - * "text": "Edit", - * "onClick": { - * "action": { - * "function": "goToView", - * "parameters": [ - * { - * "key": "viewType", - * "value": "EDIT", - * } - * ], - * } - * } - * }, - * ], - * } - * }, - * ], - * }, - * ], - * }, + * "url": "https://example.com/share" + * } + * } + * }, + * { + * "text": "Edit", + * "onClick": { + * "action": { + * "function": "goToView", + * "parameters": [ + * { + * "key": "viewType", + * "value": "EDIT" + * } + * ] + * } + * } + * } + * ] + * } + * } + * ] + * } + * ] + * } * } - * ], + * ] * } * ``` * @@ -120,8 +120,8 @@ class Card extends \Google\Protobuf\Internal\Message /** * Contains a collection of widgets. Each section has its own, optional * header. Sections are visually separated by a line divider. For an example - * in Google Chat apps, see [Card - * section](https://developers.google.com/chat/ui/widgets/card-section). + * in Google Chat apps, see [Define a section of a + * card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card). * * Generated from protobuf field repeated .google.apps.card.v1.Card.Section sections = 2; */ @@ -182,9 +182,9 @@ class Card extends \Google\Protobuf\Internal\Message * Setting `fixedFooter` without specifying a `primaryButton` or a * `secondaryButton` causes an error. For Chat apps, you can use fixed footers * in - * [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not + * [dialogs](https://developers.google.com/workspace/chat/dialogs), but not * [card - * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create). + * messages](https://developers.google.com/workspace/chat/create-messages#create). * [Google Workspace Add-ons and Chat * apps](https://developers.google.com/workspace/extend): * @@ -223,8 +223,8 @@ class Card extends \Google\Protobuf\Internal\Message * @type array<\Google\Apps\Card\V1\Card\Section>|\Google\Protobuf\Internal\RepeatedField $sections * Contains a collection of widgets. Each section has its own, optional * header. Sections are visually separated by a line divider. For an example - * in Google Chat apps, see [Card - * section](https://developers.google.com/chat/ui/widgets/card-section). + * in Google Chat apps, see [Define a section of a + * card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card). * @type int $section_divider_style * The divider style between sections. * @type array<\Google\Apps\Card\V1\Card\CardAction>|\Google\Protobuf\Internal\RepeatedField $card_actions @@ -269,9 +269,9 @@ class Card extends \Google\Protobuf\Internal\Message * Setting `fixedFooter` without specifying a `primaryButton` or a * `secondaryButton` causes an error. For Chat apps, you can use fixed footers * in - * [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not + * [dialogs](https://developers.google.com/workspace/chat/dialogs), but not * [card - * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create). + * messages](https://developers.google.com/workspace/chat/create-messages#create). * [Google Workspace Add-ons and Chat * apps](https://developers.google.com/workspace/extend): * @type int $display_style @@ -333,8 +333,8 @@ public function setHeader($var) /** * Contains a collection of widgets. Each section has its own, optional * header. Sections are visually separated by a line divider. For an example - * in Google Chat apps, see [Card - * section](https://developers.google.com/chat/ui/widgets/card-section). + * in Google Chat apps, see [Define a section of a + * card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card). * * Generated from protobuf field repeated .google.apps.card.v1.Card.Section sections = 2; * @return \Google\Protobuf\Internal\RepeatedField @@ -347,8 +347,8 @@ public function getSections() /** * Contains a collection of widgets. Each section has its own, optional * header. Sections are visually separated by a line divider. For an example - * in Google Chat apps, see [Card - * section](https://developers.google.com/chat/ui/widgets/card-section). + * in Google Chat apps, see [Define a section of a + * card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card). * * Generated from protobuf field repeated .google.apps.card.v1.Card.Section sections = 2; * @param array<\Google\Apps\Card\V1\Card\Section>|\Google\Protobuf\Internal\RepeatedField $var @@ -511,9 +511,9 @@ public function setName($var) * Setting `fixedFooter` without specifying a `primaryButton` or a * `secondaryButton` causes an error. For Chat apps, you can use fixed footers * in - * [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not + * [dialogs](https://developers.google.com/workspace/chat/dialogs), but not * [card - * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create). + * messages](https://developers.google.com/workspace/chat/create-messages#create). * [Google Workspace Add-ons and Chat * apps](https://developers.google.com/workspace/extend): * @@ -540,9 +540,9 @@ public function clearFixedFooter() * Setting `fixedFooter` without specifying a `primaryButton` or a * `secondaryButton` causes an error. For Chat apps, you can use fixed footers * in - * [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not + * [dialogs](https://developers.google.com/workspace/chat/dialogs), but not * [card - * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create). + * messages](https://developers.google.com/workspace/chat/create-messages#create). * [Google Workspace Add-ons and Chat * apps](https://developers.google.com/workspace/extend): * diff --git a/AppsChat/src/Card/V1/Card/CardFixedFooter.php b/AppsChat/src/Card/V1/Card/CardFixedFooter.php index e0537f93597c..7cd59d1a1fd3 100644 --- a/AppsChat/src/Card/V1/Card/CardFixedFooter.php +++ b/AppsChat/src/Card/V1/Card/CardFixedFooter.php @@ -13,11 +13,11 @@ * Setting `fixedFooter` without specifying a `primaryButton` or a * `secondaryButton` causes an error. * For Chat apps, you can use fixed footers in - * [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not + * [dialogs](https://developers.google.com/workspace/chat/dialogs), but not * [card - * messages](https://developers.google.com/chat/api/guides/v1/messages/create#create). - * For an example in Google Chat apps, see [Card - * footer](https://developers.google.com/chat/ui/widgets/card-fixed-footer). + * messages](https://developers.google.com/workspace/chat/create-messages#create). + * For an example in Google Chat apps, see [Add a persistent + * footer](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_persistent_footer). * [Google Workspace Add-ons and Chat * apps](https://developers.google.com/workspace/extend): * diff --git a/AppsChat/src/Card/V1/Card/CardHeader.php b/AppsChat/src/Card/V1/Card/CardHeader.php index 2e5e177082d4..37724de78a3f 100644 --- a/AppsChat/src/Card/V1/Card/CardHeader.php +++ b/AppsChat/src/Card/V1/Card/CardHeader.php @@ -9,8 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Represents a card header. For an example in Google Chat apps, see [Card - * header](https://developers.google.com/chat/ui/widgets/card-header). + * Represents a card header. For an example in Google Chat apps, see [Add a + * header](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_header). * [Google Workspace Add-ons and Chat * apps](https://developers.google.com/workspace/extend): * diff --git a/AppsChat/src/Card/V1/Card/Section.php b/AppsChat/src/Card/V1/Card/Section.php index 9bb28625feb5..67f9538f92b0 100644 --- a/AppsChat/src/Card/V1/Card/Section.php +++ b/AppsChat/src/Card/V1/Card/Section.php @@ -23,7 +23,7 @@ class Section extends \Google\Protobuf\Internal\Message * Supports simple HTML formatted text. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -74,7 +74,7 @@ class Section extends \Google\Protobuf\Internal\Message * Supports simple HTML formatted text. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -109,7 +109,7 @@ public function __construct($data = NULL) { * Supports simple HTML formatted text. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -128,7 +128,7 @@ public function getHeader() * Supports simple HTML formatted text. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace diff --git a/AppsChat/src/Card/V1/Columns.php b/AppsChat/src/Card/V1/Columns.php index f6368131029a..f2e8cff1b175 100644 --- a/AppsChat/src/Card/V1/Columns.php +++ b/AppsChat/src/Card/V1/Columns.php @@ -12,7 +12,8 @@ * The `Columns` widget displays up to 2 columns in a card or dialog. You can * add widgets to each column; the widgets appear in the order that they are * specified. For an example in Google Chat apps, see - * [Columns](https://developers.google.com/chat/ui/widgets/columns). + * [Display cards and dialogs in + * columns](https://developers.google.com/workspace/chat/format-structure-card-dialog#display_cards_and_dialogs_in_columns). * The height of each column is determined by the taller column. For example, if * the first column is taller than the second column, both columns have the * height of the first column. Because each column can contain a different @@ -32,7 +33,7 @@ * [Google Workspace Add-ons and Chat * apps](https://developers.google.com/workspace/extend): * Columns for Google Workspace Add-ons are in - * [Developer Preview](https://developers.google.com/workspace/preview). + * Developer Preview. * * Generated from protobuf message google.apps.card.v1.Columns */ diff --git a/AppsChat/src/Card/V1/Columns/Column.php b/AppsChat/src/Card/V1/Columns/Column.php index 7d877a859253..e53399f551df 100644 --- a/AppsChat/src/Card/V1/Columns/Column.php +++ b/AppsChat/src/Card/V1/Columns/Column.php @@ -10,7 +10,10 @@ /** * A column. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Workspace Add-ons and Chat + * apps](https://developers.google.com/workspace/extend): + * Columns for Google Workspace Add-ons are in + * Developer Preview. * * Generated from protobuf message google.apps.card.v1.Columns.Column */ @@ -18,7 +21,6 @@ class Column extends \Google\Protobuf\Internal\Message { /** * Specifies how a column fills the width of the card. - * [Google Chat apps](https://developers.google.com/chat): * * Generated from protobuf field .google.apps.card.v1.Columns.Column.HorizontalSizeStyle horizontal_size_style = 1; */ @@ -33,7 +35,6 @@ class Column extends \Google\Protobuf\Internal\Message /** * Specifies whether widgets align to the top, bottom, or center of a * column. - * [Google Chat apps](https://developers.google.com/chat): * * Generated from protobuf field .google.apps.card.v1.Columns.Column.VerticalAlignment vertical_alignment = 3; */ @@ -54,14 +55,12 @@ class Column extends \Google\Protobuf\Internal\Message * * @type int $horizontal_size_style * Specifies how a column fills the width of the card. - * [Google Chat apps](https://developers.google.com/chat): * @type int $horizontal_alignment * Specifies whether widgets align to the left, right, or center of a * column. * @type int $vertical_alignment * Specifies whether widgets align to the top, bottom, or center of a * column. - * [Google Chat apps](https://developers.google.com/chat): * @type array<\Google\Apps\Card\V1\Columns\Column\Widgets>|\Google\Protobuf\Internal\RepeatedField $widgets * An array of widgets included in a column. Widgets appear in the order * that they are specified. @@ -74,7 +73,6 @@ public function __construct($data = NULL) { /** * Specifies how a column fills the width of the card. - * [Google Chat apps](https://developers.google.com/chat): * * Generated from protobuf field .google.apps.card.v1.Columns.Column.HorizontalSizeStyle horizontal_size_style = 1; * @return int @@ -86,7 +84,6 @@ public function getHorizontalSizeStyle() /** * Specifies how a column fills the width of the card. - * [Google Chat apps](https://developers.google.com/chat): * * Generated from protobuf field .google.apps.card.v1.Columns.Column.HorizontalSizeStyle horizontal_size_style = 1; * @param int $var @@ -131,7 +128,6 @@ public function setHorizontalAlignment($var) /** * Specifies whether widgets align to the top, bottom, or center of a * column. - * [Google Chat apps](https://developers.google.com/chat): * * Generated from protobuf field .google.apps.card.v1.Columns.Column.VerticalAlignment vertical_alignment = 3; * @return int @@ -144,7 +140,6 @@ public function getVerticalAlignment() /** * Specifies whether widgets align to the top, bottom, or center of a * column. - * [Google Chat apps](https://developers.google.com/chat): * * Generated from protobuf field .google.apps.card.v1.Columns.Column.VerticalAlignment vertical_alignment = 3; * @param int $var diff --git a/AppsChat/src/Card/V1/Columns/Column/HorizontalSizeStyle.php b/AppsChat/src/Card/V1/Columns/Column/HorizontalSizeStyle.php index aae55afdd1f6..a09691dc7bb8 100644 --- a/AppsChat/src/Card/V1/Columns/Column/HorizontalSizeStyle.php +++ b/AppsChat/src/Card/V1/Columns/Column/HorizontalSizeStyle.php @@ -10,7 +10,10 @@ * Specifies how a column fills the width of the card. The width of each * column depends on both the `HorizontalSizeStyle` and the width of the * widgets within the column. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Workspace Add-ons and Chat + * apps](https://developers.google.com/workspace/extend): + * Columns for Google Workspace Add-ons are in + * Developer Preview. * * Protobuf type google.apps.card.v1.Columns.Column.HorizontalSizeStyle */ diff --git a/AppsChat/src/Card/V1/Columns/Column/VerticalAlignment.php b/AppsChat/src/Card/V1/Columns/Column/VerticalAlignment.php index be17080af577..5418be763e9b 100644 --- a/AppsChat/src/Card/V1/Columns/Column/VerticalAlignment.php +++ b/AppsChat/src/Card/V1/Columns/Column/VerticalAlignment.php @@ -9,7 +9,10 @@ /** * Specifies whether widgets align to the top, bottom, or center of a * column. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Workspace Add-ons and Chat + * apps](https://developers.google.com/workspace/extend): + * Columns for Google Workspace Add-ons are in + * Developer Preview. * * Protobuf type google.apps.card.v1.Columns.Column.VerticalAlignment */ diff --git a/AppsChat/src/Card/V1/Columns/Column/Widgets.php b/AppsChat/src/Card/V1/Columns/Column/Widgets.php index 8bc7a0d98f27..c543b1b57682 100644 --- a/AppsChat/src/Card/V1/Columns/Column/Widgets.php +++ b/AppsChat/src/Card/V1/Columns/Column/Widgets.php @@ -10,7 +10,10 @@ /** * The supported widgets that you can include in a column. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Workspace Add-ons and Chat + * apps](https://developers.google.com/workspace/extend): + * Columns for Google Workspace Add-ons are in + * Developer Preview. * * Generated from protobuf message google.apps.card.v1.Columns.Column.Widgets */ diff --git a/AppsChat/src/Card/V1/DateTimePicker.php b/AppsChat/src/Card/V1/DateTimePicker.php index 0c485997e47a..324bcac7ae7c 100644 --- a/AppsChat/src/Card/V1/DateTimePicker.php +++ b/AppsChat/src/Card/V1/DateTimePicker.php @@ -10,8 +10,8 @@ /** * Lets users input a date, a time, or both a date and a time. For an example in - * Google Chat apps, see [Date time - * picker](https://developers.google.com/chat/ui/widgets/date-time-picker). + * Google Chat apps, see [Let a user pick a date and + * time](https://developers.google.com/workspace/chat/design-interactive-card-dialog#let_a_user_pick_a_date_and_time). * Users can input text or use the picker to select dates and times. If users * input an invalid date or time, the picker shows an error that prompts users * to input the information correctly. @@ -25,7 +25,7 @@ class DateTimePicker extends \Google\Protobuf\Internal\Message /** * The name by which the `DateTimePicker` is identified in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string name = 1; */ @@ -83,7 +83,7 @@ class DateTimePicker extends \Google\Protobuf\Internal\Message * @type string $name * The name by which the `DateTimePicker` is identified in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * @type string $label * The text that prompts users to input a date, a time, or a date and time. * For example, if users are scheduling an appointment, use a label such as @@ -117,7 +117,7 @@ public function __construct($data = NULL) { /** * The name by which the `DateTimePicker` is identified in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string name = 1; * @return string @@ -130,7 +130,7 @@ public function getName() /** * The name by which the `DateTimePicker` is identified in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string name = 1; * @param string $var diff --git a/AppsChat/src/Card/V1/DecoratedText.php b/AppsChat/src/Card/V1/DecoratedText.php index fee632f71776..b8526ef893b8 100644 --- a/AppsChat/src/Card/V1/DecoratedText.php +++ b/AppsChat/src/Card/V1/DecoratedText.php @@ -12,8 +12,8 @@ * A widget that displays text with optional decorations such as a label above * or below the text, an icon in front of the text, a selection widget, or a * button after the text. For an example in - * Google Chat apps, see [Decorated - * text](https://developers.google.com/chat/ui/widgets/decorated-text). + * Google Chat apps, see [Display text with decorative + * text](https://developers.google.com/workspace/chat/add-text-image-card-dialog#display_text_with_decorative_elements). * [Google Workspace Add-ons and Chat * apps](https://developers.google.com/workspace/extend): * @@ -45,7 +45,7 @@ class DecoratedText extends \Google\Protobuf\Internal\Message * Supports simple formatting. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -93,7 +93,7 @@ class DecoratedText extends \Google\Protobuf\Internal\Message * Supports simple formatting. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -114,9 +114,9 @@ class DecoratedText extends \Google\Protobuf\Internal\Message * @type \Google\Apps\Card\V1\Icon $end_icon * An icon displayed after the text. * Supports - * [built-in](https://developers.google.com/chat/format-messages#builtinicons) + * [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) * and - * [custom](https://developers.google.com/chat/format-messages#customicons) + * [custom](https://developers.google.com/workspace/chat/format-messages#customicons) * icons. * } */ @@ -234,7 +234,7 @@ public function setTopLabel($var) * Supports simple formatting. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -253,7 +253,7 @@ public function getText() * Supports simple formatting. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -430,9 +430,9 @@ public function setSwitchControl($var) /** * An icon displayed after the text. * Supports - * [built-in](https://developers.google.com/chat/format-messages#builtinicons) + * [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) * and - * [custom](https://developers.google.com/chat/format-messages#customicons) + * [custom](https://developers.google.com/workspace/chat/format-messages#customicons) * icons. * * Generated from protobuf field .google.apps.card.v1.Icon end_icon = 11; @@ -451,9 +451,9 @@ public function hasEndIcon() /** * An icon displayed after the text. * Supports - * [built-in](https://developers.google.com/chat/format-messages#builtinicons) + * [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) * and - * [custom](https://developers.google.com/chat/format-messages#customicons) + * [custom](https://developers.google.com/workspace/chat/format-messages#customicons) * icons. * * Generated from protobuf field .google.apps.card.v1.Icon end_icon = 11; diff --git a/AppsChat/src/Card/V1/DecoratedText/SwitchControl.php b/AppsChat/src/Card/V1/DecoratedText/SwitchControl.php index 6fc9109c4e15..36934fcc38aa 100644 --- a/AppsChat/src/Card/V1/DecoratedText/SwitchControl.php +++ b/AppsChat/src/Card/V1/DecoratedText/SwitchControl.php @@ -21,7 +21,7 @@ class SwitchControl extends \Google\Protobuf\Internal\Message /** * The name by which the switch widget is identified in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string name = 1; */ @@ -29,7 +29,7 @@ class SwitchControl extends \Google\Protobuf\Internal\Message /** * The value entered by a user, returned as part of a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string value = 2; */ @@ -65,11 +65,11 @@ class SwitchControl extends \Google\Protobuf\Internal\Message * @type string $name * The name by which the switch widget is identified in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * @type string $value * The value entered by a user, returned as part of a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * @type bool $selected * When `true`, the switch is selected. * @type \Google\Apps\Card\V1\Action $on_change_action @@ -89,7 +89,7 @@ public function __construct($data = NULL) { /** * The name by which the switch widget is identified in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string name = 1; * @return string @@ -102,7 +102,7 @@ public function getName() /** * The name by which the switch widget is identified in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string name = 1; * @param string $var @@ -119,7 +119,7 @@ public function setName($var) /** * The value entered by a user, returned as part of a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string value = 2; * @return string @@ -132,7 +132,7 @@ public function getValue() /** * The value entered by a user, returned as part of a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string value = 2; * @param string $var diff --git a/AppsChat/src/Card/V1/Divider.php b/AppsChat/src/Card/V1/Divider.php index 58e09faf499f..302c3a2b4e4f 100644 --- a/AppsChat/src/Card/V1/Divider.php +++ b/AppsChat/src/Card/V1/Divider.php @@ -11,7 +11,8 @@ /** * Displays a divider between widgets as a horizontal line. For an example in * Google Chat apps, see - * [Divider](https://developers.google.com/chat/ui/widgets/divider). + * [Add a horizontal divider between + * widgets](https://developers.google.com/workspace/chat/format-structure-card-dialog#add_a_horizontal_divider_between_widgets). * [Google Workspace Add-ons and Chat * apps](https://developers.google.com/workspace/extend): * For example, the following JSON creates a divider: diff --git a/AppsChat/src/Card/V1/Grid.php b/AppsChat/src/Card/V1/Grid.php index 6134843c8b65..daf8a87f9278 100644 --- a/AppsChat/src/Card/V1/Grid.php +++ b/AppsChat/src/Card/V1/Grid.php @@ -12,7 +12,8 @@ * Displays a grid with a collection of items. Items can only include text or * images. For responsive columns, or to include more than text or images, use * [`Columns`][google.apps.card.v1.Columns]. For an example in Google Chat apps, - * see [Grid](https://developers.google.com/chat/ui/widgets/grid). + * see [Display a Grid with a collection of + * items](https://developers.google.com/workspace/chat/format-structure-card-dialog#display_a_grid_with_a_collection_of_items). * A grid supports any number of columns and items. The number of rows is * determined by items divided by columns. A grid with * 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns diff --git a/AppsChat/src/Card/V1/Icon.php b/AppsChat/src/Card/V1/Icon.php index 4089bd01b618..e3ef2178b1cb 100644 --- a/AppsChat/src/Card/V1/Icon.php +++ b/AppsChat/src/Card/V1/Icon.php @@ -10,11 +10,12 @@ /** * An icon displayed in a widget on a card. For an example in Google Chat apps, - * see [Icon](https://developers.google.com/chat/ui/widgets/icon). + * see [Add an + * icon](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon). * Supports - * [built-in](https://developers.google.com/chat/format-messages#builtinicons) + * [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) * and - * [custom](https://developers.google.com/chat/format-messages#customicons) + * [custom](https://developers.google.com/workspace/chat/format-messages#customicons) * icons. * [Google Workspace Add-ons and Chat * apps](https://developers.google.com/workspace/extend): @@ -29,7 +30,7 @@ class Icon extends \Google\Protobuf\Internal\Message * you should set a helpful description for what the icon displays, and if * applicable, what it does. For example, `A user's account portrait`, or * `Opens a new browser tab and navigates to the Google Chat developer - * documentation at https://developers.google.com/chat`. + * documentation at https://developers.google.com/workspace/chat`. * If the icon is set in a [`Button`][google.apps.card.v1.Button], the * `altText` appears as helper text when the user hovers over the button. * However, if the button also sets `text`, the icon's `altText` is ignored. @@ -58,22 +59,34 @@ class Icon extends \Google\Protobuf\Internal\Message * For example, to display an airplane icon, specify `AIRPLANE`. * For a bus, specify `BUS`. * For a full list of supported icons, see [built-in - * icons](https://developers.google.com/chat/format-messages#builtinicons). + * icons](https://developers.google.com/workspace/chat/format-messages#builtinicons). * @type string $icon_url * Display a custom icon hosted at an HTTPS URL. * For example: * ``` * "iconUrl": - * "https://developers.google.com/chat/images/quickstart-app-avatar.png" + * "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png" * ``` * Supported file types include `.png` and `.jpg`. + * @type \Google\Apps\Card\V1\MaterialIcon $material_icon + * Display one of the [Google Material + * Icons](https://fonts.google.com/icons). + * For example, to display a [checkbox + * icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048), + * use + * ``` + * "material_icon": { + * "name": "check_box" + * } + * ``` + * [Google Chat apps](https://developers.google.com/workspace/chat): * @type string $alt_text * Optional. A description of the icon used for accessibility. * If unspecified, the default value `Button` is provided. As a best practice, * you should set a helpful description for what the icon displays, and if * applicable, what it does. For example, `A user's account portrait`, or * `Opens a new browser tab and navigates to the Google Chat developer - * documentation at https://developers.google.com/chat`. + * documentation at https://developers.google.com/workspace/chat`. * If the icon is set in a [`Button`][google.apps.card.v1.Button], the * `altText` appears as helper text when the user hovers over the button. * However, if the button also sets `text`, the icon's `altText` is ignored. @@ -93,7 +106,7 @@ public function __construct($data = NULL) { * For example, to display an airplane icon, specify `AIRPLANE`. * For a bus, specify `BUS`. * For a full list of supported icons, see [built-in - * icons](https://developers.google.com/chat/format-messages#builtinicons). + * icons](https://developers.google.com/workspace/chat/format-messages#builtinicons). * * Generated from protobuf field string known_icon = 1; * @return string @@ -113,7 +126,7 @@ public function hasKnownIcon() * For example, to display an airplane icon, specify `AIRPLANE`. * For a bus, specify `BUS`. * For a full list of supported icons, see [built-in - * icons](https://developers.google.com/chat/format-messages#builtinicons). + * icons](https://developers.google.com/workspace/chat/format-messages#builtinicons). * * Generated from protobuf field string known_icon = 1; * @param string $var @@ -132,7 +145,7 @@ public function setKnownIcon($var) * For example: * ``` * "iconUrl": - * "https://developers.google.com/chat/images/quickstart-app-avatar.png" + * "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png" * ``` * Supported file types include `.png` and `.jpg`. * @@ -154,7 +167,7 @@ public function hasIconUrl() * For example: * ``` * "iconUrl": - * "https://developers.google.com/chat/images/quickstart-app-avatar.png" + * "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png" * ``` * Supported file types include `.png` and `.jpg`. * @@ -170,13 +183,64 @@ public function setIconUrl($var) return $this; } + /** + * Display one of the [Google Material + * Icons](https://fonts.google.com/icons). + * For example, to display a [checkbox + * icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048), + * use + * ``` + * "material_icon": { + * "name": "check_box" + * } + * ``` + * [Google Chat apps](https://developers.google.com/workspace/chat): + * + * Generated from protobuf field .google.apps.card.v1.MaterialIcon material_icon = 5; + * @return \Google\Apps\Card\V1\MaterialIcon|null + */ + public function getMaterialIcon() + { + return $this->readOneof(5); + } + + public function hasMaterialIcon() + { + return $this->hasOneof(5); + } + + /** + * Display one of the [Google Material + * Icons](https://fonts.google.com/icons). + * For example, to display a [checkbox + * icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048), + * use + * ``` + * "material_icon": { + * "name": "check_box" + * } + * ``` + * [Google Chat apps](https://developers.google.com/workspace/chat): + * + * Generated from protobuf field .google.apps.card.v1.MaterialIcon material_icon = 5; + * @param \Google\Apps\Card\V1\MaterialIcon $var + * @return $this + */ + public function setMaterialIcon($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Card\V1\MaterialIcon::class); + $this->writeOneof(5, $var); + + return $this; + } + /** * Optional. A description of the icon used for accessibility. * If unspecified, the default value `Button` is provided. As a best practice, * you should set a helpful description for what the icon displays, and if * applicable, what it does. For example, `A user's account portrait`, or * `Opens a new browser tab and navigates to the Google Chat developer - * documentation at https://developers.google.com/chat`. + * documentation at https://developers.google.com/workspace/chat`. * If the icon is set in a [`Button`][google.apps.card.v1.Button], the * `altText` appears as helper text when the user hovers over the button. * However, if the button also sets `text`, the icon's `altText` is ignored. @@ -195,7 +259,7 @@ public function getAltText() * you should set a helpful description for what the icon displays, and if * applicable, what it does. For example, `A user's account portrait`, or * `Opens a new browser tab and navigates to the Google Chat developer - * documentation at https://developers.google.com/chat`. + * documentation at https://developers.google.com/workspace/chat`. * If the icon is set in a [`Button`][google.apps.card.v1.Button], the * `altText` appears as helper text when the user hovers over the button. * However, if the button also sets `text`, the icon's `altText` is ignored. diff --git a/AppsChat/src/Card/V1/Image.php b/AppsChat/src/Card/V1/Image.php index a8c767deaecd..9cd6c58f1608 100644 --- a/AppsChat/src/Card/V1/Image.php +++ b/AppsChat/src/Card/V1/Image.php @@ -10,7 +10,8 @@ /** * An image that is specified by a URL and can have an `onClick` action. For an - * example, see [Image](https://developers.google.com/chat/ui/widgets/image). + * example, see [Add an + * image](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_image). * [Google Workspace Add-ons and Chat * apps](https://developers.google.com/workspace/extend): * @@ -22,7 +23,7 @@ class Image extends \Google\Protobuf\Internal\Message * The HTTPS URL that hosts the image. * For example: * ``` - * https://developers.google.com/chat/images/quickstart-app-avatar.png + * https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png * ``` * * Generated from protobuf field string image_url = 1; @@ -51,7 +52,7 @@ class Image extends \Google\Protobuf\Internal\Message * The HTTPS URL that hosts the image. * For example: * ``` - * https://developers.google.com/chat/images/quickstart-app-avatar.png + * https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png * ``` * @type \Google\Apps\Card\V1\OnClick $on_click * When a user clicks the image, the click triggers this action. @@ -68,7 +69,7 @@ public function __construct($data = NULL) { * The HTTPS URL that hosts the image. * For example: * ``` - * https://developers.google.com/chat/images/quickstart-app-avatar.png + * https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png * ``` * * Generated from protobuf field string image_url = 1; @@ -83,7 +84,7 @@ public function getImageUrl() * The HTTPS URL that hosts the image. * For example: * ``` - * https://developers.google.com/chat/images/quickstart-app-avatar.png + * https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png * ``` * * Generated from protobuf field string image_url = 1; diff --git a/AppsChat/src/Card/V1/MaterialIcon.php b/AppsChat/src/Card/V1/MaterialIcon.php new file mode 100644 index 000000000000..f37b5ed6e401 --- /dev/null +++ b/AppsChat/src/Card/V1/MaterialIcon.php @@ -0,0 +1,250 @@ +google.apps.card.v1.MaterialIcon + */ +class MaterialIcon extends \Google\Protobuf\Internal\Message +{ + /** + * The icon name defined in the [Google Material + * Icon](https://fonts.google.com/icons), for example, `check_box`. Any + * invalid names are abandoned and replaced with empty string and + * results in the icon failing to render. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Whether the icon renders as filled. Default value is false. + * To preview different icon settings, go to + * [Google Font Icons](https://fonts.google.com/icons) and adjust the + * settings under **Customize**. + * + * Generated from protobuf field bool fill = 2; + */ + protected $fill = false; + /** + * The stroke weight of the icon. Choose from {100, 200, 300, 400, + * 500, 600, 700}. If absent, default value is 400. If any other value is + * specified, the default value is used. + * To preview different icon settings, go to + * [Google Font Icons](https://fonts.google.com/icons) and adjust the + * settings under **Customize**. + * + * Generated from protobuf field int32 weight = 3; + */ + protected $weight = 0; + /** + * Weight and grade affect a symbol’s thickness. Adjustments to grade are more + * granular than adjustments to weight and have a small impact on the size of + * the symbol. Choose from {-25, 0, 200}. If absent, default value is 0. If + * any other value is specified, the default value is used. + * To preview different icon settings, go to + * [Google Font Icons](https://fonts.google.com/icons) and adjust the + * settings under **Customize**. + * + * Generated from protobuf field int32 grade = 4; + */ + protected $grade = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The icon name defined in the [Google Material + * Icon](https://fonts.google.com/icons), for example, `check_box`. Any + * invalid names are abandoned and replaced with empty string and + * results in the icon failing to render. + * @type bool $fill + * Whether the icon renders as filled. Default value is false. + * To preview different icon settings, go to + * [Google Font Icons](https://fonts.google.com/icons) and adjust the + * settings under **Customize**. + * @type int $weight + * The stroke weight of the icon. Choose from {100, 200, 300, 400, + * 500, 600, 700}. If absent, default value is 400. If any other value is + * specified, the default value is used. + * To preview different icon settings, go to + * [Google Font Icons](https://fonts.google.com/icons) and adjust the + * settings under **Customize**. + * @type int $grade + * Weight and grade affect a symbol’s thickness. Adjustments to grade are more + * granular than adjustments to weight and have a small impact on the size of + * the symbol. Choose from {-25, 0, 200}. If absent, default value is 0. If + * any other value is specified, the default value is used. + * To preview different icon settings, go to + * [Google Font Icons](https://fonts.google.com/icons) and adjust the + * settings under **Customize**. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Apps\Card\V1\Card::initOnce(); + parent::__construct($data); + } + + /** + * The icon name defined in the [Google Material + * Icon](https://fonts.google.com/icons), for example, `check_box`. Any + * invalid names are abandoned and replaced with empty string and + * results in the icon failing to render. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The icon name defined in the [Google Material + * Icon](https://fonts.google.com/icons), for example, `check_box`. Any + * invalid names are abandoned and replaced with empty string and + * results in the icon failing to render. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Whether the icon renders as filled. Default value is false. + * To preview different icon settings, go to + * [Google Font Icons](https://fonts.google.com/icons) and adjust the + * settings under **Customize**. + * + * Generated from protobuf field bool fill = 2; + * @return bool + */ + public function getFill() + { + return $this->fill; + } + + /** + * Whether the icon renders as filled. Default value is false. + * To preview different icon settings, go to + * [Google Font Icons](https://fonts.google.com/icons) and adjust the + * settings under **Customize**. + * + * Generated from protobuf field bool fill = 2; + * @param bool $var + * @return $this + */ + public function setFill($var) + { + GPBUtil::checkBool($var); + $this->fill = $var; + + return $this; + } + + /** + * The stroke weight of the icon. Choose from {100, 200, 300, 400, + * 500, 600, 700}. If absent, default value is 400. If any other value is + * specified, the default value is used. + * To preview different icon settings, go to + * [Google Font Icons](https://fonts.google.com/icons) and adjust the + * settings under **Customize**. + * + * Generated from protobuf field int32 weight = 3; + * @return int + */ + public function getWeight() + { + return $this->weight; + } + + /** + * The stroke weight of the icon. Choose from {100, 200, 300, 400, + * 500, 600, 700}. If absent, default value is 400. If any other value is + * specified, the default value is used. + * To preview different icon settings, go to + * [Google Font Icons](https://fonts.google.com/icons) and adjust the + * settings under **Customize**. + * + * Generated from protobuf field int32 weight = 3; + * @param int $var + * @return $this + */ + public function setWeight($var) + { + GPBUtil::checkInt32($var); + $this->weight = $var; + + return $this; + } + + /** + * Weight and grade affect a symbol’s thickness. Adjustments to grade are more + * granular than adjustments to weight and have a small impact on the size of + * the symbol. Choose from {-25, 0, 200}. If absent, default value is 0. If + * any other value is specified, the default value is used. + * To preview different icon settings, go to + * [Google Font Icons](https://fonts.google.com/icons) and adjust the + * settings under **Customize**. + * + * Generated from protobuf field int32 grade = 4; + * @return int + */ + public function getGrade() + { + return $this->grade; + } + + /** + * Weight and grade affect a symbol’s thickness. Adjustments to grade are more + * granular than adjustments to weight and have a small impact on the size of + * the symbol. Choose from {-25, 0, 200}. If absent, default value is 0. If + * any other value is specified, the default value is used. + * To preview different icon settings, go to + * [Google Font Icons](https://fonts.google.com/icons) and adjust the + * settings under **Customize**. + * + * Generated from protobuf field int32 grade = 4; + * @param int $var + * @return $this + */ + public function setGrade($var) + { + GPBUtil::checkInt32($var); + $this->grade = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Card/V1/SelectionInput.php b/AppsChat/src/Card/V1/SelectionInput.php index f226f4e03b64..8ae42a18e5d9 100644 --- a/AppsChat/src/Card/V1/SelectionInput.php +++ b/AppsChat/src/Card/V1/SelectionInput.php @@ -12,11 +12,11 @@ * A widget that creates one or more UI items that users can select. * For example, a dropdown menu or checkboxes. You can use this widget to * collect data that can be predicted or enumerated. For an example in Google - * Chat apps, see [Selection - * input](https://developers.google.com/chat/ui/widgets/selection-input). + * Chat apps, see [Add selectable UI + * elements](/workspace/chat/design-interactive-card-dialog#add_selectable_ui_elements). * Chat apps can process the value of items that users select or input. For * details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * To collect undefined or abstract data from users, use * the [TextInput][google.apps.card.v1.TextInput] widget. * [Google Workspace Add-ons @@ -29,7 +29,7 @@ class SelectionInput extends \Google\Protobuf\Internal\Message /** * The name that identifies the selection input in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string name = 1; */ @@ -64,7 +64,7 @@ class SelectionInput extends \Google\Protobuf\Internal\Message * If specified, the form is submitted when the selection changes. If not * specified, you must specify a separate button that submits the form. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 5; */ @@ -78,7 +78,7 @@ class SelectionInput extends \Google\Protobuf\Internal\Message protected $multi_select_max_selected_items = 0; /** * For multiselect menus, the number of text characters that a user inputs - * before the Chat app queries autocomplete and displays suggested items + * before the app queries autocomplete and displays suggested items * in the menu. * If unspecified, defaults to 0 characters for static data sources and 3 * characters for external data sources. @@ -97,7 +97,7 @@ class SelectionInput extends \Google\Protobuf\Internal\Message * @type string $name * The name that identifies the selection input in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * @type string $label * The text that appears above the selection input field in the user * interface. @@ -116,13 +116,13 @@ class SelectionInput extends \Google\Protobuf\Internal\Message * If specified, the form is submitted when the selection changes. If not * specified, you must specify a separate button that submits the form. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * @type int $multi_select_max_selected_items * For multiselect menus, the maximum number of items that a user can select. * Minimum value is 1 item. If unspecified, defaults to 3 items. * @type int $multi_select_min_query_length * For multiselect menus, the number of text characters that a user inputs - * before the Chat app queries autocomplete and displays suggested items + * before the app queries autocomplete and displays suggested items * in the menu. * If unspecified, defaults to 0 characters for static data sources and 3 * characters for external data sources. @@ -140,7 +140,7 @@ public function __construct($data = NULL) { /** * The name that identifies the selection input in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string name = 1; * @return string @@ -153,7 +153,7 @@ public function getName() /** * The name that identifies the selection input in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string name = 1; * @param string $var @@ -265,7 +265,7 @@ public function setItems($var) * If specified, the form is submitted when the selection changes. If not * specified, you must specify a separate button that submits the form. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 5; * @return \Google\Apps\Card\V1\Action|null @@ -289,7 +289,7 @@ public function clearOnChangeAction() * If specified, the form is submitted when the selection changes. If not * specified, you must specify a separate button that submits the form. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 5; * @param \Google\Apps\Card\V1\Action $var @@ -333,7 +333,7 @@ public function setMultiSelectMaxSelectedItems($var) /** * For multiselect menus, the number of text characters that a user inputs - * before the Chat app queries autocomplete and displays suggested items + * before the app queries autocomplete and displays suggested items * in the menu. * If unspecified, defaults to 0 characters for static data sources and 3 * characters for external data sources. @@ -348,7 +348,7 @@ public function getMultiSelectMinQueryLength() /** * For multiselect menus, the number of text characters that a user inputs - * before the Chat app queries autocomplete and displays suggested items + * before the app queries autocomplete and displays suggested items * in the menu. * If unspecified, defaults to 0 characters for static data sources and 3 * characters for external data sources. diff --git a/AppsChat/src/Card/V1/SelectionInput/PlatformDataSource.php b/AppsChat/src/Card/V1/SelectionInput/PlatformDataSource.php index d67d86938f94..c57b4ca69fec 100644 --- a/AppsChat/src/Card/V1/SelectionInput/PlatformDataSource.php +++ b/AppsChat/src/Card/V1/SelectionInput/PlatformDataSource.php @@ -13,7 +13,7 @@ * [`SelectionInput`][google.apps.card.v1.SelectionInput] widget that uses a * multiselect menu, a data source from Google Workspace. Used to populate * items in a multiselect menu. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Chat apps](https://developers.google.com/workspace/chat): * * Generated from protobuf message google.apps.card.v1.SelectionInput.PlatformDataSource */ diff --git a/AppsChat/src/Card/V1/SelectionInput/PlatformDataSource/CommonDataSource.php b/AppsChat/src/Card/V1/SelectionInput/PlatformDataSource/CommonDataSource.php index f55eb2a10f7c..cb9973e908a0 100644 --- a/AppsChat/src/Card/V1/SelectionInput/PlatformDataSource/CommonDataSource.php +++ b/AppsChat/src/Card/V1/SelectionInput/PlatformDataSource/CommonDataSource.php @@ -9,8 +9,8 @@ /** * A data source shared by all [Google Workspace * applications] - * (https://developers.google.com/chat/api/reference/rest/v1/HostApp). - * [Google Chat apps](https://developers.google.com/chat): + * (https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp). + * [Google Chat apps](https://developers.google.com/workspace/chat): * * Protobuf type google.apps.card.v1.SelectionInput.PlatformDataSource.CommonDataSource */ diff --git a/AppsChat/src/Card/V1/SelectionInput/SelectionItem.php b/AppsChat/src/Card/V1/SelectionInput/SelectionItem.php index 538614353a84..3ed2ba659cf9 100644 --- a/AppsChat/src/Card/V1/SelectionInput/SelectionItem.php +++ b/AppsChat/src/Card/V1/SelectionInput/SelectionItem.php @@ -28,7 +28,7 @@ class SelectionItem extends \Google\Protobuf\Internal\Message * The value associated with this item. The client should use this as a form * input value. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string value = 2; */ @@ -45,7 +45,7 @@ class SelectionItem extends \Google\Protobuf\Internal\Message * For multiselect menus, the URL for the icon displayed next to * the item's `text` field. Supports PNG and JPEG files. Must be an `HTTPS` * URL. For example, - * `https://developers.google.com/chat/images/quickstart-app-avatar.png`. + * `https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png`. * * Generated from protobuf field string start_icon_uri = 4; */ @@ -70,7 +70,7 @@ class SelectionItem extends \Google\Protobuf\Internal\Message * The value associated with this item. The client should use this as a form * input value. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * @type bool $selected * Whether the item is selected by default. If the selection input only * accepts one value (such as for radio buttons or a dropdown menu), only @@ -79,7 +79,7 @@ class SelectionItem extends \Google\Protobuf\Internal\Message * For multiselect menus, the URL for the icon displayed next to * the item's `text` field. Supports PNG and JPEG files. Must be an `HTTPS` * URL. For example, - * `https://developers.google.com/chat/images/quickstart-app-avatar.png`. + * `https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png`. * @type string $bottom_text * For multiselect menus, a text description or label that's * displayed below the item's `text` field. @@ -120,7 +120,7 @@ public function setText($var) * The value associated with this item. The client should use this as a form * input value. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string value = 2; * @return string @@ -134,7 +134,7 @@ public function getValue() * The value associated with this item. The client should use this as a form * input value. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string value = 2; * @param string $var @@ -182,7 +182,7 @@ public function setSelected($var) * For multiselect menus, the URL for the icon displayed next to * the item's `text` field. Supports PNG and JPEG files. Must be an `HTTPS` * URL. For example, - * `https://developers.google.com/chat/images/quickstart-app-avatar.png`. + * `https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png`. * * Generated from protobuf field string start_icon_uri = 4; * @return string @@ -196,7 +196,7 @@ public function getStartIconUri() * For multiselect menus, the URL for the icon displayed next to * the item's `text` field. Supports PNG and JPEG files. Must be an `HTTPS` * URL. For example, - * `https://developers.google.com/chat/images/quickstart-app-avatar.png`. + * `https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png`. * * Generated from protobuf field string start_icon_uri = 4; * @param string $var diff --git a/AppsChat/src/Card/V1/SelectionInput/SelectionType.php b/AppsChat/src/Card/V1/SelectionInput/SelectionType.php index ef97029033d3..1a84c939688c 100644 --- a/AppsChat/src/Card/V1/SelectionInput/SelectionType.php +++ b/AppsChat/src/Card/V1/SelectionInput/SelectionType.php @@ -56,13 +56,13 @@ class SelectionType * Workspace, such as Google Workspace users or Google Chat spaces. * * External data: Items are populated from an external data * source outside of Google Workspace. - * For examples of how to implement multiselect menus, see the - * [`SelectionInput` widget - * page](https://developers.google.com/chat/ui/widgets/selection-input#multiselect-menu). + * For examples of how to implement multiselect menus, see + * [Add a multiselect + * menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#multiselect-menu). * [Google Workspace Add-ons and Chat * apps](https://developers.google.com/workspace/extend): - * multiselect for Google Workspace Add-ons are in - * [Developer Preview](https://developers.google.com/workspace/preview). + * Multiselect for Google Workspace Add-ons are in + * Developer Preview. * * Generated from protobuf enum MULTI_SELECT = 4; */ diff --git a/AppsChat/src/Card/V1/TextInput.php b/AppsChat/src/Card/V1/TextInput.php index ad7a57ec4879..60c7cfbed1c4 100644 --- a/AppsChat/src/Card/V1/TextInput.php +++ b/AppsChat/src/Card/V1/TextInput.php @@ -10,11 +10,12 @@ /** * A field in which users can enter text. Supports suggestions and on-change - * actions. For an example in Google Chat apps, see [Text - * input](https://developers.google.com/chat/ui/widgets/text-input). + * actions. For an example in Google Chat apps, see [Add a field in which a user + * can enter + * text](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_field_in_which_a_user_can_enter_text). * Chat apps receive and can process the value of entered text during form input * events. For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * When you need to collect undefined or abstract data from users, * use a text input. To collect defined or enumerated data from users, use the * [SelectionInput][google.apps.card.v1.SelectionInput] widget. @@ -28,7 +29,7 @@ class TextInput extends \Google\Protobuf\Internal\Message /** * The name by which the text input is identified in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string name = 1; */ @@ -54,7 +55,7 @@ class TextInput extends \Google\Protobuf\Internal\Message /** * The value entered by a user, returned as part of a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string value = 4; */ @@ -70,7 +71,7 @@ class TextInput extends \Google\Protobuf\Internal\Message * What to do when a change occurs in the text input field. For example, a * user adding to the field or deleting text. * Examples of actions to take include running a custom function or opening - * a [dialog](https://developers.google.com/chat/how-tos/dialogs) + * a [dialog](https://developers.google.com/workspace/chat/dialogs) * in Google Chat. * * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 6; @@ -112,7 +113,7 @@ class TextInput extends \Google\Protobuf\Internal\Message * Text that appears in the text input field when the field is empty. * Use this text to prompt users to enter a value. For example, `Enter a * number from 0 to 100`. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Chat apps](https://developers.google.com/workspace/chat): * * Generated from protobuf field string placeholder_text = 12; */ @@ -127,7 +128,7 @@ class TextInput extends \Google\Protobuf\Internal\Message * @type string $name * The name by which the text input is identified in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * @type string $label * The text that appears above the text input field in the user interface. * Specify text that helps the user enter the information your app needs. @@ -141,7 +142,7 @@ class TextInput extends \Google\Protobuf\Internal\Message * @type string $value * The value entered by a user, returned as part of a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * @type int $type * How a text input field appears in the user interface. * For example, whether the field is single or multi-line. @@ -149,7 +150,7 @@ class TextInput extends \Google\Protobuf\Internal\Message * What to do when a change occurs in the text input field. For example, a * user adding to the field or deleting text. * Examples of actions to take include running a custom function or opening - * a [dialog](https://developers.google.com/chat/how-tos/dialogs) + * a [dialog](https://developers.google.com/workspace/chat/dialogs) * in Google Chat. * @type \Google\Apps\Card\V1\Suggestions $initial_suggestions * Suggested values that users can enter. These values appear when users click @@ -179,7 +180,7 @@ class TextInput extends \Google\Protobuf\Internal\Message * Text that appears in the text input field when the field is empty. * Use this text to prompt users to enter a value. For example, `Enter a * number from 0 to 100`. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Chat apps](https://developers.google.com/workspace/chat): * } */ public function __construct($data = NULL) { @@ -190,7 +191,7 @@ public function __construct($data = NULL) { /** * The name by which the text input is identified in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string name = 1; * @return string @@ -203,7 +204,7 @@ public function getName() /** * The name by which the text input is identified in a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string name = 1; * @param string $var @@ -284,7 +285,7 @@ public function setHintText($var) /** * The value entered by a user, returned as part of a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string value = 4; * @return string @@ -297,7 +298,7 @@ public function getValue() /** * The value entered by a user, returned as part of a form input event. * For details about working with form inputs, see [Receive form - * data](https://developers.google.com/chat/ui/read-form-data). + * data](https://developers.google.com/workspace/chat/read-form-data). * * Generated from protobuf field string value = 4; * @param string $var @@ -343,7 +344,7 @@ public function setType($var) * What to do when a change occurs in the text input field. For example, a * user adding to the field or deleting text. * Examples of actions to take include running a custom function or opening - * a [dialog](https://developers.google.com/chat/how-tos/dialogs) + * a [dialog](https://developers.google.com/workspace/chat/dialogs) * in Google Chat. * * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 6; @@ -368,7 +369,7 @@ public function clearOnChangeAction() * What to do when a change occurs in the text input field. For example, a * user adding to the field or deleting text. * Examples of actions to take include running a custom function or opening - * a [dialog](https://developers.google.com/chat/how-tos/dialogs) + * a [dialog](https://developers.google.com/workspace/chat/dialogs) * in Google Chat. * * Generated from protobuf field .google.apps.card.v1.Action on_change_action = 6; @@ -499,7 +500,7 @@ public function setAutoCompleteAction($var) * Text that appears in the text input field when the field is empty. * Use this text to prompt users to enter a value. For example, `Enter a * number from 0 to 100`. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Chat apps](https://developers.google.com/workspace/chat): * * Generated from protobuf field string placeholder_text = 12; * @return string @@ -513,7 +514,7 @@ public function getPlaceholderText() * Text that appears in the text input field when the field is empty. * Use this text to prompt users to enter a value. For example, `Enter a * number from 0 to 100`. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Chat apps](https://developers.google.com/workspace/chat): * * Generated from protobuf field string placeholder_text = 12; * @param string $var diff --git a/AppsChat/src/Card/V1/TextParagraph.php b/AppsChat/src/Card/V1/TextParagraph.php index b55fdf0da69e..029cb54e8a3c 100644 --- a/AppsChat/src/Card/V1/TextParagraph.php +++ b/AppsChat/src/Card/V1/TextParagraph.php @@ -10,12 +10,12 @@ /** * A paragraph of text that supports formatting. For an example in - * Google Chat apps, see [Text - * paragraph](https://developers.google.com/chat/ui/widgets/text-paragraph). + * Google Chat apps, see [Add a paragraph of formatted + * text](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_a_paragraph_of_formatted_text). * For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace diff --git a/AppsChat/src/Card/V1/Widget.php b/AppsChat/src/Card/V1/Widget.php index ee86c5de6591..9299d133d355 100644 --- a/AppsChat/src/Card/V1/Widget.php +++ b/AppsChat/src/Card/V1/Widget.php @@ -35,7 +35,7 @@ class Widget extends \Google\Protobuf\Internal\Message * Displays a text paragraph. Supports simple HTML formatted text. For more * information about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -52,7 +52,7 @@ class Widget extends \Google\Protobuf\Internal\Message * ``` * "image": { * "imageUrl": - * "https://developers.google.com/chat/images/quickstart-app-avatar.png", + * "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", * "altText": "Chat app avatar" * } * ``` @@ -282,7 +282,7 @@ public function __construct($data = NULL) { * Displays a text paragraph. Supports simple HTML formatted text. For more * information about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -311,7 +311,7 @@ public function hasTextParagraph() * Displays a text paragraph. Supports simple HTML formatted text. For more * information about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -341,7 +341,7 @@ public function setTextParagraph($var) * ``` * "image": { * "imageUrl": - * "https://developers.google.com/chat/images/quickstart-app-avatar.png", + * "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", * "altText": "Chat app avatar" * } * ``` @@ -365,7 +365,7 @@ public function hasImage() * ``` * "image": { * "imageUrl": - * "https://developers.google.com/chat/images/quickstart-app-avatar.png", + * "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", * "altText": "Chat app avatar" * } * ``` diff --git a/AppsChat/src/Card/V1/Widget/HorizontalAlignment.php b/AppsChat/src/Card/V1/Widget/HorizontalAlignment.php index 9fb56c2f051a..671c6ea5cf14 100644 --- a/AppsChat/src/Card/V1/Widget/HorizontalAlignment.php +++ b/AppsChat/src/Card/V1/Widget/HorizontalAlignment.php @@ -8,7 +8,7 @@ /** * Specifies whether widgets align to the left, right, or center of a column. - * [Google Chat apps](https://developers.google.com/chat): + * [Google Chat apps](https://developers.google.com/workspace/chat): * * Protobuf type google.apps.card.v1.Widget.HorizontalAlignment */ diff --git a/AppsChat/src/Chat/V1/AccessoryWidget.php b/AppsChat/src/Chat/V1/AccessoryWidget.php index e9fd8eebefea..f752a3ac9111 100644 --- a/AppsChat/src/Chat/V1/AccessoryWidget.php +++ b/AppsChat/src/Chat/V1/AccessoryWidget.php @@ -9,7 +9,9 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A borderless widget attached to the bottom of an app's message. + * One or more interactive widgets that appear at the bottom of a message. For + * details, see [Add interactive widgets at the bottom of a + * message](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets). * * Generated from protobuf message google.chat.v1.AccessoryWidget */ @@ -24,7 +26,7 @@ class AccessoryWidget extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Apps\Card\V1\ButtonList $button_list - * A list of buttons that are displayed under the message. + * A list of buttons. * } */ public function __construct($data = NULL) { @@ -33,7 +35,7 @@ public function __construct($data = NULL) { } /** - * A list of buttons that are displayed under the message. + * A list of buttons. * * Generated from protobuf field .google.apps.card.v1.ButtonList button_list = 1; * @return \Google\Apps\Card\V1\ButtonList|null @@ -49,7 +51,7 @@ public function hasButtonList() } /** - * A list of buttons that are displayed under the message. + * A list of buttons. * * Generated from protobuf field .google.apps.card.v1.ButtonList button_list = 1; * @param \Google\Apps\Card\V1\ButtonList $var diff --git a/AppsChat/src/Chat/V1/ActionResponse.php b/AppsChat/src/Chat/V1/ActionResponse.php index ff4e4f6015ee..ab29fb67f3d4 100644 --- a/AppsChat/src/Chat/V1/ActionResponse.php +++ b/AppsChat/src/Chat/V1/ActionResponse.php @@ -30,7 +30,7 @@ class ActionResponse extends \Google\Protobuf\Internal\Message protected $url = ''; /** * Input only. A response to an interaction event related to a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). Must be + * [dialog](https://developers.google.com/workspace/chat/dialogs). Must be * accompanied by `ResponseType.Dialog`. * * Generated from protobuf field .google.chat.v1.DialogAction dialog_action = 3 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -56,7 +56,7 @@ class ActionResponse extends \Google\Protobuf\Internal\Message * `REQUEST_CONFIG` response types.) * @type \Google\Apps\Chat\V1\DialogAction $dialog_action * Input only. A response to an interaction event related to a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). Must be + * [dialog](https://developers.google.com/workspace/chat/dialogs). Must be * accompanied by `ResponseType.Dialog`. * @type \Google\Apps\Chat\V1\ActionResponse\UpdatedWidget $updated_widget * Input only. The response of the updated widget. @@ -123,7 +123,7 @@ public function setUrl($var) /** * Input only. A response to an interaction event related to a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). Must be + * [dialog](https://developers.google.com/workspace/chat/dialogs). Must be * accompanied by `ResponseType.Dialog`. * * Generated from protobuf field .google.chat.v1.DialogAction dialog_action = 3 [(.google.api.field_behavior) = INPUT_ONLY]; @@ -146,7 +146,7 @@ public function clearDialogAction() /** * Input only. A response to an interaction event related to a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). Must be + * [dialog](https://developers.google.com/workspace/chat/dialogs). Must be * accompanied by `ResponseType.Dialog`. * * Generated from protobuf field .google.chat.v1.DialogAction dialog_action = 3 [(.google.api.field_behavior) = INPUT_ONLY]; diff --git a/AppsChat/src/Chat/V1/ActionResponse/ResponseType.php b/AppsChat/src/Chat/V1/ActionResponse/ResponseType.php index 5b38a65993da..0388bcef37bb 100644 --- a/AppsChat/src/Chat/V1/ActionResponse/ResponseType.php +++ b/AppsChat/src/Chat/V1/ActionResponse/ResponseType.php @@ -48,7 +48,7 @@ class ResponseType const REQUEST_CONFIG = 3; /** * Presents a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). + * [dialog](https://developers.google.com/workspace/chat/dialogs). * * Generated from protobuf enum DIALOG = 4; */ diff --git a/AppsChat/src/Chat/V1/ActionStatus.php b/AppsChat/src/Chat/V1/ActionStatus.php index 3e0ffca71e5b..687ef00ac63c 100644 --- a/AppsChat/src/Chat/V1/ActionStatus.php +++ b/AppsChat/src/Chat/V1/ActionStatus.php @@ -10,7 +10,7 @@ /** * Represents the status for a request to either invoke or submit a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). + * [dialog](https://developers.google.com/workspace/chat/dialogs). * * Generated from protobuf message google.chat.v1.ActionStatus */ diff --git a/AppsChat/src/Chat/V1/Annotation.php b/AppsChat/src/Chat/V1/Annotation.php index 9bc518c93032..7c9e10fdc422 100644 --- a/AppsChat/src/Chat/V1/Annotation.php +++ b/AppsChat/src/Chat/V1/Annotation.php @@ -12,7 +12,7 @@ * Output only. Annotations associated with the plain-text body of the message. * To add basic formatting to a text message, see * [Format text - * messages](https://developers.google.com/chat/format-messages). + * messages](https://developers.google.com/workspace/chat/format-messages). * Example plain-text message body: * ``` * Hello @FooBot how are you!" diff --git a/AppsChat/src/Chat/V1/Attachment/Source.php b/AppsChat/src/Chat/V1/Attachment/Source.php index ae7b2b2ecd02..3d86c29161cc 100644 --- a/AppsChat/src/Chat/V1/Attachment/Source.php +++ b/AppsChat/src/Chat/V1/Attachment/Source.php @@ -7,19 +7,27 @@ use UnexpectedValueException; /** + * The source of the attachment. + * * Protobuf type google.chat.v1.Attachment.Source */ class Source { /** + * Reserved. + * * Generated from protobuf enum SOURCE_UNSPECIFIED = 0; */ const SOURCE_UNSPECIFIED = 0; /** + * The file is a Google Drive file. + * * Generated from protobuf enum DRIVE_FILE = 1; */ const DRIVE_FILE = 1; /** + * The file is uploaded to Chat. + * * Generated from protobuf enum UPLOADED_CONTENT = 2; */ const UPLOADED_CONTENT = 2; diff --git a/AppsChat/src/Chat/V1/AttachmentDataRef.php b/AppsChat/src/Chat/V1/AttachmentDataRef.php index abf0fd8d9dfa..713e30068a9b 100644 --- a/AppsChat/src/Chat/V1/AttachmentDataRef.php +++ b/AppsChat/src/Chat/V1/AttachmentDataRef.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * A reference to the attachment data. + * * Generated from protobuf message google.chat.v1.AttachmentDataRef */ class AttachmentDataRef extends \Google\Protobuf\Internal\Message diff --git a/AppsChat/src/Chat/V1/CardWithId.php b/AppsChat/src/Chat/V1/CardWithId.php index a1a4231378d9..3d2235adb173 100644 --- a/AppsChat/src/Chat/V1/CardWithId.php +++ b/AppsChat/src/Chat/V1/CardWithId.php @@ -9,11 +9,12 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A [card](https://developers.google.com/chat/api/reference/rest/v1/cards) in a - * Google Chat message. + * A + * [card](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards) + * in a Google Chat message. * Only Chat apps can create cards. If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the message - * can't contain cards. + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the message can't contain cards. * [Card builder](https://addons.gsuite.google.com/uikit/builder) * * Generated from protobuf message google.chat.v1.CardWithId diff --git a/AppsChat/src/Chat/V1/Client/ChatServiceClient.php b/AppsChat/src/Chat/V1/Client/ChatServiceClient.php index 5eb5c1c36572..cfbe6d679e84 100644 --- a/AppsChat/src/Chat/V1/Client/ChatServiceClient.php +++ b/AppsChat/src/Chat/V1/Client/ChatServiceClient.php @@ -390,11 +390,11 @@ public function __call($method, $args) /** * Completes the - * [import process](https://developers.google.com/chat/api/guides/import-data) + * [import process](https://developers.google.com/workspace/chat/import-data) * for the specified space and makes it visible to users. * Requires app authentication and domain-wide delegation. For more * information, see [Authorize Google Chat apps to import - * data](https://developers.google.com/chat/api/guides/authorize-import). + * data](https://developers.google.com/workspace/chat/authorize-import). * * The async variant is {@see ChatServiceClient::completeImportSpaceAsync()} . * @@ -424,13 +424,13 @@ public function completeImportSpace( /** * Creates a human membership or app membership for the calling app. Creating * memberships for other apps isn't supported. For an example, see - * [ Create a - * membership](https://developers.google.com/chat/api/guides/v1/members/create). + * [Invite or add a user or a Google Chat app to a + * space](https://developers.google.com/workspace/chat/create-members). * When creating a membership, if the specified member has their auto-accept * policy turned off, then they're invited, and must accept the space * invitation before joining. Otherwise, creating a membership adds the member * directly to the specified space. Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * To specify the member to add, set the `membership.member.name` in the * `CreateMembershipRequest`: @@ -471,12 +471,12 @@ public function createMembership(CreateMembershipRequest $request, array $callOp } /** - * Creates a message in a Google Chat space. For an example, see [Create a - * message](https://developers.google.com/chat/api/guides/v1/messages/create). + * Creates a message in a Google Chat space. For an example, see [Send a + * message](https://developers.google.com/workspace/chat/create-messages). * * Calling this method requires - * [authentication](https://developers.google.com/chat/api/guides/auth) and - * supports the following authentication types: + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) + * and supports the following authentication types: * * - For text messages, user authentication or app authentication are * supported. @@ -507,12 +507,12 @@ public function createMessage(CreateMessageRequest $request, array $callOptions } /** - * Creates a reaction and adds it to a message. For an example, see - * [Create a - * reaction](https://developers.google.com/chat/api/guides/v1/reactions/create). + * Creates a reaction and adds it to a message. Only unicode emojis are + * supported. For an example, see + * [Add a reaction to a + * message](https://developers.google.com/workspace/chat/create-reactions). * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). - * Only unicode emoji are supported. + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * The async variant is {@see ChatServiceClient::createReactionAsync()} . * @@ -540,14 +540,14 @@ public function createReaction(CreateReactionRequest $request, array $callOption /** * Creates a named space. Spaces grouped by topics aren't supported. For an * example, see [Create a - * space](https://developers.google.com/chat/api/guides/v1/spaces/create). + * space](https://developers.google.com/workspace/chat/create-spaces). * * If you receive the error message `ALREADY_EXISTS` when creating * a space, try a different `displayName`. An existing space within * the Google Workspace organization might already use this display name. * * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * The async variant is {@see ChatServiceClient::createSpaceAsync()} . * @@ -574,11 +574,11 @@ public function createSpace(CreateSpaceRequest $request, array $callOptions = [] /** * Deletes a membership. For an example, see - * [Delete a - * membership](https://developers.google.com/chat/api/guides/v1/members/delete). + * [Remove a user or a Google Chat app from a + * space](https://developers.google.com/workspace/chat/delete-members). * * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * The async variant is {@see ChatServiceClient::deleteMembershipAsync()} . * @@ -606,15 +606,15 @@ public function deleteMembership(DeleteMembershipRequest $request, array $callOp /** * Deletes a message. * For an example, see [Delete a - * message](https://developers.google.com/chat/api/guides/v1/messages/delete). + * message](https://developers.google.com/workspace/chat/delete-messages). * * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). * Supports * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * When using app authentication, requests can only delete messages * created by the calling Chat app. * @@ -640,11 +640,12 @@ public function deleteMessage(DeleteMessageRequest $request, array $callOptions } /** - * Deletes a reaction to a message. For an example, see + * Deletes a reaction to a message. Only unicode emojis are supported. + * For an example, see * [Delete a - * reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete). + * reaction](https://developers.google.com/workspace/chat/delete-reactions). * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * The async variant is {@see ChatServiceClient::deleteReactionAsync()} . * @@ -672,9 +673,9 @@ public function deleteReaction(DeleteReactionRequest $request, array $callOption * that the space's child resources—like messages posted in the space and * memberships in the space—are also deleted. For an example, see * [Delete a - * space](https://developers.google.com/chat/api/guides/v1/spaces/delete). + * space](https://developers.google.com/workspace/chat/delete-spaces). * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) * from a user who has permission to delete the space. * * The async variant is {@see ChatServiceClient::deleteSpaceAsync()} . @@ -705,19 +706,19 @@ public function deleteSpace(DeleteSpaceRequest $request, array $callOptions = [] * [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). * * With [user - * authentication](https://developers.google.com/chat/api/guides/auth/users), + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), * returns the direct message space between the specified user and the * authenticated user. * * With [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), * returns the direct message space between the specified user and the calling * Chat app. * * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) * or [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * * The async variant is {@see ChatServiceClient::findDirectMessageAsync()} . * @@ -745,12 +746,12 @@ public function findDirectMessage(FindDirectMessageRequest $request, array $call /** * Gets the metadata of a message attachment. The attachment data is fetched * using the [media - * API](https://developers.google.com/chat/api/reference/rest/v1/media/download). + * API](https://developers.google.com/workspace/chat/api/reference/rest/v1/media/download). * For an example, see - * [Get a message - * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). + * [Get metadata about a message + * attachment](https://developers.google.com/workspace/chat/get-media-attachments). * Requires [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * * The async variant is {@see ChatServiceClient::getAttachmentAsync()} . * @@ -777,16 +778,16 @@ public function getAttachment(GetAttachmentRequest $request, array $callOptions /** * Returns details about a membership. For an example, see - * [Get a - * membership](https://developers.google.com/chat/api/guides/v1/members/get). + * [Get details about a user's or Google Chat app's + * membership](https://developers.google.com/workspace/chat/get-members). * * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). * Supports * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * The async variant is {@see ChatServiceClient::getMembershipAsync()} . * @@ -813,16 +814,16 @@ public function getMembership(GetMembershipRequest $request, array $callOptions /** * Returns details about a message. - * For an example, see [Read a - * message](https://developers.google.com/chat/api/guides/v1/messages/get). + * For an example, see [Get details about a + * message](https://developers.google.com/workspace/chat/get-messages). * * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). * Supports * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * Note: Might return a message from a blocked member or space. * @@ -851,15 +852,16 @@ public function getMessage(GetMessageRequest $request, array $callOptions = []): /** * Returns details about a space. For an example, see - * [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get). + * [Get details about a + * space](https://developers.google.com/workspace/chat/get-spaces). * * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). * Supports * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * The async variant is {@see ChatServiceClient::getSpaceAsync()} . * @@ -885,25 +887,25 @@ public function getSpace(GetSpaceRequest $request, array $callOptions = []): Spa } /** - * Lists memberships in a space. For an example, see [List - * memberships](https://developers.google.com/chat/api/guides/v1/members/list). - * Listing memberships with - * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * Lists memberships in a space. For an example, see [List users and Google + * Chat apps in a + * space](https://developers.google.com/workspace/chat/list-members). Listing + * memberships with [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * lists memberships in spaces that the Chat app has * access to, but excludes Chat app memberships, * including its own. Listing memberships with * [User - * authentication](https://developers.google.com/chat/api/guides/auth/users) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) * lists memberships in spaces that the authenticated user has access to. * * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). * Supports * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * The async variant is {@see ChatServiceClient::listMembershipsAsync()} . * @@ -933,7 +935,7 @@ public function listMemberships(ListMembershipsRequest $request, array $callOpti * messages from blocked members and spaces. For an example, see * [List messages](/chat/api/guides/v1/messages/list). * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * The async variant is {@see ChatServiceClient::listMessagesAsync()} . * @@ -960,10 +962,10 @@ public function listMessages(ListMessagesRequest $request, array $callOptions = /** * Lists reactions to a message. For an example, see - * [List - * reactions](https://developers.google.com/chat/api/guides/v1/reactions/list). + * [List reactions for a + * message](https://developers.google.com/workspace/chat/list-reactions). * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * The async variant is {@see ChatServiceClient::listReactionsAsync()} . * @@ -992,15 +994,15 @@ public function listReactions(ListReactionsRequest $request, array $callOptions * Lists spaces the caller is a member of. Group chats and DMs aren't listed * until the first message is sent. For an example, see * [List - * spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). + * spaces](https://developers.google.com/workspace/chat/list-spaces). * * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). * Supports * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * Lists spaces visible to the caller or authenticated user. Group chats * and DMs aren't listed until the first message is sent. @@ -1032,8 +1034,8 @@ public function listSpaces(ListSpacesRequest $request, array $callOptions = []): * Creates a space and adds specified users to it. The calling user is * automatically added to the space, and shouldn't be specified as a * membership in the request. For an example, see - * [Set up a - * space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). + * [Set up a space with initial + * members](https://developers.google.com/workspace/chat/set-up-spaces). * * To specify the human members to add, add memberships with the appropriate * `member.name` in the `SetUpSpaceRequest`. To add a human user, use @@ -1057,8 +1059,8 @@ public function listSpaces(ListSpacesRequest $request, array $callOptions = []): * can only use this method to set up a DM with the calling app. To add the * calling app as a member of a space or an existing DM between two human * users, see - * [create a - * membership](https://developers.google.com/chat/api/guides/v1/members/create). + * [Invite or add a user or app to a + * space](https://developers.google.com/workspace/chat/create-members). * * If a DM already exists between two users, even when one user blocks the * other at the time a request is made, then the existing DM is returned. @@ -1069,7 +1071,7 @@ public function listSpaces(ListSpacesRequest $request, array $callOptions = []): * might already use this display name. * * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * The async variant is {@see ChatServiceClient::setUpSpaceAsync()} . * @@ -1100,15 +1102,15 @@ public function setUpSpace(SetUpSpaceRequest $request, array $callOptions = []): * method uses a `patch` request while the `update` method uses a `put` * request. We recommend using the `patch` method. For an example, see * [Update a - * message](https://developers.google.com/chat/api/guides/v1/messages/update). + * message](https://developers.google.com/workspace/chat/update-messages). * * Requires - * [authentication](https://developers.google.com/chat/api/guides/auth). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). * Supports * [app - * authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) * and [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * When using app authentication, requests can only update messages * created by the calling Chat app. * @@ -1138,14 +1140,14 @@ public function updateMessage(UpdateMessageRequest $request, array $callOptions /** * Updates a space. For an example, see * [Update a - * space](https://developers.google.com/chat/api/guides/v1/spaces/update). + * space](https://developers.google.com/workspace/chat/update-spaces). * * If you're updating the `displayName` field and receive the error message * `ALREADY_EXISTS`, try a different display name.. An existing space within * the Google Workspace organization might already use this display name. * * Requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * The async variant is {@see ChatServiceClient::updateSpaceAsync()} . * @@ -1173,9 +1175,9 @@ public function updateSpace(UpdateSpaceRequest $request, array $callOptions = [] /** * Uploads an attachment. For an example, see * [Upload media as a file - * attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload). + * attachment](https://developers.google.com/workspace/chat/upload-media-attachments). * Requires user - * [authentication](https://developers.google.com/chat/api/guides/auth/users). + * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * You can upload attachments up to 200 MB. Certain file types aren't * supported. For details, see [File types blocked by Google diff --git a/AppsChat/src/Chat/V1/CompleteImportSpaceResponse.php b/AppsChat/src/Chat/V1/CompleteImportSpaceResponse.php index ba11ebfe4fec..500dcf0d0fe4 100644 --- a/AppsChat/src/Chat/V1/CompleteImportSpaceResponse.php +++ b/AppsChat/src/Chat/V1/CompleteImportSpaceResponse.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Response message for completing the import process for a space. + * * Generated from protobuf message google.chat.v1.CompleteImportSpaceResponse */ class CompleteImportSpaceResponse extends \Google\Protobuf\Internal\Message diff --git a/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/Section.php b/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/Section.php index a625a570b0c5..e6039ce3f556 100644 --- a/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/Section.php +++ b/AppsChat/src/Chat/V1/ContextualAddOnMarkup/Card/Section.php @@ -23,7 +23,7 @@ class Section extends \Google\Protobuf\Internal\Message * supported. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -50,7 +50,7 @@ class Section extends \Google\Protobuf\Internal\Message * supported. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -69,7 +69,7 @@ public function __construct($data = NULL) { * supported. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -88,7 +88,7 @@ public function getHeader() * supported. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace diff --git a/AppsChat/src/Chat/V1/CreateMembershipRequest.php b/AppsChat/src/Chat/V1/CreateMembershipRequest.php index 010da124cbf0..49c50f44ed88 100644 --- a/AppsChat/src/Chat/V1/CreateMembershipRequest.php +++ b/AppsChat/src/Chat/V1/CreateMembershipRequest.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Request message for creating a membership. + * * Generated from protobuf message google.chat.v1.CreateMembershipRequest */ class CreateMembershipRequest extends \Google\Protobuf\Internal\Message diff --git a/AppsChat/src/Chat/V1/CreateMessageRequest.php b/AppsChat/src/Chat/V1/CreateMessageRequest.php index 06b6b8d756f4..e90a569bc416 100644 --- a/AppsChat/src/Chat/V1/CreateMessageRequest.php +++ b/AppsChat/src/Chat/V1/CreateMessageRequest.php @@ -35,7 +35,7 @@ class CreateMessageRequest extends \Google\Protobuf\Internal\Message * a message and specify a `threadKey` or the * [thread.name][google.chat.v1.Thread.name]. For example usage, see [Start or * reply to a message - * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). * * Generated from protobuf field string thread_key = 6 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * @deprecated @@ -68,7 +68,7 @@ class CreateMessageRequest extends \Google\Protobuf\Internal\Message * * Is unique within a space. A Chat app can't use the same custom ID for * different messages. * For details, see [Name a - * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string message_id = 9 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -94,7 +94,7 @@ class CreateMessageRequest extends \Google\Protobuf\Internal\Message * different messages. * * For details, see [Name a - * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * @return \Google\Apps\Chat\V1\CreateMessageRequest * @@ -126,7 +126,7 @@ public static function build(string $parent, \Google\Apps\Chat\V1\Message $messa * a message and specify a `threadKey` or the * [thread.name][google.chat.v1.Thread.name]. For example usage, see [Start or * reply to a message - * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). * @type string $request_id * Optional. A unique request ID for this message. Specifying an existing * request ID returns the message created with that ID instead of creating a @@ -146,7 +146,7 @@ public static function build(string $parent, \Google\Apps\Chat\V1\Message $messa * * Is unique within a space. A Chat app can't use the same custom ID for * different messages. * For details, see [Name a - * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * } */ public function __construct($data = NULL) { @@ -225,7 +225,7 @@ public function setMessage($var) * a message and specify a `threadKey` or the * [thread.name][google.chat.v1.Thread.name]. For example usage, see [Start or * reply to a message - * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). * * Generated from protobuf field string thread_key = 6 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * @return string @@ -244,7 +244,7 @@ public function getThreadKey() * a message and specify a `threadKey` or the * [thread.name][google.chat.v1.Thread.name]. For example usage, see [Start or * reply to a message - * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). * * Generated from protobuf field string thread_key = 6 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * @param string $var @@ -330,7 +330,7 @@ public function setMessageReplyOption($var) * * Is unique within a space. A Chat app can't use the same custom ID for * different messages. * For details, see [Name a - * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string message_id = 9 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -352,7 +352,7 @@ public function getMessageId() * * Is unique within a space. A Chat app can't use the same custom ID for * different messages. * For details, see [Name a - * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string message_id = 9 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/AppsChat/src/Chat/V1/CreateSpaceRequest.php b/AppsChat/src/Chat/V1/CreateSpaceRequest.php index a5e5f59870ca..6de66b3cff27 100644 --- a/AppsChat/src/Chat/V1/CreateSpaceRequest.php +++ b/AppsChat/src/Chat/V1/CreateSpaceRequest.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * A request to create a named space. + * * Generated from protobuf message google.chat.v1.CreateSpaceRequest */ class CreateSpaceRequest extends \Google\Protobuf\Internal\Message diff --git a/AppsChat/src/Chat/V1/DeleteMembershipRequest.php b/AppsChat/src/Chat/V1/DeleteMembershipRequest.php index 596d7060d7f4..9861837902c8 100644 --- a/AppsChat/src/Chat/V1/DeleteMembershipRequest.php +++ b/AppsChat/src/Chat/V1/DeleteMembershipRequest.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Request to delete a membership in a space. + * * Generated from protobuf message google.chat.v1.DeleteMembershipRequest */ class DeleteMembershipRequest extends \Google\Protobuf\Internal\Message diff --git a/AppsChat/src/Chat/V1/DeleteMessageRequest.php b/AppsChat/src/Chat/V1/DeleteMessageRequest.php index 0fdd22bab913..37cb2a3434f7 100644 --- a/AppsChat/src/Chat/V1/DeleteMessageRequest.php +++ b/AppsChat/src/Chat/V1/DeleteMessageRequest.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Request to delete a message. + * * Generated from protobuf message google.chat.v1.DeleteMessageRequest */ class DeleteMessageRequest extends \Google\Protobuf\Internal\Message @@ -19,7 +21,7 @@ class DeleteMessageRequest extends \Google\Protobuf\Internal\Message * If you've set a custom ID for your message, you can use the value from the * `clientAssignedMessageId` field for `{message}`. For details, see [Name a * message] - * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -28,9 +30,9 @@ class DeleteMessageRequest extends \Google\Protobuf\Internal\Message * When `true`, deleting a message also deletes its threaded replies. When * `false`, if a message has threaded replies, deletion fails. * Only applies when [authenticating as a - * user](https://developers.google.com/chat/api/guides/auth/users). Has no - * effect when [authenticating as a Chat app] - * (https://developers.google.com/chat/api/guides/auth/service-accounts). + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * Has no effect when [authenticating as a Chat app] + * (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * * Generated from protobuf field bool force = 2; */ @@ -44,7 +46,7 @@ class DeleteMessageRequest extends \Google\Protobuf\Internal\Message * If you've set a custom ID for your message, you can use the value from the * `clientAssignedMessageId` field for `{message}`. For details, see [Name a * message] - * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). Please see + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). Please see * {@see ChatServiceClient::messageName()} for help formatting this field. * * @return \Google\Apps\Chat\V1\DeleteMessageRequest @@ -69,14 +71,14 @@ public static function build(string $name): self * If you've set a custom ID for your message, you can use the value from the * `clientAssignedMessageId` field for `{message}`. For details, see [Name a * message] - * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * @type bool $force * When `true`, deleting a message also deletes its threaded replies. When * `false`, if a message has threaded replies, deletion fails. * Only applies when [authenticating as a - * user](https://developers.google.com/chat/api/guides/auth/users). Has no - * effect when [authenticating as a Chat app] - * (https://developers.google.com/chat/api/guides/auth/service-accounts). + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * Has no effect when [authenticating as a Chat app] + * (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * } */ public function __construct($data = NULL) { @@ -90,7 +92,7 @@ public function __construct($data = NULL) { * If you've set a custom ID for your message, you can use the value from the * `clientAssignedMessageId` field for `{message}`. For details, see [Name a * message] - * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -106,7 +108,7 @@ public function getName() * If you've set a custom ID for your message, you can use the value from the * `clientAssignedMessageId` field for `{message}`. For details, see [Name a * message] - * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var @@ -124,9 +126,9 @@ public function setName($var) * When `true`, deleting a message also deletes its threaded replies. When * `false`, if a message has threaded replies, deletion fails. * Only applies when [authenticating as a - * user](https://developers.google.com/chat/api/guides/auth/users). Has no - * effect when [authenticating as a Chat app] - * (https://developers.google.com/chat/api/guides/auth/service-accounts). + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * Has no effect when [authenticating as a Chat app] + * (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * * Generated from protobuf field bool force = 2; * @return bool @@ -140,9 +142,9 @@ public function getForce() * When `true`, deleting a message also deletes its threaded replies. When * `false`, if a message has threaded replies, deletion fails. * Only applies when [authenticating as a - * user](https://developers.google.com/chat/api/guides/auth/users). Has no - * effect when [authenticating as a Chat app] - * (https://developers.google.com/chat/api/guides/auth/service-accounts). + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * Has no effect when [authenticating as a Chat app] + * (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * * Generated from protobuf field bool force = 2; * @param bool $var diff --git a/AppsChat/src/Chat/V1/DialogAction.php b/AppsChat/src/Chat/V1/DialogAction.php index 3b0653745886..381110a1278f 100644 --- a/AppsChat/src/Chat/V1/DialogAction.php +++ b/AppsChat/src/Chat/V1/DialogAction.php @@ -10,7 +10,7 @@ /** * Contains a - * [dialog](https://developers.google.com/chat/how-tos/dialogs) and request + * [dialog](https://developers.google.com/workspace/chat/dialogs) and request * status code. * * Generated from protobuf message google.chat.v1.DialogAction @@ -19,7 +19,7 @@ class DialogAction extends \Google\Protobuf\Internal\Message { /** * Input only. Status for a request to either invoke or submit a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). Displays + * [dialog](https://developers.google.com/workspace/chat/dialogs). Displays * a status and message to users, if necessary. * For example, in case of an error or success. * @@ -35,11 +35,12 @@ class DialogAction extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Apps\Chat\V1\Dialog $dialog - * Input only. [Dialog](https://developers.google.com/chat/how-tos/dialogs) - * for the request. + * Input only. + * [Dialog](https://developers.google.com/workspace/chat/dialogs) for the + * request. * @type \Google\Apps\Chat\V1\ActionStatus $action_status * Input only. Status for a request to either invoke or submit a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). Displays + * [dialog](https://developers.google.com/workspace/chat/dialogs). Displays * a status and message to users, if necessary. * For example, in case of an error or success. * } @@ -50,8 +51,9 @@ public function __construct($data = NULL) { } /** - * Input only. [Dialog](https://developers.google.com/chat/how-tos/dialogs) - * for the request. + * Input only. + * [Dialog](https://developers.google.com/workspace/chat/dialogs) for the + * request. * * Generated from protobuf field .google.chat.v1.Dialog dialog = 1 [(.google.api.field_behavior) = INPUT_ONLY]; * @return \Google\Apps\Chat\V1\Dialog|null @@ -67,8 +69,9 @@ public function hasDialog() } /** - * Input only. [Dialog](https://developers.google.com/chat/how-tos/dialogs) - * for the request. + * Input only. + * [Dialog](https://developers.google.com/workspace/chat/dialogs) for the + * request. * * Generated from protobuf field .google.chat.v1.Dialog dialog = 1 [(.google.api.field_behavior) = INPUT_ONLY]; * @param \Google\Apps\Chat\V1\Dialog $var @@ -84,7 +87,7 @@ public function setDialog($var) /** * Input only. Status for a request to either invoke or submit a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). Displays + * [dialog](https://developers.google.com/workspace/chat/dialogs). Displays * a status and message to users, if necessary. * For example, in case of an error or success. * @@ -108,7 +111,7 @@ public function clearActionStatus() /** * Input only. Status for a request to either invoke or submit a - * [dialog](https://developers.google.com/chat/how-tos/dialogs). Displays + * [dialog](https://developers.google.com/workspace/chat/dialogs). Displays * a status and message to users, if necessary. * For example, in case of an error or success. * diff --git a/AppsChat/src/Chat/V1/DriveLinkData.php b/AppsChat/src/Chat/V1/DriveLinkData.php index 4693e82450fc..f27cfb2631df 100644 --- a/AppsChat/src/Chat/V1/DriveLinkData.php +++ b/AppsChat/src/Chat/V1/DriveLinkData.php @@ -17,7 +17,7 @@ class DriveLinkData extends \Google\Protobuf\Internal\Message { /** * A - * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) + * [DriveDataRef](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) * which references a Google Drive file. * * Generated from protobuf field .google.chat.v1.DriveDataRef drive_data_ref = 1; @@ -38,7 +38,7 @@ class DriveLinkData extends \Google\Protobuf\Internal\Message * * @type \Google\Apps\Chat\V1\DriveDataRef $drive_data_ref * A - * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) + * [DriveDataRef](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) * which references a Google Drive file. * @type string $mime_type * The mime type of the linked Google Drive resource. @@ -51,7 +51,7 @@ public function __construct($data = NULL) { /** * A - * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) + * [DriveDataRef](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) * which references a Google Drive file. * * Generated from protobuf field .google.chat.v1.DriveDataRef drive_data_ref = 1; @@ -74,7 +74,7 @@ public function clearDriveDataRef() /** * A - * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) + * [DriveDataRef](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) * which references a Google Drive file. * * Generated from protobuf field .google.chat.v1.DriveDataRef drive_data_ref = 1; diff --git a/AppsChat/src/Chat/V1/FindDirectMessageRequest.php b/AppsChat/src/Chat/V1/FindDirectMessageRequest.php index e3b5471f5fb6..d8347a58af0b 100644 --- a/AppsChat/src/Chat/V1/FindDirectMessageRequest.php +++ b/AppsChat/src/Chat/V1/FindDirectMessageRequest.php @@ -24,8 +24,8 @@ class FindDirectMessageRequest extends \Google\Protobuf\Internal\Message * in the Directory API. For example, if the People API profile ID is * `123456789`, you can find a direct message with that person by using * `users/123456789` as the `name`. When [authenticated as a - * user](https://developers.google.com/chat/api/guides/auth/users), you can - * use the email as an alias for `{user}`. For example, + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the email as an alias for `{user}`. For example, * `users/example@gmail.com` where `example@gmail.com` is the email of the * Google Chat user. * @@ -48,8 +48,8 @@ class FindDirectMessageRequest extends \Google\Protobuf\Internal\Message * in the Directory API. For example, if the People API profile ID is * `123456789`, you can find a direct message with that person by using * `users/123456789` as the `name`. When [authenticated as a - * user](https://developers.google.com/chat/api/guides/auth/users), you can - * use the email as an alias for `{user}`. For example, + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the email as an alias for `{user}`. For example, * `users/example@gmail.com` where `example@gmail.com` is the email of the * Google Chat user. * } @@ -68,8 +68,8 @@ public function __construct($data = NULL) { * in the Directory API. For example, if the People API profile ID is * `123456789`, you can find a direct message with that person by using * `users/123456789` as the `name`. When [authenticated as a - * user](https://developers.google.com/chat/api/guides/auth/users), you can - * use the email as an alias for `{user}`. For example, + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the email as an alias for `{user}`. For example, * `users/example@gmail.com` where `example@gmail.com` is the email of the * Google Chat user. * @@ -90,8 +90,8 @@ public function getName() * in the Directory API. For example, if the People API profile ID is * `123456789`, you can find a direct message with that person by using * `users/123456789` as the `name`. When [authenticated as a - * user](https://developers.google.com/chat/api/guides/auth/users), you can - * use the email as an alias for `{user}`. For example, + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the email as an alias for `{user}`. For example, * `users/example@gmail.com` where `example@gmail.com` is the email of the * Google Chat user. * diff --git a/AppsChat/src/Chat/V1/GetAttachmentRequest.php b/AppsChat/src/Chat/V1/GetAttachmentRequest.php index b47f06ae75fd..85bd441331c2 100644 --- a/AppsChat/src/Chat/V1/GetAttachmentRequest.php +++ b/AppsChat/src/Chat/V1/GetAttachmentRequest.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Request to get an attachment. + * * Generated from protobuf message google.chat.v1.GetAttachmentRequest */ class GetAttachmentRequest extends \Google\Protobuf\Internal\Message diff --git a/AppsChat/src/Chat/V1/GetMembershipRequest.php b/AppsChat/src/Chat/V1/GetMembershipRequest.php index 68515ab95913..bd46f59d7711 100644 --- a/AppsChat/src/Chat/V1/GetMembershipRequest.php +++ b/AppsChat/src/Chat/V1/GetMembershipRequest.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Request to get a membership of a space. + * * Generated from protobuf message google.chat.v1.GetMembershipRequest */ class GetMembershipRequest extends \Google\Protobuf\Internal\Message @@ -19,8 +21,8 @@ class GetMembershipRequest extends \Google\Protobuf\Internal\Message * `spaces/{space}/members/app`. * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` * When [authenticated as a - * user](https://developers.google.com/chat/api/guides/auth/users), you can - * use the user's email as an alias for `{member}`. For example, + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the user's email as an alias for `{member}`. For example, * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the * email of the Google Chat user. * @@ -37,8 +39,8 @@ class GetMembershipRequest extends \Google\Protobuf\Internal\Message * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` * * When [authenticated as a - * user](https://developers.google.com/chat/api/guides/auth/users), you can - * use the user's email as an alias for `{member}`. For example, + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the user's email as an alias for `{member}`. For example, * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the * email of the Google Chat user. Please see * {@see ChatServiceClient::membershipName()} for help formatting this field. @@ -65,8 +67,8 @@ public static function build(string $name): self * `spaces/{space}/members/app`. * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` * When [authenticated as a - * user](https://developers.google.com/chat/api/guides/auth/users), you can - * use the user's email as an alias for `{member}`. For example, + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the user's email as an alias for `{member}`. For example, * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the * email of the Google Chat user. * } @@ -82,8 +84,8 @@ public function __construct($data = NULL) { * `spaces/{space}/members/app`. * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` * When [authenticated as a - * user](https://developers.google.com/chat/api/guides/auth/users), you can - * use the user's email as an alias for `{member}`. For example, + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the user's email as an alias for `{member}`. For example, * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the * email of the Google Chat user. * @@ -101,8 +103,8 @@ public function getName() * `spaces/{space}/members/app`. * Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` * When [authenticated as a - * user](https://developers.google.com/chat/api/guides/auth/users), you can - * use the user's email as an alias for `{member}`. For example, + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * you can use the user's email as an alias for `{member}`. For example, * `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the * email of the Google Chat user. * diff --git a/AppsChat/src/Chat/V1/GetMessageRequest.php b/AppsChat/src/Chat/V1/GetMessageRequest.php index ebef334059f2..99403d2bead6 100644 --- a/AppsChat/src/Chat/V1/GetMessageRequest.php +++ b/AppsChat/src/Chat/V1/GetMessageRequest.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Request to get a message. + * * Generated from protobuf message google.chat.v1.GetMessageRequest */ class GetMessageRequest extends \Google\Protobuf\Internal\Message @@ -19,7 +21,7 @@ class GetMessageRequest extends \Google\Protobuf\Internal\Message * If you've set a custom ID for your message, you can use the value from the * `clientAssignedMessageId` field for `{message}`. For details, see [Name a * message] - * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -33,7 +35,7 @@ class GetMessageRequest extends \Google\Protobuf\Internal\Message * If you've set a custom ID for your message, you can use the value from the * `clientAssignedMessageId` field for `{message}`. For details, see [Name a * message] - * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). Please see + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). Please see * {@see ChatServiceClient::messageName()} for help formatting this field. * * @return \Google\Apps\Chat\V1\GetMessageRequest @@ -58,7 +60,7 @@ public static function build(string $name): self * If you've set a custom ID for your message, you can use the value from the * `clientAssignedMessageId` field for `{message}`. For details, see [Name a * message] - * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * } */ public function __construct($data = NULL) { @@ -72,7 +74,7 @@ public function __construct($data = NULL) { * If you've set a custom ID for your message, you can use the value from the * `clientAssignedMessageId` field for `{message}`. For details, see [Name a * message] - * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -88,7 +90,7 @@ public function getName() * If you've set a custom ID for your message, you can use the value from the * `clientAssignedMessageId` field for `{message}`. For details, see [Name a * message] - * (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * (https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/AppsChat/src/Chat/V1/ListMembershipsRequest.php b/AppsChat/src/Chat/V1/ListMembershipsRequest.php index 3070f5a2e566..aa13f8f92d44 100644 --- a/AppsChat/src/Chat/V1/ListMembershipsRequest.php +++ b/AppsChat/src/Chat/V1/ListMembershipsRequest.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Request message for listing memberships. + * * Generated from protobuf message google.chat.v1.ListMembershipsRequest */ class ListMembershipsRequest extends \Google\Protobuf\Internal\Message @@ -25,8 +27,8 @@ class ListMembershipsRequest extends \Google\Protobuf\Internal\Message * Optional. The maximum number of memberships to return. The service might * return fewer than this value. * If unspecified, at most 100 memberships are returned. - * The maximum value is 1,000. If you use a value more than 1,000, it's - * automatically changed to 1,000. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. * Negative values return an `INVALID_ARGUMENT` error. * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -45,9 +47,9 @@ class ListMembershipsRequest extends \Google\Protobuf\Internal\Message /** * Optional. A query filter. * You can filter memberships by a member's role - * ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole)) + * ([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole)) * and type - * ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)). + * ([`member.type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/User#type)). * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. * To filter by type, set `member.type` to `HUMAN` or `BOT`. * To filter by both role and type, use the `AND` operator. To filter by @@ -87,7 +89,7 @@ class ListMembershipsRequest extends \Google\Protobuf\Internal\Message * [invited][google.chat.v1.Membership.MembershipState.INVITED] memberships * that don't match the filter criteria aren't returned. * Currently requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * Generated from protobuf field bool show_invited = 7 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -124,8 +126,8 @@ public static function build(string $parent): self * Optional. The maximum number of memberships to return. The service might * return fewer than this value. * If unspecified, at most 100 memberships are returned. - * The maximum value is 1,000. If you use a value more than 1,000, it's - * automatically changed to 1,000. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. * Negative values return an `INVALID_ARGUMENT` error. * @type string $page_token * Optional. A page token, received from a previous call to list memberships. @@ -136,9 +138,9 @@ public static function build(string $parent): self * @type string $filter * Optional. A query filter. * You can filter memberships by a member's role - * ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole)) + * ([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole)) * and type - * ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)). + * ([`member.type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/User#type)). * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. * To filter by type, set `member.type` to `HUMAN` or `BOT`. * To filter by both role and type, use the `AND` operator. To filter by @@ -170,7 +172,7 @@ public static function build(string $parent): self * [invited][google.chat.v1.Membership.MembershipState.INVITED] memberships * that don't match the filter criteria aren't returned. * Currently requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * } */ public function __construct($data = NULL) { @@ -212,8 +214,8 @@ public function setParent($var) * Optional. The maximum number of memberships to return. The service might * return fewer than this value. * If unspecified, at most 100 memberships are returned. - * The maximum value is 1,000. If you use a value more than 1,000, it's - * automatically changed to 1,000. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. * Negative values return an `INVALID_ARGUMENT` error. * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -228,8 +230,8 @@ public function getPageSize() * Optional. The maximum number of memberships to return. The service might * return fewer than this value. * If unspecified, at most 100 memberships are returned. - * The maximum value is 1,000. If you use a value more than 1,000, it's - * automatically changed to 1,000. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. * Negative values return an `INVALID_ARGUMENT` error. * * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; @@ -281,9 +283,9 @@ public function setPageToken($var) /** * Optional. A query filter. * You can filter memberships by a member's role - * ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole)) + * ([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole)) * and type - * ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)). + * ([`member.type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/User#type)). * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. * To filter by type, set `member.type` to `HUMAN` or `BOT`. * To filter by both role and type, use the `AND` operator. To filter by @@ -312,9 +314,9 @@ public function getFilter() /** * Optional. A query filter. * You can filter memberships by a member's role - * ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole)) + * ([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole)) * and type - * ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)). + * ([`member.type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/User#type)). * To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. * To filter by type, set `member.type` to `HUMAN` or `BOT`. * To filter by both role and type, use the `AND` operator. To filter by @@ -388,7 +390,7 @@ public function setShowGroups($var) * [invited][google.chat.v1.Membership.MembershipState.INVITED] memberships * that don't match the filter criteria aren't returned. * Currently requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * Generated from protobuf field bool show_invited = 7 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -406,7 +408,7 @@ public function getShowInvited() * [invited][google.chat.v1.Membership.MembershipState.INVITED] memberships * that don't match the filter criteria aren't returned. * Currently requires [user - * authentication](https://developers.google.com/chat/api/guides/auth/users). + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * Generated from protobuf field bool show_invited = 7 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/AppsChat/src/Chat/V1/ListMembershipsResponse.php b/AppsChat/src/Chat/V1/ListMembershipsResponse.php index 19e3718b6d63..683786ade983 100644 --- a/AppsChat/src/Chat/V1/ListMembershipsResponse.php +++ b/AppsChat/src/Chat/V1/ListMembershipsResponse.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Response to list memberships of the space. + * * Generated from protobuf message google.chat.v1.ListMembershipsResponse */ class ListMembershipsResponse extends \Google\Protobuf\Internal\Message diff --git a/AppsChat/src/Chat/V1/ListMessagesRequest.php b/AppsChat/src/Chat/V1/ListMessagesRequest.php index cb966ab70e15..ab83af2f4080 100644 --- a/AppsChat/src/Chat/V1/ListMessagesRequest.php +++ b/AppsChat/src/Chat/V1/ListMessagesRequest.php @@ -26,8 +26,8 @@ class ListMessagesRequest extends \Google\Protobuf\Internal\Message * The maximum number of messages returned. The service might return fewer * messages than this value. * If unspecified, at most 25 are returned. - * The maximum value is 1,000. If you use a value more than 1,000, it's - * automatically changed to 1,000. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. * Negative values return an `INVALID_ARGUMENT` error. * * Generated from protobuf field int32 page_size = 2; @@ -123,8 +123,8 @@ public static function build(string $parent): self * The maximum number of messages returned. The service might return fewer * messages than this value. * If unspecified, at most 25 are returned. - * The maximum value is 1,000. If you use a value more than 1,000, it's - * automatically changed to 1,000. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. * Negative values return an `INVALID_ARGUMENT` error. * @type string $page_token * Optional, if resuming from a previous query. @@ -209,8 +209,8 @@ public function setParent($var) * The maximum number of messages returned. The service might return fewer * messages than this value. * If unspecified, at most 25 are returned. - * The maximum value is 1,000. If you use a value more than 1,000, it's - * automatically changed to 1,000. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. * Negative values return an `INVALID_ARGUMENT` error. * * Generated from protobuf field int32 page_size = 2; @@ -225,8 +225,8 @@ public function getPageSize() * The maximum number of messages returned. The service might return fewer * messages than this value. * If unspecified, at most 25 are returned. - * The maximum value is 1,000. If you use a value more than 1,000, it's - * automatically changed to 1,000. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. * Negative values return an `INVALID_ARGUMENT` error. * * Generated from protobuf field int32 page_size = 2; diff --git a/AppsChat/src/Chat/V1/ListMessagesResponse.php b/AppsChat/src/Chat/V1/ListMessagesResponse.php index 8fc55d01c82d..2b34fab21efd 100644 --- a/AppsChat/src/Chat/V1/ListMessagesResponse.php +++ b/AppsChat/src/Chat/V1/ListMessagesResponse.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Response message for listing messages. + * * Generated from protobuf message google.chat.v1.ListMessagesResponse */ class ListMessagesResponse extends \Google\Protobuf\Internal\Message diff --git a/AppsChat/src/Chat/V1/ListReactionsRequest.php b/AppsChat/src/Chat/V1/ListReactionsRequest.php index 1b88deaddaa8..57ee4da7a254 100644 --- a/AppsChat/src/Chat/V1/ListReactionsRequest.php +++ b/AppsChat/src/Chat/V1/ListReactionsRequest.php @@ -43,9 +43,9 @@ class ListReactionsRequest extends \Google\Protobuf\Internal\Message /** * Optional. A query filter. * You can filter reactions by - * [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji) + * [emoji](https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji) * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and - * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) * (`user.name`). * To filter reactions for multiple emojis or users, join similar fields * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = @@ -119,9 +119,9 @@ public static function build(string $parent): self * @type string $filter * Optional. A query filter. * You can filter reactions by - * [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji) + * [emoji](https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji) * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and - * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) * (`user.name`). * To filter reactions for multiple emojis or users, join similar fields * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = @@ -254,9 +254,9 @@ public function setPageToken($var) /** * Optional. A query filter. * You can filter reactions by - * [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji) + * [emoji](https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji) * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and - * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) * (`user.name`). * To filter reactions for multiple emojis or users, join similar fields * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = @@ -299,9 +299,9 @@ public function getFilter() /** * Optional. A query filter. * You can filter reactions by - * [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji) + * [emoji](https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji) * (either `emoji.unicode` or `emoji.custom_emoji.uid`) and - * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) * (`user.name`). * To filter reactions for multiple emojis or users, join similar fields * with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = diff --git a/AppsChat/src/Chat/V1/ListReactionsResponse.php b/AppsChat/src/Chat/V1/ListReactionsResponse.php index a6c58c72a9ec..429f5e5b5565 100644 --- a/AppsChat/src/Chat/V1/ListReactionsResponse.php +++ b/AppsChat/src/Chat/V1/ListReactionsResponse.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Response to a list reactions request. + * * Generated from protobuf message google.chat.v1.ListReactionsResponse */ class ListReactionsResponse extends \Google\Protobuf\Internal\Message diff --git a/AppsChat/src/Chat/V1/ListSpacesRequest.php b/AppsChat/src/Chat/V1/ListSpacesRequest.php index eab3ad89dd60..b1764b3e4d93 100644 --- a/AppsChat/src/Chat/V1/ListSpacesRequest.php +++ b/AppsChat/src/Chat/V1/ListSpacesRequest.php @@ -19,8 +19,8 @@ class ListSpacesRequest extends \Google\Protobuf\Internal\Message * Optional. The maximum number of spaces to return. The service might return * fewer than this value. * If unspecified, at most 100 spaces are returned. - * The maximum value is 1,000. If you use a value more than 1,000, it's - * automatically changed to 1,000. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. * Negative values return an `INVALID_ARGUMENT` error. * * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -38,7 +38,7 @@ class ListSpacesRequest extends \Google\Protobuf\Internal\Message /** * Optional. A query filter. * You can filter spaces by the space type - * ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). + * ([`space_type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype)). * To filter by space type, you must specify valid enum value, such as * `SPACE` or `GROUP_CHAT` (the `space_type` can't be * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` @@ -65,8 +65,8 @@ class ListSpacesRequest extends \Google\Protobuf\Internal\Message * Optional. The maximum number of spaces to return. The service might return * fewer than this value. * If unspecified, at most 100 spaces are returned. - * The maximum value is 1,000. If you use a value more than 1,000, it's - * automatically changed to 1,000. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. * Negative values return an `INVALID_ARGUMENT` error. * @type string $page_token * Optional. A page token, received from a previous list spaces call. @@ -76,7 +76,7 @@ class ListSpacesRequest extends \Google\Protobuf\Internal\Message * @type string $filter * Optional. A query filter. * You can filter spaces by the space type - * ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). + * ([`space_type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype)). * To filter by space type, you must specify valid enum value, such as * `SPACE` or `GROUP_CHAT` (the `space_type` can't be * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` @@ -99,8 +99,8 @@ public function __construct($data = NULL) { * Optional. The maximum number of spaces to return. The service might return * fewer than this value. * If unspecified, at most 100 spaces are returned. - * The maximum value is 1,000. If you use a value more than 1,000, it's - * automatically changed to 1,000. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. * Negative values return an `INVALID_ARGUMENT` error. * * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -115,8 +115,8 @@ public function getPageSize() * Optional. The maximum number of spaces to return. The service might return * fewer than this value. * If unspecified, at most 100 spaces are returned. - * The maximum value is 1,000. If you use a value more than 1,000, it's - * automatically changed to 1,000. + * The maximum value is 1000. If you use a value more than 1000, it's + * automatically changed to 1000. * Negative values return an `INVALID_ARGUMENT` error. * * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -166,7 +166,7 @@ public function setPageToken($var) /** * Optional. A query filter. * You can filter spaces by the space type - * ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). + * ([`space_type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype)). * To filter by space type, you must specify valid enum value, such as * `SPACE` or `GROUP_CHAT` (the `space_type` can't be * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` @@ -190,7 +190,7 @@ public function getFilter() /** * Optional. A query filter. * You can filter spaces by the space type - * ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). + * ([`space_type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype)). * To filter by space type, you must specify valid enum value, such as * `SPACE` or `GROUP_CHAT` (the `space_type` can't be * `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` diff --git a/AppsChat/src/Chat/V1/ListSpacesResponse.php b/AppsChat/src/Chat/V1/ListSpacesResponse.php index 25939f2fdc7d..64406b36ad8f 100644 --- a/AppsChat/src/Chat/V1/ListSpacesResponse.php +++ b/AppsChat/src/Chat/V1/ListSpacesResponse.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * The response for a list spaces request. + * * Generated from protobuf message google.chat.v1.ListSpacesResponse */ class ListSpacesResponse extends \Google\Protobuf\Internal\Message diff --git a/AppsChat/src/Chat/V1/Membership.php b/AppsChat/src/Chat/V1/Membership.php index 64c57831e06b..4361e9ab1970 100644 --- a/AppsChat/src/Chat/V1/Membership.php +++ b/AppsChat/src/Chat/V1/Membership.php @@ -75,9 +75,9 @@ class Membership extends \Google\Protobuf\Internal\Message * @type \Google\Apps\Chat\V1\User $member * The Google Chat user or app the membership corresponds to. * If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the - * output populates the - * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the output populates the + * [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) * `name` and `type`. * @type \Google\Apps\Chat\V1\Group $group_member * The Google Group the membership corresponds to. @@ -187,9 +187,9 @@ public function setRole($var) /** * The Google Chat user or app the membership corresponds to. * If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the - * output populates the - * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the output populates the + * [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) * `name` and `type`. * * Generated from protobuf field .google.chat.v1.User member = 3; @@ -208,9 +208,9 @@ public function hasMember() /** * The Google Chat user or app the membership corresponds to. * If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the - * output populates the - * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the output populates the + * [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) * `name` and `type`. * * Generated from protobuf field .google.chat.v1.User member = 3; diff --git a/AppsChat/src/Chat/V1/Message.php b/AppsChat/src/Chat/V1/Message.php index f4952c6c6bc3..881bdf2e84a0 100644 --- a/AppsChat/src/Chat/V1/Message.php +++ b/AppsChat/src/Chat/V1/Message.php @@ -26,7 +26,7 @@ class Message extends \Google\Protobuf\Internal\Message * from the `clientAssignedMessageId` field. For example, * `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name * a - * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string name = 1; */ @@ -34,9 +34,9 @@ class Message extends \Google\Protobuf\Internal\Message /** * Output only. The user who created the message. * If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the output - * populates the - * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the output populates the + * [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) * `name` and `type`. * * Generated from protobuf field .google.chat.v1.User sender = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -70,12 +70,12 @@ class Message extends \Google\Protobuf\Internal\Message /** * Plain-text body of the message. The first link to an image, video, or web * page generates a - * [preview chip](https://developers.google.com/chat/how-tos/preview-links). + * [preview chip](https://developers.google.com/workspace/chat/preview-links). * You can also [@mention a Google Chat - * user](https://developers.google.com/chat/format-messages#messages-@mention), + * user](https://developers.google.com/workspace/chat/format-messages#messages-@mention), * or everyone in the space. * To learn about creating text messages, see [Send a text - * message](https://developers.google.com/chat/api/guides/v1/messages/create#create-text-messages). + * message](https://developers.google.com/workspace/chat/create-messages#create-text-messages). * * Generated from protobuf field string text = 4; */ @@ -85,19 +85,20 @@ class Message extends \Google\Protobuf\Internal\Message * formatting. This field might not capture all formatting visible in the UI, * but includes the following: * * [Markup - * syntax](https://developers.google.com/chat/format-messages) - * for bold, italic, strikethrough, monospace, and monospace block. + * syntax](https://developers.google.com/workspace/chat/format-messages) + * for bold, italic, strikethrough, monospace, monospace block, and bulleted + * list. * * [User - * mentions](https://developers.google.com/chat/format-messages#messages-@mention) - * using the format ``. + * mentions](https://developers.google.com/workspace/chat/format-messages#messages-@mention) + * using the format ``. * * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the - * first string is the URL and the second is the rendered text—for example, - * ``. + * first string is the URL and the second is the rendered text—for example, + * ``. * * Custom emoji using the format `:{emoji_name}:`—for example, `:smile:`. - * This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning + * This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning * face emoji. * For more information, see [View text formatting sent in a - * message](https://developers.google.com/chat/format-messages#view_text_formatting_sent_in_a_message) + * message](https://developers.google.com/workspace/chat/format-messages#view_text_formatting_sent_in_a_message) * * Generated from protobuf field string formatted_text = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -115,13 +116,12 @@ class Message extends \Google\Protobuf\Internal\Message private $cards; /** * An array of - * [cards](https://developers.google.com/chat/api/reference/rest/v1/cards). + * [cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards). * Only Chat apps can create cards. If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the - * messages can't contain cards. - * To learn about cards and how to create them, see [Design dynamic, - * interactive, and consistent UIs with - * cards](https://developers.google.com/chat/ui). + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the messages can't contain cards. + * To learn about cards and how to create them, see [Send card + * messages](https://developers.google.com/workspace/chat/create-messages#create). * [Card builder](https://addons.gsuite.google.com/uikit/builder) * * Generated from protobuf field repeated .google.chat.v1.CardWithId cards_v2 = 22; @@ -136,16 +136,16 @@ class Message extends \Google\Protobuf\Internal\Message /** * The thread the message belongs to. For example usage, see * [Start or reply to a message - * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). * * Generated from protobuf field .google.chat.v1.Thread thread = 11; */ protected $thread = null; /** * If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the output - * populates the - * [space](https://developers.google.com/chat/api/reference/rest/v1/spaces) + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the output populates the + * [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) * `name`. * * Generated from protobuf field .google.chat.v1.Space space = 12; @@ -187,7 +187,7 @@ class Message extends \Google\Protobuf\Internal\Message /** * Output only. A URL in `spaces.messages.text` that matches a link preview * pattern. For more information, see [Preview - * links](https://developers.google.com/chat/how-tos/preview-links). + * 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]; */ @@ -206,9 +206,9 @@ class Message extends \Google\Protobuf\Internal\Message * Optional. A custom ID for the message. You can use field to identify a * message, or to get, delete, or update a message. To set a custom ID, * specify the - * [`messageId`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) + * [`messageId`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) * field when you create the message. For details, see [Name a - * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string client_assigned_message_id = 32; */ @@ -225,10 +225,11 @@ class Message extends \Google\Protobuf\Internal\Message * visible to the specified user and the Chat app. Link previews and * attachments aren't supported for private messages. * Only Chat apps can send private messages. If your Chat app [authenticates - * as a user](https://developers.google.com/chat/api/guides/auth/users) to - * send a message, the message can't be private and must omit this field. + * as a + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * to send a message, the message can't be private and must omit this field. * For details, see [Send private messages to Google Chat - * users](https://developers.google.com/chat/api/guides/v1/messages/private). + * users](https://developers.google.com/workspace/chat/private-messages). * * Generated from protobuf field .google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE]; */ @@ -256,62 +257,12 @@ class Message extends \Google\Protobuf\Internal\Message /** * One or more interactive widgets that appear at the bottom of a message. * You can add accessory widgets to messages that contain text, cards, or both - * text and cards. Not supported for messages that contain dialogs. + * text and cards. Not supported for messages that contain dialogs. For + * details, see [Add interactive widgets at the bottom of a + * message](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets). * Creating a message with accessory widgets requires [app * authentication] - * (https://developers.google.com/chat/api/guides/auth/service-accounts). - * The following example shows a Chat app that uses accessory widgets (thumbs - * up and thumbs down buttons) in a text message: - * ![Example accessory widgets - * message](https://developers.google.com/chat/images/message-accessory-widgets-reference.png) - * The JSON for this example message is the following: - * ``` - * { - * "text": "Rate your experience with this Chat app.", - * "accessoryWidgets": [ - * { - * "buttonList": { - * "buttons": [ - * { - * "icon": { - * "material_icon": { - * "name": "thumb_up" - * } - * }, - * "color": { - * "red": 0, - * "blue": 255, - * "green": 0 - * }, - * "onClick": { - * "action": { - * "function": "doUpvote", - * } - * } - * }, - * { - * "icon": { - * "material_icon": { - * "name": "thumb_down" - * } - * }, - * "color": { - * "red": 0, - * "blue": 255, - * "green": 0 - * }, - * "onClick": { - * "action": { - * "function": "doDownvote", - * } - * } - * } - * ] - * } - * } - * ] - * } - * ``` + * (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * * Generated from protobuf field repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44; */ @@ -334,13 +285,13 @@ class Message extends \Google\Protobuf\Internal\Message * from the `clientAssignedMessageId` field. For example, * `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name * a - * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * @type \Google\Apps\Chat\V1\User $sender * Output only. The user who created the message. * If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the output - * populates the - * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the output populates the + * [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) * `name` and `type`. * @type \Google\Protobuf\Timestamp $create_time * Optional. Immutable. For spaces created in Chat, the time at which the @@ -358,30 +309,31 @@ class Message extends \Google\Protobuf\Internal\Message * @type string $text * Plain-text body of the message. The first link to an image, video, or web * page generates a - * [preview chip](https://developers.google.com/chat/how-tos/preview-links). + * [preview chip](https://developers.google.com/workspace/chat/preview-links). * You can also [@mention a Google Chat - * user](https://developers.google.com/chat/format-messages#messages-@mention), + * user](https://developers.google.com/workspace/chat/format-messages#messages-@mention), * or everyone in the space. * To learn about creating text messages, see [Send a text - * message](https://developers.google.com/chat/api/guides/v1/messages/create#create-text-messages). + * message](https://developers.google.com/workspace/chat/create-messages#create-text-messages). * @type string $formatted_text * Output only. Contains the message `text` with markups added to communicate * formatting. This field might not capture all formatting visible in the UI, * but includes the following: * * [Markup - * syntax](https://developers.google.com/chat/format-messages) - * for bold, italic, strikethrough, monospace, and monospace block. + * syntax](https://developers.google.com/workspace/chat/format-messages) + * for bold, italic, strikethrough, monospace, monospace block, and bulleted + * list. * * [User - * mentions](https://developers.google.com/chat/format-messages#messages-@mention) - * using the format ``. + * mentions](https://developers.google.com/workspace/chat/format-messages#messages-@mention) + * using the format ``. * * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the - * first string is the URL and the second is the rendered text—for example, - * ``. + * first string is the URL and the second is the rendered text—for example, + * ``. * * Custom emoji using the format `:{emoji_name}:`—for example, `:smile:`. - * This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning + * This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning * face emoji. * For more information, see [View text formatting sent in a - * message](https://developers.google.com/chat/format-messages#view_text_formatting_sent_in_a_message) + * message](https://developers.google.com/workspace/chat/format-messages#view_text_formatting_sent_in_a_message) * @type array<\Google\Apps\Chat\V1\ContextualAddOnMarkup\Card>|\Google\Protobuf\Internal\RepeatedField $cards * Deprecated: Use `cards_v2` instead. * Rich, formatted, and interactive cards that you can use to display UI @@ -390,25 +342,24 @@ class Message extends \Google\Protobuf\Internal\Message * `cards_v2` can have a maximum size of 32 KB. * @type array<\Google\Apps\Chat\V1\CardWithId>|\Google\Protobuf\Internal\RepeatedField $cards_v2 * An array of - * [cards](https://developers.google.com/chat/api/reference/rest/v1/cards). + * [cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards). * Only Chat apps can create cards. If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the - * messages can't contain cards. - * To learn about cards and how to create them, see [Design dynamic, - * interactive, and consistent UIs with - * cards](https://developers.google.com/chat/ui). + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the messages can't contain cards. + * To learn about cards and how to create them, see [Send card + * messages](https://developers.google.com/workspace/chat/create-messages#create). * [Card builder](https://addons.gsuite.google.com/uikit/builder) * @type array<\Google\Apps\Chat\V1\Annotation>|\Google\Protobuf\Internal\RepeatedField $annotations * Output only. Annotations associated with the `text` in this message. * @type \Google\Apps\Chat\V1\Thread $thread * The thread the message belongs to. For example usage, see * [Start or reply to a message - * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). * @type \Google\Apps\Chat\V1\Space $space * If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the output - * populates the - * [space](https://developers.google.com/chat/api/reference/rest/v1/spaces) + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the output populates the + * [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) * `name`. * @type string $fallback_text * A plain-text description of the message's cards, used when the actual cards @@ -426,7 +377,7 @@ class Message extends \Google\Protobuf\Internal\Message * @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 - * links](https://developers.google.com/chat/how-tos/preview-links). + * 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 * `false`, the message is visible in the space's top-level conversation as @@ -437,9 +388,9 @@ class Message extends \Google\Protobuf\Internal\Message * Optional. A custom ID for the message. You can use field to identify a * message, or to get, delete, or update a message. To set a custom ID, * specify the - * [`messageId`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) + * [`messageId`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) * field when you create the message. For details, see [Name a - * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * @type array<\Google\Apps\Chat\V1\EmojiReactionSummary>|\Google\Protobuf\Internal\RepeatedField $emoji_reaction_summaries * Output only. The list of emoji reaction summaries on the message. * @type \Google\Apps\Chat\V1\User $private_message_viewer @@ -448,10 +399,11 @@ class Message extends \Google\Protobuf\Internal\Message * visible to the specified user and the Chat app. Link previews and * attachments aren't supported for private messages. * Only Chat apps can send private messages. If your Chat app [authenticates - * as a user](https://developers.google.com/chat/api/guides/auth/users) to - * send a message, the message can't be private and must omit this field. + * as a + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * to send a message, the message can't be private and must omit this field. * For details, see [Send private messages to Google Chat - * users](https://developers.google.com/chat/api/guides/v1/messages/private). + * users](https://developers.google.com/workspace/chat/private-messages). * @type \Google\Apps\Chat\V1\DeletionMetadata $deletion_metadata * Output only. Information about a deleted message. A message is deleted when * `delete_time` is set. @@ -463,62 +415,12 @@ class Message extends \Google\Protobuf\Internal\Message * @type array<\Google\Apps\Chat\V1\AccessoryWidget>|\Google\Protobuf\Internal\RepeatedField $accessory_widgets * One or more interactive widgets that appear at the bottom of a message. * You can add accessory widgets to messages that contain text, cards, or both - * text and cards. Not supported for messages that contain dialogs. + * text and cards. Not supported for messages that contain dialogs. For + * details, see [Add interactive widgets at the bottom of a + * message](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets). * Creating a message with accessory widgets requires [app * authentication] - * (https://developers.google.com/chat/api/guides/auth/service-accounts). - * The following example shows a Chat app that uses accessory widgets (thumbs - * up and thumbs down buttons) in a text message: - * ![Example accessory widgets - * message](https://developers.google.com/chat/images/message-accessory-widgets-reference.png) - * The JSON for this example message is the following: - * ``` - * { - * "text": "Rate your experience with this Chat app.", - * "accessoryWidgets": [ - * { - * "buttonList": { - * "buttons": [ - * { - * "icon": { - * "material_icon": { - * "name": "thumb_up" - * } - * }, - * "color": { - * "red": 0, - * "blue": 255, - * "green": 0 - * }, - * "onClick": { - * "action": { - * "function": "doUpvote", - * } - * } - * }, - * { - * "icon": { - * "material_icon": { - * "name": "thumb_down" - * } - * }, - * "color": { - * "red": 0, - * "blue": 255, - * "green": 0 - * }, - * "onClick": { - * "action": { - * "function": "doDownvote", - * } - * } - * } - * ] - * } - * } - * ] - * } - * ``` + * (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * } */ public function __construct($data = NULL) { @@ -537,7 +439,7 @@ public function __construct($data = NULL) { * from the `clientAssignedMessageId` field. For example, * `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name * a - * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string name = 1; * @return string @@ -558,7 +460,7 @@ public function getName() * from the `clientAssignedMessageId` field. For example, * `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name * a - * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string name = 1; * @param string $var @@ -575,9 +477,9 @@ public function setName($var) /** * Output only. The user who created the message. * If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the output - * populates the - * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the output populates the + * [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) * `name` and `type`. * * Generated from protobuf field .google.chat.v1.User sender = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -601,9 +503,9 @@ public function clearSender() /** * Output only. The user who created the message. * If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the output - * populates the - * [user](https://developers.google.com/chat/api/reference/rest/v1/User) + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the output populates the + * [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) * `name` and `type`. * * Generated from protobuf field .google.chat.v1.User sender = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -743,12 +645,12 @@ public function setDeleteTime($var) /** * Plain-text body of the message. The first link to an image, video, or web * page generates a - * [preview chip](https://developers.google.com/chat/how-tos/preview-links). + * [preview chip](https://developers.google.com/workspace/chat/preview-links). * You can also [@mention a Google Chat - * user](https://developers.google.com/chat/format-messages#messages-@mention), + * user](https://developers.google.com/workspace/chat/format-messages#messages-@mention), * or everyone in the space. * To learn about creating text messages, see [Send a text - * message](https://developers.google.com/chat/api/guides/v1/messages/create#create-text-messages). + * message](https://developers.google.com/workspace/chat/create-messages#create-text-messages). * * Generated from protobuf field string text = 4; * @return string @@ -761,12 +663,12 @@ public function getText() /** * Plain-text body of the message. The first link to an image, video, or web * page generates a - * [preview chip](https://developers.google.com/chat/how-tos/preview-links). + * [preview chip](https://developers.google.com/workspace/chat/preview-links). * You can also [@mention a Google Chat - * user](https://developers.google.com/chat/format-messages#messages-@mention), + * user](https://developers.google.com/workspace/chat/format-messages#messages-@mention), * or everyone in the space. * To learn about creating text messages, see [Send a text - * message](https://developers.google.com/chat/api/guides/v1/messages/create#create-text-messages). + * message](https://developers.google.com/workspace/chat/create-messages#create-text-messages). * * Generated from protobuf field string text = 4; * @param string $var @@ -785,19 +687,20 @@ public function setText($var) * formatting. This field might not capture all formatting visible in the UI, * but includes the following: * * [Markup - * syntax](https://developers.google.com/chat/format-messages) - * for bold, italic, strikethrough, monospace, and monospace block. + * syntax](https://developers.google.com/workspace/chat/format-messages) + * for bold, italic, strikethrough, monospace, monospace block, and bulleted + * list. * * [User - * mentions](https://developers.google.com/chat/format-messages#messages-@mention) - * using the format ``. + * mentions](https://developers.google.com/workspace/chat/format-messages#messages-@mention) + * using the format ``. * * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the - * first string is the URL and the second is the rendered text—for example, - * ``. + * first string is the URL and the second is the rendered text—for example, + * ``. * * Custom emoji using the format `:{emoji_name}:`—for example, `:smile:`. - * This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning + * This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning * face emoji. * For more information, see [View text formatting sent in a - * message](https://developers.google.com/chat/format-messages#view_text_formatting_sent_in_a_message) + * message](https://developers.google.com/workspace/chat/format-messages#view_text_formatting_sent_in_a_message) * * Generated from protobuf field string formatted_text = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string @@ -812,19 +715,20 @@ public function getFormattedText() * formatting. This field might not capture all formatting visible in the UI, * but includes the following: * * [Markup - * syntax](https://developers.google.com/chat/format-messages) - * for bold, italic, strikethrough, monospace, and monospace block. + * syntax](https://developers.google.com/workspace/chat/format-messages) + * for bold, italic, strikethrough, monospace, monospace block, and bulleted + * list. * * [User - * mentions](https://developers.google.com/chat/format-messages#messages-@mention) - * using the format ``. + * mentions](https://developers.google.com/workspace/chat/format-messages#messages-@mention) + * using the format ``. * * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the - * first string is the URL and the second is the rendered text—for example, - * ``. + * first string is the URL and the second is the rendered text—for example, + * ``. * * Custom emoji using the format `:{emoji_name}:`—for example, `:smile:`. - * This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning + * This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning * face emoji. * For more information, see [View text formatting sent in a - * message](https://developers.google.com/chat/format-messages#view_text_formatting_sent_in_a_message) + * message](https://developers.google.com/workspace/chat/format-messages#view_text_formatting_sent_in_a_message) * * Generated from protobuf field string formatted_text = 43 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var @@ -878,13 +782,12 @@ public function setCards($var) /** * An array of - * [cards](https://developers.google.com/chat/api/reference/rest/v1/cards). + * [cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards). * Only Chat apps can create cards. If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the - * messages can't contain cards. - * To learn about cards and how to create them, see [Design dynamic, - * interactive, and consistent UIs with - * cards](https://developers.google.com/chat/ui). + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the messages can't contain cards. + * To learn about cards and how to create them, see [Send card + * messages](https://developers.google.com/workspace/chat/create-messages#create). * [Card builder](https://addons.gsuite.google.com/uikit/builder) * * Generated from protobuf field repeated .google.chat.v1.CardWithId cards_v2 = 22; @@ -897,13 +800,12 @@ public function getCardsV2() /** * An array of - * [cards](https://developers.google.com/chat/api/reference/rest/v1/cards). + * [cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards). * Only Chat apps can create cards. If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the - * messages can't contain cards. - * To learn about cards and how to create them, see [Design dynamic, - * interactive, and consistent UIs with - * cards](https://developers.google.com/chat/ui). + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the messages can't contain cards. + * To learn about cards and how to create them, see [Send card + * messages](https://developers.google.com/workspace/chat/create-messages#create). * [Card builder](https://addons.gsuite.google.com/uikit/builder) * * Generated from protobuf field repeated .google.chat.v1.CardWithId cards_v2 = 22; @@ -947,7 +849,7 @@ public function setAnnotations($var) /** * The thread the message belongs to. For example usage, see * [Start or reply to a message - * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). * * Generated from protobuf field .google.chat.v1.Thread thread = 11; * @return \Google\Apps\Chat\V1\Thread|null @@ -970,7 +872,7 @@ public function clearThread() /** * The thread the message belongs to. For example usage, see * [Start or reply to a message - * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). * * Generated from protobuf field .google.chat.v1.Thread thread = 11; * @param \Google\Apps\Chat\V1\Thread $var @@ -986,9 +888,9 @@ public function setThread($var) /** * If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the output - * populates the - * [space](https://developers.google.com/chat/api/reference/rest/v1/spaces) + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the output populates the + * [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) * `name`. * * Generated from protobuf field .google.chat.v1.Space space = 12; @@ -1011,9 +913,9 @@ public function clearSpace() /** * If your Chat app [authenticates as a - * user](https://developers.google.com/chat/api/guides/auth/users), the output - * populates the - * [space](https://developers.google.com/chat/api/reference/rest/v1/spaces) + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the output populates the + * [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) * `name`. * * Generated from protobuf field .google.chat.v1.Space space = 12; @@ -1187,7 +1089,7 @@ public function setAttachment($var) /** * Output only. A URL in `spaces.messages.text` that matches a link preview * pattern. For more information, see [Preview - * links](https://developers.google.com/chat/how-tos/preview-links). + * 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]; * @return \Google\Apps\Chat\V1\MatchedUrl|null @@ -1210,7 +1112,7 @@ public function clearMatchedUrl() /** * Output only. A URL in `spaces.messages.text` that matches a link preview * pattern. For more information, see [Preview - * links](https://developers.google.com/chat/how-tos/preview-links). + * 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]; * @param \Google\Apps\Chat\V1\MatchedUrl $var @@ -1262,9 +1164,9 @@ public function setThreadReply($var) * Optional. A custom ID for the message. You can use field to identify a * message, or to get, delete, or update a message. To set a custom ID, * specify the - * [`messageId`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) + * [`messageId`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) * field when you create the message. For details, see [Name a - * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string client_assigned_message_id = 32; * @return string @@ -1278,9 +1180,9 @@ public function getClientAssignedMessageId() * Optional. A custom ID for the message. You can use field to identify a * message, or to get, delete, or update a message. To set a custom ID, * specify the - * [`messageId`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) + * [`messageId`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) * field when you create the message. For details, see [Name a - * message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). * * Generated from protobuf field string client_assigned_message_id = 32; * @param string $var @@ -1326,10 +1228,11 @@ public function setEmojiReactionSummaries($var) * visible to the specified user and the Chat app. Link previews and * attachments aren't supported for private messages. * Only Chat apps can send private messages. If your Chat app [authenticates - * as a user](https://developers.google.com/chat/api/guides/auth/users) to - * send a message, the message can't be private and must omit this field. + * as a + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * to send a message, the message can't be private and must omit this field. * For details, see [Send private messages to Google Chat - * users](https://developers.google.com/chat/api/guides/v1/messages/private). + * users](https://developers.google.com/workspace/chat/private-messages). * * Generated from protobuf field .google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE]; * @return \Google\Apps\Chat\V1\User|null @@ -1355,10 +1258,11 @@ public function clearPrivateMessageViewer() * visible to the specified user and the Chat app. Link previews and * attachments aren't supported for private messages. * Only Chat apps can send private messages. If your Chat app [authenticates - * as a user](https://developers.google.com/chat/api/guides/auth/users) to - * send a message, the message can't be private and must omit this field. + * as a + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * to send a message, the message can't be private and must omit this field. * For details, see [Send private messages to Google Chat - * users](https://developers.google.com/chat/api/guides/v1/messages/private). + * users](https://developers.google.com/workspace/chat/private-messages). * * Generated from protobuf field .google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE]; * @param \Google\Apps\Chat\V1\User $var @@ -1477,62 +1381,12 @@ public function setAttachedGifs($var) /** * One or more interactive widgets that appear at the bottom of a message. * You can add accessory widgets to messages that contain text, cards, or both - * text and cards. Not supported for messages that contain dialogs. + * text and cards. Not supported for messages that contain dialogs. For + * details, see [Add interactive widgets at the bottom of a + * message](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets). * Creating a message with accessory widgets requires [app * authentication] - * (https://developers.google.com/chat/api/guides/auth/service-accounts). - * The following example shows a Chat app that uses accessory widgets (thumbs - * up and thumbs down buttons) in a text message: - * ![Example accessory widgets - * message](https://developers.google.com/chat/images/message-accessory-widgets-reference.png) - * The JSON for this example message is the following: - * ``` - * { - * "text": "Rate your experience with this Chat app.", - * "accessoryWidgets": [ - * { - * "buttonList": { - * "buttons": [ - * { - * "icon": { - * "material_icon": { - * "name": "thumb_up" - * } - * }, - * "color": { - * "red": 0, - * "blue": 255, - * "green": 0 - * }, - * "onClick": { - * "action": { - * "function": "doUpvote", - * } - * } - * }, - * { - * "icon": { - * "material_icon": { - * "name": "thumb_down" - * } - * }, - * "color": { - * "red": 0, - * "blue": 255, - * "green": 0 - * }, - * "onClick": { - * "action": { - * "function": "doDownvote", - * } - * } - * } - * ] - * } - * } - * ] - * } - * ``` + * (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * * Generated from protobuf field repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44; * @return \Google\Protobuf\Internal\RepeatedField @@ -1545,62 +1399,12 @@ public function getAccessoryWidgets() /** * One or more interactive widgets that appear at the bottom of a message. * You can add accessory widgets to messages that contain text, cards, or both - * text and cards. Not supported for messages that contain dialogs. + * text and cards. Not supported for messages that contain dialogs. For + * details, see [Add interactive widgets at the bottom of a + * message](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets). * Creating a message with accessory widgets requires [app * authentication] - * (https://developers.google.com/chat/api/guides/auth/service-accounts). - * The following example shows a Chat app that uses accessory widgets (thumbs - * up and thumbs down buttons) in a text message: - * ![Example accessory widgets - * message](https://developers.google.com/chat/images/message-accessory-widgets-reference.png) - * The JSON for this example message is the following: - * ``` - * { - * "text": "Rate your experience with this Chat app.", - * "accessoryWidgets": [ - * { - * "buttonList": { - * "buttons": [ - * { - * "icon": { - * "material_icon": { - * "name": "thumb_up" - * } - * }, - * "color": { - * "red": 0, - * "blue": 255, - * "green": 0 - * }, - * "onClick": { - * "action": { - * "function": "doUpvote", - * } - * } - * }, - * { - * "icon": { - * "material_icon": { - * "name": "thumb_down" - * } - * }, - * "color": { - * "red": 0, - * "blue": 255, - * "green": 0 - * }, - * "onClick": { - * "action": { - * "function": "doDownvote", - * } - * } - * } - * ] - * } - * } - * ] - * } - * ``` + * (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * * Generated from protobuf field repeated .google.chat.v1.AccessoryWidget accessory_widgets = 44; * @param array<\Google\Apps\Chat\V1\AccessoryWidget>|\Google\Protobuf\Internal\RepeatedField $var diff --git a/AppsChat/src/Chat/V1/SetUpSpaceRequest.php b/AppsChat/src/Chat/V1/SetUpSpaceRequest.php index e26dc3ee59c7..5051e3a70944 100644 --- a/AppsChat/src/Chat/V1/SetUpSpaceRequest.php +++ b/AppsChat/src/Chat/V1/SetUpSpaceRequest.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Request to create a space and add specified users to it. + * * Generated from protobuf message google.chat.v1.SetUpSpaceRequest */ class SetUpSpaceRequest extends \Google\Protobuf\Internal\Message diff --git a/AppsChat/src/Chat/V1/SlashCommand.php b/AppsChat/src/Chat/V1/SlashCommand.php index e06d30be2cb2..07f44423d3b2 100644 --- a/AppsChat/src/Chat/V1/SlashCommand.php +++ b/AppsChat/src/Chat/V1/SlashCommand.php @@ -9,8 +9,9 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A [slash command](https://developers.google.com/chat/how-tos/slash-commands) - * in Google Chat. + * A [slash + * command](https://developers.google.com/workspace/chat/slash-commands) in + * Google Chat. * * Generated from protobuf message google.chat.v1.SlashCommand */ diff --git a/AppsChat/src/Chat/V1/Space.php b/AppsChat/src/Chat/V1/Space.php index 1816e0517f7e..9164e82839b9 100644 --- a/AppsChat/src/Chat/V1/Space.php +++ b/AppsChat/src/Chat/V1/Space.php @@ -55,7 +55,7 @@ class Space extends \Google\Protobuf\Internal\Message protected $threaded = false; /** * The space's display name. Required when [creating a - * space](https://developers.google.com/chat/api/reference/rest/v1/spaces/create). + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create). * If you receive the error message `ALREADY_EXISTS` when creating a space or * updating the `displayName`, try a different `displayName`. An * existing space within the Google Workspace organization might already use @@ -70,12 +70,17 @@ class Space extends \Google\Protobuf\Internal\Message * Immutable. Whether this space permits any Google Chat user as a member. * Input when creating a space in a Google Workspace organization. Omit this * field when creating spaces in the following conditions: - * * The authenticated user uses a Google Account. By default, - * the space permits any Google Chat user. + * * The authenticated user uses a consumer account (unmanaged user + * account). By default, a space created by a consumer account permits any + * Google Chat user. * * The space is used to [import data to Google Chat] - * (https://developers.google.com/chat/api/guides/import-data-overview). - * Import mode spaces must only permit members from the same Google - * Workspace organization. + * (https://developers.google.com/chat/api/guides/import-data-overview) + * because import mode spaces must only permit members from the same + * Google Workspace organization. However, as part of the [Google + * Workspace Developer Preview + * Program](https://developers.google.com/workspace/preview), import mode + * spaces can permit any Google Chat user so this field can then be set + * for import mode spaces. * For existing spaces, this field is output only. * * Generated from protobuf field bool external_user_allowed = 8 [(.google.api.field_behavior) = IMMUTABLE]; @@ -153,7 +158,7 @@ class Space extends \Google\Protobuf\Internal\Message * Whether messages are threaded in this space. * @type string $display_name * The space's display name. Required when [creating a - * space](https://developers.google.com/chat/api/reference/rest/v1/spaces/create). + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create). * If you receive the error message `ALREADY_EXISTS` when creating a space or * updating the `displayName`, try a different `displayName`. An * existing space within the Google Workspace organization might already use @@ -164,12 +169,17 @@ class Space extends \Google\Protobuf\Internal\Message * Immutable. Whether this space permits any Google Chat user as a member. * Input when creating a space in a Google Workspace organization. Omit this * field when creating spaces in the following conditions: - * * The authenticated user uses a Google Account. By default, - * the space permits any Google Chat user. + * * The authenticated user uses a consumer account (unmanaged user + * account). By default, a space created by a consumer account permits any + * Google Chat user. * * The space is used to [import data to Google Chat] - * (https://developers.google.com/chat/api/guides/import-data-overview). - * Import mode spaces must only permit members from the same Google - * Workspace organization. + * (https://developers.google.com/chat/api/guides/import-data-overview) + * because import mode spaces must only permit members from the same + * Google Workspace organization. However, as part of the [Google + * Workspace Developer Preview + * Program](https://developers.google.com/workspace/preview), import mode + * spaces can permit any Google Chat user so this field can then be set + * for import mode spaces. * For existing spaces, this field is output only. * @type int $space_threading_state * Output only. The threading state in the Chat space. @@ -352,7 +362,7 @@ public function setThreaded($var) /** * The space's display name. Required when [creating a - * space](https://developers.google.com/chat/api/reference/rest/v1/spaces/create). + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create). * If you receive the error message `ALREADY_EXISTS` when creating a space or * updating the `displayName`, try a different `displayName`. An * existing space within the Google Workspace organization might already use @@ -370,7 +380,7 @@ public function getDisplayName() /** * The space's display name. Required when [creating a - * space](https://developers.google.com/chat/api/reference/rest/v1/spaces/create). + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create). * If you receive the error message `ALREADY_EXISTS` when creating a space or * updating the `displayName`, try a different `displayName`. An * existing space within the Google Workspace organization might already use @@ -394,12 +404,17 @@ public function setDisplayName($var) * Immutable. Whether this space permits any Google Chat user as a member. * Input when creating a space in a Google Workspace organization. Omit this * field when creating spaces in the following conditions: - * * The authenticated user uses a Google Account. By default, - * the space permits any Google Chat user. + * * The authenticated user uses a consumer account (unmanaged user + * account). By default, a space created by a consumer account permits any + * Google Chat user. * * The space is used to [import data to Google Chat] - * (https://developers.google.com/chat/api/guides/import-data-overview). - * Import mode spaces must only permit members from the same Google - * Workspace organization. + * (https://developers.google.com/chat/api/guides/import-data-overview) + * because import mode spaces must only permit members from the same + * Google Workspace organization. However, as part of the [Google + * Workspace Developer Preview + * Program](https://developers.google.com/workspace/preview), import mode + * spaces can permit any Google Chat user so this field can then be set + * for import mode spaces. * For existing spaces, this field is output only. * * Generated from protobuf field bool external_user_allowed = 8 [(.google.api.field_behavior) = IMMUTABLE]; @@ -414,12 +429,17 @@ public function getExternalUserAllowed() * Immutable. Whether this space permits any Google Chat user as a member. * Input when creating a space in a Google Workspace organization. Omit this * field when creating spaces in the following conditions: - * * The authenticated user uses a Google Account. By default, - * the space permits any Google Chat user. + * * The authenticated user uses a consumer account (unmanaged user + * account). By default, a space created by a consumer account permits any + * Google Chat user. * * The space is used to [import data to Google Chat] - * (https://developers.google.com/chat/api/guides/import-data-overview). - * Import mode spaces must only permit members from the same Google - * Workspace organization. + * (https://developers.google.com/chat/api/guides/import-data-overview) + * because import mode spaces must only permit members from the same + * Google Workspace organization. However, as part of the [Google + * Workspace Developer Preview + * Program](https://developers.google.com/workspace/preview), import mode + * spaces can permit any Google Chat user so this field can then be set + * for import mode spaces. * For existing spaces, this field is output only. * * Generated from protobuf field bool external_user_allowed = 8 [(.google.api.field_behavior) = IMMUTABLE]; diff --git a/AppsChat/src/Chat/V1/Space/Type.php b/AppsChat/src/Chat/V1/Space/Type.php index 0971ff19b78e..3abc63374c1c 100644 --- a/AppsChat/src/Chat/V1/Space/Type.php +++ b/AppsChat/src/Chat/V1/Space/Type.php @@ -14,6 +14,8 @@ class Type { /** + * Reserved. + * * Generated from protobuf enum TYPE_UNSPECIFIED = 0; */ const TYPE_UNSPECIFIED = 0; diff --git a/AppsChat/src/Chat/V1/Thread.php b/AppsChat/src/Chat/V1/Thread.php index 978edec93ea8..199a101cc358 100644 --- a/AppsChat/src/Chat/V1/Thread.php +++ b/AppsChat/src/Chat/V1/Thread.php @@ -11,9 +11,9 @@ /** * A thread in a Google Chat space. For example usage, see * [Start or reply to a message - * thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). + * thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). * If you specify a thread when creating a message, you can set the - * [`messageReplyOption`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages/create#messagereplyoption) + * [`messageReplyOption`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#messagereplyoption) * field to determine what happens if no matching thread is found. * * Generated from protobuf message google.chat.v1.Thread diff --git a/AppsChat/src/Chat/V1/UpdateMessageRequest.php b/AppsChat/src/Chat/V1/UpdateMessageRequest.php index 487d069bb4ee..338ec6bf863c 100644 --- a/AppsChat/src/Chat/V1/UpdateMessageRequest.php +++ b/AppsChat/src/Chat/V1/UpdateMessageRequest.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Request to update a message. + * * Generated from protobuf message google.chat.v1.UpdateMessageRequest */ class UpdateMessageRequest extends \Google\Protobuf\Internal\Message @@ -38,7 +40,7 @@ class UpdateMessageRequest extends \Google\Protobuf\Internal\Message /** * Optional. If `true` and the message isn't found, a new message is created * and `updateMask` is ignored. The specified message ID must be - * [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message) + * [client-assigned](https://developers.google.com/workspace/chat/create-messages#name_a_created_message) * or the request fails. * * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -99,7 +101,7 @@ public static function build(\Google\Apps\Chat\V1\Message $message, \Google\Prot * @type bool $allow_missing * Optional. If `true` and the message isn't found, a new message is created * and `updateMask` is ignored. The specified message ID must be - * [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message) + * [client-assigned](https://developers.google.com/workspace/chat/create-messages#name_a_created_message) * or the request fails. * } */ @@ -203,7 +205,7 @@ public function setUpdateMask($var) /** * Optional. If `true` and the message isn't found, a new message is created * and `updateMask` is ignored. The specified message ID must be - * [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message) + * [client-assigned](https://developers.google.com/workspace/chat/create-messages#name_a_created_message) * or the request fails. * * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -217,7 +219,7 @@ public function getAllowMissing() /** * Optional. If `true` and the message isn't found, a new message is created * and `updateMask` is ignored. The specified message ID must be - * [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message) + * [client-assigned](https://developers.google.com/workspace/chat/create-messages#name_a_created_message) * or the request fails. * * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/AppsChat/src/Chat/V1/UpdateSpaceRequest.php b/AppsChat/src/Chat/V1/UpdateSpaceRequest.php index e7f71686d7a7..b612dda4892f 100644 --- a/AppsChat/src/Chat/V1/UpdateSpaceRequest.php +++ b/AppsChat/src/Chat/V1/UpdateSpaceRequest.php @@ -35,12 +35,13 @@ class UpdateSpaceRequest extends \Google\Protobuf\Internal\Message * `displayName`, try a different `displayName`. An existing space within the * Google Workspace organization might already use this display name.) * - `space_type` (Only supports changing a `GROUP_CHAT` space type to - * `SPACE`. Include `display_name` together with `space_type` in the update - * mask and ensure that the specified space has a non-empty display name and - * the `SPACE` space type. Including the `space_type` mask and the `SPACE` - * type in the specified space when updating the display name is optional if - * the existing space already has the `SPACE` type. Trying to update the - * space type in other ways results in an invalid argument error). + * `SPACE`. Include `display_name` together + * with `space_type` in the update mask and ensure that the specified space + * has a non-empty display name and the `SPACE` space type. Including the + * `space_type` mask and the `SPACE` type in the specified space when updating + * the display name is optional if the existing space already has the `SPACE` + * type. Trying to update the space type in other ways results in an invalid + * argument error). * - `space_details` * - `space_history_state` (Supports [turning history on or off for the * space](https://support.google.com/chat/answer/7664687) if [the organization @@ -75,12 +76,13 @@ class UpdateSpaceRequest extends \Google\Protobuf\Internal\Message * Google Workspace organization might already use this display name.) * * - `space_type` (Only supports changing a `GROUP_CHAT` space type to - * `SPACE`. Include `display_name` together with `space_type` in the update - * mask and ensure that the specified space has a non-empty display name and - * the `SPACE` space type. Including the `space_type` mask and the `SPACE` - * type in the specified space when updating the display name is optional if - * the existing space already has the `SPACE` type. Trying to update the - * space type in other ways results in an invalid argument error). + * `SPACE`. Include `display_name` together + * with `space_type` in the update mask and ensure that the specified space + * has a non-empty display name and the `SPACE` space type. Including the + * `space_type` mask and the `SPACE` type in the specified space when updating + * the display name is optional if the existing space already has the `SPACE` + * type. Trying to update the space type in other ways results in an invalid + * argument error). * * - `space_details` * @@ -89,6 +91,7 @@ class UpdateSpaceRequest extends \Google\Protobuf\Internal\Message * allows users to change their history * setting](https://support.google.com/a/answer/7664184). * Warning: mutually exclusive with all other field paths.) + * * - Developer Preview: `access_settings.audience` (Supports changing the * [access setting](https://support.google.com/chat/answer/11971020) of a * space. If no audience is specified in the access setting, the space's @@ -128,12 +131,13 @@ public static function build(\Google\Apps\Chat\V1\Space $space, \Google\Protobuf * `displayName`, try a different `displayName`. An existing space within the * Google Workspace organization might already use this display name.) * - `space_type` (Only supports changing a `GROUP_CHAT` space type to - * `SPACE`. Include `display_name` together with `space_type` in the update - * mask and ensure that the specified space has a non-empty display name and - * the `SPACE` space type. Including the `space_type` mask and the `SPACE` - * type in the specified space when updating the display name is optional if - * the existing space already has the `SPACE` type. Trying to update the - * space type in other ways results in an invalid argument error). + * `SPACE`. Include `display_name` together + * with `space_type` in the update mask and ensure that the specified space + * has a non-empty display name and the `SPACE` space type. Including the + * `space_type` mask and the `SPACE` type in the specified space when updating + * the display name is optional if the existing space already has the `SPACE` + * type. Trying to update the space type in other ways results in an invalid + * argument error). * - `space_details` * - `space_history_state` (Supports [turning history on or off for the * space](https://support.google.com/chat/answer/7664687) if [the organization @@ -204,12 +208,13 @@ public function setSpace($var) * `displayName`, try a different `displayName`. An existing space within the * Google Workspace organization might already use this display name.) * - `space_type` (Only supports changing a `GROUP_CHAT` space type to - * `SPACE`. Include `display_name` together with `space_type` in the update - * mask and ensure that the specified space has a non-empty display name and - * the `SPACE` space type. Including the `space_type` mask and the `SPACE` - * type in the specified space when updating the display name is optional if - * the existing space already has the `SPACE` type. Trying to update the - * space type in other ways results in an invalid argument error). + * `SPACE`. Include `display_name` together + * with `space_type` in the update mask and ensure that the specified space + * has a non-empty display name and the `SPACE` space type. Including the + * `space_type` mask and the `SPACE` type in the specified space when updating + * the display name is optional if the existing space already has the `SPACE` + * type. Trying to update the space type in other ways results in an invalid + * argument error). * - `space_details` * - `space_history_state` (Supports [turning history on or off for the * space](https://support.google.com/chat/answer/7664687) if [the organization @@ -252,12 +257,13 @@ public function clearUpdateMask() * `displayName`, try a different `displayName`. An existing space within the * Google Workspace organization might already use this display name.) * - `space_type` (Only supports changing a `GROUP_CHAT` space type to - * `SPACE`. Include `display_name` together with `space_type` in the update - * mask and ensure that the specified space has a non-empty display name and - * the `SPACE` space type. Including the `space_type` mask and the `SPACE` - * type in the specified space when updating the display name is optional if - * the existing space already has the `SPACE` type. Trying to update the - * space type in other ways results in an invalid argument error). + * `SPACE`. Include `display_name` together + * with `space_type` in the update mask and ensure that the specified space + * has a non-empty display name and the `SPACE` space type. Including the + * `space_type` mask and the `SPACE` type in the specified space when updating + * the display name is optional if the existing space already has the `SPACE` + * type. Trying to update the space type in other ways results in an invalid + * argument error). * - `space_details` * - `space_history_state` (Supports [turning history on or off for the * space](https://support.google.com/chat/answer/7664687) if [the organization diff --git a/AppsChat/src/Chat/V1/UploadAttachmentRequest.php b/AppsChat/src/Chat/V1/UploadAttachmentRequest.php index c5710da1988e..2afa91efd97d 100644 --- a/AppsChat/src/Chat/V1/UploadAttachmentRequest.php +++ b/AppsChat/src/Chat/V1/UploadAttachmentRequest.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Request to upload an attachment. + * * Generated from protobuf message google.chat.v1.UploadAttachmentRequest */ class UploadAttachmentRequest extends \Google\Protobuf\Internal\Message diff --git a/AppsChat/src/Chat/V1/UploadAttachmentResponse.php b/AppsChat/src/Chat/V1/UploadAttachmentResponse.php index 2c691fed6225..942c71f0fe3b 100644 --- a/AppsChat/src/Chat/V1/UploadAttachmentResponse.php +++ b/AppsChat/src/Chat/V1/UploadAttachmentResponse.php @@ -9,6 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Response of uploading an attachment. + * * Generated from protobuf message google.chat.v1.UploadAttachmentResponse */ class UploadAttachmentResponse extends \Google\Protobuf\Internal\Message diff --git a/AppsChat/src/Chat/V1/User.php b/AppsChat/src/Chat/V1/User.php index 24b1f16affe1..87cb7134117f 100644 --- a/AppsChat/src/Chat/V1/User.php +++ b/AppsChat/src/Chat/V1/User.php @@ -11,8 +11,9 @@ /** * A user in Google Chat. * When returned as an output from a request, if your Chat app [authenticates as - * a user](https://developers.google.com/chat/api/guides/auth/users), the output - * for a `User` resource only populates the user's `name` and `type`. + * a + * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + * the output for a `User` resource only populates the user's `name` and `type`. * * Generated from protobuf message google.chat.v1.User */ diff --git a/AppsChat/src/Chat/V1/WidgetMarkup/KeyValue.php b/AppsChat/src/Chat/V1/WidgetMarkup/KeyValue.php index 052eb523f7c1..61aa4b92e409 100644 --- a/AppsChat/src/Chat/V1/WidgetMarkup/KeyValue.php +++ b/AppsChat/src/Chat/V1/WidgetMarkup/KeyValue.php @@ -20,7 +20,7 @@ class KeyValue extends \Google\Protobuf\Internal\Message * The text of the top label. Formatted text supported. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -34,7 +34,7 @@ class KeyValue extends \Google\Protobuf\Internal\Message * For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -52,7 +52,7 @@ class KeyValue extends \Google\Protobuf\Internal\Message /** * The text of the bottom label. Formatted text supported. For more * information about formatting text, see [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -86,7 +86,7 @@ class KeyValue extends \Google\Protobuf\Internal\Message * The text of the top label. Formatted text supported. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -96,7 +96,7 @@ class KeyValue extends \Google\Protobuf\Internal\Message * For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -106,7 +106,7 @@ class KeyValue extends \Google\Protobuf\Internal\Message * @type string $bottom_label * The text of the bottom label. Formatted text supported. For more * information about formatting text, see [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -191,7 +191,7 @@ public function setIconUrl($var) * The text of the top label. Formatted text supported. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -209,7 +209,7 @@ public function getTopLabel() * The text of the top label. Formatted text supported. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -232,7 +232,7 @@ public function setTopLabel($var) * For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -251,7 +251,7 @@ public function getContent() * For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -298,7 +298,7 @@ public function setContentMultiline($var) /** * The text of the bottom label. Formatted text supported. For more * information about formatting text, see [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace @@ -315,7 +315,7 @@ public function getBottomLabel() /** * The text of the bottom label. Formatted text supported. For more * information about formatting text, see [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace diff --git a/AppsChat/src/Chat/V1/WidgetMarkup/TextParagraph.php b/AppsChat/src/Chat/V1/WidgetMarkup/TextParagraph.php index f5cbeffb1b15..3c124c0da7a8 100644 --- a/AppsChat/src/Chat/V1/WidgetMarkup/TextParagraph.php +++ b/AppsChat/src/Chat/V1/WidgetMarkup/TextParagraph.php @@ -12,7 +12,7 @@ * A paragraph of text. Formatted text supported. For more information * about formatting text, see * [Formatting text in Google Chat - * apps](https://developers.google.com/chat/format-messages#card-formatting) + * apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) * and * [Formatting * text in Google Workspace