com.amazonaws.services.cloudformation.model.CreateGeneratedTemplateRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudformation 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.cloudformation.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateGeneratedTemplateRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* An optional list of resources to be included in the generated template.
*
*
* If no resources are specified,the template will be created without any resources. Resources can be added to the
* template using the UpdateGeneratedTemplate
API action.
*
*/
private com.amazonaws.internal.SdkInternalList resources;
/**
*
* The name assigned to the generated template.
*
*/
private String generatedTemplateName;
/**
*
* An optional name or ARN of a stack to use as the base stack for the generated template.
*
*/
private String stackName;
/**
*
* The configuration details of the generated template, including the DeletionPolicy
and
* UpdateReplacePolicy
.
*
*/
private TemplateConfiguration templateConfiguration;
/**
*
* An optional list of resources to be included in the generated template.
*
*
* If no resources are specified,the template will be created without any resources. Resources can be added to the
* template using the UpdateGeneratedTemplate
API action.
*
*
* @return An optional list of resources to be included in the generated template.
*
* If no resources are specified,the template will be created without any resources. Resources can be added
* to the template using the UpdateGeneratedTemplate
API action.
*/
public java.util.List getResources() {
if (resources == null) {
resources = new com.amazonaws.internal.SdkInternalList();
}
return resources;
}
/**
*
* An optional list of resources to be included in the generated template.
*
*
* If no resources are specified,the template will be created without any resources. Resources can be added to the
* template using the UpdateGeneratedTemplate
API action.
*
*
* @param resources
* An optional list of resources to be included in the generated template.
*
* If no resources are specified,the template will be created without any resources. Resources can be added
* to the template using the UpdateGeneratedTemplate
API action.
*/
public void setResources(java.util.Collection resources) {
if (resources == null) {
this.resources = null;
return;
}
this.resources = new com.amazonaws.internal.SdkInternalList(resources);
}
/**
*
* An optional list of resources to be included in the generated template.
*
*
* If no resources are specified,the template will be created without any resources. Resources can be added to the
* template using the UpdateGeneratedTemplate
API action.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setResources(java.util.Collection)} or {@link #withResources(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param resources
* An optional list of resources to be included in the generated template.
*
* If no resources are specified,the template will be created without any resources. Resources can be added
* to the template using the UpdateGeneratedTemplate
API action.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateGeneratedTemplateRequest withResources(ResourceDefinition... resources) {
if (this.resources == null) {
setResources(new com.amazonaws.internal.SdkInternalList(resources.length));
}
for (ResourceDefinition ele : resources) {
this.resources.add(ele);
}
return this;
}
/**
*
* An optional list of resources to be included in the generated template.
*
*
* If no resources are specified,the template will be created without any resources. Resources can be added to the
* template using the UpdateGeneratedTemplate
API action.
*
*
* @param resources
* An optional list of resources to be included in the generated template.
*
* If no resources are specified,the template will be created without any resources. Resources can be added
* to the template using the UpdateGeneratedTemplate
API action.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateGeneratedTemplateRequest withResources(java.util.Collection resources) {
setResources(resources);
return this;
}
/**
*
* The name assigned to the generated template.
*
*
* @param generatedTemplateName
* The name assigned to the generated template.
*/
public void setGeneratedTemplateName(String generatedTemplateName) {
this.generatedTemplateName = generatedTemplateName;
}
/**
*
* The name assigned to the generated template.
*
*
* @return The name assigned to the generated template.
*/
public String getGeneratedTemplateName() {
return this.generatedTemplateName;
}
/**
*
* The name assigned to the generated template.
*
*
* @param generatedTemplateName
* The name assigned to the generated template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateGeneratedTemplateRequest withGeneratedTemplateName(String generatedTemplateName) {
setGeneratedTemplateName(generatedTemplateName);
return this;
}
/**
*
* An optional name or ARN of a stack to use as the base stack for the generated template.
*
*
* @param stackName
* An optional name or ARN of a stack to use as the base stack for the generated template.
*/
public void setStackName(String stackName) {
this.stackName = stackName;
}
/**
*
* An optional name or ARN of a stack to use as the base stack for the generated template.
*
*
* @return An optional name or ARN of a stack to use as the base stack for the generated template.
*/
public String getStackName() {
return this.stackName;
}
/**
*
* An optional name or ARN of a stack to use as the base stack for the generated template.
*
*
* @param stackName
* An optional name or ARN of a stack to use as the base stack for the generated template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateGeneratedTemplateRequest withStackName(String stackName) {
setStackName(stackName);
return this;
}
/**
*
* The configuration details of the generated template, including the DeletionPolicy
and
* UpdateReplacePolicy
.
*
*
* @param templateConfiguration
* The configuration details of the generated template, including the DeletionPolicy
and
* UpdateReplacePolicy
.
*/
public void setTemplateConfiguration(TemplateConfiguration templateConfiguration) {
this.templateConfiguration = templateConfiguration;
}
/**
*
* The configuration details of the generated template, including the DeletionPolicy
and
* UpdateReplacePolicy
.
*
*
* @return The configuration details of the generated template, including the DeletionPolicy
and
* UpdateReplacePolicy
.
*/
public TemplateConfiguration getTemplateConfiguration() {
return this.templateConfiguration;
}
/**
*
* The configuration details of the generated template, including the DeletionPolicy
and
* UpdateReplacePolicy
.
*
*
* @param templateConfiguration
* The configuration details of the generated template, including the DeletionPolicy
and
* UpdateReplacePolicy
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateGeneratedTemplateRequest withTemplateConfiguration(TemplateConfiguration templateConfiguration) {
setTemplateConfiguration(templateConfiguration);
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 (getResources() != null)
sb.append("Resources: ").append(getResources()).append(",");
if (getGeneratedTemplateName() != null)
sb.append("GeneratedTemplateName: ").append(getGeneratedTemplateName()).append(",");
if (getStackName() != null)
sb.append("StackName: ").append(getStackName()).append(",");
if (getTemplateConfiguration() != null)
sb.append("TemplateConfiguration: ").append(getTemplateConfiguration());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateGeneratedTemplateRequest == false)
return false;
CreateGeneratedTemplateRequest other = (CreateGeneratedTemplateRequest) obj;
if (other.getResources() == null ^ this.getResources() == null)
return false;
if (other.getResources() != null && other.getResources().equals(this.getResources()) == false)
return false;
if (other.getGeneratedTemplateName() == null ^ this.getGeneratedTemplateName() == null)
return false;
if (other.getGeneratedTemplateName() != null && other.getGeneratedTemplateName().equals(this.getGeneratedTemplateName()) == false)
return false;
if (other.getStackName() == null ^ this.getStackName() == null)
return false;
if (other.getStackName() != null && other.getStackName().equals(this.getStackName()) == false)
return false;
if (other.getTemplateConfiguration() == null ^ this.getTemplateConfiguration() == null)
return false;
if (other.getTemplateConfiguration() != null && other.getTemplateConfiguration().equals(this.getTemplateConfiguration()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getResources() == null) ? 0 : getResources().hashCode());
hashCode = prime * hashCode + ((getGeneratedTemplateName() == null) ? 0 : getGeneratedTemplateName().hashCode());
hashCode = prime * hashCode + ((getStackName() == null) ? 0 : getStackName().hashCode());
hashCode = prime * hashCode + ((getTemplateConfiguration() == null) ? 0 : getTemplateConfiguration().hashCode());
return hashCode;
}
@Override
public CreateGeneratedTemplateRequest clone() {
return (CreateGeneratedTemplateRequest) super.clone();
}
}