com.amazonaws.services.synthetics.model.CanaryScheduleInput Maven / Gradle / Ivy
Show all versions of aws-java-sdk-synthetics Show documentation
/*
* Copyright 2019-2024 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.synthetics.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* This structure specifies how often a canary is to make runs and the date and time when it should stop making runs.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CanaryScheduleInput implements Serializable, Cloneable, StructuredPojo {
/**
*
* A rate
expression or a cron
expression that defines how often the canary is to run.
*
*
* For a rate expression, The syntax is rate(number unit)
. unit can be
* minute
, minutes
, or hour
.
*
*
* For example, rate(1 minute)
runs the canary once a minute, rate(10 minutes)
runs it
* once every 10 minutes, and rate(1 hour)
runs it once every hour. You can specify a frequency between
* rate(1 minute)
and rate(1 hour)
.
*
*
* Specifying rate(0 minute)
or rate(0 hour)
is a special value that causes the canary to
* run only once when it is started.
*
*
* Use cron(expression)
to specify a cron expression. You can't schedule a canary to wait for
* more than a year before running. For information about the syntax for cron expressions, see
* Scheduling canary runs using cron.
*
*/
private String expression;
/**
*
* How long, in seconds, for the canary to continue making regular runs according to the schedule in the
* Expression
value. If you specify 0, the canary continues making runs until you stop it. If you omit
* this field, the default of 0 is used.
*
*/
private Long durationInSeconds;
/**
*
* A rate
expression or a cron
expression that defines how often the canary is to run.
*
*
* For a rate expression, The syntax is rate(number unit)
. unit can be
* minute
, minutes
, or hour
.
*
*
* For example, rate(1 minute)
runs the canary once a minute, rate(10 minutes)
runs it
* once every 10 minutes, and rate(1 hour)
runs it once every hour. You can specify a frequency between
* rate(1 minute)
and rate(1 hour)
.
*
*
* Specifying rate(0 minute)
or rate(0 hour)
is a special value that causes the canary to
* run only once when it is started.
*
*
* Use cron(expression)
to specify a cron expression. You can't schedule a canary to wait for
* more than a year before running. For information about the syntax for cron expressions, see
* Scheduling canary runs using cron.
*
*
* @param expression
* A rate
expression or a cron
expression that defines how often the canary is to
* run.
*
* For a rate expression, The syntax is rate(number unit)
. unit can be
* minute
, minutes
, or hour
.
*
*
* For example, rate(1 minute)
runs the canary once a minute, rate(10 minutes)
runs
* it once every 10 minutes, and rate(1 hour)
runs it once every hour. You can specify a
* frequency between rate(1 minute)
and rate(1 hour)
.
*
*
* Specifying rate(0 minute)
or rate(0 hour)
is a special value that causes the
* canary to run only once when it is started.
*
*
* Use cron(expression)
to specify a cron expression. You can't schedule a canary to wait
* for more than a year before running. For information about the syntax for cron expressions, see
* Scheduling canary runs using cron.
*/
public void setExpression(String expression) {
this.expression = expression;
}
/**
*
* A rate
expression or a cron
expression that defines how often the canary is to run.
*
*
* For a rate expression, The syntax is rate(number unit)
. unit can be
* minute
, minutes
, or hour
.
*
*
* For example, rate(1 minute)
runs the canary once a minute, rate(10 minutes)
runs it
* once every 10 minutes, and rate(1 hour)
runs it once every hour. You can specify a frequency between
* rate(1 minute)
and rate(1 hour)
.
*
*
* Specifying rate(0 minute)
or rate(0 hour)
is a special value that causes the canary to
* run only once when it is started.
*
*
* Use cron(expression)
to specify a cron expression. You can't schedule a canary to wait for
* more than a year before running. For information about the syntax for cron expressions, see
* Scheduling canary runs using cron.
*
*
* @return A rate
expression or a cron
expression that defines how often the canary is to
* run.
*
* For a rate expression, The syntax is rate(number unit)
. unit can be
* minute
, minutes
, or hour
.
*
*
* For example, rate(1 minute)
runs the canary once a minute, rate(10 minutes)
* runs it once every 10 minutes, and rate(1 hour)
runs it once every hour. You can specify a
* frequency between rate(1 minute)
and rate(1 hour)
.
*
*
* Specifying rate(0 minute)
or rate(0 hour)
is a special value that causes the
* canary to run only once when it is started.
*
*
* Use cron(expression)
to specify a cron expression. You can't schedule a canary to
* wait for more than a year before running. For information about the syntax for cron expressions, see Scheduling canary runs using cron.
*/
public String getExpression() {
return this.expression;
}
/**
*
* A rate
expression or a cron
expression that defines how often the canary is to run.
*
*
* For a rate expression, The syntax is rate(number unit)
. unit can be
* minute
, minutes
, or hour
.
*
*
* For example, rate(1 minute)
runs the canary once a minute, rate(10 minutes)
runs it
* once every 10 minutes, and rate(1 hour)
runs it once every hour. You can specify a frequency between
* rate(1 minute)
and rate(1 hour)
.
*
*
* Specifying rate(0 minute)
or rate(0 hour)
is a special value that causes the canary to
* run only once when it is started.
*
*
* Use cron(expression)
to specify a cron expression. You can't schedule a canary to wait for
* more than a year before running. For information about the syntax for cron expressions, see
* Scheduling canary runs using cron.
*
*
* @param expression
* A rate
expression or a cron
expression that defines how often the canary is to
* run.
*
* For a rate expression, The syntax is rate(number unit)
. unit can be
* minute
, minutes
, or hour
.
*
*
* For example, rate(1 minute)
runs the canary once a minute, rate(10 minutes)
runs
* it once every 10 minutes, and rate(1 hour)
runs it once every hour. You can specify a
* frequency between rate(1 minute)
and rate(1 hour)
.
*
*
* Specifying rate(0 minute)
or rate(0 hour)
is a special value that causes the
* canary to run only once when it is started.
*
*
* Use cron(expression)
to specify a cron expression. You can't schedule a canary to wait
* for more than a year before running. For information about the syntax for cron expressions, see
* Scheduling canary runs using cron.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CanaryScheduleInput withExpression(String expression) {
setExpression(expression);
return this;
}
/**
*
* How long, in seconds, for the canary to continue making regular runs according to the schedule in the
* Expression
value. If you specify 0, the canary continues making runs until you stop it. If you omit
* this field, the default of 0 is used.
*
*
* @param durationInSeconds
* How long, in seconds, for the canary to continue making regular runs according to the schedule in the
* Expression
value. If you specify 0, the canary continues making runs until you stop it. If
* you omit this field, the default of 0 is used.
*/
public void setDurationInSeconds(Long durationInSeconds) {
this.durationInSeconds = durationInSeconds;
}
/**
*
* How long, in seconds, for the canary to continue making regular runs according to the schedule in the
* Expression
value. If you specify 0, the canary continues making runs until you stop it. If you omit
* this field, the default of 0 is used.
*
*
* @return How long, in seconds, for the canary to continue making regular runs according to the schedule in the
* Expression
value. If you specify 0, the canary continues making runs until you stop it. If
* you omit this field, the default of 0 is used.
*/
public Long getDurationInSeconds() {
return this.durationInSeconds;
}
/**
*
* How long, in seconds, for the canary to continue making regular runs according to the schedule in the
* Expression
value. If you specify 0, the canary continues making runs until you stop it. If you omit
* this field, the default of 0 is used.
*
*
* @param durationInSeconds
* How long, in seconds, for the canary to continue making regular runs according to the schedule in the
* Expression
value. If you specify 0, the canary continues making runs until you stop it. If
* you omit this field, the default of 0 is used.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CanaryScheduleInput withDurationInSeconds(Long durationInSeconds) {
setDurationInSeconds(durationInSeconds);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getExpression() != null)
sb.append("Expression: ").append(getExpression()).append(",");
if (getDurationInSeconds() != null)
sb.append("DurationInSeconds: ").append(getDurationInSeconds());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CanaryScheduleInput == false)
return false;
CanaryScheduleInput other = (CanaryScheduleInput) obj;
if (other.getExpression() == null ^ this.getExpression() == null)
return false;
if (other.getExpression() != null && other.getExpression().equals(this.getExpression()) == false)
return false;
if (other.getDurationInSeconds() == null ^ this.getDurationInSeconds() == null)
return false;
if (other.getDurationInSeconds() != null && other.getDurationInSeconds().equals(this.getDurationInSeconds()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getExpression() == null) ? 0 : getExpression().hashCode());
hashCode = prime * hashCode + ((getDurationInSeconds() == null) ? 0 : getDurationInSeconds().hashCode());
return hashCode;
}
@Override
public CanaryScheduleInput clone() {
try {
return (CanaryScheduleInput) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.synthetics.model.transform.CanaryScheduleInputMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}