
com.amazonaws.services.ec2.model.CreateLaunchTemplateVersionRequest Maven / Gradle / Ivy
/*
* Copyright 2017-2022 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.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.CreateLaunchTemplateVersionRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateLaunchTemplateVersionRequest extends AmazonWebServiceRequest implements Serializable, Cloneable,
DryRunSupportedRequest {
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* Ensuring
* idempotency.
*
*
* Constraint: Maximum 128 ASCII characters.
*
*/
private String clientToken;
/**
*
* The ID of the launch template.
*
*
* You must specify either the LaunchTemplateId
or the LaunchTemplateName
, but not both.
*
*/
private String launchTemplateId;
/**
*
* The name of the launch template.
*
*
* You must specify the LaunchTemplateName
or the LaunchTemplateId
, but not both.
*
*/
private String launchTemplateName;
/**
*
* The version number of the launch template version on which to base the new version. The new version inherits the
* same launch parameters as the source version, except for parameters that you specify in
* LaunchTemplateData
. Snapshots applied to the block device mapping are ignored when creating a new
* version unless they are explicitly included.
*
*/
private String sourceVersion;
/**
*
* A description for the version of the launch template.
*
*/
private String versionDescription;
/**
*
* The information for the launch template.
*
*/
private RequestLaunchTemplateData launchTemplateData;
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* Ensuring
* idempotency.
*
*
* Constraint: Maximum 128 ASCII characters.
*
*
* @param clientToken
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* idempotency.
*
* Constraint: Maximum 128 ASCII characters.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* Ensuring
* idempotency.
*
*
* Constraint: Maximum 128 ASCII characters.
*
*
* @return Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* idempotency.
*
* Constraint: Maximum 128 ASCII characters.
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* Ensuring
* idempotency.
*
*
* Constraint: Maximum 128 ASCII characters.
*
*
* @param clientToken
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* idempotency.
*
* Constraint: Maximum 128 ASCII characters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLaunchTemplateVersionRequest withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
*
* The ID of the launch template.
*
*
* You must specify either the LaunchTemplateId
or the LaunchTemplateName
, but not both.
*
*
* @param launchTemplateId
* The ID of the launch template.
*
* You must specify either the LaunchTemplateId
or the LaunchTemplateName
, but not
* both.
*/
public void setLaunchTemplateId(String launchTemplateId) {
this.launchTemplateId = launchTemplateId;
}
/**
*
* The ID of the launch template.
*
*
* You must specify either the LaunchTemplateId
or the LaunchTemplateName
, but not both.
*
*
* @return The ID of the launch template.
*
* You must specify either the LaunchTemplateId
or the LaunchTemplateName
, but not
* both.
*/
public String getLaunchTemplateId() {
return this.launchTemplateId;
}
/**
*
* The ID of the launch template.
*
*
* You must specify either the LaunchTemplateId
or the LaunchTemplateName
, but not both.
*
*
* @param launchTemplateId
* The ID of the launch template.
*
* You must specify either the LaunchTemplateId
or the LaunchTemplateName
, but not
* both.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLaunchTemplateVersionRequest withLaunchTemplateId(String launchTemplateId) {
setLaunchTemplateId(launchTemplateId);
return this;
}
/**
*
* The name of the launch template.
*
*
* You must specify the LaunchTemplateName
or the LaunchTemplateId
, but not both.
*
*
* @param launchTemplateName
* The name of the launch template.
*
* You must specify the LaunchTemplateName
or the LaunchTemplateId
, but not both.
*/
public void setLaunchTemplateName(String launchTemplateName) {
this.launchTemplateName = launchTemplateName;
}
/**
*
* The name of the launch template.
*
*
* You must specify the LaunchTemplateName
or the LaunchTemplateId
, but not both.
*
*
* @return The name of the launch template.
*
* You must specify the LaunchTemplateName
or the LaunchTemplateId
, but not both.
*/
public String getLaunchTemplateName() {
return this.launchTemplateName;
}
/**
*
* The name of the launch template.
*
*
* You must specify the LaunchTemplateName
or the LaunchTemplateId
, but not both.
*
*
* @param launchTemplateName
* The name of the launch template.
*
* You must specify the LaunchTemplateName
or the LaunchTemplateId
, but not both.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLaunchTemplateVersionRequest withLaunchTemplateName(String launchTemplateName) {
setLaunchTemplateName(launchTemplateName);
return this;
}
/**
*
* The version number of the launch template version on which to base the new version. The new version inherits the
* same launch parameters as the source version, except for parameters that you specify in
* LaunchTemplateData
. Snapshots applied to the block device mapping are ignored when creating a new
* version unless they are explicitly included.
*
*
* @param sourceVersion
* The version number of the launch template version on which to base the new version. The new version
* inherits the same launch parameters as the source version, except for parameters that you specify in
* LaunchTemplateData
. Snapshots applied to the block device mapping are ignored when creating a
* new version unless they are explicitly included.
*/
public void setSourceVersion(String sourceVersion) {
this.sourceVersion = sourceVersion;
}
/**
*
* The version number of the launch template version on which to base the new version. The new version inherits the
* same launch parameters as the source version, except for parameters that you specify in
* LaunchTemplateData
. Snapshots applied to the block device mapping are ignored when creating a new
* version unless they are explicitly included.
*
*
* @return The version number of the launch template version on which to base the new version. The new version
* inherits the same launch parameters as the source version, except for parameters that you specify in
* LaunchTemplateData
. Snapshots applied to the block device mapping are ignored when creating
* a new version unless they are explicitly included.
*/
public String getSourceVersion() {
return this.sourceVersion;
}
/**
*
* The version number of the launch template version on which to base the new version. The new version inherits the
* same launch parameters as the source version, except for parameters that you specify in
* LaunchTemplateData
. Snapshots applied to the block device mapping are ignored when creating a new
* version unless they are explicitly included.
*
*
* @param sourceVersion
* The version number of the launch template version on which to base the new version. The new version
* inherits the same launch parameters as the source version, except for parameters that you specify in
* LaunchTemplateData
. Snapshots applied to the block device mapping are ignored when creating a
* new version unless they are explicitly included.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLaunchTemplateVersionRequest withSourceVersion(String sourceVersion) {
setSourceVersion(sourceVersion);
return this;
}
/**
*
* A description for the version of the launch template.
*
*
* @param versionDescription
* A description for the version of the launch template.
*/
public void setVersionDescription(String versionDescription) {
this.versionDescription = versionDescription;
}
/**
*
* A description for the version of the launch template.
*
*
* @return A description for the version of the launch template.
*/
public String getVersionDescription() {
return this.versionDescription;
}
/**
*
* A description for the version of the launch template.
*
*
* @param versionDescription
* A description for the version of the launch template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLaunchTemplateVersionRequest withVersionDescription(String versionDescription) {
setVersionDescription(versionDescription);
return this;
}
/**
*
* The information for the launch template.
*
*
* @param launchTemplateData
* The information for the launch template.
*/
public void setLaunchTemplateData(RequestLaunchTemplateData launchTemplateData) {
this.launchTemplateData = launchTemplateData;
}
/**
*
* The information for the launch template.
*
*
* @return The information for the launch template.
*/
public RequestLaunchTemplateData getLaunchTemplateData() {
return this.launchTemplateData;
}
/**
*
* The information for the launch template.
*
*
* @param launchTemplateData
* The information for the launch template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLaunchTemplateVersionRequest withLaunchTemplateData(RequestLaunchTemplateData launchTemplateData) {
setLaunchTemplateData(launchTemplateData);
return this;
}
/**
* This method is intended for internal use only. Returns the marshaled request configured with additional
* parameters to enable operation dry-run.
*/
@Override
public Request getDryRunRequest() {
Request request = new CreateLaunchTemplateVersionRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
}
/**
* 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 (getClientToken() != null)
sb.append("ClientToken: ").append(getClientToken()).append(",");
if (getLaunchTemplateId() != null)
sb.append("LaunchTemplateId: ").append(getLaunchTemplateId()).append(",");
if (getLaunchTemplateName() != null)
sb.append("LaunchTemplateName: ").append(getLaunchTemplateName()).append(",");
if (getSourceVersion() != null)
sb.append("SourceVersion: ").append(getSourceVersion()).append(",");
if (getVersionDescription() != null)
sb.append("VersionDescription: ").append(getVersionDescription()).append(",");
if (getLaunchTemplateData() != null)
sb.append("LaunchTemplateData: ").append(getLaunchTemplateData());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateLaunchTemplateVersionRequest == false)
return false;
CreateLaunchTemplateVersionRequest other = (CreateLaunchTemplateVersionRequest) obj;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false)
return false;
if (other.getLaunchTemplateId() == null ^ this.getLaunchTemplateId() == null)
return false;
if (other.getLaunchTemplateId() != null && other.getLaunchTemplateId().equals(this.getLaunchTemplateId()) == false)
return false;
if (other.getLaunchTemplateName() == null ^ this.getLaunchTemplateName() == null)
return false;
if (other.getLaunchTemplateName() != null && other.getLaunchTemplateName().equals(this.getLaunchTemplateName()) == false)
return false;
if (other.getSourceVersion() == null ^ this.getSourceVersion() == null)
return false;
if (other.getSourceVersion() != null && other.getSourceVersion().equals(this.getSourceVersion()) == false)
return false;
if (other.getVersionDescription() == null ^ this.getVersionDescription() == null)
return false;
if (other.getVersionDescription() != null && other.getVersionDescription().equals(this.getVersionDescription()) == false)
return false;
if (other.getLaunchTemplateData() == null ^ this.getLaunchTemplateData() == null)
return false;
if (other.getLaunchTemplateData() != null && other.getLaunchTemplateData().equals(this.getLaunchTemplateData()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
hashCode = prime * hashCode + ((getLaunchTemplateId() == null) ? 0 : getLaunchTemplateId().hashCode());
hashCode = prime * hashCode + ((getLaunchTemplateName() == null) ? 0 : getLaunchTemplateName().hashCode());
hashCode = prime * hashCode + ((getSourceVersion() == null) ? 0 : getSourceVersion().hashCode());
hashCode = prime * hashCode + ((getVersionDescription() == null) ? 0 : getVersionDescription().hashCode());
hashCode = prime * hashCode + ((getLaunchTemplateData() == null) ? 0 : getLaunchTemplateData().hashCode());
return hashCode;
}
@Override
public CreateLaunchTemplateVersionRequest clone() {
return (CreateLaunchTemplateVersionRequest) super.clone();
}
}