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

com.amazonaws.services.fis.model.CreateExperimentTemplateActionInput 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.fis.model;

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

/**
 * 

* Specifies an action for an experiment template. *

*

* For more information, see Actions in the * Fault Injection Service User Guide. *

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

* The ID of the action. The format of the action ID is: aws:service-name:action-type. *

*/ private String actionId; /** *

* A description for the action. *

*/ private String description; /** *

* The parameters for the action, if applicable. *

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

* The targets for the action. *

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

* The name of the action that must be completed before the current action starts. Omit this parameter to run the * action at the start of the experiment. *

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

* The ID of the action. The format of the action ID is: aws:service-name:action-type. *

* * @param actionId * The ID of the action. The format of the action ID is: aws:service-name:action-type. */ public void setActionId(String actionId) { this.actionId = actionId; } /** *

* The ID of the action. The format of the action ID is: aws:service-name:action-type. *

* * @return The ID of the action. The format of the action ID is: aws:service-name:action-type. */ public String getActionId() { return this.actionId; } /** *

* The ID of the action. The format of the action ID is: aws:service-name:action-type. *

* * @param actionId * The ID of the action. The format of the action ID is: aws:service-name:action-type. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateExperimentTemplateActionInput withActionId(String actionId) { setActionId(actionId); return this; } /** *

* A description for the action. *

* * @param description * A description for the action. */ public void setDescription(String description) { this.description = description; } /** *

* A description for the action. *

* * @return A description for the action. */ public String getDescription() { return this.description; } /** *

* A description for the action. *

* * @param description * A description for the action. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateExperimentTemplateActionInput withDescription(String description) { setDescription(description); return this; } /** *

* The parameters for the action, if applicable. *

* * @return The parameters for the action, if applicable. */ public java.util.Map getParameters() { return parameters; } /** *

* The parameters for the action, if applicable. *

* * @param parameters * The parameters for the action, if applicable. */ public void setParameters(java.util.Map parameters) { this.parameters = parameters; } /** *

* The parameters for the action, if applicable. *

* * @param parameters * The parameters for the action, if applicable. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateExperimentTemplateActionInput withParameters(java.util.Map parameters) { setParameters(parameters); return this; } /** * Add a single Parameters entry * * @see CreateExperimentTemplateActionInput#withParameters * @returns a reference to this object so that method calls can be chained together. */ public CreateExperimentTemplateActionInput addParametersEntry(String key, String 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 CreateExperimentTemplateActionInput clearParametersEntries() { this.parameters = null; return this; } /** *

* The targets for the action. *

* * @return The targets for the action. */ public java.util.Map getTargets() { return targets; } /** *

* The targets for the action. *

* * @param targets * The targets for the action. */ public void setTargets(java.util.Map targets) { this.targets = targets; } /** *

* The targets for the action. *

* * @param targets * The targets for the action. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateExperimentTemplateActionInput withTargets(java.util.Map targets) { setTargets(targets); return this; } /** * Add a single Targets entry * * @see CreateExperimentTemplateActionInput#withTargets * @returns a reference to this object so that method calls can be chained together. */ public CreateExperimentTemplateActionInput addTargetsEntry(String key, String value) { if (null == this.targets) { this.targets = new java.util.HashMap(); } if (this.targets.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.targets.put(key, value); return this; } /** * Removes all the entries added into Targets. * * @return Returns a reference to this object so that method calls can be chained together. */ public CreateExperimentTemplateActionInput clearTargetsEntries() { this.targets = null; return this; } /** *

* The name of the action that must be completed before the current action starts. Omit this parameter to run the * action at the start of the experiment. *

* * @return The name of the action that must be completed before the current action starts. Omit this parameter to * run the action at the start of the experiment. */ public java.util.List getStartAfter() { return startAfter; } /** *

* The name of the action that must be completed before the current action starts. Omit this parameter to run the * action at the start of the experiment. *

* * @param startAfter * The name of the action that must be completed before the current action starts. Omit this parameter to run * the action at the start of the experiment. */ public void setStartAfter(java.util.Collection startAfter) { if (startAfter == null) { this.startAfter = null; return; } this.startAfter = new java.util.ArrayList(startAfter); } /** *

* The name of the action that must be completed before the current action starts. Omit this parameter to run the * action at the start of the experiment. *

*

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

* * @param startAfter * The name of the action that must be completed before the current action starts. Omit this parameter to run * the action at the start of the experiment. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateExperimentTemplateActionInput withStartAfter(String... startAfter) { if (this.startAfter == null) { setStartAfter(new java.util.ArrayList(startAfter.length)); } for (String ele : startAfter) { this.startAfter.add(ele); } return this; } /** *

* The name of the action that must be completed before the current action starts. Omit this parameter to run the * action at the start of the experiment. *

* * @param startAfter * The name of the action that must be completed before the current action starts. Omit this parameter to run * the action at the start of the experiment. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateExperimentTemplateActionInput withStartAfter(java.util.Collection startAfter) { setStartAfter(startAfter); 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 (getActionId() != null) sb.append("ActionId: ").append(getActionId()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getParameters() != null) sb.append("Parameters: ").append(getParameters()).append(","); if (getTargets() != null) sb.append("Targets: ").append(getTargets()).append(","); if (getStartAfter() != null) sb.append("StartAfter: ").append(getStartAfter()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateExperimentTemplateActionInput == false) return false; CreateExperimentTemplateActionInput other = (CreateExperimentTemplateActionInput) obj; if (other.getActionId() == null ^ this.getActionId() == null) return false; if (other.getActionId() != null && other.getActionId().equals(this.getActionId()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == 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.getTargets() == null ^ this.getTargets() == null) return false; if (other.getTargets() != null && other.getTargets().equals(this.getTargets()) == false) return false; if (other.getStartAfter() == null ^ this.getStartAfter() == null) return false; if (other.getStartAfter() != null && other.getStartAfter().equals(this.getStartAfter()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getActionId() == null) ? 0 : getActionId().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode()); hashCode = prime * hashCode + ((getTargets() == null) ? 0 : getTargets().hashCode()); hashCode = prime * hashCode + ((getStartAfter() == null) ? 0 : getStartAfter().hashCode()); return hashCode; } @Override public CreateExperimentTemplateActionInput clone() { try { return (CreateExperimentTemplateActionInput) 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.fis.model.transform.CreateExperimentTemplateActionInputMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy