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

software.amazon.awssdk.services.cloudwatch.model.SetAlarmStateRequest Maven / Gradle / Ivy

Go to download

A single bundled dependency that includes all service and dependent JARs with third-party libraries relocated to different namespaces.

There is a newer version: 2.5.20
Show newest version
/*
 * Copyright 2013-2018 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.cloudwatch.model;

import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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 SetAlarmStateRequest extends CloudWatchRequest implements
        ToCopyableBuilder {
    private final String alarmName;

    private final String stateValue;

    private final String stateReason;

    private final String stateReasonData;

    private SetAlarmStateRequest(BuilderImpl builder) {
        super(builder);
        this.alarmName = builder.alarmName;
        this.stateValue = builder.stateValue;
        this.stateReason = builder.stateReason;
        this.stateReasonData = builder.stateReasonData;
    }

    /**
     * 

* The name for the alarm. This name must be unique within the AWS account. The maximum length is 255 characters. *

* * @return The name for the alarm. This name must be unique within the AWS account. The maximum length is 255 * characters. */ public String alarmName() { return alarmName; } /** *

* The value of the state. *

*

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

* * @return The value of the state. * @see StateValue */ public StateValue stateValue() { return StateValue.fromValue(stateValue); } /** *

* The value of the state. *

*

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

* * @return The value of the state. * @see StateValue */ public String stateValueAsString() { return stateValue; } /** *

* The reason that this alarm is set to this specific state, in text format. *

* * @return The reason that this alarm is set to this specific state, in text format. */ public String stateReason() { return stateReason; } /** *

* The reason that this alarm is set to this specific state, in JSON format. *

* * @return The reason that this alarm is set to this specific state, in JSON format. */ public String stateReasonData() { return stateReasonData; } @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 + Objects.hashCode(alarmName()); hashCode = 31 * hashCode + Objects.hashCode(stateValueAsString()); hashCode = 31 * hashCode + Objects.hashCode(stateReason()); hashCode = 31 * hashCode + Objects.hashCode(stateReasonData()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SetAlarmStateRequest)) { return false; } SetAlarmStateRequest other = (SetAlarmStateRequest) obj; return Objects.equals(alarmName(), other.alarmName()) && Objects.equals(stateValueAsString(), other.stateValueAsString()) && Objects.equals(stateReason(), other.stateReason()) && Objects.equals(stateReasonData(), other.stateReasonData()); } @Override public String toString() { return ToString.builder("SetAlarmStateRequest").add("AlarmName", alarmName()).add("StateValue", stateValueAsString()) .add("StateReason", stateReason()).add("StateReasonData", stateReasonData()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AlarmName": return Optional.ofNullable(clazz.cast(alarmName())); case "StateValue": return Optional.ofNullable(clazz.cast(stateValueAsString())); case "StateReason": return Optional.ofNullable(clazz.cast(stateReason())); case "StateReasonData": return Optional.ofNullable(clazz.cast(stateReasonData())); default: return Optional.empty(); } } public interface Builder extends CloudWatchRequest.Builder, CopyableBuilder { /** *

* The name for the alarm. This name must be unique within the AWS account. The maximum length is 255 * characters. *

* * @param alarmName * The name for the alarm. This name must be unique within the AWS account. The maximum length is 255 * characters. * @return Returns a reference to this object so that method calls can be chained together. */ Builder alarmName(String alarmName); /** *

* The value of the state. *

* * @param stateValue * The value of the state. * @see StateValue * @return Returns a reference to this object so that method calls can be chained together. * @see StateValue */ Builder stateValue(String stateValue); /** *

* The value of the state. *

* * @param stateValue * The value of the state. * @see StateValue * @return Returns a reference to this object so that method calls can be chained together. * @see StateValue */ Builder stateValue(StateValue stateValue); /** *

* The reason that this alarm is set to this specific state, in text format. *

* * @param stateReason * The reason that this alarm is set to this specific state, in text format. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stateReason(String stateReason); /** *

* The reason that this alarm is set to this specific state, in JSON format. *

* * @param stateReasonData * The reason that this alarm is set to this specific state, in JSON format. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stateReasonData(String stateReasonData); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends CloudWatchRequest.BuilderImpl implements Builder { private String alarmName; private String stateValue; private String stateReason; private String stateReasonData; private BuilderImpl() { } private BuilderImpl(SetAlarmStateRequest model) { super(model); alarmName(model.alarmName); stateValue(model.stateValue); stateReason(model.stateReason); stateReasonData(model.stateReasonData); } public final String getAlarmName() { return alarmName; } @Override public final Builder alarmName(String alarmName) { this.alarmName = alarmName; return this; } public final void setAlarmName(String alarmName) { this.alarmName = alarmName; } public final String getStateValue() { return stateValue; } @Override public final Builder stateValue(String stateValue) { this.stateValue = stateValue; return this; } @Override public final Builder stateValue(StateValue stateValue) { this.stateValue(stateValue.toString()); return this; } public final void setStateValue(String stateValue) { this.stateValue = stateValue; } public final String getStateReason() { return stateReason; } @Override public final Builder stateReason(String stateReason) { this.stateReason = stateReason; return this; } public final void setStateReason(String stateReason) { this.stateReason = stateReason; } public final String getStateReasonData() { return stateReasonData; } @Override public final Builder stateReasonData(String stateReasonData) { this.stateReasonData = stateReasonData; return this; } public final void setStateReasonData(String stateReasonData) { this.stateReasonData = stateReasonData; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public SetAlarmStateRequest build() { return new SetAlarmStateRequest(this); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy