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-rev20260927-2.0.0</version>
<version>v1-rev20261015-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-rev20260927-2.0.0'
implementation 'com.google.apis:google-api-services-chat:v1-rev20261015-2.0.0'
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6878,6 +6878,153 @@ public Patch set(String parameterName, Object value) {
return (Patch) super.set(parameterName, value);
}
}
/**
* Replaces the cards included in a message. A Chat app can only replace cards on a human-created
* message if the message already contains cards, and the cards were created by the app. If the app
* replaces the cards with an empty list, the cards are removed. After removing the cards, the app
* cannot add cards back to the message. Requires [app
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
* with the [authorization scope](https://developers.google.com/workspace/chat/authenticate-
* authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.bot`
*
* Create a request for the method "messages.replaceCards".
*
* This request holds the parameters needed by the chat server. After setting any optional
* parameters, call the {@link ReplaceCards#execute()} method to invoke the remote operation.
*
* @param name Required. The resource name of the message. Format: `spaces/{space}/messages/{message}`
* @param content the {@link com.google.api.services.chat.v1.model.ReplaceMessageCardsRequest}
* @return the request
*/
public ReplaceCards replaceCards(java.lang.String name, com.google.api.services.chat.v1.model.ReplaceMessageCardsRequest content) throws java.io.IOException {
ReplaceCards result = new ReplaceCards(name, content);
initialize(result);
return result;
}

public class ReplaceCards extends HangoutsChatRequest<com.google.api.services.chat.v1.model.ReplaceMessageCardsResponse> {

private static final String REST_PATH = "v1/{+name}:replaceCards";

private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^spaces/[^/]+/messages/[^/]+$");

/**
* Replaces the cards included in a message. A Chat app can only replace cards on a human-created
* message if the message already contains cards, and the cards were created by the app. If the
* app replaces the cards with an empty list, the cards are removed. After removing the cards, the
* app cannot add cards back to the message. Requires [app
* authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
* with the [authorization scope](https://developers.google.com/workspace/chat/authenticate-
* authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.bot`
*
* Create a request for the method "messages.replaceCards".
*
* This request holds the parameters needed by the the chat server. After setting any optional
* parameters, call the {@link ReplaceCards#execute()} method to invoke the remote operation. <p>
* {@link
* ReplaceCards#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor. </p>
*
* @param name Required. The resource name of the message. Format: `spaces/{space}/messages/{message}`
* @param content the {@link com.google.api.services.chat.v1.model.ReplaceMessageCardsRequest}
* @since 1.13
*/
protected ReplaceCards(java.lang.String name, com.google.api.services.chat.v1.model.ReplaceMessageCardsRequest content) {
super(HangoutsChat.this, "POST", REST_PATH, content, com.google.api.services.chat.v1.model.ReplaceMessageCardsResponse.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^spaces/[^/]+/messages/[^/]+$");
}
}

@Override
public ReplaceCards set$Xgafv(java.lang.String $Xgafv) {
return (ReplaceCards) super.set$Xgafv($Xgafv);
}

@Override
public ReplaceCards setAccessToken(java.lang.String accessToken) {
return (ReplaceCards) super.setAccessToken(accessToken);
}

@Override
public ReplaceCards setAlt(java.lang.String alt) {
return (ReplaceCards) super.setAlt(alt);
}

@Override
public ReplaceCards setCallback(java.lang.String callback) {
return (ReplaceCards) super.setCallback(callback);
}

@Override
public ReplaceCards setFields(java.lang.String fields) {
return (ReplaceCards) super.setFields(fields);
}

@Override
public ReplaceCards setKey(java.lang.String key) {
return (ReplaceCards) super.setKey(key);
}

@Override
public ReplaceCards setOauthToken(java.lang.String oauthToken) {
return (ReplaceCards) super.setOauthToken(oauthToken);
}

@Override
public ReplaceCards setPrettyPrint(java.lang.Boolean prettyPrint) {
return (ReplaceCards) super.setPrettyPrint(prettyPrint);
}

@Override
public ReplaceCards setQuotaUser(java.lang.String quotaUser) {
return (ReplaceCards) super.setQuotaUser(quotaUser);
}

@Override
public ReplaceCards setUploadType(java.lang.String uploadType) {
return (ReplaceCards) super.setUploadType(uploadType);
}

@Override
public ReplaceCards setUploadProtocol(java.lang.String uploadProtocol) {
return (ReplaceCards) super.setUploadProtocol(uploadProtocol);
}

/**
* Required. The resource name of the message. Format: `spaces/{space}/messages/{message}`
*/
@com.google.api.client.util.Key
private java.lang.String name;

/** Required. The resource name of the message. Format: `spaces/{space}/messages/{message}`
*/
public java.lang.String getName() {
return name;
}

/**
* Required. The resource name of the message. Format: `spaces/{space}/messages/{message}`
*/
public ReplaceCards setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^spaces/[^/]+/messages/[^/]+$");
}
this.name = name;
return this;
}

