diff --git a/clients/google-api-services-chat/v1/2.0.0/README.md b/clients/google-api-services-chat/v1/2.0.0/README.md index 43362472eaf..fa221d5e592 100644 --- a/clients/google-api-services-chat/v1/2.0.0/README.md +++ b/clients/google-api-services-chat/v1/2.0.0/README.md @@ -22,7 +22,7 @@ Add the following lines to your `pom.xml` file: com.google.apis google-api-services-chat - v1-rev20260723-2.0.0 + v1-rev20260726-2.0.0 @@ -35,7 +35,7 @@ repositories { mavenCentral() } dependencies { - implementation 'com.google.apis:google-api-services-chat:v1-rev20260723-2.0.0' + implementation 'com.google.apis:google-api-services-chat:v1-rev20260726-2.0.0' } ``` diff --git a/clients/google-api-services-chat/v1/2.0.0/com/google/api/services/chat/v1/HangoutsChat.java b/clients/google-api-services-chat/v1/2.0.0/com/google/api/services/chat/v1/HangoutsChat.java index 8bee1872c01..0ea5c57baff 100644 --- a/clients/google-api-services-chat/v1/2.0.0/com/google/api/services/chat/v1/HangoutsChat.java +++ b/clients/google-api-services-chat/v1/2.0.0/com/google/api/services/chat/v1/HangoutsChat.java @@ -6243,6 +6243,181 @@ public Patch set(String parameterName, Object value) { return (Patch) super.set(parameterName, value); } } + /** + * Searches for messages in Google Chat that the calling user has access to. Returns a list of + * messages matching the search criteria. To search across all spaces the user has access to, set + * `parent` to `spaces/-`. Using any other value for `parent` results in an `INVALID_ARGUMENT` + * error. The returned messages have their `name` field populated with the full resource name, which + * includes the specific `space` in which the message resides. This API doesn't return all message + * types. The types of messages listed below aren't included in the response. Use ListMessages to + * list all messages. - Private Messages that are visible to the authenticated user. - Messages + * posted by Chat apps in spaces or group chats. - Messages in a Chat app DM. - Messages from + * blocked users. - Messages in spaces that the caller has muted. Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * with one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - + * `https://www.googleapis.com/auth/chat.messages.readonly` - + * `https://www.googleapis.com/auth/chat.messages` + * + * Create a request for the method "messages.search". + * + * This request holds the parameters needed by the chat server. After setting any optional + * parameters, call the {@link Search#execute()} method to invoke the remote operation. + * + * @param parent Required. The resource name of the space to search within. To search across all spaces the user has + * access to, set this field to `spaces/-`. Using any other value for `parent` results in an + * `INVALID_ARGUMENT` error. To limit the search to one or more spaces, use `space.name` or + * `space.display_name` in the `filter`. + * @param content the {@link com.google.api.services.chat.v1.model.SearchMessagesRequest} + * @return the request + */ + public Search search(java.lang.String parent, com.google.api.services.chat.v1.model.SearchMessagesRequest content) throws java.io.IOException { + Search result = new Search(parent, content); + initialize(result); + return result; + } + + public class Search extends HangoutsChatRequest { + + private static final String REST_PATH = "v1/{+parent}/messages:search"; + + private final java.util.regex.Pattern PARENT_PATTERN = + java.util.regex.Pattern.compile("^spaces/[^/]+$"); + + /** + * Searches for messages in Google Chat that the calling user has access to. Returns a list of + * messages matching the search criteria. To search across all spaces the user has access to, set + * `parent` to `spaces/-`. Using any other value for `parent` results in an `INVALID_ARGUMENT` + * error. The returned messages have their `name` field populated with the full resource name, + * which includes the specific `space` in which the message resides. This API doesn't return all + * message types. The types of messages listed below aren't included in the response. Use + * ListMessages to list all messages. - Private Messages that are visible to the authenticated + * user. - Messages posted by Chat apps in spaces or group chats. - Messages in a Chat app DM. - + * Messages from blocked users. - Messages in spaces that the caller has muted. Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + * with one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - + * `https://www.googleapis.com/auth/chat.messages.readonly` - + * `https://www.googleapis.com/auth/chat.messages` + * + * Create a request for the method "messages.search". + * + * This request holds the parameters needed by the the chat server. After setting any optional + * parameters, call the {@link Search#execute()} method to invoke the remote operation.

