software.amazon.awssdk.services.cloudformation.model.GetTemplateSummaryResponse Maven / Gradle / Ivy
Show all versions of cloudformation Show documentation
/*
* Copyright 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 software.amazon.awssdk.services.cloudformation.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The output for the GetTemplateSummary action.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class GetTemplateSummaryResponse extends CloudFormationResponse implements
ToCopyableBuilder {
private static final SdkField> PARAMETERS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(GetTemplateSummaryResponse::parameters))
.setter(setter(Builder::parameters))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Parameters").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(ParameterDeclaration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetTemplateSummaryResponse::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField> CAPABILITIES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(GetTemplateSummaryResponse::capabilitiesAsStrings))
.setter(setter(Builder::capabilitiesWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Capabilities").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField CAPABILITIES_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetTemplateSummaryResponse::capabilitiesReason)).setter(setter(Builder::capabilitiesReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CapabilitiesReason").build())
.build();
private static final SdkField> RESOURCE_TYPES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(GetTemplateSummaryResponse::resourceTypes))
.setter(setter(Builder::resourceTypes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceTypes").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetTemplateSummaryResponse::version)).setter(setter(Builder::version))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Version").build()).build();
private static final SdkField METADATA_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetTemplateSummaryResponse::metadata)).setter(setter(Builder::metadata))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Metadata").build()).build();
private static final SdkField> DECLARED_TRANSFORMS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(GetTemplateSummaryResponse::declaredTransforms))
.setter(setter(Builder::declaredTransforms))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeclaredTransforms").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> RESOURCE_IDENTIFIER_SUMMARIES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(GetTemplateSummaryResponse::resourceIdentifierSummaries))
.setter(setter(Builder::resourceIdentifierSummaries))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceIdentifierSummaries")
.build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(ResourceIdentifierSummary::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PARAMETERS_FIELD,
DESCRIPTION_FIELD, CAPABILITIES_FIELD, CAPABILITIES_REASON_FIELD, RESOURCE_TYPES_FIELD, VERSION_FIELD,
METADATA_FIELD, DECLARED_TRANSFORMS_FIELD, RESOURCE_IDENTIFIER_SUMMARIES_FIELD));
private final List parameters;
private final String description;
private final List capabilities;
private final String capabilitiesReason;
private final List resourceTypes;
private final String version;
private final String metadata;
private final List declaredTransforms;
private final List resourceIdentifierSummaries;
private GetTemplateSummaryResponse(BuilderImpl builder) {
super(builder);
this.parameters = builder.parameters;
this.description = builder.description;
this.capabilities = builder.capabilities;
this.capabilitiesReason = builder.capabilitiesReason;
this.resourceTypes = builder.resourceTypes;
this.version = builder.version;
this.metadata = builder.metadata;
this.declaredTransforms = builder.declaredTransforms;
this.resourceIdentifierSummaries = builder.resourceIdentifierSummaries;
}
/**
* Returns true if the Parameters property was specified by the sender (it may be empty), or false if the sender did
* not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasParameters() {
return parameters != null && !(parameters instanceof SdkAutoConstructList);
}
/**
*
* A list of parameter declarations that describe various properties for each parameter.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasParameters()} to see if a value was sent in this field.
*
*
* @return A list of parameter declarations that describe various properties for each parameter.
*/
public List parameters() {
return parameters;
}
/**
*
* The value that is defined in the Description
property of the template.
*
*
* @return The value that is defined in the Description
property of the template.
*/
public String description() {
return description;
}
/**
*
* The capabilities found within the template. If your template contains IAM resources, you must specify the
* CAPABILITY_IAM or CAPABILITY_NAMED_IAM value for this parameter when you use the CreateStack or
* UpdateStack actions with your template; otherwise, those actions return an InsufficientCapabilities error.
*
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasCapabilities()} to see if a value was sent in this field.
*
*
* @return The capabilities found within the template. If your template contains IAM resources, you must specify the
* CAPABILITY_IAM or CAPABILITY_NAMED_IAM value for this parameter when you use the CreateStack or
* UpdateStack actions with your template; otherwise, those actions return an
* InsufficientCapabilities error.
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
*/
public List capabilities() {
return CapabilitiesCopier.copyStringToEnum(capabilities);
}
/**
* Returns true if the Capabilities property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasCapabilities() {
return capabilities != null && !(capabilities instanceof SdkAutoConstructList);
}
/**
*
* The capabilities found within the template. If your template contains IAM resources, you must specify the
* CAPABILITY_IAM or CAPABILITY_NAMED_IAM value for this parameter when you use the CreateStack or
* UpdateStack actions with your template; otherwise, those actions return an InsufficientCapabilities error.
*
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasCapabilities()} to see if a value was sent in this field.
*
*
* @return The capabilities found within the template. If your template contains IAM resources, you must specify the
* CAPABILITY_IAM or CAPABILITY_NAMED_IAM value for this parameter when you use the CreateStack or
* UpdateStack actions with your template; otherwise, those actions return an
* InsufficientCapabilities error.
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
*/
public List capabilitiesAsStrings() {
return capabilities;
}
/**
*
* The list of resources that generated the values in the Capabilities
response element.
*
*
* @return The list of resources that generated the values in the Capabilities
response element.
*/
public String capabilitiesReason() {
return capabilitiesReason;
}
/**
* Returns true if the ResourceTypes property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasResourceTypes() {
return resourceTypes != null && !(resourceTypes instanceof SdkAutoConstructList);
}
/**
*
* A list of all the template resource types that are defined in the template, such as
* AWS::EC2::Instance
, AWS::Dynamo::Table
, and Custom::MyCustomInstance
.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasResourceTypes()} to see if a value was sent in this field.
*
*
* @return A list of all the template resource types that are defined in the template, such as
* AWS::EC2::Instance
, AWS::Dynamo::Table
, and
* Custom::MyCustomInstance
.
*/
public List resourceTypes() {
return resourceTypes;
}
/**
*
* The AWS template format version, which identifies the capabilities of the template.
*
*
* @return The AWS template format version, which identifies the capabilities of the template.
*/
public String version() {
return version;
}
/**
*
* The value that is defined for the Metadata
property of the template.
*
*
* @return The value that is defined for the Metadata
property of the template.
*/
public String metadata() {
return metadata;
}
/**
* Returns true if the DeclaredTransforms property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public boolean hasDeclaredTransforms() {
return declaredTransforms != null && !(declaredTransforms instanceof SdkAutoConstructList);
}
/**
*
* A list of the transforms that are declared in the template.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasDeclaredTransforms()} to see if a value was sent in this field.
*
*
* @return A list of the transforms that are declared in the template.
*/
public List declaredTransforms() {
return declaredTransforms;
}
/**
* Returns true if the ResourceIdentifierSummaries property was specified by the sender (it may be empty), or false
* if the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the
* AWS service.
*/
public boolean hasResourceIdentifierSummaries() {
return resourceIdentifierSummaries != null && !(resourceIdentifierSummaries instanceof SdkAutoConstructList);
}
/**
*
* A list of resource identifier summaries that describe the target resources of an import operation and the
* properties you can provide during the import to identify the target resources. For example,
* BucketName
is a possible identifier property for an AWS::S3::Bucket
resource.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasResourceIdentifierSummaries()} to see if a value was sent in this field.
*
*
* @return A list of resource identifier summaries that describe the target resources of an import operation and the
* properties you can provide during the import to identify the target resources. For example,
* BucketName
is a possible identifier property for an AWS::S3::Bucket
resource.
*/
public List resourceIdentifierSummaries() {
return resourceIdentifierSummaries;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(parameters());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(capabilitiesAsStrings());
hashCode = 31 * hashCode + Objects.hashCode(capabilitiesReason());
hashCode = 31 * hashCode + Objects.hashCode(resourceTypes());
hashCode = 31 * hashCode + Objects.hashCode(version());
hashCode = 31 * hashCode + Objects.hashCode(metadata());
hashCode = 31 * hashCode + Objects.hashCode(declaredTransforms());
hashCode = 31 * hashCode + Objects.hashCode(resourceIdentifierSummaries());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetTemplateSummaryResponse)) {
return false;
}
GetTemplateSummaryResponse other = (GetTemplateSummaryResponse) obj;
return Objects.equals(parameters(), other.parameters()) && Objects.equals(description(), other.description())
&& Objects.equals(capabilitiesAsStrings(), other.capabilitiesAsStrings())
&& Objects.equals(capabilitiesReason(), other.capabilitiesReason())
&& Objects.equals(resourceTypes(), other.resourceTypes()) && Objects.equals(version(), other.version())
&& Objects.equals(metadata(), other.metadata())
&& Objects.equals(declaredTransforms(), other.declaredTransforms())
&& Objects.equals(resourceIdentifierSummaries(), other.resourceIdentifierSummaries());
}
/**
* 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.
*/
@Override
public String toString() {
return ToString.builder("GetTemplateSummaryResponse").add("Parameters", parameters()).add("Description", description())
.add("Capabilities", capabilitiesAsStrings()).add("CapabilitiesReason", capabilitiesReason())
.add("ResourceTypes", resourceTypes()).add("Version", version()).add("Metadata", metadata())
.add("DeclaredTransforms", declaredTransforms())
.add("ResourceIdentifierSummaries", resourceIdentifierSummaries()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Parameters":
return Optional.ofNullable(clazz.cast(parameters()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "Capabilities":
return Optional.ofNullable(clazz.cast(capabilitiesAsStrings()));
case "CapabilitiesReason":
return Optional.ofNullable(clazz.cast(capabilitiesReason()));
case "ResourceTypes":
return Optional.ofNullable(clazz.cast(resourceTypes()));
case "Version":
return Optional.ofNullable(clazz.cast(version()));
case "Metadata":
return Optional.ofNullable(clazz.cast(metadata()));
case "DeclaredTransforms":
return Optional.ofNullable(clazz.cast(declaredTransforms()));
case "ResourceIdentifierSummaries":
return Optional.ofNullable(clazz.cast(resourceIdentifierSummaries()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder capabilitiesWithStrings(Collection capabilities);
/**
*
* The capabilities found within the template. If your template contains IAM resources, you must specify the
* CAPABILITY_IAM or CAPABILITY_NAMED_IAM value for this parameter when you use the CreateStack or
* UpdateStack actions with your template; otherwise, those actions return an InsufficientCapabilities
* error.
*
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
*
*
* @param capabilities
* The capabilities found within the template. If your template contains IAM resources, you must specify
* the CAPABILITY_IAM or CAPABILITY_NAMED_IAM value for this parameter when you use the
* CreateStack or UpdateStack actions with your template; otherwise, those actions return
* an InsufficientCapabilities error.
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder capabilitiesWithStrings(String... capabilities);
/**
*
* The capabilities found within the template. If your template contains IAM resources, you must specify the
* CAPABILITY_IAM or CAPABILITY_NAMED_IAM value for this parameter when you use the CreateStack or
* UpdateStack actions with your template; otherwise, those actions return an InsufficientCapabilities
* error.
*
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
*
*
* @param capabilities
* The capabilities found within the template. If your template contains IAM resources, you must specify
* the CAPABILITY_IAM or CAPABILITY_NAMED_IAM value for this parameter when you use the
* CreateStack or UpdateStack actions with your template; otherwise, those actions return
* an InsufficientCapabilities error.
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder capabilities(Collection capabilities);
/**
*
* The capabilities found within the template. If your template contains IAM resources, you must specify the
* CAPABILITY_IAM or CAPABILITY_NAMED_IAM value for this parameter when you use the CreateStack or
* UpdateStack actions with your template; otherwise, those actions return an InsufficientCapabilities
* error.
*
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
*
*
* @param capabilities
* The capabilities found within the template. If your template contains IAM resources, you must specify
* the CAPABILITY_IAM or CAPABILITY_NAMED_IAM value for this parameter when you use the
* CreateStack or UpdateStack actions with your template; otherwise, those actions return
* an InsufficientCapabilities error.
*
* For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder capabilities(Capability... capabilities);
/**
*
* The list of resources that generated the values in the Capabilities
response element.
*
*
* @param capabilitiesReason
* The list of resources that generated the values in the Capabilities
response element.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder capabilitiesReason(String capabilitiesReason);
/**
*
* A list of all the template resource types that are defined in the template, such as
* AWS::EC2::Instance
, AWS::Dynamo::Table
, and Custom::MyCustomInstance
.
*
*
* @param resourceTypes
* A list of all the template resource types that are defined in the template, such as
* AWS::EC2::Instance
, AWS::Dynamo::Table
, and
* Custom::MyCustomInstance
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder resourceTypes(Collection resourceTypes);
/**
*
* A list of all the template resource types that are defined in the template, such as
* AWS::EC2::Instance
, AWS::Dynamo::Table
, and Custom::MyCustomInstance
.
*
*
* @param resourceTypes
* A list of all the template resource types that are defined in the template, such as
* AWS::EC2::Instance
, AWS::Dynamo::Table
, and
* Custom::MyCustomInstance
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder resourceTypes(String... resourceTypes);
/**
*
* The AWS template format version, which identifies the capabilities of the template.
*
*
* @param version
* The AWS template format version, which identifies the capabilities of the template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder version(String version);
/**
*
* The value that is defined for the Metadata
property of the template.
*
*
* @param metadata
* The value that is defined for the Metadata
property of the template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder metadata(String metadata);
/**
*
* A list of the transforms that are declared in the template.
*
*
* @param declaredTransforms
* A list of the transforms that are declared in the template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder declaredTransforms(Collection declaredTransforms);
/**
*
* A list of the transforms that are declared in the template.
*
*
* @param declaredTransforms
* A list of the transforms that are declared in the template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder declaredTransforms(String... declaredTransforms);
/**
*
* A list of resource identifier summaries that describe the target resources of an import operation and the
* properties you can provide during the import to identify the target resources. For example,
* BucketName
is a possible identifier property for an AWS::S3::Bucket
resource.
*
*
* @param resourceIdentifierSummaries
* A list of resource identifier summaries that describe the target resources of an import operation and
* the properties you can provide during the import to identify the target resources. For example,
* BucketName
is a possible identifier property for an AWS::S3::Bucket
* resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder resourceIdentifierSummaries(Collection resourceIdentifierSummaries);
/**
*
* A list of resource identifier summaries that describe the target resources of an import operation and the
* properties you can provide during the import to identify the target resources. For example,
* BucketName
is a possible identifier property for an AWS::S3::Bucket
resource.
*
*
* @param resourceIdentifierSummaries
* A list of resource identifier summaries that describe the target resources of an import operation and
* the properties you can provide during the import to identify the target resources. For example,
* BucketName
is a possible identifier property for an AWS::S3::Bucket
* resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder resourceIdentifierSummaries(ResourceIdentifierSummary... resourceIdentifierSummaries);
/**
*
* A list of resource identifier summaries that describe the target resources of an import operation and the
* properties you can provide during the import to identify the target resources. For example,
* BucketName
is a possible identifier property for an AWS::S3::Bucket
resource.
*
* This is a convenience that creates an instance of the {@link List.Builder}
* avoiding the need to create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called
* immediately and its result is passed to {@link #resourceIdentifierSummaries(List)}
* .
*
* @param resourceIdentifierSummaries
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #resourceIdentifierSummaries(List)
*/
Builder resourceIdentifierSummaries(Consumer... resourceIdentifierSummaries);
}
static final class BuilderImpl extends CloudFormationResponse.BuilderImpl implements Builder {
private List parameters = DefaultSdkAutoConstructList.getInstance();
private String description;
private List capabilities = DefaultSdkAutoConstructList.getInstance();
private String capabilitiesReason;
private List resourceTypes = DefaultSdkAutoConstructList.getInstance();
private String version;
private String metadata;
private List declaredTransforms = DefaultSdkAutoConstructList.getInstance();
private List resourceIdentifierSummaries = DefaultSdkAutoConstructList.getInstance();
private BuilderImpl() {
}
private BuilderImpl(GetTemplateSummaryResponse model) {
super(model);
parameters(model.parameters);
description(model.description);
capabilitiesWithStrings(model.capabilities);
capabilitiesReason(model.capabilitiesReason);
resourceTypes(model.resourceTypes);
version(model.version);
metadata(model.metadata);
declaredTransforms(model.declaredTransforms);
resourceIdentifierSummaries(model.resourceIdentifierSummaries);
}
public final Collection getParameters() {
return parameters != null ? parameters.stream().map(ParameterDeclaration::toBuilder).collect(Collectors.toList())
: null;
}
@Override
public final Builder parameters(Collection parameters) {
this.parameters = ParameterDeclarationsCopier.copy(parameters);
return this;
}
@Override
@SafeVarargs
public final Builder parameters(ParameterDeclaration... parameters) {
parameters(Arrays.asList(parameters));
return this;
}
@Override
@SafeVarargs
public final Builder parameters(Consumer... parameters) {
parameters(Stream.of(parameters).map(c -> ParameterDeclaration.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final void setParameters(Collection parameters) {
this.parameters = ParameterDeclarationsCopier.copyFromBuilder(parameters);
}
public final String getDescription() {
return description;
}
@Override
public final Builder description(String description) {
this.description = description;
return this;
}
public final void setDescription(String description) {
this.description = description;
}
public final Collection getCapabilities() {
return capabilities;
}
@Override
public final Builder capabilitiesWithStrings(Collection capabilities) {
this.capabilities = CapabilitiesCopier.copy(capabilities);
return this;
}
@Override
@SafeVarargs
public final Builder capabilitiesWithStrings(String... capabilities) {
capabilitiesWithStrings(Arrays.asList(capabilities));
return this;
}
@Override
public final Builder capabilities(Collection capabilities) {
this.capabilities = CapabilitiesCopier.copyEnumToString(capabilities);
return this;
}
@Override
@SafeVarargs
public final Builder capabilities(Capability... capabilities) {
capabilities(Arrays.asList(capabilities));
return this;
}
public final void setCapabilities(Collection capabilities) {
this.capabilities = CapabilitiesCopier.copy(capabilities);
}
public final String getCapabilitiesReason() {
return capabilitiesReason;
}
@Override
public final Builder capabilitiesReason(String capabilitiesReason) {
this.capabilitiesReason = capabilitiesReason;
return this;
}
public final void setCapabilitiesReason(String capabilitiesReason) {
this.capabilitiesReason = capabilitiesReason;
}
public final Collection getResourceTypes() {
return resourceTypes;
}
@Override
public final Builder resourceTypes(Collection resourceTypes) {
this.resourceTypes = ResourceTypesCopier.copy(resourceTypes);
return this;
}
@Override
@SafeVarargs
public final Builder resourceTypes(String... resourceTypes) {
resourceTypes(Arrays.asList(resourceTypes));
return this;
}
public final void setResourceTypes(Collection resourceTypes) {
this.resourceTypes = ResourceTypesCopier.copy(resourceTypes);
}
public final String getVersion() {
return version;
}
@Override
public final Builder version(String version) {
this.version = version;
return this;
}
public final void setVersion(String version) {
this.version = version;
}
public final String getMetadata() {
return metadata;
}
@Override
public final Builder metadata(String metadata) {
this.metadata = metadata;
return this;
}
public final void setMetadata(String metadata) {
this.metadata = metadata;
}
public final Collection getDeclaredTransforms() {
return declaredTransforms;
}
@Override
public final Builder declaredTransforms(Collection declaredTransforms) {
this.declaredTransforms = TransformsListCopier.copy(declaredTransforms);
return this;
}
@Override
@SafeVarargs
public final Builder declaredTransforms(String... declaredTransforms) {
declaredTransforms(Arrays.asList(declaredTransforms));
return this;
}
public final void setDeclaredTransforms(Collection declaredTransforms) {
this.declaredTransforms = TransformsListCopier.copy(declaredTransforms);
}
public final Collection getResourceIdentifierSummaries() {
return resourceIdentifierSummaries != null ? resourceIdentifierSummaries.stream()
.map(ResourceIdentifierSummary::toBuilder).collect(Collectors.toList()) : null;
}
@Override
public final Builder resourceIdentifierSummaries(Collection resourceIdentifierSummaries) {
this.resourceIdentifierSummaries = ResourceIdentifierSummariesCopier.copy(resourceIdentifierSummaries);
return this;
}
@Override
@SafeVarargs
public final Builder resourceIdentifierSummaries(ResourceIdentifierSummary... resourceIdentifierSummaries) {
resourceIdentifierSummaries(Arrays.asList(resourceIdentifierSummaries));
return this;
}
@Override
@SafeVarargs
public final Builder resourceIdentifierSummaries(
Consumer... resourceIdentifierSummaries) {
resourceIdentifierSummaries(Stream.of(resourceIdentifierSummaries)
.map(c -> ResourceIdentifierSummary.builder().applyMutation(c).build()).collect(Collectors.toList()));
return this;
}
public final void setResourceIdentifierSummaries(
Collection resourceIdentifierSummaries) {
this.resourceIdentifierSummaries = ResourceIdentifierSummariesCopier.copyFromBuilder(resourceIdentifierSummaries);
}
@Override
public GetTemplateSummaryResponse build() {
return new GetTemplateSummaryResponse(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}