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

software.amazon.awssdk.services.iot.model.DescribeMitigationActionResponse 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.iot.model;

import java.beans.Transient;
import java.time.Instant;
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.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 DescribeMitigationActionResponse extends IotResponse implements
        ToCopyableBuilder {
    private static final SdkField ACTION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("actionName").getter(getter(DescribeMitigationActionResponse::actionName))
            .setter(setter(Builder::actionName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("actionName").build()).build();

    private static final SdkField ACTION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("actionType").getter(getter(DescribeMitigationActionResponse::actionTypeAsString))
            .setter(setter(Builder::actionType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("actionType").build()).build();

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

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

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

    private static final SdkField ACTION_PARAMS_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("actionParams")
            .getter(getter(DescribeMitigationActionResponse::actionParams)).setter(setter(Builder::actionParams))
            .constructor(MitigationActionParams::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("actionParams").build()).build();

    private static final SdkField CREATION_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("creationDate").getter(getter(DescribeMitigationActionResponse::creationDate))
            .setter(setter(Builder::creationDate))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creationDate").build()).build();

    private static final SdkField LAST_MODIFIED_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("lastModifiedDate").getter(getter(DescribeMitigationActionResponse::lastModifiedDate))
            .setter(setter(Builder::lastModifiedDate))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastModifiedDate").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACTION_NAME_FIELD,
            ACTION_TYPE_FIELD, ACTION_ARN_FIELD, ACTION_ID_FIELD, ROLE_ARN_FIELD, ACTION_PARAMS_FIELD, CREATION_DATE_FIELD,
            LAST_MODIFIED_DATE_FIELD));

    private final String actionName;

    private final String actionType;

    private final String actionArn;

    private final String actionId;

    private final String roleArn;

    private final MitigationActionParams actionParams;

    private final Instant creationDate;

    private final Instant lastModifiedDate;

    private DescribeMitigationActionResponse(BuilderImpl builder) {
        super(builder);
        this.actionName = builder.actionName;
        this.actionType = builder.actionType;
        this.actionArn = builder.actionArn;
        this.actionId = builder.actionId;
        this.roleArn = builder.roleArn;
        this.actionParams = builder.actionParams;
        this.creationDate = builder.creationDate;
        this.lastModifiedDate = builder.lastModifiedDate;
    }

    /**
     * 

* The friendly name that uniquely identifies the mitigation action. *

* * @return The friendly name that uniquely identifies the mitigation action. */ public final String actionName() { return actionName; } /** *

* The type of mitigation action. *

*

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

* * @return The type of mitigation action. * @see MitigationActionType */ public final MitigationActionType actionType() { return MitigationActionType.fromValue(actionType); } /** *

* The type of mitigation action. *

*

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

* * @return The type of mitigation action. * @see MitigationActionType */ public final String actionTypeAsString() { return actionType; } /** *

* The ARN that identifies this migration action. *

* * @return The ARN that identifies this migration action. */ public final String actionArn() { return actionArn; } /** *

* A unique identifier for this action. *

* * @return A unique identifier for this action. */ public final String actionId() { return actionId; } /** *

* The ARN of the IAM role used to apply this action. *

* * @return The ARN of the IAM role used to apply this action. */ public final String roleArn() { return roleArn; } /** *

* Parameters that control how the mitigation action is applied, specific to the type of mitigation action. *

* * @return Parameters that control how the mitigation action is applied, specific to the type of mitigation action. */ public final MitigationActionParams actionParams() { return actionParams; } /** *

* The date and time when the mitigation action was added to your AWS account. *

* * @return The date and time when the mitigation action was added to your AWS account. */ public final Instant creationDate() { return creationDate; } /** *

* The date and time when the mitigation action was last changed. *

* * @return The date and time when the mitigation action was last changed. */ public final Instant lastModifiedDate() { return lastModifiedDate; } @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(actionName()); hashCode = 31 * hashCode + Objects.hashCode(actionTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(actionArn()); hashCode = 31 * hashCode + Objects.hashCode(actionId()); hashCode = 31 * hashCode + Objects.hashCode(roleArn()); hashCode = 31 * hashCode + Objects.hashCode(actionParams()); hashCode = 31 * hashCode + Objects.hashCode(creationDate()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedDate()); 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 DescribeMitigationActionResponse)) { return false; } DescribeMitigationActionResponse other = (DescribeMitigationActionResponse) obj; return Objects.equals(actionName(), other.actionName()) && Objects.equals(actionTypeAsString(), other.actionTypeAsString()) && Objects.equals(actionArn(), other.actionArn()) && Objects.equals(actionId(), other.actionId()) && Objects.equals(roleArn(), other.roleArn()) && Objects.equals(actionParams(), other.actionParams()) && Objects.equals(creationDate(), other.creationDate()) && Objects.equals(lastModifiedDate(), other.lastModifiedDate()); } /** * 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("DescribeMitigationActionResponse").add("ActionName", actionName()) .add("ActionType", actionTypeAsString()).add("ActionArn", actionArn()).add("ActionId", actionId()) .add("RoleArn", roleArn()).add("ActionParams", actionParams()).add("CreationDate", creationDate()) .add("LastModifiedDate", lastModifiedDate()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "actionName": return Optional.ofNullable(clazz.cast(actionName())); case "actionType": return Optional.ofNullable(clazz.cast(actionTypeAsString())); case "actionArn": return Optional.ofNullable(clazz.cast(actionArn())); case "actionId": return Optional.ofNullable(clazz.cast(actionId())); case "roleArn": return Optional.ofNullable(clazz.cast(roleArn())); case "actionParams": return Optional.ofNullable(clazz.cast(actionParams())); case "creationDate": return Optional.ofNullable(clazz.cast(creationDate())); case "lastModifiedDate": return Optional.ofNullable(clazz.cast(lastModifiedDate())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DescribeMitigationActionResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends IotResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The friendly name that uniquely identifies the mitigation action. *

* * @param actionName * The friendly name that uniquely identifies the mitigation action. * @return Returns a reference to this object so that method calls can be chained together. */ Builder actionName(String actionName); /** *

* The type of mitigation action. *

* * @param actionType * The type of mitigation action. * @see MitigationActionType * @return Returns a reference to this object so that method calls can be chained together. * @see MitigationActionType */ Builder actionType(String actionType); /** *

* The type of mitigation action. *

* * @param actionType * The type of mitigation action. * @see MitigationActionType * @return Returns a reference to this object so that method calls can be chained together. * @see MitigationActionType */ Builder actionType(MitigationActionType actionType); /** *

* The ARN that identifies this migration action. *

* * @param actionArn * The ARN that identifies this migration action. * @return Returns a reference to this object so that method calls can be chained together. */ Builder actionArn(String actionArn); /** *

* A unique identifier for this action. *

* * @param actionId * A unique identifier for this action. * @return Returns a reference to this object so that method calls can be chained together. */ Builder actionId(String actionId); /** *

* The ARN of the IAM role used to apply this action. *

* * @param roleArn * The ARN of the IAM role used to apply this action. * @return Returns a reference to this object so that method calls can be chained together. */ Builder roleArn(String roleArn); /** *

* Parameters that control how the mitigation action is applied, specific to the type of mitigation action. *

* * @param actionParams * Parameters that control how the mitigation action is applied, specific to the type of mitigation * action. * @return Returns a reference to this object so that method calls can be chained together. */ Builder actionParams(MitigationActionParams actionParams); /** *

* Parameters that control how the mitigation action is applied, specific to the type of mitigation action. *

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

* The date and time when the mitigation action was added to your AWS account. *

* * @param creationDate * The date and time when the mitigation action was added to your AWS account. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationDate(Instant creationDate); /** *

* The date and time when the mitigation action was last changed. *

* * @param lastModifiedDate * The date and time when the mitigation action was last changed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedDate(Instant lastModifiedDate); } static final class BuilderImpl extends IotResponse.BuilderImpl implements Builder { private String actionName; private String actionType; private String actionArn; private String actionId; private String roleArn; private MitigationActionParams actionParams; private Instant creationDate; private Instant lastModifiedDate; private BuilderImpl() { } private BuilderImpl(DescribeMitigationActionResponse model) { super(model); actionName(model.actionName); actionType(model.actionType); actionArn(model.actionArn); actionId(model.actionId); roleArn(model.roleArn); actionParams(model.actionParams); creationDate(model.creationDate); lastModifiedDate(model.lastModifiedDate); } public final String getActionName() { return actionName; } public final void setActionName(String actionName) { this.actionName = actionName; } @Override @Transient public final Builder actionName(String actionName) { this.actionName = actionName; return this; } public final String getActionType() { return actionType; } public final void setActionType(String actionType) { this.actionType = actionType; } @Override @Transient public final Builder actionType(String actionType) { this.actionType = actionType; return this; } @Override @Transient public final Builder actionType(MitigationActionType actionType) { this.actionType(actionType == null ? null : actionType.toString()); return this; } public final String getActionArn() { return actionArn; } public final void setActionArn(String actionArn) { this.actionArn = actionArn; } @Override @Transient public final Builder actionArn(String actionArn) { this.actionArn = actionArn; return this; } public final String getActionId() { return actionId; } public final void setActionId(String actionId) { this.actionId = actionId; } @Override @Transient public final Builder actionId(String actionId) { this.actionId = actionId; return this; } public final String getRoleArn() { return roleArn; } public final void setRoleArn(String roleArn) { this.roleArn = roleArn; } @Override @Transient public final Builder roleArn(String roleArn) { this.roleArn = roleArn; return this; } public final MitigationActionParams.Builder getActionParams() { return actionParams != null ? actionParams.toBuilder() : null; } public final void setActionParams(MitigationActionParams.BuilderImpl actionParams) { this.actionParams = actionParams != null ? actionParams.build() : null; } @Override @Transient public final Builder actionParams(MitigationActionParams actionParams) { this.actionParams = actionParams; return this; } public final Instant getCreationDate() { return creationDate; } public final void setCreationDate(Instant creationDate) { this.creationDate = creationDate; } @Override @Transient public final Builder creationDate(Instant creationDate) { this.creationDate = creationDate; return this; } public final Instant getLastModifiedDate() { return lastModifiedDate; } public final void setLastModifiedDate(Instant lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } @Override @Transient public final Builder lastModifiedDate(Instant lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; return this; } @Override public DescribeMitigationActionResponse build() { return new DescribeMitigationActionResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy