software.amazon.awssdk.services.qapps.model.UpdateQAppRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of qapps Show documentation
Show all versions of qapps Show documentation
The AWS Java SDK for Q Apps module holds the client classes that are used for
communicating with Q Apps.
The newest version!
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
package software.amazon.awssdk.services.qapps.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdateQAppRequest extends QAppsRequest implements
ToCopyableBuilder {
private static final SdkField INSTANCE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("instanceId").getter(getter(UpdateQAppRequest::instanceId)).setter(setter(Builder::instanceId))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("instance-id").build()).build();
private static final SdkField APP_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("appId")
.getter(getter(UpdateQAppRequest::appId)).setter(setter(Builder::appId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("appId").build()).build();
private static final SdkField TITLE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("title")
.getter(getter(UpdateQAppRequest::title)).setter(setter(Builder::title))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("title").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("description").getter(getter(UpdateQAppRequest::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField APP_DEFINITION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("appDefinition")
.getter(getter(UpdateQAppRequest::appDefinition)).setter(setter(Builder::appDefinition))
.constructor(AppDefinitionInput::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("appDefinition").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(INSTANCE_ID_FIELD,
APP_ID_FIELD, TITLE_FIELD, DESCRIPTION_FIELD, APP_DEFINITION_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private final String instanceId;
private final String appId;
private final String title;
private final String description;
private final AppDefinitionInput appDefinition;
private UpdateQAppRequest(BuilderImpl builder) {
super(builder);
this.instanceId = builder.instanceId;
this.appId = builder.appId;
this.title = builder.title;
this.description = builder.description;
this.appDefinition = builder.appDefinition;
}
/**
*
* The unique identifier of the Amazon Q Business application environment instance.
*
*
* @return The unique identifier of the Amazon Q Business application environment instance.
*/
public final String instanceId() {
return instanceId;
}
/**
*
* The unique identifier of the Q App to update.
*
*
* @return The unique identifier of the Q App to update.
*/
public final String appId() {
return appId;
}
/**
*
* The new title for the Q App.
*
*
* @return The new title for the Q App.
*/
public final String title() {
return title;
}
/**
*
* The new description for the Q App.
*
*
* @return The new description for the Q App.
*/
public final String description() {
return description;
}
/**
*
* The new definition specifying the cards and flow for the Q App.
*
*
* @return The new definition specifying the cards and flow for the Q App.
*/
public final AppDefinitionInput appDefinition() {
return appDefinition;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(instanceId());
hashCode = 31 * hashCode + Objects.hashCode(appId());
hashCode = 31 * hashCode + Objects.hashCode(title());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(appDefinition());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateQAppRequest)) {
return false;
}
UpdateQAppRequest other = (UpdateQAppRequest) obj;
return Objects.equals(instanceId(), other.instanceId()) && Objects.equals(appId(), other.appId())
&& Objects.equals(title(), other.title()) && Objects.equals(description(), other.description())
&& Objects.equals(appDefinition(), other.appDefinition());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("UpdateQAppRequest").add("InstanceId", instanceId()).add("AppId", appId()).add("Title", title())
.add("Description", description()).add("AppDefinition", appDefinition()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "instanceId":
return Optional.ofNullable(clazz.cast(instanceId()));
case "appId":
return Optional.ofNullable(clazz.cast(appId()));
case "title":
return Optional.ofNullable(clazz.cast(title()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "appDefinition":
return Optional.ofNullable(clazz.cast(appDefinition()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("instance-id", INSTANCE_ID_FIELD);
map.put("appId", APP_ID_FIELD);
map.put("title", TITLE_FIELD);
map.put("description", DESCRIPTION_FIELD);
map.put("appDefinition", APP_DEFINITION_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy