/* * Copyright 2018-2023 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.budgets.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* The Amazon Web Services Systems Manager (SSM) action definition details. *

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

* The action subType. *

*/ private String actionSubType; /** *

* The Region to run the SSM document. *

*/ private String region; /** *

* The EC2 and RDS instance IDs. *

*/ private java.util.List instanceIds; /** *

* The action subType. *

* * @param actionSubType * The action subType. * @see ActionSubType */ public void setActionSubType(String actionSubType) { this.actionSubType = actionSubType; } /** *

* The action subType. *

* * @return The action subType. * @see ActionSubType */ public String getActionSubType() { return this.actionSubType; } /** *

* The action subType. *

* * @param actionSubType * The action subType. * @return Returns a reference to this object so that method calls can be chained together. * @see ActionSubType */ public SsmActionDefinition withActionSubType(String actionSubType) { setActionSubType(actionSubType); return this; } /** *

* The action subType. *

* * @param actionSubType * The action subType. * @return Returns a reference to this object so that method calls can be chained together. * @see ActionSubType */ public SsmActionDefinition withActionSubType(ActionSubType actionSubType) { this.actionSubType = actionSubType.toString(); return this; } /** *

* The Region to run the SSM document. *

* * @param region * The Region to run the SSM document. */ public void setRegion(String region) { this.region = region; } /** *

* The Region to run the SSM document. *

* * @return The Region to run the SSM document. */ public String getRegion() { return this.region; } /** *

* The Region to run the SSM document. *

* * @param region * The Region to run the SSM document. * @return Returns a reference to this object so that method calls can be chained together. */ public SsmActionDefinition withRegion(String region) { setRegion(region); return this; } /** *

* The EC2 and RDS instance IDs. *

* * @return The EC2 and RDS instance IDs. */ public java.util.List getInstanceIds() { return instanceIds; } /** *

* The EC2 and RDS instance IDs. *

* * @param instanceIds * The EC2 and RDS instance IDs. */ public void setInstanceIds(java.util.Collection instanceIds) { if (instanceIds == null) { this.instanceIds = null; return; } this.instanceIds = new java.util.ArrayList(instanceIds); } /** *

* The EC2 and RDS instance IDs. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setInstanceIds(java.util.Collection)} or {@link #withInstanceIds(java.util.Collection)} if you want to * override the existing values. *

* * @param instanceIds * The EC2 and RDS instance IDs. * @return Returns a reference to this object so that method calls can be chained together. */ public SsmActionDefinition withInstanceIds(String... instanceIds) { if (this.instanceIds == null) { setInstanceIds(new java.util.ArrayList(instanceIds.length)); } for (String ele : instanceIds) { this.instanceIds.add(ele); } return this; } /** *

* The EC2 and RDS instance IDs. *

* * @param instanceIds * The EC2 and RDS instance IDs. * @return Returns a reference to this object so that method calls can be chained together. */ public SsmActionDefinition withInstanceIds(java.util.Collection instanceIds) { setInstanceIds(instanceIds); 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 (getActionSubType() != null) sb.append("ActionSubType: ").append(getActionSubType()).append(","); if (getRegion() != null) sb.append("Region: ").append(getRegion()).append(","); if (getInstanceIds() != null) sb.append("InstanceIds: ").append(getInstanceIds()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SsmActionDefinition == false) return false; SsmActionDefinition other = (SsmActionDefinition) obj; if (other.getActionSubType() == null ^ this.getActionSubType() == null) return false; if (other.getActionSubType() != null && other.getActionSubType().equals(this.getActionSubType()) == false) return false; if (other.getRegion() == null ^ this.getRegion() == null) return false; if (other.getRegion() != null && other.getRegion().equals(this.getRegion()) == false) return false; if (other.getInstanceIds() == null ^ this.getInstanceIds() == null) return false; if (other.getInstanceIds() != null && other.getInstanceIds().equals(this.getInstanceIds()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getActionSubType() == null) ? 0 : getActionSubType().hashCode()); hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode()); hashCode = prime * hashCode + ((getInstanceIds() == null) ? 0 : getInstanceIds().hashCode()); return hashCode; } @Override public SsmActionDefinition clone() { try { return (SsmActionDefinition) 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.budgets.model.transform.SsmActionDefinitionMarshaller.getInstance().marshall(this, protocolMarshaller); } }