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

com.amazonaws.services.ssmincidents.model.SsmAutomation 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.ssmincidents.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* Details about the Systems Manager automation document that will be used as a runbook during an incident. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SsmAutomation implements Serializable, Cloneable, StructuredPojo { /** *

* The automation document's name. *

*/ private String documentName; /** *

* The automation document's version to use when running. *

*/ private String documentVersion; /** *

* The key-value pair to resolve dynamic parameter values when processing a Systems Manager Automation runbook. *

*/ private java.util.Map dynamicParameters; /** *

* The key-value pair parameters to use when running the automation document. *

*/ private java.util.Map> parameters; /** *

* The Amazon Resource Name (ARN) of the role that the automation document will assume when running commands. *

*/ private String roleArn; /** *

* The account that the automation document will be run in. This can be in either the management account or an * application account. *

*/ private String targetAccount; /** *

* The automation document's name. *

* * @param documentName * The automation document's name. */ public void setDocumentName(String documentName) { this.documentName = documentName; } /** *

* The automation document's name. *

* * @return The automation document's name. */ public String getDocumentName() { return this.documentName; } /** *

* The automation document's name. *

* * @param documentName * The automation document's name. * @return Returns a reference to this object so that method calls can be chained together. */ public SsmAutomation withDocumentName(String documentName) { setDocumentName(documentName); return this; } /** *

* The automation document's version to use when running. *

* * @param documentVersion * The automation document's version to use when running. */ public void setDocumentVersion(String documentVersion) { this.documentVersion = documentVersion; } /** *

* The automation document's version to use when running. *

* * @return The automation document's version to use when running. */ public String getDocumentVersion() { return this.documentVersion; } /** *

* The automation document's version to use when running. *

* * @param documentVersion * The automation document's version to use when running. * @return Returns a reference to this object so that method calls can be chained together. */ public SsmAutomation withDocumentVersion(String documentVersion) { setDocumentVersion(documentVersion); return this; } /** *

* The key-value pair to resolve dynamic parameter values when processing a Systems Manager Automation runbook. *

* * @return The key-value pair to resolve dynamic parameter values when processing a Systems Manager Automation * runbook. */ public java.util.Map getDynamicParameters() { return dynamicParameters; } /** *

* The key-value pair to resolve dynamic parameter values when processing a Systems Manager Automation runbook. *

* * @param dynamicParameters * The key-value pair to resolve dynamic parameter values when processing a Systems Manager Automation * runbook. */ public void setDynamicParameters(java.util.Map dynamicParameters) { this.dynamicParameters = dynamicParameters; } /** *

* The key-value pair to resolve dynamic parameter values when processing a Systems Manager Automation runbook. *

* * @param dynamicParameters * The key-value pair to resolve dynamic parameter values when processing a Systems Manager Automation * runbook. * @return Returns a reference to this object so that method calls can be chained together. */ public SsmAutomation withDynamicParameters(java.util.Map dynamicParameters) { setDynamicParameters(dynamicParameters); return this; } /** * Add a single DynamicParameters entry * * @see SsmAutomation#withDynamicParameters * @returns a reference to this object so that method calls can be chained together. */ public SsmAutomation addDynamicParametersEntry(String key, DynamicSsmParameterValue value) { if (null == this.dynamicParameters) { this.dynamicParameters = new java.util.HashMap(); } if (this.dynamicParameters.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.dynamicParameters.put(key, value); return this; } /** * Removes all the entries added into DynamicParameters. * * @return Returns a reference to this object so that method calls can be chained together. */ public SsmAutomation clearDynamicParametersEntries() { this.dynamicParameters = null; return this; } /** *

* The key-value pair parameters to use when running the automation document. *

* * @return The key-value pair parameters to use when running the automation document. */ public java.util.Map> getParameters() { return parameters; } /** *

* The key-value pair parameters to use when running the automation document. *

* * @param parameters * The key-value pair parameters to use when running the automation document. */ public void setParameters(java.util.Map> parameters) { this.parameters = parameters; } /** *

* The key-value pair parameters to use when running the automation document. *

* * @param parameters * The key-value pair parameters to use when running the automation document. * @return Returns a reference to this object so that method calls can be chained together. */ public SsmAutomation withParameters(java.util.Map> parameters) { setParameters(parameters); return this; } /** * Add a single Parameters entry * * @see SsmAutomation#withParameters * @returns a reference to this object so that method calls can be chained together. */ public SsmAutomation 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 SsmAutomation clearParametersEntries() { this.parameters = null; return this; } /** *

* The Amazon Resource Name (ARN) of the role that the automation document will assume when running commands. *

* * @param roleArn * The Amazon Resource Name (ARN) of the role that the automation document will assume when running commands. */ public void setRoleArn(String roleArn) { this.roleArn = roleArn; } /** *

* The Amazon Resource Name (ARN) of the role that the automation document will assume when running commands. *

* * @return The Amazon Resource Name (ARN) of the role that the automation document will assume when running * commands. */ public String getRoleArn() { return this.roleArn; } /** *

* The Amazon Resource Name (ARN) of the role that the automation document will assume when running commands. *

* * @param roleArn * The Amazon Resource Name (ARN) of the role that the automation document will assume when running commands. * @return Returns a reference to this object so that method calls can be chained together. */ public SsmAutomation withRoleArn(String roleArn) { setRoleArn(roleArn); return this; } /** *

* The account that the automation document will be run in. This can be in either the management account or an * application account. *

* * @param targetAccount * The account that the automation document will be run in. This can be in either the management account or * an application account. * @see SsmTargetAccount */ public void setTargetAccount(String targetAccount) { this.targetAccount = targetAccount; } /** *

* The account that the automation document will be run in. This can be in either the management account or an * application account. *

* * @return The account that the automation document will be run in. This can be in either the management account or * an application account. * @see SsmTargetAccount */ public String getTargetAccount() { return this.targetAccount; } /** *

* The account that the automation document will be run in. This can be in either the management account or an * application account. *

* * @param targetAccount * The account that the automation document will be run in. This can be in either the management account or * an application account. * @return Returns a reference to this object so that method calls can be chained together. * @see SsmTargetAccount */ public SsmAutomation withTargetAccount(String targetAccount) { setTargetAccount(targetAccount); return this; } /** *

* The account that the automation document will be run in. This can be in either the management account or an * application account. *

* * @param targetAccount * The account that the automation document will be run in. This can be in either the management account or * an application account. * @return Returns a reference to this object so that method calls can be chained together. * @see SsmTargetAccount */ public SsmAutomation withTargetAccount(SsmTargetAccount targetAccount) { this.targetAccount = targetAccount.toString(); 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 (getDocumentName() != null) sb.append("DocumentName: ").append(getDocumentName()).append(","); if (getDocumentVersion() != null) sb.append("DocumentVersion: ").append(getDocumentVersion()).append(","); if (getDynamicParameters() != null) sb.append("DynamicParameters: ").append(getDynamicParameters()).append(","); if (getParameters() != null) sb.append("Parameters: ").append(getParameters()).append(","); if (getRoleArn() != null) sb.append("RoleArn: ").append(getRoleArn()).append(","); if (getTargetAccount() != null) sb.append("TargetAccount: ").append(getTargetAccount()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SsmAutomation == false) return false; SsmAutomation other = (SsmAutomation) obj; if (other.getDocumentName() == null ^ this.getDocumentName() == null) return false; if (other.getDocumentName() != null && other.getDocumentName().equals(this.getDocumentName()) == false) return false; if (other.getDocumentVersion() == null ^ this.getDocumentVersion() == null) return false; if (other.getDocumentVersion() != null && other.getDocumentVersion().equals(this.getDocumentVersion()) == false) return false; if (other.getDynamicParameters() == null ^ this.getDynamicParameters() == null) return false; if (other.getDynamicParameters() != null && other.getDynamicParameters().equals(this.getDynamicParameters()) == 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.getRoleArn() == null ^ this.getRoleArn() == null) return false; if (other.getRoleArn() != null && other.getRoleArn().equals(this.getRoleArn()) == false) return false; if (other.getTargetAccount() == null ^ this.getTargetAccount() == null) return false; if (other.getTargetAccount() != null && other.getTargetAccount().equals(this.getTargetAccount()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDocumentName() == null) ? 0 : getDocumentName().hashCode()); hashCode = prime * hashCode + ((getDocumentVersion() == null) ? 0 : getDocumentVersion().hashCode()); hashCode = prime * hashCode + ((getDynamicParameters() == null) ? 0 : getDynamicParameters().hashCode()); hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode()); hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); hashCode = prime * hashCode + ((getTargetAccount() == null) ? 0 : getTargetAccount().hashCode()); return hashCode; } @Override public SsmAutomation clone() { try { return (SsmAutomation) 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.ssmincidents.model.transform.SsmAutomationMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy