Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * Copyright 2010-2015 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 com.amazonaws.services.cloudwatch.model;
  
  
Container for the parameters to the PutMetricAlarm operation.

Creates or updates an alarm and associates it with the specified Amazon CloudWatch metric. Optionally, this operation can associate one or more Amazon Simple Notification Service resources with the alarm.

When this operation creates an alarm, the alarm state is immediately set to INSUFFICIENT_DATA . The alarm is evaluated and its StateValue is set appropriately. Any actions associated with the StateValue is then executed.

NOTE: When updating an existing alarm, its StateValue is left unchanged.

  
  public class PutMetricAlarmRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The descriptive name for the alarm. This name must be unique within the user's AWS account

Constraints:
Length: 1 - 255

  
      private String alarmName;

    
The description for the alarm.

Constraints:
Length: 0 - 255

  
      private String alarmDescription;

    
Indicates whether or not actions should be executed during any changes to the alarm's state.
  
      private Boolean actionsEnabled;

    
The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

Constraints:
Length: 0 - 5

  
The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

Constraints:
Length: 0 - 5

  
The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

Constraints:
Length: 0 - 5

  
The name for the alarm's associated metric.

Constraints:
Length: 1 - 255

 
     private String metricName;

    
The namespace for the alarm's associated metric.

Constraints:
Length: 1 - 255
Pattern: [^:].*

 
     private String namespace;

    
The statistic to apply to the alarm's associated metric.

Constraints:
Allowed Values: SampleCount, Average, Sum, Minimum, Maximum

 
     private String statistic;

    
The dimensions for the alarm's associated metric.

Constraints:
Length: 0 - 10

 
The period in seconds over which the specified statistic is applied.

Constraints:
Range: 60 -

 
     private Integer period;

    
The unit for the alarm's associated metric.

Constraints:
Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None

 
     private String unit;

    
The number of periods over which data is compared to the specified threshold.

Constraints:
Range: 1 -

 
     private Integer evaluationPeriods;

    
The value against which the specified statistic is compared.
 
     private Double threshold;

    
The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand.

Constraints:
Allowed Values: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold

 
     private String comparisonOperator;

    
The descriptive name for the alarm. This name must be unique within the user's AWS account

Constraints:
Length: 1 - 255

Returns:
The descriptive name for the alarm. This name must be unique within the user's AWS account
 
     public String getAlarmName() {
         return ;
     }
    
    
The descriptive name for the alarm. This name must be unique within the user's AWS account

Constraints:
Length: 1 - 255

Parameters:
alarmName The descriptive name for the alarm. This name must be unique within the user's AWS account
 
     public void setAlarmName(String alarmName) {
         this. = alarmName;
     }
    
    
The descriptive name for the alarm. This name must be unique within the user's AWS account

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255

Parameters:
alarmName The descriptive name for the alarm. This name must be unique within the user's AWS account
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public PutMetricAlarmRequest withAlarmName(String alarmName) {
         this. = alarmName;
         return this;
     }

    
The description for the alarm.

Constraints:
Length: 0 - 255

Returns:
The description for the alarm.
 
     public String getAlarmDescription() {
         return ;
     }
    
    
The description for the alarm.

Constraints:
Length: 0 - 255

Parameters:
alarmDescription The description for the alarm.
 
     public void setAlarmDescription(String alarmDescription) {
         this. = alarmDescription;
     }
    
    
The description for the alarm.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 255

Parameters:
alarmDescription The description for the alarm.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public PutMetricAlarmRequest withAlarmDescription(String alarmDescription) {
         this. = alarmDescription;
         return this;
     }

    
Indicates whether or not actions should be executed during any changes to the alarm's state.

Returns:
Indicates whether or not actions should be executed during any changes to the alarm's state.
 
     public Boolean isActionsEnabled() {
         return ;
     }
    
    
Indicates whether or not actions should be executed during any changes to the alarm's state.

Parameters:
actionsEnabled Indicates whether or not actions should be executed during any changes to the alarm's state.
 
     public void setActionsEnabled(Boolean actionsEnabled) {
         this. = actionsEnabled;
     }
    
    
Indicates whether or not actions should be executed during any changes to the alarm's state.

Returns a reference to this object so that method calls can be chained together.

Parameters:
actionsEnabled Indicates whether or not actions should be executed during any changes to the alarm's state.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public PutMetricAlarmRequest withActionsEnabled(Boolean actionsEnabled) {
         this. = actionsEnabled;
         return this;
     }

    
Indicates whether or not actions should be executed during any changes to the alarm's state.

Returns:
Indicates whether or not actions should be executed during any changes to the alarm's state.
 
     public Boolean getActionsEnabled() {
         return ;
     }

    
The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

Constraints:
Length: 0 - 5

Returns:
The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
 
     public java.util.List<StringgetOKActions() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

Constraints:
Length: 0 - 5

Parameters:
oKActions The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
 
     public void setOKActions(java.util.Collection<StringoKActions) {
         if (oKActions == null) {
             this. = null;
             return;
         }
         oKActionsCopy.addAll(oKActions);
         this. = oKActionsCopy;
     }
    
    
The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

NOTE: This method appends the values to the existing list (if any). Use setOKActions(java.util.Collection) or withOKActions(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 5

Parameters:
oKActions The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public PutMetricAlarmRequest withOKActions(String... oKActions) {
         if (getOKActions() == nullsetOKActions(new java.util.ArrayList<String>(oKActions.length));
         for (String value : oKActions) {
             getOKActions().add(value);
         }
         return this;
     }
    
    
The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 5

Parameters:
oKActions The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (oKActions == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<StringoKActionsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(oKActions.size());
             oKActionsCopy.addAll(oKActions);
             this. = oKActionsCopy;
         }
 
         return this;
     }

    
The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

Constraints:
Length: 0 - 5

Returns:
The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
 
     public java.util.List<StringgetAlarmActions() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

Constraints:
Length: 0 - 5

Parameters:
alarmActions The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
 
     public void setAlarmActions(java.util.Collection<StringalarmActions) {
         if (alarmActions == null) {
             this. = null;
             return;
         }
         com.amazonaws.internal.ListWithAutoConstructFlag<StringalarmActionsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(alarmActions.size());
         alarmActionsCopy.addAll(alarmActions);
         this. = alarmActionsCopy;
     }
    
    
The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

NOTE: This method appends the values to the existing list (if any). Use setAlarmActions(java.util.Collection) or withAlarmActions(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 5

Parameters:
alarmActions The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public PutMetricAlarmRequest withAlarmActions(String... alarmActions) {
         if (getAlarmActions() == nullsetAlarmActions(new java.util.ArrayList<String>(alarmActions.length));
         for (String value : alarmActions) {
             getAlarmActions().add(value);
         }
         return this;
     }
    
    
The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 5

Parameters:
alarmActions The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public PutMetricAlarmRequest withAlarmActions(java.util.Collection<StringalarmActions) {
         if (alarmActions == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<StringalarmActionsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(alarmActions.size());
             alarmActionsCopy.addAll(alarmActions);
             this. = alarmActionsCopy;
         }
 
         return this;
     }

    
The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

Constraints:
Length: 0 - 5

Returns:
The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
 
         if ( == null) {
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

Constraints:
Length: 0 - 5

Parameters:
insufficientDataActions The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
 
     public void setInsufficientDataActions(java.util.Collection<StringinsufficientDataActions) {
         if (insufficientDataActions == null) {
             this. = null;
             return;
         }
         com.amazonaws.internal.ListWithAutoConstructFlag<StringinsufficientDataActionsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(insufficientDataActions.size());
         insufficientDataActionsCopy.addAll(insufficientDataActions);
         this. = insufficientDataActionsCopy;
     }
    
    
The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

NOTE: This method appends the values to the existing list (if any). Use setInsufficientDataActions(java.util.Collection) or withInsufficientDataActions(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 5

Parameters:
insufficientDataActions The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public PutMetricAlarmRequest withInsufficientDataActions(String... insufficientDataActions) {
         if (getInsufficientDataActions() == nullsetInsufficientDataActions(new java.util.ArrayList<String>(insufficientDataActions.length));
         for (String value : insufficientDataActions) {
             getInsufficientDataActions().add(value);
         }
         return this;
     }
    
    
The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 5

Parameters:
insufficientDataActions The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public PutMetricAlarmRequest withInsufficientDataActions(java.util.Collection<StringinsufficientDataActions) {
         if (insufficientDataActions == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<StringinsufficientDataActionsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(insufficientDataActions.size());
             insufficientDataActionsCopy.addAll(insufficientDataActions);
             this. = insufficientDataActionsCopy;
         }
 
         return this;
     }

    
The name for the alarm's associated metric.

Constraints:
Length: 1 - 255

Returns:
The name for the alarm's associated metric.
 
     public String getMetricName() {
         return ;
     }
    
    
The name for the alarm's associated metric.

Constraints:
Length: 1 - 255

Parameters:
metricName The name for the alarm's associated metric.
 
     public void setMetricName(String metricName) {
         this. = metricName;
     }
    
    
The name for the alarm's associated metric.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255

Parameters:
metricName The name for the alarm's associated metric.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public PutMetricAlarmRequest withMetricName(String metricName) {
         this. = metricName;
         return this;
     }

    
The namespace for the alarm's associated metric.

Constraints:
Length: 1 - 255
Pattern: [^:].*

Returns:
The namespace for the alarm's associated metric.
 
     public String getNamespace() {
         return ;
     }
    
    
The namespace for the alarm's associated metric.

Constraints:
Length: 1 - 255
Pattern: [^:].*

Parameters:
namespace The namespace for the alarm's associated metric.
 
     public void setNamespace(String namespace) {
         this. = namespace;
     }
    
    
The namespace for the alarm's associated metric.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255
Pattern: [^:].*

Parameters:
namespace The namespace for the alarm's associated metric.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public PutMetricAlarmRequest withNamespace(String namespace) {
         this. = namespace;
         return this;
     }

    
The statistic to apply to the alarm's associated metric.

Constraints:
Allowed Values: SampleCount, Average, Sum, Minimum, Maximum

Returns:
The statistic to apply to the alarm's associated metric.
See also:
Statistic
 
     public String getStatistic() {
         return ;
     }
    
    
The statistic to apply to the alarm's associated metric.

Constraints:
Allowed Values: SampleCount, Average, Sum, Minimum, Maximum

Parameters:
statistic The statistic to apply to the alarm's associated metric.
See also:
Statistic
 
     public void setStatistic(String statistic) {
         this. = statistic;
     }
    
    
The statistic to apply to the alarm's associated metric.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: SampleCount, Average, Sum, Minimum, Maximum

Parameters:
statistic The statistic to apply to the alarm's associated metric.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
Statistic
 
     public PutMetricAlarmRequest withStatistic(String statistic) {
         this. = statistic;
         return this;
     }

    
The statistic to apply to the alarm's associated metric.

Constraints:
Allowed Values: SampleCount, Average, Sum, Minimum, Maximum

Parameters:
statistic The statistic to apply to the alarm's associated metric.
See also:
Statistic
 
     public void setStatistic(Statistic statistic) {
         this. = statistic.toString();
     }
    
    
The statistic to apply to the alarm's associated metric.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: SampleCount, Average, Sum, Minimum, Maximum

Parameters:
statistic The statistic to apply to the alarm's associated metric.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
Statistic
 
     public PutMetricAlarmRequest withStatistic(Statistic statistic) {
         this. = statistic.toString();
         return this;
     }

    
The dimensions for the alarm's associated metric.

Constraints:
Length: 0 - 10

Returns:
The dimensions for the alarm's associated metric.
 
     public java.util.List<DimensiongetDimensions() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<Dimension>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The dimensions for the alarm's associated metric.

Constraints:
Length: 0 - 10

Parameters:
dimensions The dimensions for the alarm's associated metric.
 
     public void setDimensions(java.util.Collection<Dimensiondimensions) {
         if (dimensions == null) {
             this. = null;
             return;
         }
         dimensionsCopy.addAll(dimensions);
         this. = dimensionsCopy;
     }
    
    
The dimensions for the alarm's associated metric.

NOTE: This method appends the values to the existing list (if any). Use setDimensions(java.util.Collection) or withDimensions(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 10

Parameters:
dimensions The dimensions for the alarm's associated metric.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public PutMetricAlarmRequest withDimensions(Dimension... dimensions) {
         if (getDimensions() == nullsetDimensions(new java.util.ArrayList<Dimension>(dimensions.length));
         for (Dimension value : dimensions) {
             getDimensions().add(value);
         }
         return this;
     }
    
    
The dimensions for the alarm's associated metric.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 10

Parameters:
dimensions The dimensions for the alarm's associated metric.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (dimensions == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<DimensiondimensionsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Dimension>(dimensions.size());
             dimensionsCopy.addAll(dimensions);
             this. = dimensionsCopy;
         }
 
         return this;
     }

    
The period in seconds over which the specified statistic is applied.

Constraints:
Range: 60 -

Returns:
The period in seconds over which the specified statistic is applied.
 
     public Integer getPeriod() {
         return ;
     }
    
    
The period in seconds over which the specified statistic is applied.

Constraints:
Range: 60 -

Parameters:
period The period in seconds over which the specified statistic is applied.
 
     public void setPeriod(Integer period) {
         this. = period;
     }
    
    
The period in seconds over which the specified statistic is applied.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Range: 60 -

Parameters:
period The period in seconds over which the specified statistic is applied.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public PutMetricAlarmRequest withPeriod(Integer period) {
         this. = period;
         return this;
     }

    
The unit for the alarm's associated metric.

Constraints:
Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None

Returns:
The unit for the alarm's associated metric.
See also:
StandardUnit
 
     public String getUnit() {
         return ;
     }
    
    
The unit for the alarm's associated metric.

Constraints:
Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None

Parameters:
unit The unit for the alarm's associated metric.
See also:
StandardUnit
 
     public void setUnit(String unit) {
         this. = unit;
     }
    
    
The unit for the alarm's associated metric.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None

Parameters:
unit The unit for the alarm's associated metric.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
StandardUnit
    public PutMetricAlarmRequest withUnit(String unit) {
        this. = unit;
        return this;
    }

    
The unit for the alarm's associated metric.

Constraints:
Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None

Parameters:
unit The unit for the alarm's associated metric.
See also:
StandardUnit
    public void setUnit(StandardUnit unit) {
        this. = unit.toString();
    }
    
    
The unit for the alarm's associated metric.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None

Parameters:
unit The unit for the alarm's associated metric.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
StandardUnit
        this. = unit.toString();
        return this;
    }

    
The number of periods over which data is compared to the specified threshold.

Constraints:
Range: 1 -

Returns:
The number of periods over which data is compared to the specified threshold.
    public Integer getEvaluationPeriods() {
        return ;
    }
    
    
The number of periods over which data is compared to the specified threshold.

Constraints:
Range: 1 -

Parameters:
evaluationPeriods The number of periods over which data is compared to the specified threshold.
    public void setEvaluationPeriods(Integer evaluationPeriods) {
        this. = evaluationPeriods;
    }
    
    
The number of periods over which data is compared to the specified threshold.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Range: 1 -

Parameters:
evaluationPeriods The number of periods over which data is compared to the specified threshold.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PutMetricAlarmRequest withEvaluationPeriods(Integer evaluationPeriods) {
        this. = evaluationPeriods;
        return this;
    }

    
The value against which the specified statistic is compared.

Returns:
The value against which the specified statistic is compared.
    public Double getThreshold() {
        return ;
    }
    
    
The value against which the specified statistic is compared.

Parameters:
threshold The value against which the specified statistic is compared.
    public void setThreshold(Double threshold) {
        this. = threshold;
    }
    
    
The value against which the specified statistic is compared.

Returns a reference to this object so that method calls can be chained together.

Parameters:
threshold The value against which the specified statistic is compared.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PutMetricAlarmRequest withThreshold(Double threshold) {
        this. = threshold;
        return this;
    }

    
The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand.

Constraints:
Allowed Values: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold

Returns:
The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand.
See also:
ComparisonOperator
    public String getComparisonOperator() {
        return ;
    }
    
    
The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand.

Constraints:
Allowed Values: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold

Parameters:
comparisonOperator The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand.
See also:
ComparisonOperator
    public void setComparisonOperator(String comparisonOperator) {
        this. = comparisonOperator;
    }
    
    
The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold

Parameters:
comparisonOperator The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ComparisonOperator
    public PutMetricAlarmRequest withComparisonOperator(String comparisonOperator) {
        this. = comparisonOperator;
        return this;
    }

    
The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand.

Constraints:
Allowed Values: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold

Parameters:
comparisonOperator The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand.
See also:
ComparisonOperator
    public void setComparisonOperator(ComparisonOperator comparisonOperator) {
        this. = comparisonOperator.toString();
    }
    
    
The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold

Parameters:
comparisonOperator The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ComparisonOperator
        this. = comparisonOperator.toString();
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getAlarmName() != nullsb.append("AlarmName: " + getAlarmName() + ",");
        if (getAlarmDescription() != nullsb.append("AlarmDescription: " + getAlarmDescription() + ",");
        if (isActionsEnabled() != nullsb.append("ActionsEnabled: " + isActionsEnabled() + ",");
        if (getOKActions() != nullsb.append("OKActions: " + getOKActions() + ",");
        if (getAlarmActions() != nullsb.append("AlarmActions: " + getAlarmActions() + ",");
        if (getInsufficientDataActions() != nullsb.append("InsufficientDataActions: " + getInsufficientDataActions() + ",");
        if (getMetricName() != nullsb.append("MetricName: " + getMetricName() + ",");
        if (getNamespace() != nullsb.append("Namespace: " + getNamespace() + ",");
        if (getStatistic() != nullsb.append("Statistic: " + getStatistic() + ",");
        if (getDimensions() != nullsb.append("Dimensions: " + getDimensions() + ",");
        if (getPeriod() != nullsb.append("Period: " + getPeriod() + ",");
        if (getUnit() != nullsb.append("Unit: " + getUnit() + ",");
        if (getEvaluationPeriods() != nullsb.append("EvaluationPeriods: " + getEvaluationPeriods() + ",");
        if (getThreshold() != nullsb.append("Threshold: " + getThreshold() + ",");
        if (getComparisonOperator() != nullsb.append("ComparisonOperator: " + getComparisonOperator() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getAlarmName() == null) ? 0 : getAlarmName().hashCode()); 
        hashCode = prime * hashCode + ((getAlarmDescription() == null) ? 0 : getAlarmDescription().hashCode()); 
        hashCode = prime * hashCode + ((isActionsEnabled() == null) ? 0 : isActionsEnabled().hashCode()); 
        hashCode = prime * hashCode + ((getOKActions() == null) ? 0 : getOKActions().hashCode()); 
        hashCode = prime * hashCode + ((getAlarmActions() == null) ? 0 : getAlarmActions().hashCode()); 
        hashCode = prime * hashCode + ((getInsufficientDataActions() == null) ? 0 : getInsufficientDataActions().hashCode()); 
        hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode()); 
        hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode()); 
        hashCode = prime * hashCode + ((getStatistic() == null) ? 0 : getStatistic().hashCode()); 
        hashCode = prime * hashCode + ((getDimensions() == null) ? 0 : getDimensions().hashCode()); 
        hashCode = prime * hashCode + ((getPeriod() == null) ? 0 : getPeriod().hashCode()); 
        hashCode = prime * hashCode + ((getUnit() == null) ? 0 : getUnit().hashCode()); 
        hashCode = prime * hashCode + ((getEvaluationPeriods() == null) ? 0 : getEvaluationPeriods().hashCode()); 
        hashCode = prime * hashCode + ((getThreshold() == null) ? 0 : getThreshold().hashCode()); 
        hashCode = prime * hashCode + ((getComparisonOperator() == null) ? 0 : getComparisonOperator().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof PutMetricAlarmRequest == falsereturn false;
        PutMetricAlarmRequest other = (PutMetricAlarmRequest)obj;
        
        if (other.getAlarmName() == null ^ this.getAlarmName() == nullreturn false;
        if (other.getAlarmName() != null && other.getAlarmName().equals(this.getAlarmName()) == falsereturn false
        if (other.getAlarmDescription() == null ^ this.getAlarmDescription() == nullreturn false;
        if (other.getAlarmDescription() != null && other.getAlarmDescription().equals(this.getAlarmDescription()) == falsereturn false
        if (other.isActionsEnabled() == null ^ this.isActionsEnabled() == nullreturn false;
        if (other.isActionsEnabled() != null && other.isActionsEnabled().equals(this.isActionsEnabled()) == falsereturn false
        if (other.getOKActions() == null ^ this.getOKActions() == nullreturn false;
        if (other.getOKActions() != null && other.getOKActions().equals(this.getOKActions()) == falsereturn false
        if (other.getAlarmActions() == null ^ this.getAlarmActions() == nullreturn false;
        if (other.getAlarmActions() != null && other.getAlarmActions().equals(this.getAlarmActions()) == falsereturn false
        if (other.getInsufficientDataActions() == null ^ this.getInsufficientDataActions() == nullreturn false;
        if (other.getInsufficientDataActions() != null && other.getInsufficientDataActions().equals(this.getInsufficientDataActions()) == falsereturn false
        if (other.getMetricName() == null ^ this.getMetricName() == nullreturn false;
        if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == falsereturn false
        if (other.getNamespace() == null ^ this.getNamespace() == nullreturn false;
        if (other.getNamespace() != null && other.getNamespace().equals(this.getNamespace()) == falsereturn false
        if (other.getStatistic() == null ^ this.getStatistic() == nullreturn false;
        if (other.getStatistic() != null && other.getStatistic().equals(this.getStatistic()) == falsereturn false
        if (other.getDimensions() == null ^ this.getDimensions() == nullreturn false;
        if (other.getDimensions() != null && other.getDimensions().equals(this.getDimensions()) == falsereturn false
        if (other.getPeriod() == null ^ this.getPeriod() == nullreturn false;
        if (other.getPeriod() != null && other.getPeriod().equals(this.getPeriod()) == falsereturn false
        if (other.getUnit() == null ^ this.getUnit() == nullreturn false;
        if (other.getUnit() != null && other.getUnit().equals(this.getUnit()) == falsereturn false
        if (other.getEvaluationPeriods() == null ^ this.getEvaluationPeriods() == nullreturn false;
        if (other.getEvaluationPeriods() != null && other.getEvaluationPeriods().equals(this.getEvaluationPeriods()) == falsereturn false
        if (other.getThreshold() == null ^ this.getThreshold() == nullreturn false;
        if (other.getThreshold() != null && other.getThreshold().equals(this.getThreshold()) == falsereturn false
        if (other.getComparisonOperator() == null ^ this.getComparisonOperator() == nullreturn false;
        if (other.getComparisonOperator() != null && other.getComparisonOperator().equals(this.getComparisonOperator()) == falsereturn false
        return true;
    }
    
    @Override
    public PutMetricAlarmRequest clone() {
        
            return (PutMetricAlarmRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X