All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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 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 getter(Function g) { return obj -> g.apply((UpdateAnalysisRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends QuickSightRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The ID of the AWS account that contains the analysis that you're updating. *

* * @param awsAccountId * The ID of the AWS account that contains the analysis that you're updating. * @return Returns a reference to this object so that method calls can be chained together. */ Builder awsAccountId(String awsAccountId); /** *

* The ID for the analysis that you're updating. This ID displays in the URL of the analysis. *

* * @param analysisId * The ID for the analysis that you're updating. This ID displays in the URL of the analysis. * @return Returns a reference to this object so that method calls can be chained together. */ Builder analysisId(String analysisId); /** *

* A descriptive name for the analysis that you're updating. This name displays for the analysis in the * QuickSight console. *

* * @param name * A descriptive name for the analysis that you're updating. This name displays for the analysis in the * QuickSight console. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String 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. *

* * @param parameters * 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 Returns a reference to this object so that method calls can be chained together. */ Builder parameters(Parameters parameters); /** *

* 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. *

* This is a convenience that creates an instance of the {@link Parameters.Builder} avoiding the need to create * one manually via {@link Parameters#builder()}. * * When the {@link Consumer} completes, {@link Parameters.Builder#build()} is called immediately and its result * is passed to {@link #parameters(Parameters)}. * * @param parameters * a consumer that will call methods on {@link Parameters.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #parameters(Parameters) */ default Builder parameters(Consumer parameters) { return parameters(Parameters.builder().applyMutation(parameters).build()); } /** *

* 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. *

* * @param sourceEntity * 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 Returns a reference to this object so that method calls can be chained together. */ Builder sourceEntity(AnalysisSourceEntity sourceEntity); /** *

* 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. *

* This is a convenience that creates an instance of the {@link AnalysisSourceEntity.Builder} avoiding the need * to create one manually via {@link AnalysisSourceEntity#builder()}. * * When the {@link Consumer} completes, {@link AnalysisSourceEntity.Builder#build()} is called immediately and * its result is passed to {@link #sourceEntity(AnalysisSourceEntity)}. * * @param sourceEntity * a consumer that will call methods on {@link AnalysisSourceEntity.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #sourceEntity(AnalysisSourceEntity) */ default Builder sourceEntity(Consumer sourceEntity) { return sourceEntity(AnalysisSourceEntity.builder().applyMutation(sourceEntity).build()); } /** *

* 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. *

* * @param themeArn * 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 Returns a reference to this object so that method calls can be chained together. */ Builder themeArn(String themeArn); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends QuickSightRequest.BuilderImpl implements Builder { private String awsAccountId; private String analysisId; private String name; private Parameters parameters; private AnalysisSourceEntity sourceEntity; private String themeArn; private BuilderImpl() { } private BuilderImpl(UpdateAnalysisRequest model) { super(model); awsAccountId(model.awsAccountId); analysisId(model.analysisId); name(model.name); parameters(model.parameters); sourceEntity(model.sourceEntity); themeArn(model.themeArn); } public final String getAwsAccountId() { return awsAccountId; } @Override public final Builder awsAccountId(String awsAccountId) { this.awsAccountId = awsAccountId; return this; } public final void setAwsAccountId(String awsAccountId) { this.awsAccountId = awsAccountId; } public final String getAnalysisId() { return analysisId; } @Override public final Builder analysisId(String analysisId) { this.analysisId = analysisId; return this; } public final void setAnalysisId(String analysisId) { this.analysisId = analysisId; } public final String getName() { return name; } @Override public final Builder name(String name) { this.name = name; return this; } public final void setName(String name) { this.name = name; } public final Parameters.Builder getParameters() { return parameters != null ? parameters.toBuilder() : null; } @Override public final Builder parameters(Parameters parameters) { this.parameters = parameters; return this; } public final void setParameters(Parameters.BuilderImpl parameters) { this.parameters = parameters != null ? parameters.build() : null; } public final AnalysisSourceEntity.Builder getSourceEntity() { return sourceEntity != null ? sourceEntity.toBuilder() : null; } @Override public final Builder sourceEntity(AnalysisSourceEntity sourceEntity) { this.sourceEntity = sourceEntity; return this; } public final void setSourceEntity(AnalysisSourceEntity.BuilderImpl sourceEntity) { this.sourceEntity = sourceEntity != null ? sourceEntity.build() : null; } public final String getThemeArn() { return themeArn; } @Override public final Builder themeArn(String themeArn) { this.themeArn = themeArn; return this; } public final void setThemeArn(String themeArn) { this.themeArn = themeArn; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public UpdateAnalysisRequest build() { return new UpdateAnalysisRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy