Skip to content
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
4 changes: 2 additions & 2 deletions clients/google-api-services-chat/v1/2.0.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Add the following lines to your `pom.xml` file:
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-chat</artifactId>
<version>v1-rev20260723-2.0.0</version>
<version>v1-rev20260726-2.0.0</version>
</dependency>
</dependencies>
</project>
Expand All @@ -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'
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<com.google.api.services.chat.v1.model.SearchMessagesResponse> {

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. <p> {@link
* Search#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor. </p>
*
* @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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
* <p> 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:
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
* </p>
*
* @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();
}

}
Loading
Loading