Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [AppsChat] Add missing field annotations in space.proto, message.proto, reaction.proto, space_event.proto, membership.proto, attachment.proto #7899

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified AppsChat/metadata/Chat/V1/Attachment.php
Binary file not shown.
Binary file modified AppsChat/metadata/Chat/V1/Membership.php
Binary file not shown.
Binary file modified AppsChat/metadata/Chat/V1/Message.php
Binary file not shown.
Binary file modified AppsChat/metadata/Chat/V1/Reaction.php
Binary file not shown.
Binary file modified AppsChat/metadata/Chat/V1/Space.php
Binary file not shown.
Binary file modified AppsChat/metadata/Chat/V1/SpaceEvent.php
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@
* Completes the
* [import process](https://developers.google.com/workspace/chat/import-data)
* for the specified space and makes it visible to users.
* Requires app authentication and domain-wide delegation. For more
* information, see [Authorize Google Chat apps to import
*
* Requires [app
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
* and domain-wide delegation. For more information, see [Authorize Google
* Chat apps to import
* data](https://developers.google.com/workspace/chat/authorize-import).
*
* @param string $formattedName Resource name of the import mode space.
Expand Down
15 changes: 13 additions & 2 deletions AppsChat/samples/V1/ChatServiceClient/create_membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,19 @@
* policy turned off, then they're invited, and must accept the space
* invitation before joining. Otherwise, creating a membership adds the member
* directly to the specified space.
* Requires [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
*
* Supports the following types of
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
*
* - [App
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
* with [administrator approval](https://support.google.com/a?p=chat-app-auth)
* in [Developer Preview](https://developers.google.com/workspace/preview)
*
* - [User
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
* You can authenticate and authorize this method with administrator
* privileges by setting the `use_admin_access` field in the request.
*
* For example usage, see:
*
Expand Down
13 changes: 11 additions & 2 deletions AppsChat/samples/V1/ChatServiceClient/create_message.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@
* Creates a message in a Google Chat space. For an example, see [Send a
* message](https://developers.google.com/workspace/chat/create-messages).
*
* The `create()` method requires either user or app authentication. Chat
* attributes the message sender differently depending on the type of
* The `create()` method requires either [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
* or [app
* authentication](https://developers.google.com/workspace/chat/authorize-import).
* Chat attributes the message sender differently depending on the type of
* authentication that you use in your request.
*
* The following image shows how Chat attributes a message when you use app
Expand All @@ -54,6 +57,12 @@
*
* The maximum message size, including the message contents, is 32,000 bytes.
*
* For
* [webhook](https://developers.google.com/workspace/chat/quickstart/webhooks)
* requests, the response doesn't contain the full message. The response only
* populates the `name` and `thread.name` fields in addition to the
* information that was in the request.
*
* @param string $formattedParent The resource name of the space in which to create a message.
*
* Format: `spaces/{space}`
Expand Down
6 changes: 5 additions & 1 deletion AppsChat/samples/V1/ChatServiceClient/create_reaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@
use Google\ApiCore\ApiException;
use Google\Apps\Chat\V1\Client\ChatServiceClient;
use Google\Apps\Chat\V1\CreateReactionRequest;
use Google\Apps\Chat\V1\Emoji;
use Google\Apps\Chat\V1\Reaction;

/**
* Creates a reaction and adds it to a message. Only unicode emojis are
* supported. For an example, see
* [Add a reaction to a
* message](https://developers.google.com/workspace/chat/create-reactions).
*
* Requires [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
*
Expand All @@ -47,7 +49,9 @@ function create_reaction_sample(string $formattedParent): void
$chatServiceClient = new ChatServiceClient();

// Prepare the request message.
$reaction = new Reaction();
$reactionEmoji = new Emoji();
$reaction = (new Reaction())
->setEmoji($reactionEmoji);
$request = (new CreateReactionRequest())
->setParent($formattedParent)
->setReaction($reaction);
Expand Down
22 changes: 14 additions & 8 deletions AppsChat/samples/V1/ChatServiceClient/create_space.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,27 @@
use Google\Apps\Chat\V1\Space;

/**
* Creates a space with no members. Can be used to create a named space.
* Spaces grouped by topics aren't supported. For an example, see
* [Create a
* Creates a space with no members. Can be used to create a named space, or a
* group chat in `Import mode`. For an example, see [Create a
* space](https://developers.google.com/workspace/chat/create-spaces).
*
* If you receive the error message `ALREADY_EXISTS` when creating
* a space, try a different `displayName`. An existing space within
* the Google Workspace organization might already use this display name.
*
* If you're a member of the [Developer Preview
* program](https://developers.google.com/workspace/preview), you can create a
* group chat in import mode using `spaceType.GROUP_CHAT`.
* Supports the following types of
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
*
* Requires [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
* - [App
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
* with [administrator approval](https://support.google.com/a?p=chat-app-auth)
* in [Developer Preview](https://developers.google.com/workspace/preview)
*
* - [User
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
*
* When authenticating as an app, the `space.customer` field must be set in
* the request.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
Expand Down
14 changes: 12 additions & 2 deletions AppsChat/samples/V1/ChatServiceClient/delete_membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,18 @@
* [Remove a user or a Google Chat app from a
* space](https://developers.google.com/workspace/chat/delete-members).
*
* Requires [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
* Supports the following types of
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
*
* - [App
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
* with [administrator approval](https://support.google.com/a?p=chat-app-auth)
* in [Developer Preview](https://developers.google.com/workspace/preview)
*
* - [User
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
* You can authenticate and authorize this method with administrator
* privileges by setting the `use_admin_access` field in the request.
*
* @param string $formattedName Resource name of the membership to delete. Chat apps can delete
* human users' or their own memberships. Chat apps can't delete other apps'
Expand Down
14 changes: 8 additions & 6 deletions AppsChat/samples/V1/ChatServiceClient/delete_message.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@
* For an example, see [Delete a
* message](https://developers.google.com/workspace/chat/delete-messages).
*
* Requires
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
* Supports
* [app
* Supports the following types of
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
*
* - [App
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
* and [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
*
* - [User
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
*
* When using app authentication, requests can only delete messages
* created by the calling Chat app.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* For an example, see
* [Delete a
* reaction](https://developers.google.com/workspace/chat/delete-reactions).
*
* Requires [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
*
Expand Down
14 changes: 12 additions & 2 deletions AppsChat/samples/V1/ChatServiceClient/delete_space.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,19 @@
* memberships in the space—are also deleted. For an example, see
* [Delete a
* space](https://developers.google.com/workspace/chat/delete-spaces).
* Requires [user
*
* Supports the following types of
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
*
* - [App
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
* with [administrator approval](https://support.google.com/a?p=chat-app-auth)
* in [Developer Preview](https://developers.google.com/workspace/preview)
*
* - [User
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
* from a user who has permission to delete the space.
* You can authenticate and authorize this method with administrator
* privileges by setting the `use_admin_access` field in the request.
*
* @param string $formattedName Resource name of the space to delete.
*
Expand Down
18 changes: 11 additions & 7 deletions AppsChat/samples/V1/ChatServiceClient/find_direct_message.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,24 @@
* see
* [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message).
*
* With [app
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app),
* returns the direct message space between the specified user and the calling
* Chat app.
*
* With [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
* returns the direct message space between the specified user and the
* authenticated user.
*
* With [app
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app),
* returns the direct message space between the specified user and the calling
* Chat app.
* // Supports the following types of
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
*
* - [App
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
*
* Requires [user
* - [User
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
* or [app
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
*
* @param string $name Resource name of the user to find direct message with.
*
Expand Down
19 changes: 10 additions & 9 deletions AppsChat/samples/V1/ChatServiceClient/get_membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@
* [Get details about a user's or Google Chat app's
* membership](https://developers.google.com/workspace/chat/get-members).
*
* Requires
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
* Supports
* [app
* Supports the following types of
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
*
* - [App
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
* and [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
*
* - [User
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
* You can authenticate and authorize this method with administrator
* privileges by setting the `use_admin_access` field in the request.
*
* @param string $formattedName Resource name of the membership to retrieve.
*
Expand All @@ -49,9 +52,7 @@
*
* Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`
*
* When [authenticated as a
* user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
* you can use the user's email as an alias for `{member}`. For example,
* You can use the user's email as an alias for `{member}`. For example,
* `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the
* email of the Google Chat user. Please see
* {@see ChatServiceClient::membershipName()} for help formatting this field.
Expand Down
13 changes: 7 additions & 6 deletions AppsChat/samples/V1/ChatServiceClient/get_message.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@
* For an example, see [Get details about a
* message](https://developers.google.com/workspace/chat/get-messages).
*
* Requires
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
* Supports
* [app
* Supports the following types of
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
*
* - [App
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
* and [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
*
* - [User
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
*
* Note: Might return a message from a blocked member or space.
*
Expand Down
15 changes: 9 additions & 6 deletions AppsChat/samples/V1/ChatServiceClient/get_space.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@
* [Get details about a
* space](https://developers.google.com/workspace/chat/get-spaces).
*
* Requires
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
* Supports
* [app
* Supports the following types of
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
*
* - [App
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
* and [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
*
* - [User
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
* You can authenticate and authorize this method with administrator
* privileges by setting the `use_admin_access` field in the request.
*
* @param string $formattedName Resource name of the space, in the form `spaces/{space}`.
*
Expand Down
15 changes: 9 additions & 6 deletions AppsChat/samples/V1/ChatServiceClient/list_memberships.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,16 @@
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
* lists memberships in spaces that the authenticated user has access to.
*
* Requires
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
* Supports
* [app
* Supports the following types of
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
*
* - [App
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
* and [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
*
* - [User
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
* You can authenticate and authorize this method with administrator
* privileges by setting the `use_admin_access` field in the request.
*
* @param string $formattedParent The resource name of the space for which to fetch a membership
* list.
Expand Down
1 change: 1 addition & 0 deletions AppsChat/samples/V1/ChatServiceClient/list_messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* For an example, see
* [List
* messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list).
*
* Requires [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
*
Expand Down
1 change: 1 addition & 0 deletions AppsChat/samples/V1/ChatServiceClient/list_reactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* Lists reactions to a message. For an example, see
* [List reactions for a
* message](https://developers.google.com/workspace/chat/list-reactions).
*
* Requires [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
*
Expand Down
14 changes: 6 additions & 8 deletions AppsChat/samples/V1/ChatServiceClient/list_spaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,14 @@
* [List
* spaces](https://developers.google.com/workspace/chat/list-spaces).
*
* Requires
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize).
* Supports
* [app
* Supports the following types of
* [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
*
* - [App
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
* and [user
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
*
* Lists spaces visible to the caller or authenticated user. Group chats
* and DMs aren't listed until the first message is sent.
* - [User
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
*
* To list all named spaces by Google Workspace organization, use the
* [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search)
Expand Down
4 changes: 3 additions & 1 deletion AppsChat/samples/V1/ChatServiceClient/search_spaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@

/**
* Returns a list of spaces in a Google Workspace organization based on an
* administrator's search. Requires [user
* administrator's search.
*
* Requires [user
* authentication with administrator
* privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges).
* In the request, set `use_admin_access` to `true`.
Expand Down
Loading
Loading