{@link + * Search#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must + * be called to initialize this instance immediately after invoking the constructor.

+ * + * @param parent Required. The resource name of the space to search within. To search across all spaces the user has + * access to, set this field to `spaces/-`. Using any other value for `parent` results in an + * `INVALID_ARGUMENT` error. To limit the search to one or more spaces, use `space.name` or + * `space.display_name` in the `filter`. + * @param content the {@link com.google.api.services.chat.v1.model.SearchMessagesRequest} + * @since 1.13 + */ + protected Search(java.lang.String parent, com.google.api.services.chat.v1.model.SearchMessagesRequest content) { + super(HangoutsChat.this, "POST", REST_PATH, content, com.google.api.services.chat.v1.model.SearchMessagesResponse.class); + this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified."); + if (!getSuppressPatternChecks()) { + com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(), + "Parameter parent must conform to the pattern " + + "^spaces/[^/]+$"); + } + } + + @Override + public Search set$Xgafv(java.lang.String $Xgafv) { + return (Search) super.set$Xgafv($Xgafv); + } + + @Override + public Search setAccessToken(java.lang.String accessToken) { + return (Search) super.setAccessToken(accessToken); + } + + @Override + public Search setAlt(java.lang.String alt) { + return (Search) super.setAlt(alt); + } + + @Override + public Search setCallback(java.lang.String callback) { + return (Search) super.setCallback(callback); + } + + @Override + public Search setFields(java.lang.String fields) { + return (Search) super.setFields(fields); + } + + @Override + public Search setKey(java.lang.String key) { + return (Search) super.setKey(key); + } + + @Override + public Search setOauthToken(java.lang.String oauthToken) { + return (Search) super.setOauthToken(oauthToken); + } + + @Override + public Search setPrettyPrint(java.lang.Boolean prettyPrint) { + return (Search) super.setPrettyPrint(prettyPrint); + } + + @Override + public Search setQuotaUser(java.lang.String quotaUser) { + return (Search) super.setQuotaUser(quotaUser); + } + + @Override + public Search setUploadType(java.lang.String uploadType) { + return (Search) super.setUploadType(uploadType); + } + + @Override + public Search setUploadProtocol(java.lang.String uploadProtocol) { + return (Search) super.setUploadProtocol(uploadProtocol); + } + + /** + * Required. The resource name of the space to search within. To search across all spaces + * the user has access to, set this field to `spaces/-`. Using any other value for `parent` + * results in an `INVALID_ARGUMENT` error. To limit the search to one or more spaces, use + * `space.name` or `space.display_name` in the `filter`. + */ + @com.google.api.client.util.Key + private java.lang.String parent; + + /** Required. The resource name of the space to search within. To search across all spaces the user has + access to, set this field to `spaces/-`. Using any other value for `parent` results in an + `INVALID_ARGUMENT` error. To limit the search to one or more spaces, use `space.name` or + `space.display_name` in the `filter`. + */ + public java.lang.String getParent() { + return parent; + } + + /** + * Required. The resource name of the space to search within. To search across all spaces + * the user has access to, set this field to `spaces/-`. Using any other value for `parent` + * results in an `INVALID_ARGUMENT` error. To limit the search to one or more spaces, use + * `space.name` or `space.display_name` in the `filter`. + */ + public Search setParent(java.lang.String parent) { + if (!getSuppressPatternChecks()) { + com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(), + "Parameter parent must conform to the pattern " + + "^spaces/[^/]+$"); + } + this.parent = parent; + return this; + } + + @Override + public Search set(String parameterName, Object value) { + return (Search) super.set(parameterName, value); + } + } /** * Updates a message. There's a difference between the `patch` and `update` methods. The `patch` * method uses a `patch` request while the `update` method uses a `put` request. We recommend using diff --git a/clients/google-api-services-chat/v1/2.0.0/com/google/api/services/chat/v1/model/SearchMessageResult.java b/clients/google-api-services-chat/v1/2.0.0/com/google/api/services/chat/v1/model/SearchMessageResult.java new file mode 100644 index 00000000000..477aa85dcfc --- /dev/null +++ b/clients/google-api-services-chat/v1/2.0.0/com/google/api/services/chat/v1/model/SearchMessageResult.java @@ -0,0 +1,141 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +/* + * This code was generated by https://github.com/googleapis/google-api-java-client-services/ + * Modify at your own risk. + */ + +package com.google.api.services.chat.v1.model; + +/** + * A single result item from a message search. + * + *

This is the Java data model class that specifies how to parse/serialize into the JSON that is + * transmitted over HTTP when working with the Google Chat API. For a detailed explanation see: + * https://developers.google.com/api-client-library/java/google-http-java-client/json + *

+ * + * @author Google, Inc. + */ +@SuppressWarnings("javadoc") +public final class SearchMessageResult extends com.google.api.client.json.GenericJson { + + /** + * The matched message. + * The value may be {@code null}. + */ + @com.google.api.client.util.Key + private Message message; + + /** + * Indicates if the matched message is read by the calling user. Only returned if the request view + * is `SEARCH_MESSAGES_VIEW_FULL` and the calling credentials include one of the following + * [authorization scopes](https://developers.google.com/workspace/chat/authenticate- + * authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - + * `https://www.googleapis.com/auth/chat.users.readstate` + * The value may be {@code null}. + */ + @com.google.api.client.util.Key + private java.lang.Boolean read; + + /** + * The mute setting of the calling user for the space where the message is posted. The caller app + * can use this information to decide how to process the message depending on whether the space is + * muted for the user or not. Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and + * the calling credentials include the following [authorization + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - + * `https://www.googleapis.com/auth/chat.users.spacesettings` + * The value may be {@code null}. + */ + @com.google.api.client.util.Key + private java.lang.String spaceMuteSetting; + + /** + * The matched message. + * @return value or {@code null} for none + */ + public Message getMessage() { + return message; + } + + /** + * The matched message. + * @param message message or {@code null} for none + */ + public SearchMessageResult setMessage(Message message) { + this.message = message; + return this; + } + + /** + * Indicates if the matched message is read by the calling user. Only returned if the request view + * is `SEARCH_MESSAGES_VIEW_FULL` and the calling credentials include one of the following + * [authorization scopes](https://developers.google.com/workspace/chat/authenticate- + * authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - + * `https://www.googleapis.com/auth/chat.users.readstate` + * @return value or {@code null} for none + */ + public java.lang.Boolean getRead() { + return read; + } + + /** + * Indicates if the matched message is read by the calling user. Only returned if the request view + * is `SEARCH_MESSAGES_VIEW_FULL` and the calling credentials include one of the following + * [authorization scopes](https://developers.google.com/workspace/chat/authenticate- + * authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - + * `https://www.googleapis.com/auth/chat.users.readstate` + * @param read read or {@code null} for none + */ + public SearchMessageResult setRead(java.lang.Boolean read) { + this.read = read; + return this; + } + + /** + * The mute setting of the calling user for the space where the message is posted. The caller app + * can use this information to decide how to process the message depending on whether the space is + * muted for the user or not. Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and + * the calling credentials include the following [authorization + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - + * `https://www.googleapis.com/auth/chat.users.spacesettings` + * @return value or {@code null} for none + */ + public java.lang.String getSpaceMuteSetting() { + return spaceMuteSetting; + } + + /** + * The mute setting of the calling user for the space where the message is posted. The caller app + * can use this information to decide how to process the message depending on whether the space is + * muted for the user or not. Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and + * the calling credentials include the following [authorization + * scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - + * `https://www.googleapis.com/auth/chat.users.spacesettings` + * @param spaceMuteSetting spaceMuteSetting or {@code null} for none + */ + public SearchMessageResult setSpaceMuteSetting(java.lang.String spaceMuteSetting) { + this.spaceMuteSetting = spaceMuteSetting; + return this; + } + + @Override + public SearchMessageResult set(String fieldName, Object value) { + return (SearchMessageResult) super.set(fieldName, value); + } + + @Override + public SearchMessageResult clone() { + return (SearchMessageResult) super.clone(); + } + +} diff --git a/clients/google-api-services-chat/v1/2.0.0/com/google/api/services/chat/v1/model/SearchMessagesRequest.java b/clients/google-api-services-chat/v1/2.0.0/com/google/api/services/chat/v1/model/SearchMessagesRequest.java new file mode 100644 index 00000000000..4548bbedfa3 --- /dev/null +++ b/clients/google-api-services-chat/v1/2.0.0/com/google/api/services/chat/v1/model/SearchMessagesRequest.java @@ -0,0 +1,375 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +/* + * This code was generated by https://github.com/googleapis/google-api-java-client-services/ + * Modify at your own risk. + */ + +package com.google.api.services.chat.v1.model; + +/** + * Request message for searching messages. + * + *

This is the Java data model class that specifies how to parse/serialize into the JSON that is + * transmitted over HTTP when working with the Google Chat API. For a detailed explanation see: + * https://developers.google.com/api-client-library/java/google-http-java-client/json + *

+ * + * @author Google, Inc. + */ +@SuppressWarnings("javadoc") +public final class SearchMessagesRequest extends com.google.api.client.json.GenericJson { + + /** + * Required. A search query. The query can specify one or more search keywords, which are used to + * filter the results, You can also filter the results using the following message fields: - + * `create_time`: Accepts a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format + * and the supported comparison operators are: `<` and `>=`. - `sender.name`: The resource name of + * the sender (`users/{user}`). Only supports `=`. You can use the e-mail as an alias for + * `{user}`. For example, `users/example@gmail.com`, where `example@gmail.com` is the e-mail of + * the Google Chat user. - `space.name`: The resource name of the space where the message is + * posted. (`spaces/{space}`). Only supports `=`. If this filter is not set, the search is + * performed across all direct messages and spaces the user has access to as a space member. - + * `space.display_name`: Supports the operator `:` (has) and filters spaces based on a partial + * match of their display name. Results are limited to the top five space matches. For example, + * `space.display_name:Project` searches for messages in the top five spaces that contain the word + * "Project" in their display names. - `attachment`: Supports the operator `:*` (has any) to check + * for the presence of attachments. If `attachment:*` is specified, only messages that have at + * least one attachment are returned. - `annotations.user_mentions.user.name`: The resource name + * of the mentioned user (`users/{user}`). Only supports `:` (has). For example: + * `annotations.user_mentions.user.name:"users/1234567890"` returns only messages that contain a + * mention to the specified user. Alternatively, the alias `me` can be used to filter for messages + * that mention the caller user, for example: `annotations.user_mentions.user.name:users/me`. You + * can also use the e-mail as an alias for `{user}`, for example, `users/example@gmail.com`. For + * advanced filtering, the following functions are also available: - `has_link()`: Returns only + * messages that have at least one hyperlink in the message text. - `is_unread()`: Filters out + * messages that have been read by the calling user. Using the `space.display_name` filter + * requires that the calling credentials include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - + * `https://www.googleapis.com/auth/chat.spaces.readonly` - + * `https://www.googleapis.com/auth/chat.spaces` Using the `is_unread()` filter requires that the + * calling credentials include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - + * `https://www.googleapis.com/auth/chat.users.readstate.readonly` - + * `https://www.googleapis.com/auth/chat.users.readstate` Across different fields, only `AND` + * operators are supported. A valid example is `sender.name = "users/1234567890" AND is_unread()`. + * The word `AND` is optional and is implied if omitted. For example, `sender.name = + * "users/1234567890" is_unread()` is valid and is equivalent to the previous example. An invalid + * example is `sender.name = "users/1234567890" OR is_unread()` because `OR` is not supported + * between different fields. Among the same field: - `create_time` supports only `AND`, and can + * only be used to represent an interval, such as `create_time >= "2022-01-01T00:00:00+00:00" AND + * create_time < "2023-01-01T00:00:00+00:00"`. - `sender.name` supports only the `OR` operator, + * for example: `sender.name = "users/1234567890" OR sender.name = "users/0987654321"`. - + * `space.name` supports only the `OR` operator, for example: `space.name = "spaces/ABCDEFGH" OR + * space.name = "spaces/QWERTYUI"`. - `space.display_name` supports the operators `AND` and `OR`, + * but not a mix of both. For example: `space.display_name:Project AND space.display_name:Tasks` + * returns messages that are in spaces with display names containing both `Project` and `Tasks`, + * whereas `space.display_name:Project OR space.display_name:Tasks` returns messages that are in + * spaces with display names containing either `Project` or `Tasks` or both. - + * `annotations.user_mentions.user.name` supports the operators `AND` and `OR`, but not a mix of + * both. For example: `annotations.user_mentions.user.name:"users/1234567890" AND + * annotations.user_mentions.user.name:"users/0987654321"` returns only messages that mentions + * both users, whereas `annotations.user_mentions.user.name:"users/1234567890" OR + * annotations.user_mentions.user.name:"users/0987654321"` returns messages that mention either + * user or both. Parentheses are required to disambiguate operator precedence when combining `AND` + * and `OR` operators in the same query. For example: `(sender.name="users/me" OR + * sender.name="users/123456") AND is_unread()`. Otherwise, parentheses are optional. The + * following example queries are valid: ``` "Pending reports" AND create_time >= + * "2023-01-01T00:00:00Z" sender.name = "users/example@gmail.com" + * annotations.user_mentions.user.name:"users/0987654321" attachment:* AND space.name = + * "spaces/ABCDEFGH" tasks AND is_unread() AND sender.name = "users/1234567890" "things to do" + * "urgent" (sender.name = "users/1234567890") AND (create_time < "2023-05-01T00:00:00Z") tasks + * AND space.name = "spaces/ABCDEFGH" AND has_link() "project one" is_unread() + * space.display_name:Project tasks ``` The maximum query length is 1,000 characters. Invalid + * queries are rejected by the server with an `INVALID_ARGUMENT` error. + * The value may be {@code null}. + */ + @com.google.api.client.util.Key + private java.lang.String filter; + + /** + * Optional. How the results list is ordered. Supported attributes to order by are: - + * `create_time`: Sorts the results by the time of the message creation. Default value. - + * `relevance`: Sorts the results by relevance. [Developer + * Preview](https://developers.google.com/workspace/preview). The default ordering is `create_time + * desc`. Only a single order per query (`create_time` or `relevance`) is supported. Only + * descending order (`desc`) is supported, and it must be specified after the order attribute. + * The value may be {@code null}. + */ + @com.google.api.client.util.Key + private java.lang.String orderBy; + + /** + * Optional. The maximum number of results to return. The service may return fewer than this + * value. If unspecified, at most 25 are returned. The maximum value is 100. If you use a value + * more than 100, it's automatically changed to 100. + * The value may be {@code null}. + */ + @com.google.api.client.util.Key + private java.lang.Integer pageSize; + + /** + * Optional. A token, received from the previous search messages call. Provide this parameter to + * retrieve the subsequent page. When paginating, all other parameters provided should match the + * call that provided the page token. Passing different values to the other parameters might lead + * to unexpected results. + * The value may be {@code null}. + */ + @com.google.api.client.util.Key + private java.lang.String pageToken; + + /** + * Optional. Specifies what kind of search results view to return. The default is + * `SEARCH_MESSAGES_VIEW_BASIC`. + * The value may be {@code null}. + */ + @com.google.api.client.util.Key + private java.lang.String view; + + /** + * Required. A search query. The query can specify one or more search keywords, which are used to + * filter the results, You can also filter the results using the following message fields: - + * `create_time`: Accepts a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format + * and the supported comparison operators are: `<` and `>=`. - `sender.name`: The resource name of + * the sender (`users/{user}`). Only supports `=`. You can use the e-mail as an alias for + * `{user}`. For example, `users/example@gmail.com`, where `example@gmail.com` is the e-mail of + * the Google Chat user. - `space.name`: The resource name of the space where the message is + * posted. (`spaces/{space}`). Only supports `=`. If this filter is not set, the search is + * performed across all direct messages and spaces the user has access to as a space member. - + * `space.display_name`: Supports the operator `:` (has) and filters spaces based on a partial + * match of their display name. Results are limited to the top five space matches. For example, + * `space.display_name:Project` searches for messages in the top five spaces that contain the word + * "Project" in their display names. - `attachment`: Supports the operator `:*` (has any) to check + * for the presence of attachments. If `attachment:*` is specified, only messages that have at + * least one attachment are returned. - `annotations.user_mentions.user.name`: The resource name + * of the mentioned user (`users/{user}`). Only supports `:` (has). For example: + * `annotations.user_mentions.user.name:"users/1234567890"` returns only messages that contain a + * mention to the specified user. Alternatively, the alias `me` can be used to filter for messages + * that mention the caller user, for example: `annotations.user_mentions.user.name:users/me`. You + * can also use the e-mail as an alias for `{user}`, for example, `users/example@gmail.com`. For + * advanced filtering, the following functions are also available: - `has_link()`: Returns only + * messages that have at least one hyperlink in the message text. - `is_unread()`: Filters out + * messages that have been read by the calling user. Using the `space.display_name` filter + * requires that the calling credentials include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - + * `https://www.googleapis.com/auth/chat.spaces.readonly` - + * `https://www.googleapis.com/auth/chat.spaces` Using the `is_unread()` filter requires that the + * calling credentials include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - + * `https://www.googleapis.com/auth/chat.users.readstate.readonly` - + * `https://www.googleapis.com/auth/chat.users.readstate` Across different fields, only `AND` + * operators are supported. A valid example is `sender.name = "users/1234567890" AND is_unread()`. + * The word `AND` is optional and is implied if omitted. For example, `sender.name = + * "users/1234567890" is_unread()` is valid and is equivalent to the previous example. An invalid + * example is `sender.name = "users/1234567890" OR is_unread()` because `OR` is not supported + * between different fields. Among the same field: - `create_time` supports only `AND`, and can + * only be used to represent an interval, such as `create_time >= "2022-01-01T00:00:00+00:00" AND + * create_time < "2023-01-01T00:00:00+00:00"`. - `sender.name` supports only the `OR` operator, + * for example: `sender.name = "users/1234567890" OR sender.name = "users/0987654321"`. - + * `space.name` supports only the `OR` operator, for example: `space.name = "spaces/ABCDEFGH" OR + * space.name = "spaces/QWERTYUI"`. - `space.display_name` supports the operators `AND` and `OR`, + * but not a mix of both. For example: `space.display_name:Project AND space.display_name:Tasks` + * returns messages that are in spaces with display names containing both `Project` and `Tasks`, + * whereas `space.display_name:Project OR space.display_name:Tasks` returns messages that are in + * spaces with display names containing either `Project` or `Tasks` or both. - + * `annotations.user_mentions.user.name` supports the operators `AND` and `OR`, but not a mix of + * both. For example: `annotations.user_mentions.user.name:"users/1234567890" AND + * annotations.user_mentions.user.name:"users/0987654321"` returns only messages that mentions + * both users, whereas `annotations.user_mentions.user.name:"users/1234567890" OR + * annotations.user_mentions.user.name:"users/0987654321"` returns messages that mention either + * user or both. Parentheses are required to disambiguate operator precedence when combining `AND` + * and `OR` operators in the same query. For example: `(sender.name="users/me" OR + * sender.name="users/123456") AND is_unread()`. Otherwise, parentheses are optional. The + * following example queries are valid: ``` "Pending reports" AND create_time >= + * "2023-01-01T00:00:00Z" sender.name = "users/example@gmail.com" + * annotations.user_mentions.user.name:"users/0987654321" attachment:* AND space.name = + * "spaces/ABCDEFGH" tasks AND is_unread() AND sender.name = "users/1234567890" "things to do" + * "urgent" (sender.name = "users/1234567890") AND (create_time < "2023-05-01T00:00:00Z") tasks + * AND space.name = "spaces/ABCDEFGH" AND has_link() "project one" is_unread() + * space.display_name:Project tasks ``` The maximum query length is 1,000 characters. Invalid + * queries are rejected by the server with an `INVALID_ARGUMENT` error. + * @return value or {@code null} for none + */ + public java.lang.String getFilter() { + return filter; + } + + /** + * Required. A search query. The query can specify one or more search keywords, which are used to + * filter the results, You can also filter the results using the following message fields: - + * `create_time`: Accepts a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format + * and the supported comparison operators are: `<` and `>=`. - `sender.name`: The resource name of + * the sender (`users/{user}`). Only supports `=`. You can use the e-mail as an alias for + * `{user}`. For example, `users/example@gmail.com`, where `example@gmail.com` is the e-mail of + * the Google Chat user. - `space.name`: The resource name of the space where the message is + * posted. (`spaces/{space}`). Only supports `=`. If this filter is not set, the search is + * performed across all direct messages and spaces the user has access to as a space member. - + * `space.display_name`: Supports the operator `:` (has) and filters spaces based on a partial + * match of their display name. Results are limited to the top five space matches. For example, + * `space.display_name:Project` searches for messages in the top five spaces that contain the word + * "Project" in their display names. - `attachment`: Supports the operator `:*` (has any) to check + * for the presence of attachments. If `attachment:*` is specified, only messages that have at + * least one attachment are returned. - `annotations.user_mentions.user.name`: The resource name + * of the mentioned user (`users/{user}`). Only supports `:` (has). For example: + * `annotations.user_mentions.user.name:"users/1234567890"` returns only messages that contain a + * mention to the specified user. Alternatively, the alias `me` can be used to filter for messages + * that mention the caller user, for example: `annotations.user_mentions.user.name:users/me`. You + * can also use the e-mail as an alias for `{user}`, for example, `users/example@gmail.com`. For + * advanced filtering, the following functions are also available: - `has_link()`: Returns only + * messages that have at least one hyperlink in the message text. - `is_unread()`: Filters out + * messages that have been read by the calling user. Using the `space.display_name` filter + * requires that the calling credentials include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - + * `https://www.googleapis.com/auth/chat.spaces.readonly` - + * `https://www.googleapis.com/auth/chat.spaces` Using the `is_unread()` filter requires that the + * calling credentials include one of the following [authorization + * scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - + * `https://www.googleapis.com/auth/chat.users.readstate.readonly` - + * `https://www.googleapis.com/auth/chat.users.readstate` Across different fields, only `AND` + * operators are supported. A valid example is `sender.name = "users/1234567890" AND is_unread()`. + * The word `AND` is optional and is implied if omitted. For example, `sender.name = + * "users/1234567890" is_unread()` is valid and is equivalent to the previous example. An invalid + * example is `sender.name = "users/1234567890" OR is_unread()` because `OR` is not supported + * between different fields. Among the same field: - `create_time` supports only `AND`, and can + * only be used to represent an interval, such as `create_time >= "2022-01-01T00:00:00+00:00" AND + * create_time < "2023-01-01T00:00:00+00:00"`. - `sender.name` supports only the `OR` operator, + * for example: `sender.name = "users/1234567890" OR sender.name = "users/0987654321"`. - + * `space.name` supports only the `OR` operator, for example: `space.name = "spaces/ABCDEFGH" OR + * space.name = "spaces/QWERTYUI"`. - `space.display_name` supports the operators `AND` and `OR`, + * but not a mix of both. For example: `space.display_name:Project AND space.display_name:Tasks` + * returns messages that are in spaces with display names containing both `Project` and `Tasks`, + * whereas `space.display_name:Project OR space.display_name:Tasks` returns messages that are in + * spaces with display names containing either `Project` or `Tasks` or both. - + * `annotations.user_mentions.user.name` supports the operators `AND` and `OR`, but not a mix of + * both. For example: `annotations.user_mentions.user.name:"users/1234567890" AND + * annotations.user_mentions.user.name:"users/0987654321"` returns only messages that mentions + * both users, whereas `annotations.user_mentions.user.name:"users/1234567890" OR + * annotations.user_mentions.user.name:"users/0987654321"` returns messages that mention either + * user or both. Parentheses are required to disambiguate operator precedence when combining `AND` + * and `OR` operators in the same query. For example: `(sender.name="users/me" OR + * sender.name="users/123456") AND is_unread()`. Otherwise, parentheses are optional. The + * following example queries are valid: ``` "Pending reports" AND create_time >= + * "2023-01-01T00:00:00Z" sender.name = "users/example@gmail.com" + * annotations.user_mentions.user.name:"users/0987654321" attachment:* AND space.name = + * "spaces/ABCDEFGH" tasks AND is_unread() AND sender.name = "users/1234567890" "things to do" + * "urgent" (sender.name = "users/1234567890") AND (create_time < "2023-05-01T00:00:00Z") tasks + * AND space.name = "spaces/ABCDEFGH" AND has_link() "project one" is_unread() + * space.display_name:Project tasks ``` The maximum query length is 1,000 characters. Invalid + * queries are rejected by the server with an `INVALID_ARGUMENT` error. + * @param filter filter or {@code null} for none + */ + public SearchMessagesRequest setFilter(java.lang.String filter) { + this.filter = filter; + return this; + } + + /** + * Optional. How the results list is ordered. Supported attributes to order by are: - + * `create_time`: Sorts the results by the time of the message creation. Default value. - + * `relevance`: Sorts the results by relevance. [Developer + * Preview](https://developers.google.com/workspace/preview). The default ordering is `create_time + * desc`. Only a single order per query (`create_time` or `relevance`) is supported. Only + * descending order (`desc`) is supported, and it must be specified after the order attribute. + * @return value or {@code null} for none + */ + public java.lang.String getOrderBy() { + return orderBy; + } + + /** + * Optional. How the results list is ordered. Supported attributes to order by are: - + * `create_time`: Sorts the results by the time of the message creation. Default value. - + * `relevance`: Sorts the results by relevance. [Developer + * Preview](https://developers.google.com/workspace/preview). The default ordering is `create_time + * desc`. Only a single order per query (`create_time` or `relevance`) is supported. Only + * descending order (`desc`) is supported, and it must be specified after the order attribute. + * @param orderBy orderBy or {@code null} for none + */ + public SearchMessagesRequest setOrderBy(java.lang.String orderBy) { + this.orderBy = orderBy; + return this; + } + + /** + * Optional. The maximum number of results to return. The service may return fewer than this + * value. If unspecified, at most 25 are returned. The maximum value is 100. If you use a value + * more than 100, it's automatically changed to 100. + * @return value or {@code null} for none + */ + public java.lang.Integer getPageSize() { + return pageSize; + } + + /** + * Optional. The maximum number of results to return. The service may return fewer than this + * value. If unspecified, at most 25 are returned. The maximum value is 100. If you use a value + * more than 100, it's automatically changed to 100. + * @param pageSize pageSize or {@code null} for none + */ + public SearchMessagesRequest setPageSize(java.lang.Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Optional. A token, received from the previous search messages call. Provide this parameter to + * retrieve the subsequent page. When paginating, all other parameters provided should match the + * call that provided the page token. Passing different values to the other parameters might lead + * to unexpected results. + * @return value or {@code null} for none + */ + public java.lang.String getPageToken() { + return pageToken; + } + + /** + * Optional. A token, received from the previous search messages call. Provide this parameter to + * retrieve the subsequent page. When paginating, all other parameters provided should match the + * call that provided the page token. Passing different values to the other parameters might lead + * to unexpected results. + * @param pageToken pageToken or {@code null} for none + */ + public SearchMessagesRequest setPageToken(java.lang.String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * Optional. Specifies what kind of search results view to return. The default is + * `SEARCH_MESSAGES_VIEW_BASIC`. + * @return value or {@code null} for none + */ + public java.lang.String getView() { + return view; + } + + /** + * Optional. Specifies what kind of search results view to return. The default is + * `SEARCH_MESSAGES_VIEW_BASIC`. + * @param view view or {@code null} for none + */ + public SearchMessagesRequest setView(java.lang.String view) { + this.view = view; + return this; + } + + @Override + public SearchMessagesRequest set(String fieldName, Object value) { + return (SearchMessagesRequest) super.set(fieldName, value); + } + + @Override + public SearchMessagesRequest clone() { + return (SearchMessagesRequest) super.clone(); + } + +} diff --git a/clients/google-api-services-chat/v1/2.0.0/com/google/api/services/chat/v1/model/SearchMessagesResponse.java b/clients/google-api-services-chat/v1/2.0.0/com/google/api/services/chat/v1/model/SearchMessagesResponse.java new file mode 100644 index 00000000000..7104512a34d --- /dev/null +++ b/clients/google-api-services-chat/v1/2.0.0/com/google/api/services/chat/v1/model/SearchMessagesResponse.java @@ -0,0 +1,99 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +/* + * This code was generated by https://github.com/googleapis/google-api-java-client-services/ + * Modify at your own risk. + */ + +package com.google.api.services.chat.v1.model; + +/** + * Response message for searching messages. + * + *

This is the Java data model class that specifies how to parse/serialize into the JSON that is + * transmitted over HTTP when working with the Google Chat API. For a detailed explanation see: + * https://developers.google.com/api-client-library/java/google-http-java-client/json + *

+ * + * @author Google, Inc. + */ +@SuppressWarnings("javadoc") +public final class SearchMessagesResponse extends com.google.api.client.json.GenericJson { + + /** + * A token that can be used to retrieve the next page. If this field is empty, there are no + * subsequent pages. + * The value may be {@code null}. + */ + @com.google.api.client.util.Key + private java.lang.String nextPageToken; + + /** + * The list of search results that matched the query. + * The value may be {@code null}. + */ + @com.google.api.client.util.Key + private java.util.List results; + + static { + // hack to force ProGuard to consider SearchMessageResult used, since otherwise it would be stripped out + // see https://github.com/google/google-api-java-client/issues/543 + com.google.api.client.util.Data.nullOf(SearchMessageResult.class); + } + + /** + * A token that can be used to retrieve the next page. If this field is empty, there are no + * subsequent pages. + * @return value or {@code null} for none + */ + public java.lang.String getNextPageToken() { + return nextPageToken; + } + + /** + * A token that can be used to retrieve the next page. If this field is empty, there are no + * subsequent pages. + * @param nextPageToken nextPageToken or {@code null} for none + */ + public SearchMessagesResponse setNextPageToken(java.lang.String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + /** + * The list of search results that matched the query. + * @return value or {@code null} for none + */ + public java.util.List getResults() { + return results; + } + + /** + * The list of search results that matched the query. + * @param results results or {@code null} for none + */ + public SearchMessagesResponse setResults(java.util.List results) { + this.results = results; + return this; + } + + @Override + public SearchMessagesResponse set(String fieldName, Object value) { + return (SearchMessagesResponse) super.set(fieldName, value); + } + + @Override + public SearchMessagesResponse clone() { + return (SearchMessagesResponse) super.clone(); + } + +} diff --git a/clients/google-api-services-chat/v1/2.0.0/pom.xml b/clients/google-api-services-chat/v1/2.0.0/pom.xml index 8387449a1e9..d1c4ddca359 100644 --- a/clients/google-api-services-chat/v1/2.0.0/pom.xml +++ b/clients/google-api-services-chat/v1/2.0.0/pom.xml @@ -8,8 +8,8 @@ com.google.apis google-api-services-chat - v1-rev20260723-2.0.0 - Google Chat API v1-rev20260723-2.0.0 + v1-rev20260726-2.0.0 + Google Chat API v1-rev20260726-2.0.0 jar 2011 diff --git a/clients/google-api-services-chat/v1/README.md b/clients/google-api-services-chat/v1/README.md index 43362472eaf..fa221d5e592 100644 --- a/clients/google-api-services-chat/v1/README.md +++ b/clients/google-api-services-chat/v1/README.md @@ -22,7 +22,7 @@ Add the following lines to your `pom.xml` file: com.google.apis google-api-services-chat - v1-rev20260723-2.0.0 + v1-rev20260726-2.0.0 @@ -35,7 +35,7 @@ repositories { mavenCentral() } dependencies { - implementation 'com.google.apis:google-api-services-chat:v1-rev20260723-2.0.0' + implementation 'com.google.apis:google-api-services-chat:v1-rev20260726-2.0.0' } ```