diff --git a/AppsChat/metadata/Chat/V1/ChatService.php b/AppsChat/metadata/Chat/V1/ChatService.php index 9fad8729acc0..db0e933ab7f6 100644 Binary files a/AppsChat/metadata/Chat/V1/ChatService.php and b/AppsChat/metadata/Chat/V1/ChatService.php differ diff --git a/AppsChat/metadata/Chat/V1/EventPayload.php b/AppsChat/metadata/Chat/V1/EventPayload.php new file mode 100644 index 000000000000..002a8589e7f5 --- /dev/null +++ b/AppsChat/metadata/Chat/V1/EventPayload.php @@ -0,0 +1,71 @@ +internalAddGeneratedFile( + ' +¹ +"google/chat/v1/event_payload.protogoogle.chat.v1google/chat/v1/membership.protogoogle/chat/v1/message.protogoogle/chat/v1/reaction.protogoogle/chat/v1/space.proto"L +MembershipCreatedEventData. + +membership ( 2.google.chat.v1.Membership"L +MembershipDeletedEventData. + +membership ( 2.google.chat.v1.Membership"L +MembershipUpdatedEventData. + +membership ( 2.google.chat.v1.Membership"b +MembershipBatchCreatedEventData? + memberships ( 2*.google.chat.v1.MembershipCreatedEventData"b +MembershipBatchUpdatedEventData? + memberships ( 2*.google.chat.v1.MembershipUpdatedEventData"b +MembershipBatchDeletedEventData? + memberships ( 2*.google.chat.v1.MembershipDeletedEventData"C +MessageCreatedEventData( +message ( 2.google.chat.v1.Message"C +MessageUpdatedEventData( +message ( 2.google.chat.v1.Message"C +MessageDeletedEventData( +message ( 2.google.chat.v1.Message"Y +MessageBatchCreatedEventData9 +messages ( 2\'.google.chat.v1.MessageCreatedEventData"Y +MessageBatchUpdatedEventData9 +messages ( 2\'.google.chat.v1.MessageUpdatedEventData"Y +MessageBatchDeletedEventData9 +messages ( 2\'.google.chat.v1.MessageDeletedEventData"= +SpaceUpdatedEventData$ +space ( 2.google.chat.v1.Space"S +SpaceBatchUpdatedEventData5 +spaces ( 2%.google.chat.v1.SpaceUpdatedEventData"F +ReactionCreatedEventData* +reaction ( 2.google.chat.v1.Reaction"F +ReactionDeletedEventData* +reaction ( 2.google.chat.v1.Reaction"\\ +ReactionBatchCreatedEventData; + reactions ( 2(.google.chat.v1.ReactionCreatedEventData"\\ +ReactionBatchDeletedEventData; + reactions ( 2(.google.chat.v1.ReactionDeletedEventDataBª +com.google.chat.v1BEventPayloadProtoPZ,cloud.google.com/go/chat/apiv1/chatpb;chatpb¢ DYNAPIProtoªGoogle.Apps.Chat.V1ÊGoogle\\Apps\\Chat\\V1êGoogle::Apps::Chat::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AppsChat/metadata/Chat/V1/SpaceEvent.php b/AppsChat/metadata/Chat/V1/SpaceEvent.php new file mode 100644 index 000000000000..28b3baeaed4a Binary files /dev/null and b/AppsChat/metadata/Chat/V1/SpaceEvent.php differ diff --git a/AppsChat/samples/V1/ChatServiceClient/get_space_event.php b/AppsChat/samples/V1/ChatServiceClient/get_space_event.php new file mode 100644 index 000000000000..3a0bd5f76858 --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/get_space_event.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var SpaceEvent $response */ + $response = $chatServiceClient->getSpaceEvent($request); + 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::spaceEventName('[SPACE]', '[SPACE_EVENT]'); + + get_space_event_sample($formattedName); +} +// [END chat_v1_generated_ChatService_GetSpaceEvent_sync] diff --git a/AppsChat/samples/V1/ChatServiceClient/list_space_events.php b/AppsChat/samples/V1/ChatServiceClient/list_space_events.php new file mode 100644 index 000000000000..6998213ce1c4 --- /dev/null +++ b/AppsChat/samples/V1/ChatServiceClient/list_space_events.php @@ -0,0 +1,147 @@ +setParent($formattedParent) + ->setFilter($filter); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $chatServiceClient->listSpaceEvents($request); + + /** @var SpaceEvent $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ChatServiceClient::spaceName('[SPACE]'); + $filter = '[FILTER]'; + + list_space_events_sample($formattedParent, $filter); +} +// [END chat_v1_generated_ChatService_ListSpaceEvents_sync] diff --git a/AppsChat/src/Chat/V1/Client/ChatServiceClient.php b/AppsChat/src/Chat/V1/Client/ChatServiceClient.php index de76b85d72f6..10158583e8a6 100644 --- a/AppsChat/src/Chat/V1/Client/ChatServiceClient.php +++ b/AppsChat/src/Chat/V1/Client/ChatServiceClient.php @@ -47,18 +47,21 @@ use Google\Apps\Chat\V1\GetAttachmentRequest; use Google\Apps\Chat\V1\GetMembershipRequest; use Google\Apps\Chat\V1\GetMessageRequest; +use Google\Apps\Chat\V1\GetSpaceEventRequest; use Google\Apps\Chat\V1\GetSpaceReadStateRequest; use Google\Apps\Chat\V1\GetSpaceRequest; use Google\Apps\Chat\V1\GetThreadReadStateRequest; use Google\Apps\Chat\V1\ListMembershipsRequest; use Google\Apps\Chat\V1\ListMessagesRequest; use Google\Apps\Chat\V1\ListReactionsRequest; +use Google\Apps\Chat\V1\ListSpaceEventsRequest; use Google\Apps\Chat\V1\ListSpacesRequest; 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\SpaceEvent; use Google\Apps\Chat\V1\SpaceReadState; use Google\Apps\Chat\V1\ThreadReadState; use Google\Apps\Chat\V1\UpdateMembershipRequest; @@ -96,11 +99,13 @@ * @method PromiseInterface getMembershipAsync(GetMembershipRequest $request, array $optionalArgs = []) * @method PromiseInterface getMessageAsync(GetMessageRequest $request, array $optionalArgs = []) * @method PromiseInterface getSpaceAsync(GetSpaceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSpaceEventAsync(GetSpaceEventRequest $request, array $optionalArgs = []) * @method PromiseInterface getSpaceReadStateAsync(GetSpaceReadStateRequest $request, array $optionalArgs = []) * @method PromiseInterface getThreadReadStateAsync(GetThreadReadStateRequest $request, array $optionalArgs = []) * @method PromiseInterface listMembershipsAsync(ListMembershipsRequest $request, array $optionalArgs = []) * @method PromiseInterface listMessagesAsync(ListMessagesRequest $request, array $optionalArgs = []) * @method PromiseInterface listReactionsAsync(ListReactionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSpaceEventsAsync(ListSpaceEventsRequest $request, array $optionalArgs = []) * @method PromiseInterface listSpacesAsync(ListSpacesRequest $request, array $optionalArgs = []) * @method PromiseInterface setUpSpaceAsync(SetUpSpaceRequest $request, array $optionalArgs = []) * @method PromiseInterface updateMembershipAsync(UpdateMembershipRequest $request, array $optionalArgs = []) @@ -287,6 +292,23 @@ public static function spaceName(string $space): string ]); } + /** + * Formats a string containing the fully-qualified path to represent a space_event + * resource. + * + * @param string $space + * @param string $spaceEvent + * + * @return string The formatted space_event resource. + */ + public static function spaceEventName(string $space, string $spaceEvent): string + { + return self::getPathTemplate('spaceEvent')->render([ + 'space' => $space, + 'space_event' => $spaceEvent, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * space_read_state resource. @@ -350,6 +372,7 @@ public static function threadReadStateName(string $user, string $space, string $ * - quotedMessageMetadata: spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata} * - reaction: spaces/{space}/messages/{message}/reactions/{reaction} * - space: spaces/{space} + * - spaceEvent: spaces/{space}/spaceEvents/{space_event} * - spaceReadState: users/{user}/spaces/{space}/spaceReadState * - thread: spaces/{space}/threads/{thread} * - threadReadState: users/{user}/spaces/{space}/threads/{thread}/threadReadState @@ -952,6 +975,45 @@ public function getSpace(GetSpaceRequest $request, array $callOptions = []): Spa return $this->startApiCall('GetSpace', $request, $callOptions)->wait(); } + /** + * Returns an event from a Google Chat space. The [event + * payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) + * contains the most recent version of the resource that changed. For example, + * if you request an event about a new message but the message was later + * updated, the server returns the updated `Message` resource in the event + * payload. + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * To get an event, the authenticated user must be a member of the space. + * + * For an example, see [Get details about an + * event from a Google Chat + * space](https://developers.google.com/workspace/chat/get-space-event). + * + * The async variant is {@see ChatServiceClient::getSpaceEventAsync()} . + * + * @example samples/V1/ChatServiceClient/get_space_event.php + * + * @param GetSpaceEventRequest $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 SpaceEvent + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSpaceEvent(GetSpaceEventRequest $request, array $callOptions = []): SpaceEvent + { + return $this->startApiCall('GetSpaceEvent', $request, $callOptions)->wait(); + } + /** * Returns details about a user's read state within a space, used to identify * read and unread messages. For an example, see [Get details about a user's @@ -1120,6 +1182,45 @@ public function listReactions(ListReactionsRequest $request, array $callOptions return $this->startApiCall('ListReactions', $request, $callOptions); } + /** + * Lists events from a Google Chat space. For each event, the + * [payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) + * contains the most recent version of the Chat resource. For example, if you + * list events about new space members, the server returns `Membership` + * resources that contain the latest membership details. If new members were + * removed during the requested period, the event payload contains an empty + * `Membership` resource. + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * To list events, the authenticated user must be a member of the space. + * + * For an example, see [List events from a Google Chat + * space](https://developers.google.com/workspace/chat/list-space-events). + * + * The async variant is {@see ChatServiceClient::listSpaceEventsAsync()} . + * + * @example samples/V1/ChatServiceClient/list_space_events.php + * + * @param ListSpaceEventsRequest $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 listSpaceEvents(ListSpaceEventsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSpaceEvents', $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 diff --git a/AppsChat/src/Chat/V1/GetSpaceEventRequest.php b/AppsChat/src/Chat/V1/GetSpaceEventRequest.php new file mode 100644 index 000000000000..892b3632ebb6 --- /dev/null +++ b/AppsChat/src/Chat/V1/GetSpaceEventRequest.php @@ -0,0 +1,87 @@ +google.chat.v1.GetSpaceEventRequest + */ +class GetSpaceEventRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the space event. + * Format: `spaces/{space}/spaceEvents/{spaceEvent}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the space event. + * + * Format: `spaces/{space}/spaceEvents/{spaceEvent}` + * Please see {@see ChatServiceClient::spaceEventName()} for help formatting this field. + * + * @return \Google\Apps\Chat\V1\GetSpaceEventRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the space event. + * Format: `spaces/{space}/spaceEvents/{spaceEvent}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\SpaceEvent::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the space event. + * Format: `spaces/{space}/spaceEvents/{spaceEvent}` + * + * 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. The resource name of the space event. + * Format: `spaces/{space}/spaceEvents/{spaceEvent}` + * + * 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/ListSpaceEventsRequest.php b/AppsChat/src/Chat/V1/ListSpaceEventsRequest.php new file mode 100644 index 000000000000..d4cf55391b8b --- /dev/null +++ b/AppsChat/src/Chat/V1/ListSpaceEventsRequest.php @@ -0,0 +1,444 @@ +google.chat.v1.ListSpaceEventsRequest + */ +class ListSpaceEventsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the [Google Chat + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + * where the events occurred. + * 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 space events returned. The service might + * return fewer than this value. + * Negative values return an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field int32 page_size = 5; + */ + protected $page_size = 0; + /** + * A page token, received from a previous list space events call. Provide this + * to retrieve the subsequent page. + * When paginating, all other parameters provided to list space events must + * 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 = 6; + */ + protected $page_token = ''; + /** + * Required. A query filter. + * You must specify at least one event type (`event_type`) + * using the has `:` operator. To filter by multiple event types, use the `OR` + * operator. Omit batch event types in your filter. The request automatically + * returns any related batch events. For example, if you filter by new + * reactions + * (`google.workspace.chat.reaction.v1.created`), the server also returns + * batch new reactions events + * (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported + * event types, see the [`SpaceEvents` reference + * documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type). + * Optionally, you can also filter by start time (`start_time`) and + * end time (`end_time`): + * * `start_time`: Exclusive timestamp from which to start listing space + * events. + * You can list events that occurred up to 28 days ago. If unspecified, lists + * space events from the past 28 days. + * * `end_time`: Inclusive timestamp until which space events are listed. + * If unspecified, lists events up to the time of the request. + * To specify a start or end time, use the equals `=` operator and format in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). To filter by both + * `start_time` and `end_time`, use the `AND` operator. + * For example, the following queries are valid: + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * (event_types:"google.workspace.chat.space.v1.updated" OR + * event_types:"google.workspace.chat.message.v1.created") + * ``` + * The following queries are invalid: + * ``` + * start_time="2023-08-23T19:20:33+00:00" OR + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * event_types:"google.workspace.chat.space.v1.updated" AND + * event_types:"google.workspace.chat.message.v1.created" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. Resource name of the [Google Chat + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + * where the events occurred. + * + * Format: `spaces/{space}`. Please see + * {@see ChatServiceClient::spaceName()} for help formatting this field. + * @param string $filter Required. A query filter. + * + * You must specify at least one event type (`event_type`) + * using the has `:` operator. To filter by multiple event types, use the `OR` + * operator. Omit batch event types in your filter. The request automatically + * returns any related batch events. For example, if you filter by new + * reactions + * (`google.workspace.chat.reaction.v1.created`), the server also returns + * batch new reactions events + * (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported + * event types, see the [`SpaceEvents` reference + * documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type). + * + * Optionally, you can also filter by start time (`start_time`) and + * end time (`end_time`): + * + * * `start_time`: Exclusive timestamp from which to start listing space + * events. + * You can list events that occurred up to 28 days ago. If unspecified, lists + * space events from the past 28 days. + * * `end_time`: Inclusive timestamp until which space events are listed. + * If unspecified, lists events up to the time of the request. + * + * To specify a start or end time, use the equals `=` operator and format in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). To filter by both + * `start_time` and `end_time`, use the `AND` operator. + * + * For example, the following queries are valid: + * + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * (event_types:"google.workspace.chat.space.v1.updated" OR + * event_types:"google.workspace.chat.message.v1.created") + * ``` + * + * The following queries are invalid: + * + * ``` + * start_time="2023-08-23T19:20:33+00:00" OR + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * event_types:"google.workspace.chat.space.v1.updated" AND + * event_types:"google.workspace.chat.message.v1.created" + * ``` + * + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * @return \Google\Apps\Chat\V1\ListSpaceEventsRequest + * + * @experimental + */ + public static function build(string $parent, string $filter): self + { + return (new self()) + ->setParent($parent) + ->setFilter($filter); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the [Google Chat + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + * where the events occurred. + * Format: `spaces/{space}`. + * @type int $page_size + * Optional. The maximum number of space events returned. The service might + * return fewer than this value. + * Negative values return an `INVALID_ARGUMENT` error. + * @type string $page_token + * A page token, received from a previous list space events call. Provide this + * to retrieve the subsequent page. + * When paginating, all other parameters provided to list space events must + * match the call that provided the page token. Passing different values to + * the other parameters might lead to unexpected results. + * @type string $filter + * Required. A query filter. + * You must specify at least one event type (`event_type`) + * using the has `:` operator. To filter by multiple event types, use the `OR` + * operator. Omit batch event types in your filter. The request automatically + * returns any related batch events. For example, if you filter by new + * reactions + * (`google.workspace.chat.reaction.v1.created`), the server also returns + * batch new reactions events + * (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported + * event types, see the [`SpaceEvents` reference + * documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type). + * Optionally, you can also filter by start time (`start_time`) and + * end time (`end_time`): + * * `start_time`: Exclusive timestamp from which to start listing space + * events. + * You can list events that occurred up to 28 days ago. If unspecified, lists + * space events from the past 28 days. + * * `end_time`: Inclusive timestamp until which space events are listed. + * If unspecified, lists events up to the time of the request. + * To specify a start or end time, use the equals `=` operator and format in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). To filter by both + * `start_time` and `end_time`, use the `AND` operator. + * For example, the following queries are valid: + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * (event_types:"google.workspace.chat.space.v1.updated" OR + * event_types:"google.workspace.chat.message.v1.created") + * ``` + * The following queries are invalid: + * ``` + * start_time="2023-08-23T19:20:33+00:00" OR + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * event_types:"google.workspace.chat.space.v1.updated" AND + * event_types:"google.workspace.chat.message.v1.created" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\SpaceEvent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the [Google Chat + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + * where the events occurred. + * 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 [Google Chat + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + * where the events occurred. + * 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 space events returned. The service might + * return fewer than this value. + * Negative values return an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field int32 page_size = 5; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of space events returned. The service might + * return fewer than this value. + * Negative values return an `INVALID_ARGUMENT` error. + * + * Generated from protobuf field int32 page_size = 5; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token, received from a previous list space events call. Provide this + * to retrieve the subsequent page. + * When paginating, all other parameters provided to list space events must + * 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 = 6; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, received from a previous list space events call. Provide this + * to retrieve the subsequent page. + * When paginating, all other parameters provided to list space events must + * 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 = 6; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Required. A query filter. + * You must specify at least one event type (`event_type`) + * using the has `:` operator. To filter by multiple event types, use the `OR` + * operator. Omit batch event types in your filter. The request automatically + * returns any related batch events. For example, if you filter by new + * reactions + * (`google.workspace.chat.reaction.v1.created`), the server also returns + * batch new reactions events + * (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported + * event types, see the [`SpaceEvents` reference + * documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type). + * Optionally, you can also filter by start time (`start_time`) and + * end time (`end_time`): + * * `start_time`: Exclusive timestamp from which to start listing space + * events. + * You can list events that occurred up to 28 days ago. If unspecified, lists + * space events from the past 28 days. + * * `end_time`: Inclusive timestamp until which space events are listed. + * If unspecified, lists events up to the time of the request. + * To specify a start or end time, use the equals `=` operator and format in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). To filter by both + * `start_time` and `end_time`, use the `AND` operator. + * For example, the following queries are valid: + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * (event_types:"google.workspace.chat.space.v1.updated" OR + * event_types:"google.workspace.chat.message.v1.created") + * ``` + * The following queries are invalid: + * ``` + * start_time="2023-08-23T19:20:33+00:00" OR + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * event_types:"google.workspace.chat.space.v1.updated" AND + * event_types:"google.workspace.chat.message.v1.created" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. A query filter. + * You must specify at least one event type (`event_type`) + * using the has `:` operator. To filter by multiple event types, use the `OR` + * operator. Omit batch event types in your filter. The request automatically + * returns any related batch events. For example, if you filter by new + * reactions + * (`google.workspace.chat.reaction.v1.created`), the server also returns + * batch new reactions events + * (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported + * event types, see the [`SpaceEvents` reference + * documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type). + * Optionally, you can also filter by start time (`start_time`) and + * end time (`end_time`): + * * `start_time`: Exclusive timestamp from which to start listing space + * events. + * You can list events that occurred up to 28 days ago. If unspecified, lists + * space events from the past 28 days. + * * `end_time`: Inclusive timestamp until which space events are listed. + * If unspecified, lists events up to the time of the request. + * To specify a start or end time, use the equals `=` operator and format in + * [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). To filter by both + * `start_time` and `end_time`, use the `AND` operator. + * For example, the following queries are valid: + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * start_time="2023-08-23T19:20:33+00:00" AND + * (event_types:"google.workspace.chat.space.v1.updated" OR + * event_types:"google.workspace.chat.message.v1.created") + * ``` + * The following queries are invalid: + * ``` + * start_time="2023-08-23T19:20:33+00:00" OR + * end_time="2023-08-23T19:21:54+00:00" + * ``` + * ``` + * event_types:"google.workspace.chat.space.v1.updated" AND + * event_types:"google.workspace.chat.message.v1.created" + * ``` + * Invalid queries are rejected by the server with an `INVALID_ARGUMENT` + * error. + * + * Generated from protobuf field string filter = 8 [(.google.api.field_behavior) = REQUIRED]; + * @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/ListSpaceEventsResponse.php b/AppsChat/src/Chat/V1/ListSpaceEventsResponse.php new file mode 100644 index 000000000000..e2c6a3830f47 --- /dev/null +++ b/AppsChat/src/Chat/V1/ListSpaceEventsResponse.php @@ -0,0 +1,105 @@ +google.chat.v1.ListSpaceEventsResponse + */ +class ListSpaceEventsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Results are returned in chronological order (oldest event first). + * + * Generated from protobuf field repeated .google.chat.v1.SpaceEvent space_events = 1; + */ + private $space_events; + /** + * Continuation token used to fetch more events. + * If this field is omitted, 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\SpaceEvent>|\Google\Protobuf\Internal\RepeatedField $space_events + * Results are returned in chronological order (oldest event first). + * @type string $next_page_token + * Continuation token used to fetch more events. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\SpaceEvent::initOnce(); + parent::__construct($data); + } + + /** + * Results are returned in chronological order (oldest event first). + * + * Generated from protobuf field repeated .google.chat.v1.SpaceEvent space_events = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpaceEvents() + { + return $this->space_events; + } + + /** + * Results are returned in chronological order (oldest event first). + * + * Generated from protobuf field repeated .google.chat.v1.SpaceEvent space_events = 1; + * @param array<\Google\Apps\Chat\V1\SpaceEvent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpaceEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\SpaceEvent::class); + $this->space_events = $arr; + + return $this; + } + + /** + * Continuation token used to fetch more events. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Continuation token used to fetch more events. + * If this field is omitted, 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/MembershipBatchCreatedEventData.php b/AppsChat/src/Chat/V1/MembershipBatchCreatedEventData.php new file mode 100644 index 000000000000..699e47e35da3 --- /dev/null +++ b/AppsChat/src/Chat/V1/MembershipBatchCreatedEventData.php @@ -0,0 +1,68 @@ +google.chat.v1.MembershipBatchCreatedEventData + */ +class MembershipBatchCreatedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * A list of new memberships. + * + * Generated from protobuf field repeated .google.chat.v1.MembershipCreatedEventData memberships = 1; + */ + private $memberships; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Apps\Chat\V1\MembershipCreatedEventData>|\Google\Protobuf\Internal\RepeatedField $memberships + * A list of new memberships. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * A list of new memberships. + * + * Generated from protobuf field repeated .google.chat.v1.MembershipCreatedEventData memberships = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMemberships() + { + return $this->memberships; + } + + /** + * A list of new memberships. + * + * Generated from protobuf field repeated .google.chat.v1.MembershipCreatedEventData memberships = 1; + * @param array<\Google\Apps\Chat\V1\MembershipCreatedEventData>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMemberships($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\MembershipCreatedEventData::class); + $this->memberships = $arr; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/MembershipBatchDeletedEventData.php b/AppsChat/src/Chat/V1/MembershipBatchDeletedEventData.php new file mode 100644 index 000000000000..55b38cfbba73 --- /dev/null +++ b/AppsChat/src/Chat/V1/MembershipBatchDeletedEventData.php @@ -0,0 +1,68 @@ +google.chat.v1.MembershipBatchDeletedEventData + */ +class MembershipBatchDeletedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * A list of deleted memberships. + * + * Generated from protobuf field repeated .google.chat.v1.MembershipDeletedEventData memberships = 1; + */ + private $memberships; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Apps\Chat\V1\MembershipDeletedEventData>|\Google\Protobuf\Internal\RepeatedField $memberships + * A list of deleted memberships. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * A list of deleted memberships. + * + * Generated from protobuf field repeated .google.chat.v1.MembershipDeletedEventData memberships = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMemberships() + { + return $this->memberships; + } + + /** + * A list of deleted memberships. + * + * Generated from protobuf field repeated .google.chat.v1.MembershipDeletedEventData memberships = 1; + * @param array<\Google\Apps\Chat\V1\MembershipDeletedEventData>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMemberships($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\MembershipDeletedEventData::class); + $this->memberships = $arr; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/MembershipBatchUpdatedEventData.php b/AppsChat/src/Chat/V1/MembershipBatchUpdatedEventData.php new file mode 100644 index 000000000000..a69226399552 --- /dev/null +++ b/AppsChat/src/Chat/V1/MembershipBatchUpdatedEventData.php @@ -0,0 +1,68 @@ +google.chat.v1.MembershipBatchUpdatedEventData + */ +class MembershipBatchUpdatedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * A list of updated memberships. + * + * Generated from protobuf field repeated .google.chat.v1.MembershipUpdatedEventData memberships = 1; + */ + private $memberships; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Apps\Chat\V1\MembershipUpdatedEventData>|\Google\Protobuf\Internal\RepeatedField $memberships + * A list of updated memberships. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * A list of updated memberships. + * + * Generated from protobuf field repeated .google.chat.v1.MembershipUpdatedEventData memberships = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMemberships() + { + return $this->memberships; + } + + /** + * A list of updated memberships. + * + * Generated from protobuf field repeated .google.chat.v1.MembershipUpdatedEventData memberships = 1; + * @param array<\Google\Apps\Chat\V1\MembershipUpdatedEventData>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMemberships($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\MembershipUpdatedEventData::class); + $this->memberships = $arr; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/MembershipCreatedEventData.php b/AppsChat/src/Chat/V1/MembershipCreatedEventData.php new file mode 100644 index 000000000000..f7eda903edad --- /dev/null +++ b/AppsChat/src/Chat/V1/MembershipCreatedEventData.php @@ -0,0 +1,78 @@ +google.chat.v1.MembershipCreatedEventData + */ +class MembershipCreatedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * The new membership. + * + * Generated from protobuf field .google.chat.v1.Membership membership = 1; + */ + protected $membership = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Membership $membership + * The new membership. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * The new membership. + * + * Generated from protobuf field .google.chat.v1.Membership membership = 1; + * @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); + } + + /** + * The new membership. + * + * Generated from protobuf field .google.chat.v1.Membership membership = 1; + * @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/MembershipDeletedEventData.php b/AppsChat/src/Chat/V1/MembershipDeletedEventData.php new file mode 100644 index 000000000000..ec28249ca189 --- /dev/null +++ b/AppsChat/src/Chat/V1/MembershipDeletedEventData.php @@ -0,0 +1,78 @@ +google.chat.v1.MembershipDeletedEventData + */ +class MembershipDeletedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * The deleted membership. Only the `name` and `state` fields are populated. + * + * Generated from protobuf field .google.chat.v1.Membership membership = 1; + */ + protected $membership = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Membership $membership + * The deleted membership. Only the `name` and `state` fields are populated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * The deleted membership. Only the `name` and `state` fields are populated. + * + * Generated from protobuf field .google.chat.v1.Membership membership = 1; + * @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); + } + + /** + * The deleted membership. Only the `name` and `state` fields are populated. + * + * Generated from protobuf field .google.chat.v1.Membership membership = 1; + * @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/MembershipUpdatedEventData.php b/AppsChat/src/Chat/V1/MembershipUpdatedEventData.php new file mode 100644 index 000000000000..df395bd6d237 --- /dev/null +++ b/AppsChat/src/Chat/V1/MembershipUpdatedEventData.php @@ -0,0 +1,78 @@ +google.chat.v1.MembershipUpdatedEventData + */ +class MembershipUpdatedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * The updated membership. + * + * Generated from protobuf field .google.chat.v1.Membership membership = 1; + */ + protected $membership = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Membership $membership + * The updated membership. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * The updated membership. + * + * Generated from protobuf field .google.chat.v1.Membership membership = 1; + * @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); + } + + /** + * The updated membership. + * + * Generated from protobuf field .google.chat.v1.Membership membership = 1; + * @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/MessageBatchCreatedEventData.php b/AppsChat/src/Chat/V1/MessageBatchCreatedEventData.php new file mode 100644 index 000000000000..df1973205c35 --- /dev/null +++ b/AppsChat/src/Chat/V1/MessageBatchCreatedEventData.php @@ -0,0 +1,68 @@ +google.chat.v1.MessageBatchCreatedEventData + */ +class MessageBatchCreatedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * A list of new messages. + * + * Generated from protobuf field repeated .google.chat.v1.MessageCreatedEventData messages = 1; + */ + private $messages; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Apps\Chat\V1\MessageCreatedEventData>|\Google\Protobuf\Internal\RepeatedField $messages + * A list of new messages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * A list of new messages. + * + * Generated from protobuf field repeated .google.chat.v1.MessageCreatedEventData messages = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMessages() + { + return $this->messages; + } + + /** + * A list of new messages. + * + * Generated from protobuf field repeated .google.chat.v1.MessageCreatedEventData messages = 1; + * @param array<\Google\Apps\Chat\V1\MessageCreatedEventData>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\MessageCreatedEventData::class); + $this->messages = $arr; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/MessageBatchDeletedEventData.php b/AppsChat/src/Chat/V1/MessageBatchDeletedEventData.php new file mode 100644 index 000000000000..0264ff4cfea5 --- /dev/null +++ b/AppsChat/src/Chat/V1/MessageBatchDeletedEventData.php @@ -0,0 +1,68 @@ +google.chat.v1.MessageBatchDeletedEventData + */ +class MessageBatchDeletedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * A list of deleted messages. + * + * Generated from protobuf field repeated .google.chat.v1.MessageDeletedEventData messages = 1; + */ + private $messages; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Apps\Chat\V1\MessageDeletedEventData>|\Google\Protobuf\Internal\RepeatedField $messages + * A list of deleted messages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * A list of deleted messages. + * + * Generated from protobuf field repeated .google.chat.v1.MessageDeletedEventData messages = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMessages() + { + return $this->messages; + } + + /** + * A list of deleted messages. + * + * Generated from protobuf field repeated .google.chat.v1.MessageDeletedEventData messages = 1; + * @param array<\Google\Apps\Chat\V1\MessageDeletedEventData>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\MessageDeletedEventData::class); + $this->messages = $arr; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/MessageBatchUpdatedEventData.php b/AppsChat/src/Chat/V1/MessageBatchUpdatedEventData.php new file mode 100644 index 000000000000..2085b91f0887 --- /dev/null +++ b/AppsChat/src/Chat/V1/MessageBatchUpdatedEventData.php @@ -0,0 +1,68 @@ +google.chat.v1.MessageBatchUpdatedEventData + */ +class MessageBatchUpdatedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * A list of updated messages. + * + * Generated from protobuf field repeated .google.chat.v1.MessageUpdatedEventData messages = 1; + */ + private $messages; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Apps\Chat\V1\MessageUpdatedEventData>|\Google\Protobuf\Internal\RepeatedField $messages + * A list of updated messages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * A list of updated messages. + * + * Generated from protobuf field repeated .google.chat.v1.MessageUpdatedEventData messages = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMessages() + { + return $this->messages; + } + + /** + * A list of updated messages. + * + * Generated from protobuf field repeated .google.chat.v1.MessageUpdatedEventData messages = 1; + * @param array<\Google\Apps\Chat\V1\MessageUpdatedEventData>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\MessageUpdatedEventData::class); + $this->messages = $arr; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/MessageCreatedEventData.php b/AppsChat/src/Chat/V1/MessageCreatedEventData.php new file mode 100644 index 000000000000..9fd83ebb9454 --- /dev/null +++ b/AppsChat/src/Chat/V1/MessageCreatedEventData.php @@ -0,0 +1,78 @@ +google.chat.v1.MessageCreatedEventData + */ +class MessageCreatedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * The new message. + * + * Generated from protobuf field .google.chat.v1.Message message = 1; + */ + protected $message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Message $message + * The new message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * The new message. + * + * Generated from protobuf field .google.chat.v1.Message message = 1; + * @return \Google\Apps\Chat\V1\Message|null + */ + public function getMessage() + { + return $this->message; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * The new message. + * + * Generated from protobuf field .google.chat.v1.Message message = 1; + * @param \Google\Apps\Chat\V1\Message $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Message::class); + $this->message = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/MessageDeletedEventData.php b/AppsChat/src/Chat/V1/MessageDeletedEventData.php new file mode 100644 index 000000000000..979e52ff7474 --- /dev/null +++ b/AppsChat/src/Chat/V1/MessageDeletedEventData.php @@ -0,0 +1,82 @@ +google.chat.v1.MessageDeletedEventData + */ +class MessageDeletedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * The deleted message. Only the `name`, `createTime`, `deleteTime`, and + * `deletionMetadata` fields are populated. + * + * Generated from protobuf field .google.chat.v1.Message message = 1; + */ + protected $message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Message $message + * The deleted message. Only the `name`, `createTime`, `deleteTime`, and + * `deletionMetadata` fields are populated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * The deleted message. Only the `name`, `createTime`, `deleteTime`, and + * `deletionMetadata` fields are populated. + * + * Generated from protobuf field .google.chat.v1.Message message = 1; + * @return \Google\Apps\Chat\V1\Message|null + */ + public function getMessage() + { + return $this->message; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * The deleted message. Only the `name`, `createTime`, `deleteTime`, and + * `deletionMetadata` fields are populated. + * + * Generated from protobuf field .google.chat.v1.Message message = 1; + * @param \Google\Apps\Chat\V1\Message $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Message::class); + $this->message = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/MessageUpdatedEventData.php b/AppsChat/src/Chat/V1/MessageUpdatedEventData.php new file mode 100644 index 000000000000..515273c038c8 --- /dev/null +++ b/AppsChat/src/Chat/V1/MessageUpdatedEventData.php @@ -0,0 +1,78 @@ +google.chat.v1.MessageUpdatedEventData + */ +class MessageUpdatedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * The updated message. + * + * Generated from protobuf field .google.chat.v1.Message message = 1; + */ + protected $message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Message $message + * The updated message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * The updated message. + * + * Generated from protobuf field .google.chat.v1.Message message = 1; + * @return \Google\Apps\Chat\V1\Message|null + */ + public function getMessage() + { + return $this->message; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * The updated message. + * + * Generated from protobuf field .google.chat.v1.Message message = 1; + * @param \Google\Apps\Chat\V1\Message $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Message::class); + $this->message = $var; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/ReactionBatchCreatedEventData.php b/AppsChat/src/Chat/V1/ReactionBatchCreatedEventData.php new file mode 100644 index 000000000000..35bcef50d126 --- /dev/null +++ b/AppsChat/src/Chat/V1/ReactionBatchCreatedEventData.php @@ -0,0 +1,68 @@ +google.chat.v1.ReactionBatchCreatedEventData + */ +class ReactionBatchCreatedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * A list of new reactions. + * + * Generated from protobuf field repeated .google.chat.v1.ReactionCreatedEventData reactions = 1; + */ + private $reactions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Apps\Chat\V1\ReactionCreatedEventData>|\Google\Protobuf\Internal\RepeatedField $reactions + * A list of new reactions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * A list of new reactions. + * + * Generated from protobuf field repeated .google.chat.v1.ReactionCreatedEventData reactions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReactions() + { + return $this->reactions; + } + + /** + * A list of new reactions. + * + * Generated from protobuf field repeated .google.chat.v1.ReactionCreatedEventData reactions = 1; + * @param array<\Google\Apps\Chat\V1\ReactionCreatedEventData>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReactions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\ReactionCreatedEventData::class); + $this->reactions = $arr; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/ReactionBatchDeletedEventData.php b/AppsChat/src/Chat/V1/ReactionBatchDeletedEventData.php new file mode 100644 index 000000000000..cfa937973a8b --- /dev/null +++ b/AppsChat/src/Chat/V1/ReactionBatchDeletedEventData.php @@ -0,0 +1,68 @@ +google.chat.v1.ReactionBatchDeletedEventData + */ +class ReactionBatchDeletedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * A list of deleted reactions. + * + * Generated from protobuf field repeated .google.chat.v1.ReactionDeletedEventData reactions = 1; + */ + private $reactions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Apps\Chat\V1\ReactionDeletedEventData>|\Google\Protobuf\Internal\RepeatedField $reactions + * A list of deleted reactions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * A list of deleted reactions. + * + * Generated from protobuf field repeated .google.chat.v1.ReactionDeletedEventData reactions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReactions() + { + return $this->reactions; + } + + /** + * A list of deleted reactions. + * + * Generated from protobuf field repeated .google.chat.v1.ReactionDeletedEventData reactions = 1; + * @param array<\Google\Apps\Chat\V1\ReactionDeletedEventData>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReactions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\ReactionDeletedEventData::class); + $this->reactions = $arr; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/ReactionCreatedEventData.php b/AppsChat/src/Chat/V1/ReactionCreatedEventData.php new file mode 100644 index 000000000000..12a3ca4640f4 --- /dev/null +++ b/AppsChat/src/Chat/V1/ReactionCreatedEventData.php @@ -0,0 +1,78 @@ +google.chat.v1.ReactionCreatedEventData + */ +class ReactionCreatedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * The new reaction. + * + * Generated from protobuf field .google.chat.v1.Reaction reaction = 1; + */ + protected $reaction = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Reaction $reaction + * The new reaction. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * The new reaction. + * + * Generated from protobuf field .google.chat.v1.Reaction reaction = 1; + * @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); + } + + /** + * The new reaction. + * + * Generated from protobuf field .google.chat.v1.Reaction reaction = 1; + * @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/ReactionDeletedEventData.php b/AppsChat/src/Chat/V1/ReactionDeletedEventData.php new file mode 100644 index 000000000000..e6d5a9e766d1 --- /dev/null +++ b/AppsChat/src/Chat/V1/ReactionDeletedEventData.php @@ -0,0 +1,78 @@ +google.chat.v1.ReactionDeletedEventData + */ +class ReactionDeletedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * The deleted reaction. + * + * Generated from protobuf field .google.chat.v1.Reaction reaction = 1; + */ + protected $reaction = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Reaction $reaction + * The deleted reaction. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * The deleted reaction. + * + * Generated from protobuf field .google.chat.v1.Reaction reaction = 1; + * @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); + } + + /** + * The deleted reaction. + * + * Generated from protobuf field .google.chat.v1.Reaction reaction = 1; + * @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/SpaceBatchUpdatedEventData.php b/AppsChat/src/Chat/V1/SpaceBatchUpdatedEventData.php new file mode 100644 index 000000000000..766dca2695aa --- /dev/null +++ b/AppsChat/src/Chat/V1/SpaceBatchUpdatedEventData.php @@ -0,0 +1,68 @@ +google.chat.v1.SpaceBatchUpdatedEventData + */ +class SpaceBatchUpdatedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * A list of updated spaces. + * + * Generated from protobuf field repeated .google.chat.v1.SpaceUpdatedEventData spaces = 1; + */ + private $spaces; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Apps\Chat\V1\SpaceUpdatedEventData>|\Google\Protobuf\Internal\RepeatedField $spaces + * A list of updated spaces. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * A list of updated spaces. + * + * Generated from protobuf field repeated .google.chat.v1.SpaceUpdatedEventData spaces = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpaces() + { + return $this->spaces; + } + + /** + * A list of updated spaces. + * + * Generated from protobuf field repeated .google.chat.v1.SpaceUpdatedEventData spaces = 1; + * @param array<\Google\Apps\Chat\V1\SpaceUpdatedEventData>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\SpaceUpdatedEventData::class); + $this->spaces = $arr; + + return $this; + } + +} + diff --git a/AppsChat/src/Chat/V1/SpaceEvent.php b/AppsChat/src/Chat/V1/SpaceEvent.php new file mode 100644 index 000000000000..edd947280f93 --- /dev/null +++ b/AppsChat/src/Chat/V1/SpaceEvent.php @@ -0,0 +1,956 @@ +google.chat.v1.SpaceEvent + */ +class SpaceEvent extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name of the space event. + * Format: `spaces/{space}/spaceEvents/{spaceEvent}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Time when the event occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 3; + */ + protected $event_time = null; + /** + * Type of space event. Each event type has a batch version, which + * represents multiple instances of the event type that occur in a short + * period of time. For `spaceEvents.list()` requests, omit batch event types + * in your query filter. By default, the server returns both event type and + * its batch version. + * Supported event types for + * [messages](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages): + * * New message: `google.workspace.chat.message.v1.created` + * * Updated message: `google.workspace.chat.message.v1.updated` + * * Deleted message: `google.workspace.chat.message.v1.deleted` + * * Multiple new messages: `google.workspace.chat.message.v1.batchCreated` + * * Multiple updated messages: + * `google.workspace.chat.message.v1.batchUpdated` + * * Multiple deleted messages: + * `google.workspace.chat.message.v1.batchDeleted` + * Supported event types for + * [memberships](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members): + * * New membership: `google.workspace.chat.membership.v1.created` + * * Updated membership: `google.workspace.chat.membership.v1.updated` + * * Deleted membership: `google.workspace.chat.membership.v1.deleted` + * * Multiple new memberships: + * `google.workspace.chat.membership.v1.batchCreated` + * * Multiple updated memberships: + * `google.workspace.chat.membership.v1.batchUpdated` + * * Multiple deleted memberships: + * `google.workspace.chat.membership.v1.batchDeleted` + * Supported event types for + * [reactions](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.reactions): + * * New reaction: `google.workspace.chat.reaction.v1.created` + * * Deleted reaction: `google.workspace.chat.reaction.v1.deleted` + * * Multiple new reactions: + * `google.workspace.chat.reaction.v1.batchCreated` + * * Multiple deleted reactions: + * `google.workspace.chat.reaction.v1.batchDeleted` + * Supported event types about the + * [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces): + * * Updated space: `google.workspace.chat.space.v1.updated` + * * Multiple space updates: `google.workspace.chat.space.v1.batchUpdated` + * + * Generated from protobuf field string event_type = 6; + */ + protected $event_type = ''; + protected $payload; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Resource name of the space event. + * Format: `spaces/{space}/spaceEvents/{spaceEvent}` + * @type \Google\Protobuf\Timestamp $event_time + * Time when the event occurred. + * @type string $event_type + * Type of space event. Each event type has a batch version, which + * represents multiple instances of the event type that occur in a short + * period of time. For `spaceEvents.list()` requests, omit batch event types + * in your query filter. By default, the server returns both event type and + * its batch version. + * Supported event types for + * [messages](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages): + * * New message: `google.workspace.chat.message.v1.created` + * * Updated message: `google.workspace.chat.message.v1.updated` + * * Deleted message: `google.workspace.chat.message.v1.deleted` + * * Multiple new messages: `google.workspace.chat.message.v1.batchCreated` + * * Multiple updated messages: + * `google.workspace.chat.message.v1.batchUpdated` + * * Multiple deleted messages: + * `google.workspace.chat.message.v1.batchDeleted` + * Supported event types for + * [memberships](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members): + * * New membership: `google.workspace.chat.membership.v1.created` + * * Updated membership: `google.workspace.chat.membership.v1.updated` + * * Deleted membership: `google.workspace.chat.membership.v1.deleted` + * * Multiple new memberships: + * `google.workspace.chat.membership.v1.batchCreated` + * * Multiple updated memberships: + * `google.workspace.chat.membership.v1.batchUpdated` + * * Multiple deleted memberships: + * `google.workspace.chat.membership.v1.batchDeleted` + * Supported event types for + * [reactions](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.reactions): + * * New reaction: `google.workspace.chat.reaction.v1.created` + * * Deleted reaction: `google.workspace.chat.reaction.v1.deleted` + * * Multiple new reactions: + * `google.workspace.chat.reaction.v1.batchCreated` + * * Multiple deleted reactions: + * `google.workspace.chat.reaction.v1.batchDeleted` + * Supported event types about the + * [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces): + * * Updated space: `google.workspace.chat.space.v1.updated` + * * Multiple space updates: `google.workspace.chat.space.v1.batchUpdated` + * @type \Google\Apps\Chat\V1\MessageCreatedEventData $message_created_event_data + * Event payload for a new message. + * Event type: `google.workspace.chat.message.v1.created` + * @type \Google\Apps\Chat\V1\MessageUpdatedEventData $message_updated_event_data + * Event payload for an updated message. + * Event type: `google.workspace.chat.message.v1.updated` + * @type \Google\Apps\Chat\V1\MessageDeletedEventData $message_deleted_event_data + * Event payload for a deleted message. + * Event type: `google.workspace.chat.message.v1.deleted` + * @type \Google\Apps\Chat\V1\MessageBatchCreatedEventData $message_batch_created_event_data + * Event payload for multiple new messages. + * Event type: `google.workspace.chat.message.v1.batchCreated` + * @type \Google\Apps\Chat\V1\MessageBatchUpdatedEventData $message_batch_updated_event_data + * Event payload for multiple updated messages. + * Event type: `google.workspace.chat.message.v1.batchUpdated` + * @type \Google\Apps\Chat\V1\MessageBatchDeletedEventData $message_batch_deleted_event_data + * Event payload for multiple deleted messages. + * Event type: `google.workspace.chat.message.v1.batchDeleted` + * @type \Google\Apps\Chat\V1\SpaceUpdatedEventData $space_updated_event_data + * Event payload for a space update. + * Event type: `google.workspace.chat.space.v1.updated` + * @type \Google\Apps\Chat\V1\SpaceBatchUpdatedEventData $space_batch_updated_event_data + * Event payload for multiple updates to a space. + * Event type: `google.workspace.chat.space.v1.batchUpdated` + * @type \Google\Apps\Chat\V1\MembershipCreatedEventData $membership_created_event_data + * Event payload for a new membership. + * Event type: `google.workspace.chat.membership.v1.created` + * @type \Google\Apps\Chat\V1\MembershipUpdatedEventData $membership_updated_event_data + * Event payload for an updated membership. + * Event type: `google.workspace.chat.membership.v1.updated` + * @type \Google\Apps\Chat\V1\MembershipDeletedEventData $membership_deleted_event_data + * Event payload for a deleted membership. + * Event type: `google.workspace.chat.membership.v1.deleted` + * @type \Google\Apps\Chat\V1\MembershipBatchCreatedEventData $membership_batch_created_event_data + * Event payload for multiple new memberships. + * Event type: `google.workspace.chat.membership.v1.batchCreated` + * @type \Google\Apps\Chat\V1\MembershipBatchUpdatedEventData $membership_batch_updated_event_data + * Event payload for multiple updated memberships. + * Event type: `google.workspace.chat.membership.v1.batchUpdated` + * @type \Google\Apps\Chat\V1\MembershipBatchDeletedEventData $membership_batch_deleted_event_data + * Event payload for multiple deleted memberships. + * Event type: `google.workspace.chat.membership.v1.batchDeleted` + * @type \Google\Apps\Chat\V1\ReactionCreatedEventData $reaction_created_event_data + * Event payload for a new reaction. + * Event type: `google.workspace.chat.reaction.v1.created` + * @type \Google\Apps\Chat\V1\ReactionDeletedEventData $reaction_deleted_event_data + * Event payload for a deleted reaction. + * Event type: `google.workspace.chat.reaction.v1.deleted` + * @type \Google\Apps\Chat\V1\ReactionBatchCreatedEventData $reaction_batch_created_event_data + * Event payload for multiple new reactions. + * Event type: `google.workspace.chat.reaction.v1.batchCreated` + * @type \Google\Apps\Chat\V1\ReactionBatchDeletedEventData $reaction_batch_deleted_event_data + * Event payload for multiple deleted reactions. + * Event type: `google.workspace.chat.reaction.v1.batchDeleted` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\SpaceEvent::initOnce(); + parent::__construct($data); + } + + /** + * Resource name of the space event. + * Format: `spaces/{space}/spaceEvents/{spaceEvent}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Resource name of the space event. + * Format: `spaces/{space}/spaceEvents/{spaceEvent}` + * + * 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; + } + + /** + * Time when the event occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEventTime() + { + return $this->event_time; + } + + public function hasEventTime() + { + return isset($this->event_time); + } + + public function clearEventTime() + { + unset($this->event_time); + } + + /** + * Time when the event occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEventTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->event_time = $var; + + return $this; + } + + /** + * Type of space event. Each event type has a batch version, which + * represents multiple instances of the event type that occur in a short + * period of time. For `spaceEvents.list()` requests, omit batch event types + * in your query filter. By default, the server returns both event type and + * its batch version. + * Supported event types for + * [messages](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages): + * * New message: `google.workspace.chat.message.v1.created` + * * Updated message: `google.workspace.chat.message.v1.updated` + * * Deleted message: `google.workspace.chat.message.v1.deleted` + * * Multiple new messages: `google.workspace.chat.message.v1.batchCreated` + * * Multiple updated messages: + * `google.workspace.chat.message.v1.batchUpdated` + * * Multiple deleted messages: + * `google.workspace.chat.message.v1.batchDeleted` + * Supported event types for + * [memberships](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members): + * * New membership: `google.workspace.chat.membership.v1.created` + * * Updated membership: `google.workspace.chat.membership.v1.updated` + * * Deleted membership: `google.workspace.chat.membership.v1.deleted` + * * Multiple new memberships: + * `google.workspace.chat.membership.v1.batchCreated` + * * Multiple updated memberships: + * `google.workspace.chat.membership.v1.batchUpdated` + * * Multiple deleted memberships: + * `google.workspace.chat.membership.v1.batchDeleted` + * Supported event types for + * [reactions](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.reactions): + * * New reaction: `google.workspace.chat.reaction.v1.created` + * * Deleted reaction: `google.workspace.chat.reaction.v1.deleted` + * * Multiple new reactions: + * `google.workspace.chat.reaction.v1.batchCreated` + * * Multiple deleted reactions: + * `google.workspace.chat.reaction.v1.batchDeleted` + * Supported event types about the + * [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces): + * * Updated space: `google.workspace.chat.space.v1.updated` + * * Multiple space updates: `google.workspace.chat.space.v1.batchUpdated` + * + * Generated from protobuf field string event_type = 6; + * @return string + */ + public function getEventType() + { + return $this->event_type; + } + + /** + * Type of space event. Each event type has a batch version, which + * represents multiple instances of the event type that occur in a short + * period of time. For `spaceEvents.list()` requests, omit batch event types + * in your query filter. By default, the server returns both event type and + * its batch version. + * Supported event types for + * [messages](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages): + * * New message: `google.workspace.chat.message.v1.created` + * * Updated message: `google.workspace.chat.message.v1.updated` + * * Deleted message: `google.workspace.chat.message.v1.deleted` + * * Multiple new messages: `google.workspace.chat.message.v1.batchCreated` + * * Multiple updated messages: + * `google.workspace.chat.message.v1.batchUpdated` + * * Multiple deleted messages: + * `google.workspace.chat.message.v1.batchDeleted` + * Supported event types for + * [memberships](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members): + * * New membership: `google.workspace.chat.membership.v1.created` + * * Updated membership: `google.workspace.chat.membership.v1.updated` + * * Deleted membership: `google.workspace.chat.membership.v1.deleted` + * * Multiple new memberships: + * `google.workspace.chat.membership.v1.batchCreated` + * * Multiple updated memberships: + * `google.workspace.chat.membership.v1.batchUpdated` + * * Multiple deleted memberships: + * `google.workspace.chat.membership.v1.batchDeleted` + * Supported event types for + * [reactions](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.reactions): + * * New reaction: `google.workspace.chat.reaction.v1.created` + * * Deleted reaction: `google.workspace.chat.reaction.v1.deleted` + * * Multiple new reactions: + * `google.workspace.chat.reaction.v1.batchCreated` + * * Multiple deleted reactions: + * `google.workspace.chat.reaction.v1.batchDeleted` + * Supported event types about the + * [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces): + * * Updated space: `google.workspace.chat.space.v1.updated` + * * Multiple space updates: `google.workspace.chat.space.v1.batchUpdated` + * + * Generated from protobuf field string event_type = 6; + * @param string $var + * @return $this + */ + public function setEventType($var) + { + GPBUtil::checkString($var, True); + $this->event_type = $var; + + return $this; + } + + /** + * Event payload for a new message. + * Event type: `google.workspace.chat.message.v1.created` + * + * Generated from protobuf field .google.chat.v1.MessageCreatedEventData message_created_event_data = 12; + * @return \Google\Apps\Chat\V1\MessageCreatedEventData|null + */ + public function getMessageCreatedEventData() + { + return $this->readOneof(12); + } + + public function hasMessageCreatedEventData() + { + return $this->hasOneof(12); + } + + /** + * Event payload for a new message. + * Event type: `google.workspace.chat.message.v1.created` + * + * Generated from protobuf field .google.chat.v1.MessageCreatedEventData message_created_event_data = 12; + * @param \Google\Apps\Chat\V1\MessageCreatedEventData $var + * @return $this + */ + public function setMessageCreatedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\MessageCreatedEventData::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Event payload for an updated message. + * Event type: `google.workspace.chat.message.v1.updated` + * + * Generated from protobuf field .google.chat.v1.MessageUpdatedEventData message_updated_event_data = 13; + * @return \Google\Apps\Chat\V1\MessageUpdatedEventData|null + */ + public function getMessageUpdatedEventData() + { + return $this->readOneof(13); + } + + public function hasMessageUpdatedEventData() + { + return $this->hasOneof(13); + } + + /** + * Event payload for an updated message. + * Event type: `google.workspace.chat.message.v1.updated` + * + * Generated from protobuf field .google.chat.v1.MessageUpdatedEventData message_updated_event_data = 13; + * @param \Google\Apps\Chat\V1\MessageUpdatedEventData $var + * @return $this + */ + public function setMessageUpdatedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\MessageUpdatedEventData::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Event payload for a deleted message. + * Event type: `google.workspace.chat.message.v1.deleted` + * + * Generated from protobuf field .google.chat.v1.MessageDeletedEventData message_deleted_event_data = 14; + * @return \Google\Apps\Chat\V1\MessageDeletedEventData|null + */ + public function getMessageDeletedEventData() + { + return $this->readOneof(14); + } + + public function hasMessageDeletedEventData() + { + return $this->hasOneof(14); + } + + /** + * Event payload for a deleted message. + * Event type: `google.workspace.chat.message.v1.deleted` + * + * Generated from protobuf field .google.chat.v1.MessageDeletedEventData message_deleted_event_data = 14; + * @param \Google\Apps\Chat\V1\MessageDeletedEventData $var + * @return $this + */ + public function setMessageDeletedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\MessageDeletedEventData::class); + $this->writeOneof(14, $var); + + return $this; + } + + /** + * Event payload for multiple new messages. + * Event type: `google.workspace.chat.message.v1.batchCreated` + * + * Generated from protobuf field .google.chat.v1.MessageBatchCreatedEventData message_batch_created_event_data = 26; + * @return \Google\Apps\Chat\V1\MessageBatchCreatedEventData|null + */ + public function getMessageBatchCreatedEventData() + { + return $this->readOneof(26); + } + + public function hasMessageBatchCreatedEventData() + { + return $this->hasOneof(26); + } + + /** + * Event payload for multiple new messages. + * Event type: `google.workspace.chat.message.v1.batchCreated` + * + * Generated from protobuf field .google.chat.v1.MessageBatchCreatedEventData message_batch_created_event_data = 26; + * @param \Google\Apps\Chat\V1\MessageBatchCreatedEventData $var + * @return $this + */ + public function setMessageBatchCreatedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\MessageBatchCreatedEventData::class); + $this->writeOneof(26, $var); + + return $this; + } + + /** + * Event payload for multiple updated messages. + * Event type: `google.workspace.chat.message.v1.batchUpdated` + * + * Generated from protobuf field .google.chat.v1.MessageBatchUpdatedEventData message_batch_updated_event_data = 27; + * @return \Google\Apps\Chat\V1\MessageBatchUpdatedEventData|null + */ + public function getMessageBatchUpdatedEventData() + { + return $this->readOneof(27); + } + + public function hasMessageBatchUpdatedEventData() + { + return $this->hasOneof(27); + } + + /** + * Event payload for multiple updated messages. + * Event type: `google.workspace.chat.message.v1.batchUpdated` + * + * Generated from protobuf field .google.chat.v1.MessageBatchUpdatedEventData message_batch_updated_event_data = 27; + * @param \Google\Apps\Chat\V1\MessageBatchUpdatedEventData $var + * @return $this + */ + public function setMessageBatchUpdatedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\MessageBatchUpdatedEventData::class); + $this->writeOneof(27, $var); + + return $this; + } + + /** + * Event payload for multiple deleted messages. + * Event type: `google.workspace.chat.message.v1.batchDeleted` + * + * Generated from protobuf field .google.chat.v1.MessageBatchDeletedEventData message_batch_deleted_event_data = 28; + * @return \Google\Apps\Chat\V1\MessageBatchDeletedEventData|null + */ + public function getMessageBatchDeletedEventData() + { + return $this->readOneof(28); + } + + public function hasMessageBatchDeletedEventData() + { + return $this->hasOneof(28); + } + + /** + * Event payload for multiple deleted messages. + * Event type: `google.workspace.chat.message.v1.batchDeleted` + * + * Generated from protobuf field .google.chat.v1.MessageBatchDeletedEventData message_batch_deleted_event_data = 28; + * @param \Google\Apps\Chat\V1\MessageBatchDeletedEventData $var + * @return $this + */ + public function setMessageBatchDeletedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\MessageBatchDeletedEventData::class); + $this->writeOneof(28, $var); + + return $this; + } + + /** + * Event payload for a space update. + * Event type: `google.workspace.chat.space.v1.updated` + * + * Generated from protobuf field .google.chat.v1.SpaceUpdatedEventData space_updated_event_data = 15; + * @return \Google\Apps\Chat\V1\SpaceUpdatedEventData|null + */ + public function getSpaceUpdatedEventData() + { + return $this->readOneof(15); + } + + public function hasSpaceUpdatedEventData() + { + return $this->hasOneof(15); + } + + /** + * Event payload for a space update. + * Event type: `google.workspace.chat.space.v1.updated` + * + * Generated from protobuf field .google.chat.v1.SpaceUpdatedEventData space_updated_event_data = 15; + * @param \Google\Apps\Chat\V1\SpaceUpdatedEventData $var + * @return $this + */ + public function setSpaceUpdatedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\SpaceUpdatedEventData::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Event payload for multiple updates to a space. + * Event type: `google.workspace.chat.space.v1.batchUpdated` + * + * Generated from protobuf field .google.chat.v1.SpaceBatchUpdatedEventData space_batch_updated_event_data = 29; + * @return \Google\Apps\Chat\V1\SpaceBatchUpdatedEventData|null + */ + public function getSpaceBatchUpdatedEventData() + { + return $this->readOneof(29); + } + + public function hasSpaceBatchUpdatedEventData() + { + return $this->hasOneof(29); + } + + /** + * Event payload for multiple updates to a space. + * Event type: `google.workspace.chat.space.v1.batchUpdated` + * + * Generated from protobuf field .google.chat.v1.SpaceBatchUpdatedEventData space_batch_updated_event_data = 29; + * @param \Google\Apps\Chat\V1\SpaceBatchUpdatedEventData $var + * @return $this + */ + public function setSpaceBatchUpdatedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\SpaceBatchUpdatedEventData::class); + $this->writeOneof(29, $var); + + return $this; + } + + /** + * Event payload for a new membership. + * Event type: `google.workspace.chat.membership.v1.created` + * + * Generated from protobuf field .google.chat.v1.MembershipCreatedEventData membership_created_event_data = 17; + * @return \Google\Apps\Chat\V1\MembershipCreatedEventData|null + */ + public function getMembershipCreatedEventData() + { + return $this->readOneof(17); + } + + public function hasMembershipCreatedEventData() + { + return $this->hasOneof(17); + } + + /** + * Event payload for a new membership. + * Event type: `google.workspace.chat.membership.v1.created` + * + * Generated from protobuf field .google.chat.v1.MembershipCreatedEventData membership_created_event_data = 17; + * @param \Google\Apps\Chat\V1\MembershipCreatedEventData $var + * @return $this + */ + public function setMembershipCreatedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\MembershipCreatedEventData::class); + $this->writeOneof(17, $var); + + return $this; + } + + /** + * Event payload for an updated membership. + * Event type: `google.workspace.chat.membership.v1.updated` + * + * Generated from protobuf field .google.chat.v1.MembershipUpdatedEventData membership_updated_event_data = 18; + * @return \Google\Apps\Chat\V1\MembershipUpdatedEventData|null + */ + public function getMembershipUpdatedEventData() + { + return $this->readOneof(18); + } + + public function hasMembershipUpdatedEventData() + { + return $this->hasOneof(18); + } + + /** + * Event payload for an updated membership. + * Event type: `google.workspace.chat.membership.v1.updated` + * + * Generated from protobuf field .google.chat.v1.MembershipUpdatedEventData membership_updated_event_data = 18; + * @param \Google\Apps\Chat\V1\MembershipUpdatedEventData $var + * @return $this + */ + public function setMembershipUpdatedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\MembershipUpdatedEventData::class); + $this->writeOneof(18, $var); + + return $this; + } + + /** + * Event payload for a deleted membership. + * Event type: `google.workspace.chat.membership.v1.deleted` + * + * Generated from protobuf field .google.chat.v1.MembershipDeletedEventData membership_deleted_event_data = 219; + * @return \Google\Apps\Chat\V1\MembershipDeletedEventData|null + */ + public function getMembershipDeletedEventData() + { + return $this->readOneof(219); + } + + public function hasMembershipDeletedEventData() + { + return $this->hasOneof(219); + } + + /** + * Event payload for a deleted membership. + * Event type: `google.workspace.chat.membership.v1.deleted` + * + * Generated from protobuf field .google.chat.v1.MembershipDeletedEventData membership_deleted_event_data = 219; + * @param \Google\Apps\Chat\V1\MembershipDeletedEventData $var + * @return $this + */ + public function setMembershipDeletedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\MembershipDeletedEventData::class); + $this->writeOneof(219, $var); + + return $this; + } + + /** + * Event payload for multiple new memberships. + * Event type: `google.workspace.chat.membership.v1.batchCreated` + * + * Generated from protobuf field .google.chat.v1.MembershipBatchCreatedEventData membership_batch_created_event_data = 31; + * @return \Google\Apps\Chat\V1\MembershipBatchCreatedEventData|null + */ + public function getMembershipBatchCreatedEventData() + { + return $this->readOneof(31); + } + + public function hasMembershipBatchCreatedEventData() + { + return $this->hasOneof(31); + } + + /** + * Event payload for multiple new memberships. + * Event type: `google.workspace.chat.membership.v1.batchCreated` + * + * Generated from protobuf field .google.chat.v1.MembershipBatchCreatedEventData membership_batch_created_event_data = 31; + * @param \Google\Apps\Chat\V1\MembershipBatchCreatedEventData $var + * @return $this + */ + public function setMembershipBatchCreatedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\MembershipBatchCreatedEventData::class); + $this->writeOneof(31, $var); + + return $this; + } + + /** + * Event payload for multiple updated memberships. + * Event type: `google.workspace.chat.membership.v1.batchUpdated` + * + * Generated from protobuf field .google.chat.v1.MembershipBatchUpdatedEventData membership_batch_updated_event_data = 32; + * @return \Google\Apps\Chat\V1\MembershipBatchUpdatedEventData|null + */ + public function getMembershipBatchUpdatedEventData() + { + return $this->readOneof(32); + } + + public function hasMembershipBatchUpdatedEventData() + { + return $this->hasOneof(32); + } + + /** + * Event payload for multiple updated memberships. + * Event type: `google.workspace.chat.membership.v1.batchUpdated` + * + * Generated from protobuf field .google.chat.v1.MembershipBatchUpdatedEventData membership_batch_updated_event_data = 32; + * @param \Google\Apps\Chat\V1\MembershipBatchUpdatedEventData $var + * @return $this + */ + public function setMembershipBatchUpdatedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\MembershipBatchUpdatedEventData::class); + $this->writeOneof(32, $var); + + return $this; + } + + /** + * Event payload for multiple deleted memberships. + * Event type: `google.workspace.chat.membership.v1.batchDeleted` + * + * Generated from protobuf field .google.chat.v1.MembershipBatchDeletedEventData membership_batch_deleted_event_data = 33; + * @return \Google\Apps\Chat\V1\MembershipBatchDeletedEventData|null + */ + public function getMembershipBatchDeletedEventData() + { + return $this->readOneof(33); + } + + public function hasMembershipBatchDeletedEventData() + { + return $this->hasOneof(33); + } + + /** + * Event payload for multiple deleted memberships. + * Event type: `google.workspace.chat.membership.v1.batchDeleted` + * + * Generated from protobuf field .google.chat.v1.MembershipBatchDeletedEventData membership_batch_deleted_event_data = 33; + * @param \Google\Apps\Chat\V1\MembershipBatchDeletedEventData $var + * @return $this + */ + public function setMembershipBatchDeletedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\MembershipBatchDeletedEventData::class); + $this->writeOneof(33, $var); + + return $this; + } + + /** + * Event payload for a new reaction. + * Event type: `google.workspace.chat.reaction.v1.created` + * + * Generated from protobuf field .google.chat.v1.ReactionCreatedEventData reaction_created_event_data = 21; + * @return \Google\Apps\Chat\V1\ReactionCreatedEventData|null + */ + public function getReactionCreatedEventData() + { + return $this->readOneof(21); + } + + public function hasReactionCreatedEventData() + { + return $this->hasOneof(21); + } + + /** + * Event payload for a new reaction. + * Event type: `google.workspace.chat.reaction.v1.created` + * + * Generated from protobuf field .google.chat.v1.ReactionCreatedEventData reaction_created_event_data = 21; + * @param \Google\Apps\Chat\V1\ReactionCreatedEventData $var + * @return $this + */ + public function setReactionCreatedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\ReactionCreatedEventData::class); + $this->writeOneof(21, $var); + + return $this; + } + + /** + * Event payload for a deleted reaction. + * Event type: `google.workspace.chat.reaction.v1.deleted` + * + * Generated from protobuf field .google.chat.v1.ReactionDeletedEventData reaction_deleted_event_data = 22; + * @return \Google\Apps\Chat\V1\ReactionDeletedEventData|null + */ + public function getReactionDeletedEventData() + { + return $this->readOneof(22); + } + + public function hasReactionDeletedEventData() + { + return $this->hasOneof(22); + } + + /** + * Event payload for a deleted reaction. + * Event type: `google.workspace.chat.reaction.v1.deleted` + * + * Generated from protobuf field .google.chat.v1.ReactionDeletedEventData reaction_deleted_event_data = 22; + * @param \Google\Apps\Chat\V1\ReactionDeletedEventData $var + * @return $this + */ + public function setReactionDeletedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\ReactionDeletedEventData::class); + $this->writeOneof(22, $var); + + return $this; + } + + /** + * Event payload for multiple new reactions. + * Event type: `google.workspace.chat.reaction.v1.batchCreated` + * + * Generated from protobuf field .google.chat.v1.ReactionBatchCreatedEventData reaction_batch_created_event_data = 34; + * @return \Google\Apps\Chat\V1\ReactionBatchCreatedEventData|null + */ + public function getReactionBatchCreatedEventData() + { + return $this->readOneof(34); + } + + public function hasReactionBatchCreatedEventData() + { + return $this->hasOneof(34); + } + + /** + * Event payload for multiple new reactions. + * Event type: `google.workspace.chat.reaction.v1.batchCreated` + * + * Generated from protobuf field .google.chat.v1.ReactionBatchCreatedEventData reaction_batch_created_event_data = 34; + * @param \Google\Apps\Chat\V1\ReactionBatchCreatedEventData $var + * @return $this + */ + public function setReactionBatchCreatedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\ReactionBatchCreatedEventData::class); + $this->writeOneof(34, $var); + + return $this; + } + + /** + * Event payload for multiple deleted reactions. + * Event type: `google.workspace.chat.reaction.v1.batchDeleted` + * + * Generated from protobuf field .google.chat.v1.ReactionBatchDeletedEventData reaction_batch_deleted_event_data = 35; + * @return \Google\Apps\Chat\V1\ReactionBatchDeletedEventData|null + */ + public function getReactionBatchDeletedEventData() + { + return $this->readOneof(35); + } + + public function hasReactionBatchDeletedEventData() + { + return $this->hasOneof(35); + } + + /** + * Event payload for multiple deleted reactions. + * Event type: `google.workspace.chat.reaction.v1.batchDeleted` + * + * Generated from protobuf field .google.chat.v1.ReactionBatchDeletedEventData reaction_batch_deleted_event_data = 35; + * @param \Google\Apps\Chat\V1\ReactionBatchDeletedEventData $var + * @return $this + */ + public function setReactionBatchDeletedEventData($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\ReactionBatchDeletedEventData::class); + $this->writeOneof(35, $var); + + return $this; + } + + /** + * @return string + */ + public function getPayload() + { + return $this->whichOneof("payload"); + } + +} + diff --git a/AppsChat/src/Chat/V1/SpaceUpdatedEventData.php b/AppsChat/src/Chat/V1/SpaceUpdatedEventData.php new file mode 100644 index 000000000000..00eb47764a7e --- /dev/null +++ b/AppsChat/src/Chat/V1/SpaceUpdatedEventData.php @@ -0,0 +1,78 @@ +google.chat.v1.SpaceUpdatedEventData + */ +class SpaceUpdatedEventData extends \Google\Protobuf\Internal\Message +{ + /** + * The updated 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 updated space. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\EventPayload::initOnce(); + parent::__construct($data); + } + + /** + * The updated 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 updated 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/gapic_metadata.json b/AppsChat/src/Chat/V1/gapic_metadata.json index d94cea6ab2e5..455f7b32b702 100644 --- a/AppsChat/src/Chat/V1/gapic_metadata.json +++ b/AppsChat/src/Chat/V1/gapic_metadata.json @@ -80,6 +80,11 @@ "getSpace" ] }, + "GetSpaceEvent": { + "methods": [ + "getSpaceEvent" + ] + }, "GetSpaceReadState": { "methods": [ "getSpaceReadState" @@ -105,6 +110,11 @@ "listReactions" ] }, + "ListSpaceEvents": { + "methods": [ + "listSpaceEvents" + ] + }, "ListSpaces": { "methods": [ "listSpaces" diff --git a/AppsChat/src/Chat/V1/resources/chat_service_client_config.json b/AppsChat/src/Chat/V1/resources/chat_service_client_config.json index f1134ba2ce70..38a30d47c8ca 100644 --- a/AppsChat/src/Chat/V1/resources/chat_service_client_config.json +++ b/AppsChat/src/Chat/V1/resources/chat_service_client_config.json @@ -98,6 +98,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "GetSpaceEvent": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetSpaceReadState": { "timeout_millis": 30000, "retry_codes_name": "retry_policy_1_codes", @@ -123,6 +128,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListSpaceEvents": { + "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", 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 daa891eb9118..c0d342438eef 100644 --- a/AppsChat/src/Chat/V1/resources/chat_service_descriptor_config.php +++ b/AppsChat/src/Chat/V1/resources/chat_service_descriptor_config.php @@ -175,6 +175,18 @@ ], ], ], + 'GetSpaceEvent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Apps\Chat\V1\SpaceEvent', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetSpaceReadState' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Apps\Chat\V1\SpaceReadState', @@ -259,6 +271,26 @@ ], ], ], + 'ListSpaceEvents' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSpaceEvents', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Apps\Chat\V1\ListSpaceEventsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListSpaces' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -346,6 +378,7 @@ 'quotedMessageMetadata' => 'spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}', 'reaction' => 'spaces/{space}/messages/{message}/reactions/{reaction}', 'space' => 'spaces/{space}', + 'spaceEvent' => 'spaces/{space}/spaceEvents/{space_event}', 'spaceReadState' => 'users/{user}/spaces/{space}/spaceReadState', 'thread' => 'spaces/{space}/threads/{thread}', 'threadReadState' => 'users/{user}/spaces/{space}/threads/{thread}/threadReadState', 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 a4fdec701035..bd30e354eacc 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 @@ -168,6 +168,17 @@ ], ], ], + 'GetSpaceEvent' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=spaces/*/spaceEvents/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetSpaceReadState' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=users/*/spaces/*/spaceReadState}', @@ -223,6 +234,20 @@ ], ], ], + 'ListSpaceEvents' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=spaces/*}/spaceEvents', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'filter', + ], + ], 'ListSpaces' => [ 'method' => 'get', 'uriTemplate' => '/v1/spaces', diff --git a/AppsChat/tests/Unit/V1/Client/ChatServiceClientTest.php b/AppsChat/tests/Unit/V1/Client/ChatServiceClientTest.php index 0b6496931f8c..2d8a2edea443 100644 --- a/AppsChat/tests/Unit/V1/Client/ChatServiceClientTest.php +++ b/AppsChat/tests/Unit/V1/Client/ChatServiceClientTest.php @@ -42,6 +42,7 @@ use Google\Apps\Chat\V1\GetAttachmentRequest; use Google\Apps\Chat\V1\GetMembershipRequest; use Google\Apps\Chat\V1\GetMessageRequest; +use Google\Apps\Chat\V1\GetSpaceEventRequest; use Google\Apps\Chat\V1\GetSpaceReadStateRequest; use Google\Apps\Chat\V1\GetSpaceRequest; use Google\Apps\Chat\V1\GetThreadReadStateRequest; @@ -51,6 +52,8 @@ use Google\Apps\Chat\V1\ListMessagesResponse; use Google\Apps\Chat\V1\ListReactionsRequest; use Google\Apps\Chat\V1\ListReactionsResponse; +use Google\Apps\Chat\V1\ListSpaceEventsRequest; +use Google\Apps\Chat\V1\ListSpaceEventsResponse; use Google\Apps\Chat\V1\ListSpacesRequest; use Google\Apps\Chat\V1\ListSpacesResponse; use Google\Apps\Chat\V1\Membership; @@ -58,6 +61,7 @@ use Google\Apps\Chat\V1\Reaction; use Google\Apps\Chat\V1\SetUpSpaceRequest; use Google\Apps\Chat\V1\Space; +use Google\Apps\Chat\V1\SpaceEvent; use Google\Apps\Chat\V1\SpaceReadState; use Google\Apps\Chat\V1\ThreadReadState; use Google\Apps\Chat\V1\UpdateMembershipRequest; @@ -1086,6 +1090,73 @@ public function getSpaceExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function getSpaceEventTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $eventType = 'eventType984376767'; + $expectedResponse = new SpaceEvent(); + $expectedResponse->setName($name2); + $expectedResponse->setEventType($eventType); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->spaceEventName('[SPACE]', '[SPACE_EVENT]'); + $request = (new GetSpaceEventRequest())->setName($formattedName); + $response = $gapicClient->getSpaceEvent($request); + $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/GetSpaceEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSpaceEventExceptionTest() + { + $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->spaceEventName('[SPACE]', '[SPACE_EVENT]'); + $request = (new GetSpaceEventRequest())->setName($formattedName); + try { + $gapicClient->getSpaceEvent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function getSpaceReadStateTest() { @@ -1429,6 +1500,81 @@ public function listReactionsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function listSpaceEventsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $spaceEventsElement = new SpaceEvent(); + $spaceEvents = [$spaceEventsElement]; + $expectedResponse = new ListSpaceEventsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSpaceEvents($spaceEvents); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->spaceName('[SPACE]'); + $filter = 'filter-1274492040'; + $request = (new ListSpaceEventsRequest())->setParent($formattedParent)->setFilter($filter); + $response = $gapicClient->listSpaceEvents($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSpaceEvents()[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/ListSpaceEvents', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getFilter(); + $this->assertProtobufEquals($filter, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSpaceEventsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->spaceName('[SPACE]'); + $filter = 'filter-1274492040'; + $request = (new ListSpaceEventsRequest())->setParent($formattedParent)->setFilter($filter); + try { + $gapicClient->listSpaceEvents($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function listSpacesTest() {