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

software.amazon.awssdk.services.trustedadvisor.model.UpdateRecommendationLifecycleRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Trusted Advisor module holds the client classes that are used for communicating with Trusted Advisor.

There is a newer version: 2.29.15
Show 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.trustedadvisor.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 UpdateRecommendationLifecycleRequest extends TrustedAdvisorRequest implements
        ToCopyableBuilder {
    private static final SdkField LIFECYCLE_STAGE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("lifecycleStage").getter(getter(UpdateRecommendationLifecycleRequest::lifecycleStageAsString))
            .setter(setter(Builder::lifecycleStage))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lifecycleStage").build()).build();

    private static final SdkField RECOMMENDATION_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("recommendationIdentifier")
            .getter(getter(UpdateRecommendationLifecycleRequest::recommendationIdentifier))
            .setter(setter(Builder::recommendationIdentifier))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("recommendationIdentifier").build())
            .build();

    private static final SdkField UPDATE_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("updateReason").getter(getter(UpdateRecommendationLifecycleRequest::updateReason))
            .setter(setter(Builder::updateReason))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("updateReason").build()).build();

    private static final SdkField UPDATE_REASON_CODE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("updateReasonCode").getter(getter(UpdateRecommendationLifecycleRequest::updateReasonCodeAsString))
            .setter(setter(Builder::updateReasonCode))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("updateReasonCode").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LIFECYCLE_STAGE_FIELD,
            RECOMMENDATION_IDENTIFIER_FIELD, UPDATE_REASON_FIELD, UPDATE_REASON_CODE_FIELD));

    private final String lifecycleStage;

    private final String recommendationIdentifier;

    private final String updateReason;

    private final String updateReasonCode;

    private UpdateRecommendationLifecycleRequest(BuilderImpl builder) {
        super(builder);
        this.lifecycleStage = builder.lifecycleStage;
        this.recommendationIdentifier = builder.recommendationIdentifier;
        this.updateReason = builder.updateReason;
        this.updateReasonCode = builder.updateReasonCode;
    }

    /**
     * 

* The new lifecycle stage *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #lifecycleStage} * will return {@link UpdateRecommendationLifecycleStage#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the * service is available from {@link #lifecycleStageAsString}. *

* * @return The new lifecycle stage * @see UpdateRecommendationLifecycleStage */ public final UpdateRecommendationLifecycleStage lifecycleStage() { return UpdateRecommendationLifecycleStage.fromValue(lifecycleStage); } /** *

* The new lifecycle stage *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #lifecycleStage} * will return {@link UpdateRecommendationLifecycleStage#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the * service is available from {@link #lifecycleStageAsString}. *

* * @return The new lifecycle stage * @see UpdateRecommendationLifecycleStage */ public final String lifecycleStageAsString() { return lifecycleStage; } /** *

* The Recommendation identifier for AWS Trusted Advisor Priority recommendations *

* * @return The Recommendation identifier for AWS Trusted Advisor Priority recommendations */ public final String recommendationIdentifier() { return recommendationIdentifier; } /** *

* Reason for the lifecycle stage change *

* * @return Reason for the lifecycle stage change */ public final String updateReason() { return updateReason; } /** *

* Reason code for the lifecycle state change *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #updateReasonCode} * will return {@link UpdateRecommendationLifecycleStageReasonCode#UNKNOWN_TO_SDK_VERSION}. The raw value returned * by the service is available from {@link #updateReasonCodeAsString}. *

* * @return Reason code for the lifecycle state change * @see UpdateRecommendationLifecycleStageReasonCode */ public final UpdateRecommendationLifecycleStageReasonCode updateReasonCode() { return UpdateRecommendationLifecycleStageReasonCode.fromValue(updateReasonCode); } /** *

* Reason code for the lifecycle state change *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #updateReasonCode} * will return {@link UpdateRecommendationLifecycleStageReasonCode#UNKNOWN_TO_SDK_VERSION}. The raw value returned * by the service is available from {@link #updateReasonCodeAsString}. *

* * @return Reason code for the lifecycle state change * @see UpdateRecommendationLifecycleStageReasonCode */ public final String updateReasonCodeAsString() { return updateReasonCode; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(lifecycleStageAsString()); hashCode = 31 * hashCode + Objects.hashCode(recommendationIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(updateReason()); hashCode = 31 * hashCode + Objects.hashCode(updateReasonCodeAsString()); 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 UpdateRecommendationLifecycleRequest)) { return false; } UpdateRecommendationLifecycleRequest other = (UpdateRecommendationLifecycleRequest) obj; return Objects.equals(lifecycleStageAsString(), other.lifecycleStageAsString()) && Objects.equals(recommendationIdentifier(), other.recommendationIdentifier()) && Objects.equals(updateReason(), other.updateReason()) && Objects.equals(updateReasonCodeAsString(), other.updateReasonCodeAsString()); } /** * 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("UpdateRecommendationLifecycleRequest").add("LifecycleStage", lifecycleStageAsString()) .add("RecommendationIdentifier", recommendationIdentifier()) .add("UpdateReason", updateReason() == null ? null : "*** Sensitive Data Redacted ***") .add("UpdateReasonCode", updateReasonCodeAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "lifecycleStage": return Optional.ofNullable(clazz.cast(lifecycleStageAsString())); case "recommendationIdentifier": return Optional.ofNullable(clazz.cast(recommendationIdentifier())); case "updateReason": return Optional.ofNullable(clazz.cast(updateReason())); case "updateReasonCode": return Optional.ofNullable(clazz.cast(updateReasonCodeAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateRecommendationLifecycleRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends TrustedAdvisorRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The new lifecycle stage *

* * @param lifecycleStage * The new lifecycle stage * @see UpdateRecommendationLifecycleStage * @return Returns a reference to this object so that method calls can be chained together. * @see UpdateRecommendationLifecycleStage */ Builder lifecycleStage(String lifecycleStage); /** *

* The new lifecycle stage *

* * @param lifecycleStage * The new lifecycle stage * @see UpdateRecommendationLifecycleStage * @return Returns a reference to this object so that method calls can be chained together. * @see UpdateRecommendationLifecycleStage */ Builder lifecycleStage(UpdateRecommendationLifecycleStage lifecycleStage); /** *

* The Recommendation identifier for AWS Trusted Advisor Priority recommendations *

* * @param recommendationIdentifier * The Recommendation identifier for AWS Trusted Advisor Priority recommendations * @return Returns a reference to this object so that method calls can be chained together. */ Builder recommendationIdentifier(String recommendationIdentifier); /** *

* Reason for the lifecycle stage change *

* * @param updateReason * Reason for the lifecycle stage change * @return Returns a reference to this object so that method calls can be chained together. */ Builder updateReason(String updateReason); /** *

* Reason code for the lifecycle state change *

* * @param updateReasonCode * Reason code for the lifecycle state change * @see UpdateRecommendationLifecycleStageReasonCode * @return Returns a reference to this object so that method calls can be chained together. * @see UpdateRecommendationLifecycleStageReasonCode */ Builder updateReasonCode(String updateReasonCode); /** *

* Reason code for the lifecycle state change *

* * @param updateReasonCode * Reason code for the lifecycle state change * @see UpdateRecommendationLifecycleStageReasonCode * @return Returns a reference to this object so that method calls can be chained together. * @see UpdateRecommendationLifecycleStageReasonCode */ Builder updateReasonCode(UpdateRecommendationLifecycleStageReasonCode updateReasonCode); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends TrustedAdvisorRequest.BuilderImpl implements Builder { private String lifecycleStage; private String recommendationIdentifier; private String updateReason; private String updateReasonCode; private BuilderImpl() { } private BuilderImpl(UpdateRecommendationLifecycleRequest model) { super(model); lifecycleStage(model.lifecycleStage); recommendationIdentifier(model.recommendationIdentifier); updateReason(model.updateReason); updateReasonCode(model.updateReasonCode); } public final String getLifecycleStage() { return lifecycleStage; } public final void setLifecycleStage(String lifecycleStage) { this.lifecycleStage = lifecycleStage; } @Override public final Builder lifecycleStage(String lifecycleStage) { this.lifecycleStage = lifecycleStage; return this; } @Override public final Builder lifecycleStage(UpdateRecommendationLifecycleStage lifecycleStage) { this.lifecycleStage(lifecycleStage == null ? null : lifecycleStage.toString()); return this; } public final String getRecommendationIdentifier() { return recommendationIdentifier; } public final void setRecommendationIdentifier(String recommendationIdentifier) { this.recommendationIdentifier = recommendationIdentifier; } @Override public final Builder recommendationIdentifier(String recommendationIdentifier) { this.recommendationIdentifier = recommendationIdentifier; return this; } public final String getUpdateReason() { return updateReason; } public final void setUpdateReason(String updateReason) { this.updateReason = updateReason; } @Override public final Builder updateReason(String updateReason) { this.updateReason = updateReason; return this; } public final String getUpdateReasonCode() { return updateReasonCode; } public final void setUpdateReasonCode(String updateReasonCode) { this.updateReasonCode = updateReasonCode; } @Override public final Builder updateReasonCode(String updateReasonCode) { this.updateReasonCode = updateReasonCode; return this; } @Override public final Builder updateReasonCode(UpdateRecommendationLifecycleStageReasonCode updateReasonCode) { this.updateReasonCode(updateReasonCode == null ? null : updateReasonCode.toString()); return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public UpdateRecommendationLifecycleRequest build() { return new UpdateRecommendationLifecycleRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy