
software.amazon.awssdk.services.quicksight.model.UpdateAnalysisRequest Maven / Gradle / Ivy
/*
* 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.quicksight.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
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 UpdateAnalysisRequest extends QuickSightRequest implements
ToCopyableBuilder {
private static final SdkField AWS_ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AwsAccountId").getter(getter(UpdateAnalysisRequest::awsAccountId)).setter(setter(Builder::awsAccountId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("AwsAccountId").build()).build();
private static final SdkField ANALYSIS_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AnalysisId").getter(getter(UpdateAnalysisRequest::analysisId)).setter(setter(Builder::analysisId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("AnalysisId").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(UpdateAnalysisRequest::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField PARAMETERS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Parameters").getter(getter(UpdateAnalysisRequest::parameters)).setter(setter(Builder::parameters))
.constructor(Parameters::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Parameters").build()).build();
private static final SdkField SOURCE_ENTITY_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("SourceEntity")
.getter(getter(UpdateAnalysisRequest::sourceEntity)).setter(setter(Builder::sourceEntity))
.constructor(AnalysisSourceEntity::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceEntity").build()).build();
private static final SdkField THEME_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ThemeArn").getter(getter(UpdateAnalysisRequest::themeArn)).setter(setter(Builder::themeArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ThemeArn").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AWS_ACCOUNT_ID_FIELD,
ANALYSIS_ID_FIELD, NAME_FIELD, PARAMETERS_FIELD, SOURCE_ENTITY_FIELD, THEME_ARN_FIELD));
private final String awsAccountId;
private final String analysisId;
private final String name;
private final Parameters parameters;
private final AnalysisSourceEntity sourceEntity;
private final String themeArn;
private UpdateAnalysisRequest(BuilderImpl builder) {
super(builder);
this.awsAccountId = builder.awsAccountId;
this.analysisId = builder.analysisId;
this.name = builder.name;
this.parameters = builder.parameters;
this.sourceEntity = builder.sourceEntity;
this.themeArn = builder.themeArn;
}
/**
*
* The ID of the AWS account that contains the analysis that you're updating.
*
*
* @return The ID of the AWS account that contains the analysis that you're updating.
*/
public String awsAccountId() {
return awsAccountId;
}
/**
*
* The ID for the analysis that you're updating. This ID displays in the URL of the analysis.
*
*
* @return The ID for the analysis that you're updating. This ID displays in the URL of the analysis.
*/
public String analysisId() {
return analysisId;
}
/**
*
* A descriptive name for the analysis that you're updating. This name displays for the analysis in the QuickSight
* console.
*
*
* @return A descriptive name for the analysis that you're updating. This name displays for the analysis in the
* QuickSight console.
*/
public String name() {
return name;
}
/**
*
* The parameter names and override values that you want to use. An analysis can have any parameter type, and some
* parameters might accept multiple values.
*
*
* @return The parameter names and override values that you want to use. An analysis can have any parameter type,
* and some parameters might accept multiple values.
*/
public Parameters parameters() {
return parameters;
}
/**
*
* A source entity to use for the analysis that you're updating. This metadata structure contains details that
* describe a source template and one or more datasets.
*
*
* @return A source entity to use for the analysis that you're updating. This metadata structure contains details
* that describe a source template and one or more datasets.
*/
public AnalysisSourceEntity sourceEntity() {
return sourceEntity;
}
/**
*
* The Amazon Resource Name (ARN) for the theme to apply to the analysis that you're creating. To see the theme in
* the QuickSight console, make sure that you have access to it.
*
*
* @return The Amazon Resource Name (ARN) for the theme to apply to the analysis that you're creating. To see the
* theme in the QuickSight console, make sure that you have access to it.
*/
public String themeArn() {
return themeArn;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(awsAccountId());
hashCode = 31 * hashCode + Objects.hashCode(analysisId());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(parameters());
hashCode = 31 * hashCode + Objects.hashCode(sourceEntity());
hashCode = 31 * hashCode + Objects.hashCode(themeArn());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateAnalysisRequest)) {
return false;
}
UpdateAnalysisRequest other = (UpdateAnalysisRequest) obj;
return Objects.equals(awsAccountId(), other.awsAccountId()) && Objects.equals(analysisId(), other.analysisId())
&& Objects.equals(name(), other.name()) && Objects.equals(parameters(), other.parameters())
&& Objects.equals(sourceEntity(), other.sourceEntity()) && Objects.equals(themeArn(), other.themeArn());
}
/**
* 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 String toString() {
return ToString.builder("UpdateAnalysisRequest").add("AwsAccountId", awsAccountId()).add("AnalysisId", analysisId())
.add("Name", name()).add("Parameters", parameters()).add("SourceEntity", sourceEntity())
.add("ThemeArn", themeArn()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AwsAccountId":
return Optional.ofNullable(clazz.cast(awsAccountId()));
case "AnalysisId":
return Optional.ofNullable(clazz.cast(analysisId()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Parameters":
return Optional.ofNullable(clazz.cast(parameters()));
case "SourceEntity":
return Optional.ofNullable(clazz.cast(sourceEntity()));
case "ThemeArn":
return Optional.ofNullable(clazz.cast(themeArn()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function