com.amazonaws.services.synthetics.model.CanaryRunConfigInput Maven / Gradle / Ivy
/*
* 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;
/**
*
* A structure that contains input information for a canary run.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CanaryRunConfigInput implements Serializable, Cloneable, StructuredPojo {
/**
*
* How long the canary is allowed to run before it must stop. You can't set this time to be longer than the
* frequency of the runs of this canary.
*
*
* If you omit this field, the frequency of the canary is used as this value, up to a maximum of 14 minutes.
*
*/
private Integer timeoutInSeconds;
/**
*
* The maximum amount of memory available to the canary while it is running, in MB. This value must be a multiple of
* 64.
*
*/
private Integer memoryInMB;
/**
*
* Specifies whether this canary is to use active X-Ray tracing when it runs. Active tracing enables this canary run
* to be displayed in the ServiceLens and X-Ray service maps even if the canary does not hit an endpoint that has
* X-Ray tracing enabled. Using X-Ray tracing incurs charges. For more information, see
* Canaries and X-Ray tracing.
*
*
* You can enable active tracing only for canaries that use version syn-nodejs-2.0
or later for their
* canary runtime.
*
*/
private Boolean activeTracing;
/**
*
* Specifies the keys and values to use for any environment variables used in the canary script. Use the following
* format:
*
*
* { "key1" : "value1", "key2" : "value2", ...}
*
*
* Keys must start with a letter and be at least two characters. The total size of your environment variables cannot
* exceed 4 KB. You can't specify any Lambda reserved environment variables as the keys for your environment
* variables. For more information about reserved keys, see
* Runtime environment variables.
*
*
*
* The environment variables keys and values are not encrypted. Do not store sensitive information in this field.
*
*
*/
private java.util.Map environmentVariables;
/**
*
* How long the canary is allowed to run before it must stop. You can't set this time to be longer than the
* frequency of the runs of this canary.
*
*
* If you omit this field, the frequency of the canary is used as this value, up to a maximum of 14 minutes.
*
*
* @param timeoutInSeconds
* How long the canary is allowed to run before it must stop. You can't set this time to be longer than the
* frequency of the runs of this canary.
*
* If you omit this field, the frequency of the canary is used as this value, up to a maximum of 14 minutes.
*/
public void setTimeoutInSeconds(Integer timeoutInSeconds) {
this.timeoutInSeconds = timeoutInSeconds;
}
/**
*
* How long the canary is allowed to run before it must stop. You can't set this time to be longer than the
* frequency of the runs of this canary.
*
*
* If you omit this field, the frequency of the canary is used as this value, up to a maximum of 14 minutes.
*
*
* @return How long the canary is allowed to run before it must stop. You can't set this time to be longer than the
* frequency of the runs of this canary.
*
* If you omit this field, the frequency of the canary is used as this value, up to a maximum of 14 minutes.
*/
public Integer getTimeoutInSeconds() {
return this.timeoutInSeconds;
}
/**
*
* How long the canary is allowed to run before it must stop. You can't set this time to be longer than the
* frequency of the runs of this canary.
*
*
* If you omit this field, the frequency of the canary is used as this value, up to a maximum of 14 minutes.
*
*
* @param timeoutInSeconds
* How long the canary is allowed to run before it must stop. You can't set this time to be longer than the
* frequency of the runs of this canary.
*
* If you omit this field, the frequency of the canary is used as this value, up to a maximum of 14 minutes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CanaryRunConfigInput withTimeoutInSeconds(Integer timeoutInSeconds) {
setTimeoutInSeconds(timeoutInSeconds);
return this;
}
/**
*
* The maximum amount of memory available to the canary while it is running, in MB. This value must be a multiple of
* 64.
*
*
* @param memoryInMB
* The maximum amount of memory available to the canary while it is running, in MB. This value must be a
* multiple of 64.
*/
public void setMemoryInMB(Integer memoryInMB) {
this.memoryInMB = memoryInMB;
}
/**
*
* The maximum amount of memory available to the canary while it is running, in MB. This value must be a multiple of
* 64.
*
*
* @return The maximum amount of memory available to the canary while it is running, in MB. This value must be a
* multiple of 64.
*/
public Integer getMemoryInMB() {
return this.memoryInMB;
}
/**
*
* The maximum amount of memory available to the canary while it is running, in MB. This value must be a multiple of
* 64.
*
*
* @param memoryInMB
* The maximum amount of memory available to the canary while it is running, in MB. This value must be a
* multiple of 64.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CanaryRunConfigInput withMemoryInMB(Integer memoryInMB) {
setMemoryInMB(memoryInMB);
return this;
}
/**
*
* Specifies whether this canary is to use active X-Ray tracing when it runs. Active tracing enables this canary run
* to be displayed in the ServiceLens and X-Ray service maps even if the canary does not hit an endpoint that has
* X-Ray tracing enabled. Using X-Ray tracing incurs charges. For more information, see
* Canaries and X-Ray tracing.
*
*
* You can enable active tracing only for canaries that use version syn-nodejs-2.0
or later for their
* canary runtime.
*
*
* @param activeTracing
* Specifies whether this canary is to use active X-Ray tracing when it runs. Active tracing enables this
* canary run to be displayed in the ServiceLens and X-Ray service maps even if the canary does not hit an
* endpoint that has X-Ray tracing enabled. Using X-Ray tracing incurs charges. For more information, see Canaries and X-Ray tracing.
*
* You can enable active tracing only for canaries that use version syn-nodejs-2.0
or later for
* their canary runtime.
*/
public void setActiveTracing(Boolean activeTracing) {
this.activeTracing = activeTracing;
}
/**
*
* Specifies whether this canary is to use active X-Ray tracing when it runs. Active tracing enables this canary run
* to be displayed in the ServiceLens and X-Ray service maps even if the canary does not hit an endpoint that has
* X-Ray tracing enabled. Using X-Ray tracing incurs charges. For more information, see
* Canaries and X-Ray tracing.
*
*
* You can enable active tracing only for canaries that use version syn-nodejs-2.0
or later for their
* canary runtime.
*
*
* @return Specifies whether this canary is to use active X-Ray tracing when it runs. Active tracing enables this
* canary run to be displayed in the ServiceLens and X-Ray service maps even if the canary does not hit an
* endpoint that has X-Ray tracing enabled. Using X-Ray tracing incurs charges. For more information, see Canaries and X-Ray tracing.
*
* You can enable active tracing only for canaries that use version syn-nodejs-2.0
or later for
* their canary runtime.
*/
public Boolean getActiveTracing() {
return this.activeTracing;
}
/**
*
* Specifies whether this canary is to use active X-Ray tracing when it runs. Active tracing enables this canary run
* to be displayed in the ServiceLens and X-Ray service maps even if the canary does not hit an endpoint that has
* X-Ray tracing enabled. Using X-Ray tracing incurs charges. For more information, see
* Canaries and X-Ray tracing.
*
*
* You can enable active tracing only for canaries that use version syn-nodejs-2.0
or later for their
* canary runtime.
*
*
* @param activeTracing
* Specifies whether this canary is to use active X-Ray tracing when it runs. Active tracing enables this
* canary run to be displayed in the ServiceLens and X-Ray service maps even if the canary does not hit an
* endpoint that has X-Ray tracing enabled. Using X-Ray tracing incurs charges. For more information, see Canaries and X-Ray tracing.
*
* You can enable active tracing only for canaries that use version syn-nodejs-2.0
or later for
* their canary runtime.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CanaryRunConfigInput withActiveTracing(Boolean activeTracing) {
setActiveTracing(activeTracing);
return this;
}
/**
*
* Specifies whether this canary is to use active X-Ray tracing when it runs. Active tracing enables this canary run
* to be displayed in the ServiceLens and X-Ray service maps even if the canary does not hit an endpoint that has
* X-Ray tracing enabled. Using X-Ray tracing incurs charges. For more information, see
* Canaries and X-Ray tracing.
*
*
* You can enable active tracing only for canaries that use version syn-nodejs-2.0
or later for their
* canary runtime.
*
*
* @return Specifies whether this canary is to use active X-Ray tracing when it runs. Active tracing enables this
* canary run to be displayed in the ServiceLens and X-Ray service maps even if the canary does not hit an
* endpoint that has X-Ray tracing enabled. Using X-Ray tracing incurs charges. For more information, see Canaries and X-Ray tracing.
*
* You can enable active tracing only for canaries that use version syn-nodejs-2.0
or later for
* their canary runtime.
*/
public Boolean isActiveTracing() {
return this.activeTracing;
}
/**
*
* Specifies the keys and values to use for any environment variables used in the canary script. Use the following
* format:
*
*
* { "key1" : "value1", "key2" : "value2", ...}
*
*
* Keys must start with a letter and be at least two characters. The total size of your environment variables cannot
* exceed 4 KB. You can't specify any Lambda reserved environment variables as the keys for your environment
* variables. For more information about reserved keys, see
* Runtime environment variables.
*
*
*
* The environment variables keys and values are not encrypted. Do not store sensitive information in this field.
*
*
*
* @return Specifies the keys and values to use for any environment variables used in the canary script. Use the
* following format:
*
* { "key1" : "value1", "key2" : "value2", ...}
*
*
* Keys must start with a letter and be at least two characters. The total size of your environment
* variables cannot exceed 4 KB. You can't specify any Lambda reserved environment variables as the keys for
* your environment variables. For more information about reserved keys, see
* Runtime environment variables.
*
*
*
* The environment variables keys and values are not encrypted. Do not store sensitive information in this
* field.
*
*/
public java.util.Map getEnvironmentVariables() {
return environmentVariables;
}
/**
*
* Specifies the keys and values to use for any environment variables used in the canary script. Use the following
* format:
*
*
* { "key1" : "value1", "key2" : "value2", ...}
*
*
* Keys must start with a letter and be at least two characters. The total size of your environment variables cannot
* exceed 4 KB. You can't specify any Lambda reserved environment variables as the keys for your environment
* variables. For more information about reserved keys, see
* Runtime environment variables.
*
*
*
* The environment variables keys and values are not encrypted. Do not store sensitive information in this field.
*
*
*
* @param environmentVariables
* Specifies the keys and values to use for any environment variables used in the canary script. Use the
* following format:
*
* { "key1" : "value1", "key2" : "value2", ...}
*
*
* Keys must start with a letter and be at least two characters. The total size of your environment variables
* cannot exceed 4 KB. You can't specify any Lambda reserved environment variables as the keys for your
* environment variables. For more information about reserved keys, see
* Runtime environment variables.
*
*
*
* The environment variables keys and values are not encrypted. Do not store sensitive information in this
* field.
*
*/
public void setEnvironmentVariables(java.util.Map environmentVariables) {
this.environmentVariables = environmentVariables;
}
/**
*
* Specifies the keys and values to use for any environment variables used in the canary script. Use the following
* format:
*
*
* { "key1" : "value1", "key2" : "value2", ...}
*
*
* Keys must start with a letter and be at least two characters. The total size of your environment variables cannot
* exceed 4 KB. You can't specify any Lambda reserved environment variables as the keys for your environment
* variables. For more information about reserved keys, see
* Runtime environment variables.
*
*
*
* The environment variables keys and values are not encrypted. Do not store sensitive information in this field.
*
*
*
* @param environmentVariables
* Specifies the keys and values to use for any environment variables used in the canary script. Use the
* following format:
*
* { "key1" : "value1", "key2" : "value2", ...}
*
*
* Keys must start with a letter and be at least two characters. The total size of your environment variables
* cannot exceed 4 KB. You can't specify any Lambda reserved environment variables as the keys for your
* environment variables. For more information about reserved keys, see
* Runtime environment variables.
*
*
*
* The environment variables keys and values are not encrypted. Do not store sensitive information in this
* field.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CanaryRunConfigInput withEnvironmentVariables(java.util.Map environmentVariables) {
setEnvironmentVariables(environmentVariables);
return this;
}
/**
* Add a single EnvironmentVariables entry
*
* @see CanaryRunConfigInput#withEnvironmentVariables
* @returns a reference to this object so that method calls can be chained together.
*/
public CanaryRunConfigInput addEnvironmentVariablesEntry(String key, String value) {
if (null == this.environmentVariables) {
this.environmentVariables = new java.util.HashMap();
}
if (this.environmentVariables.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.environmentVariables.put(key, value);
return this;
}
/**
* Removes all the entries added into EnvironmentVariables.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CanaryRunConfigInput clearEnvironmentVariablesEntries() {
this.environmentVariables = null;
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 (getTimeoutInSeconds() != null)
sb.append("TimeoutInSeconds: ").append(getTimeoutInSeconds()).append(",");
if (getMemoryInMB() != null)
sb.append("MemoryInMB: ").append(getMemoryInMB()).append(",");
if (getActiveTracing() != null)
sb.append("ActiveTracing: ").append(getActiveTracing()).append(",");
if (getEnvironmentVariables() != null)
sb.append("EnvironmentVariables: ").append(getEnvironmentVariables());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CanaryRunConfigInput == false)
return false;
CanaryRunConfigInput other = (CanaryRunConfigInput) obj;
if (other.getTimeoutInSeconds() == null ^ this.getTimeoutInSeconds() == null)
return false;
if (other.getTimeoutInSeconds() != null && other.getTimeoutInSeconds().equals(this.getTimeoutInSeconds()) == false)
return false;
if (other.getMemoryInMB() == null ^ this.getMemoryInMB() == null)
return false;
if (other.getMemoryInMB() != null && other.getMemoryInMB().equals(this.getMemoryInMB()) == false)
return false;
if (other.getActiveTracing() == null ^ this.getActiveTracing() == null)
return false;
if (other.getActiveTracing() != null && other.getActiveTracing().equals(this.getActiveTracing()) == false)
return false;
if (other.getEnvironmentVariables() == null ^ this.getEnvironmentVariables() == null)
return false;
if (other.getEnvironmentVariables() != null && other.getEnvironmentVariables().equals(this.getEnvironmentVariables()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTimeoutInSeconds() == null) ? 0 : getTimeoutInSeconds().hashCode());
hashCode = prime * hashCode + ((getMemoryInMB() == null) ? 0 : getMemoryInMB().hashCode());
hashCode = prime * hashCode + ((getActiveTracing() == null) ? 0 : getActiveTracing().hashCode());
hashCode = prime * hashCode + ((getEnvironmentVariables() == null) ? 0 : getEnvironmentVariables().hashCode());
return hashCode;
}
@Override
public CanaryRunConfigInput clone() {
try {
return (CanaryRunConfigInput) 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.CanaryRunConfigInputMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}