com.amazonaws.services.mgn.model.SsmDocument Maven / Gradle / Ivy
Show all versions of aws-java-sdk-mgn 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.mgn.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* AWS Systems Manager Document.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SsmDocument implements Serializable, Cloneable, StructuredPojo {
/**
*
* User-friendly name for the AWS Systems Manager Document.
*
*/
private String actionName;
/**
*
* AWS Systems Manager Document external parameters.
*
*/
private java.util.Map externalParameters;
/**
*
* If true, Cutover will not be enabled if the document has failed.
*
*/
private Boolean mustSucceedForCutover;
/**
*
* AWS Systems Manager Document parameters.
*
*/
private java.util.Map> parameters;
/**
*
* AWS Systems Manager Document name or full ARN.
*
*/
private String ssmDocumentName;
/**
*
* AWS Systems Manager Document timeout seconds.
*
*/
private Integer timeoutSeconds;
/**
*
* User-friendly name for the AWS Systems Manager Document.
*
*
* @param actionName
* User-friendly name for the AWS Systems Manager Document.
*/
public void setActionName(String actionName) {
this.actionName = actionName;
}
/**
*
* User-friendly name for the AWS Systems Manager Document.
*
*
* @return User-friendly name for the AWS Systems Manager Document.
*/
public String getActionName() {
return this.actionName;
}
/**
*
* User-friendly name for the AWS Systems Manager Document.
*
*
* @param actionName
* User-friendly name for the AWS Systems Manager Document.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SsmDocument withActionName(String actionName) {
setActionName(actionName);
return this;
}
/**
*
* AWS Systems Manager Document external parameters.
*
*
* @return AWS Systems Manager Document external parameters.
*/
public java.util.Map getExternalParameters() {
return externalParameters;
}
/**
*
* AWS Systems Manager Document external parameters.
*
*
* @param externalParameters
* AWS Systems Manager Document external parameters.
*/
public void setExternalParameters(java.util.Map externalParameters) {
this.externalParameters = externalParameters;
}
/**
*
* AWS Systems Manager Document external parameters.
*
*
* @param externalParameters
* AWS Systems Manager Document external parameters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SsmDocument withExternalParameters(java.util.Map externalParameters) {
setExternalParameters(externalParameters);
return this;
}
/**
* Add a single ExternalParameters entry
*
* @see SsmDocument#withExternalParameters
* @returns a reference to this object so that method calls can be chained together.
*/
public SsmDocument addExternalParametersEntry(String key, SsmExternalParameter value) {
if (null == this.externalParameters) {
this.externalParameters = new java.util.HashMap();
}
if (this.externalParameters.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.externalParameters.put(key, value);
return this;
}
/**
* Removes all the entries added into ExternalParameters.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SsmDocument clearExternalParametersEntries() {
this.externalParameters = null;
return this;
}
/**
*
* If true, Cutover will not be enabled if the document has failed.
*
*
* @param mustSucceedForCutover
* If true, Cutover will not be enabled if the document has failed.
*/
public void setMustSucceedForCutover(Boolean mustSucceedForCutover) {
this.mustSucceedForCutover = mustSucceedForCutover;
}
/**
*
* If true, Cutover will not be enabled if the document has failed.
*
*
* @return If true, Cutover will not be enabled if the document has failed.
*/
public Boolean getMustSucceedForCutover() {
return this.mustSucceedForCutover;
}
/**
*
* If true, Cutover will not be enabled if the document has failed.
*
*
* @param mustSucceedForCutover
* If true, Cutover will not be enabled if the document has failed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SsmDocument withMustSucceedForCutover(Boolean mustSucceedForCutover) {
setMustSucceedForCutover(mustSucceedForCutover);
return this;
}
/**
*
* If true, Cutover will not be enabled if the document has failed.
*
*
* @return If true, Cutover will not be enabled if the document has failed.
*/
public Boolean isMustSucceedForCutover() {
return this.mustSucceedForCutover;
}
/**
*
* AWS Systems Manager Document parameters.
*
*
* @return AWS Systems Manager Document parameters.
*/
public java.util.Map> getParameters() {
return parameters;
}
/**
*
* AWS Systems Manager Document parameters.
*
*
* @param parameters
* AWS Systems Manager Document parameters.
*/
public void setParameters(java.util.Map> parameters) {
this.parameters = parameters;
}
/**
*
* AWS Systems Manager Document parameters.
*
*
* @param parameters
* AWS Systems Manager Document parameters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SsmDocument withParameters(java.util.Map> parameters) {
setParameters(parameters);
return this;
}
/**
* Add a single Parameters entry
*
* @see SsmDocument#withParameters
* @returns a reference to this object so that method calls can be chained together.
*/
public SsmDocument addParametersEntry(String key, java.util.List value) {
if (null == this.parameters) {
this.parameters = new java.util.HashMap>();
}
if (this.parameters.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.parameters.put(key, value);
return this;
}
/**
* Removes all the entries added into Parameters.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SsmDocument clearParametersEntries() {
this.parameters = null;
return this;
}
/**
*
* AWS Systems Manager Document name or full ARN.
*
*
* @param ssmDocumentName
* AWS Systems Manager Document name or full ARN.
*/
public void setSsmDocumentName(String ssmDocumentName) {
this.ssmDocumentName = ssmDocumentName;
}
/**
*
* AWS Systems Manager Document name or full ARN.
*
*
* @return AWS Systems Manager Document name or full ARN.
*/
public String getSsmDocumentName() {
return this.ssmDocumentName;
}
/**
*
* AWS Systems Manager Document name or full ARN.
*
*
* @param ssmDocumentName
* AWS Systems Manager Document name or full ARN.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SsmDocument withSsmDocumentName(String ssmDocumentName) {
setSsmDocumentName(ssmDocumentName);
return this;
}
/**
*
* AWS Systems Manager Document timeout seconds.
*
*
* @param timeoutSeconds
* AWS Systems Manager Document timeout seconds.
*/
public void setTimeoutSeconds(Integer timeoutSeconds) {
this.timeoutSeconds = timeoutSeconds;
}
/**
*
* AWS Systems Manager Document timeout seconds.
*
*
* @return AWS Systems Manager Document timeout seconds.
*/
public Integer getTimeoutSeconds() {
return this.timeoutSeconds;
}
/**
*
* AWS Systems Manager Document timeout seconds.
*
*
* @param timeoutSeconds
* AWS Systems Manager Document timeout seconds.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SsmDocument withTimeoutSeconds(Integer timeoutSeconds) {
setTimeoutSeconds(timeoutSeconds);
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 (getActionName() != null)
sb.append("ActionName: ").append(getActionName()).append(",");
if (getExternalParameters() != null)
sb.append("ExternalParameters: ").append(getExternalParameters()).append(",");
if (getMustSucceedForCutover() != null)
sb.append("MustSucceedForCutover: ").append(getMustSucceedForCutover()).append(",");
if (getParameters() != null)
sb.append("Parameters: ").append(getParameters()).append(",");
if (getSsmDocumentName() != null)
sb.append("SsmDocumentName: ").append(getSsmDocumentName()).append(",");
if (getTimeoutSeconds() != null)
sb.append("TimeoutSeconds: ").append(getTimeoutSeconds());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SsmDocument == false)
return false;
SsmDocument other = (SsmDocument) obj;
if (other.getActionName() == null ^ this.getActionName() == null)
return false;
if (other.getActionName() != null && other.getActionName().equals(this.getActionName()) == false)
return false;
if (other.getExternalParameters() == null ^ this.getExternalParameters() == null)
return false;
if (other.getExternalParameters() != null && other.getExternalParameters().equals(this.getExternalParameters()) == false)
return false;
if (other.getMustSucceedForCutover() == null ^ this.getMustSucceedForCutover() == null)
return false;
if (other.getMustSucceedForCutover() != null && other.getMustSucceedForCutover().equals(this.getMustSucceedForCutover()) == false)
return false;
if (other.getParameters() == null ^ this.getParameters() == null)
return false;
if (other.getParameters() != null && other.getParameters().equals(this.getParameters()) == false)
return false;
if (other.getSsmDocumentName() == null ^ this.getSsmDocumentName() == null)
return false;
if (other.getSsmDocumentName() != null && other.getSsmDocumentName().equals(this.getSsmDocumentName()) == false)
return false;
if (other.getTimeoutSeconds() == null ^ this.getTimeoutSeconds() == null)
return false;
if (other.getTimeoutSeconds() != null && other.getTimeoutSeconds().equals(this.getTimeoutSeconds()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getActionName() == null) ? 0 : getActionName().hashCode());
hashCode = prime * hashCode + ((getExternalParameters() == null) ? 0 : getExternalParameters().hashCode());
hashCode = prime * hashCode + ((getMustSucceedForCutover() == null) ? 0 : getMustSucceedForCutover().hashCode());
hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode());
hashCode = prime * hashCode + ((getSsmDocumentName() == null) ? 0 : getSsmDocumentName().hashCode());
hashCode = prime * hashCode + ((getTimeoutSeconds() == null) ? 0 : getTimeoutSeconds().hashCode());
return hashCode;
}
@Override
public SsmDocument clone() {
try {
return (SsmDocument) 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.mgn.model.transform.SsmDocumentMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}