@Override
public ReplaceCards set(String parameterName, Object value) {
return (ReplaceCards) 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ public final class CardWithId extends com.google.api.client.json.GenericJson {
@com.google.api.client.util.Key
private java.lang.String cardId;

/**
* Output only. The app that owns the card.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private User ownerUser;

/**
* A card. Maximum size is 32 KB.
* @return value or {@code null} for none
Expand Down Expand Up @@ -85,6 +92,23 @@ public CardWithId setCardId(java.lang.String cardId) {
return this;
}

/**
* Output only. The app that owns the card.
* @return value or {@code null} for none
*/
public User getOwnerUser() {
return ownerUser;
}

/**
* Output only. The app that owns the card.
* @param ownerUser ownerUser or {@code null} for none
*/
public CardWithId setOwnerUser(User ownerUser) {
this.ownerUser = ownerUser;
return this;
}

@Override
public CardWithId set(String fieldName, Object value) {
return (CardWithId) super.set(fieldName, value);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* 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 ReplaceMessageCards API method.
*
* <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 ReplaceMessageCardsRequest extends com.google.api.client.json.GenericJson {

/**
* Optional. An array of
* [cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards) to be
* included in the message. These cards will replace the existing cards of the message. If empty,
* the original cards included in the message will be cleared.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.util.List<CardWithId> cardsV2;

static {
// hack to force ProGuard to consider CardWithId 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(CardWithId.class);
}

/**
* Optional. An array of
* [cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards) to be
* included in the message. These cards will replace the existing cards of the message. If empty,
* the original cards included in the message will be cleared.
* @return value or {@code null} for none
*/
public java.util.List<CardWithId> getCardsV2() {
return cardsV2;
}

/**
* Optional. An array of
* [cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards) to be
* included in the message. These cards will replace the existing cards of the message. If empty,
* the original cards included in the message will be cleared.
* @param cardsV2 cardsV2 or {@code null} for none
*/
public ReplaceMessageCardsRequest setCardsV2(java.util.List<CardWithId> cardsV2) {
this.cardsV2 = cardsV2;
return this;
}

@Override
public ReplaceMessageCardsRequest set(String fieldName, Object value) {
return (ReplaceMessageCardsRequest) super.set(fieldName, value);
}

@Override
public ReplaceMessageCardsRequest clone() {
return (ReplaceMessageCardsRequest) super.clone();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* 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 ReplaceMessageCards API.
*
* <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 ReplaceMessageCardsResponse extends com.google.api.client.json.GenericJson {

@Override
public ReplaceMessageCardsResponse set(String fieldName, Object value) {
return (ReplaceMessageCardsResponse) super.set(fieldName, value);
}

@Override
public ReplaceMessageCardsResponse clone() {
return (ReplaceMessageCardsResponse) super.clone();
}

}
4 changes: 2 additions & 2 deletions clients/google-api-services-chat/v1/2.0.0/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<groupId>com.google.apis</groupId>
<artifactId>google-api-services-chat</artifactId>
<version>v1-rev20260927-2.0.0</version>
<name>Google Chat API v1-rev20260927-2.0.0</name>
<version>v1-rev20261015-2.0.0</version>
<name>Google Chat API v1-rev20261015-2.0.0</name>
<packaging>jar</packaging>

<inceptionYear>2011</inceptionYear>
Expand Down
4 changes: 2 additions & 2 deletions clients/google-api-services-chat/v1/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-rev20260927-2.0.0</version>
<version>v1-rev20261015-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-rev20260927-2.0.0'
implementation 'com.google.apis:google-api-services-chat:v1-rev20261015-2.0.0'
}
```

Expand Down
Loading