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

software.amazon.awssdk.services.proton.model.EnvironmentTemplateVersion Maven / Gradle / Ivy

/*
 * 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.proton.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
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.Function;
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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* The environment template version data. *

*/ @Generated("software.amazon.awssdk:codegen") public final class EnvironmentTemplateVersion implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn") .getter(getter(EnvironmentTemplateVersion::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build(); private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("createdAt").getter(getter(EnvironmentTemplateVersion::createdAt)).setter(setter(Builder::createdAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdAt").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("description").getter(getter(EnvironmentTemplateVersion::description)) .setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build(); private static final SdkField LAST_MODIFIED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("lastModifiedAt").getter(getter(EnvironmentTemplateVersion::lastModifiedAt)) .setter(setter(Builder::lastModifiedAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastModifiedAt").build()).build(); private static final SdkField MAJOR_VERSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("majorVersion").getter(getter(EnvironmentTemplateVersion::majorVersion)) .setter(setter(Builder::majorVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("majorVersion").build()).build(); private static final SdkField MINOR_VERSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("minorVersion").getter(getter(EnvironmentTemplateVersion::minorVersion)) .setter(setter(Builder::minorVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("minorVersion").build()).build(); private static final SdkField RECOMMENDED_MINOR_VERSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("recommendedMinorVersion").getter(getter(EnvironmentTemplateVersion::recommendedMinorVersion)) .setter(setter(Builder::recommendedMinorVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("recommendedMinorVersion").build()) .build(); private static final SdkField SCHEMA_FIELD = SdkField. builder(MarshallingType.STRING).memberName("schema") .getter(getter(EnvironmentTemplateVersion::schema)).setter(setter(Builder::schema)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("schema").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status") .getter(getter(EnvironmentTemplateVersion::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final SdkField STATUS_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("statusMessage").getter(getter(EnvironmentTemplateVersion::statusMessage)) .setter(setter(Builder::statusMessage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("statusMessage").build()).build(); private static final SdkField TEMPLATE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("templateName").getter(getter(EnvironmentTemplateVersion::templateName)) .setter(setter(Builder::templateName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("templateName").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, CREATED_AT_FIELD, DESCRIPTION_FIELD, LAST_MODIFIED_AT_FIELD, MAJOR_VERSION_FIELD, MINOR_VERSION_FIELD, RECOMMENDED_MINOR_VERSION_FIELD, SCHEMA_FIELD, STATUS_FIELD, STATUS_MESSAGE_FIELD, TEMPLATE_NAME_FIELD)); private static final long serialVersionUID = 1L; private final String arn; private final Instant createdAt; private final String description; private final Instant lastModifiedAt; private final String majorVersion; private final String minorVersion; private final String recommendedMinorVersion; private final String schema; private final String status; private final String statusMessage; private final String templateName; private EnvironmentTemplateVersion(BuilderImpl builder) { this.arn = builder.arn; this.createdAt = builder.createdAt; this.description = builder.description; this.lastModifiedAt = builder.lastModifiedAt; this.majorVersion = builder.majorVersion; this.minorVersion = builder.minorVersion; this.recommendedMinorVersion = builder.recommendedMinorVersion; this.schema = builder.schema; this.status = builder.status; this.statusMessage = builder.statusMessage; this.templateName = builder.templateName; } /** *

* The Amazon Resource Name (ARN) of the version of an environment template. *

* * @return The Amazon Resource Name (ARN) of the version of an environment template. */ public final String arn() { return arn; } /** *

* The time when the version of an environment template was created. *

* * @return The time when the version of an environment template was created. */ public final Instant createdAt() { return createdAt; } /** *

* A description of the minor version of an environment template. *

* * @return A description of the minor version of an environment template. */ public final String description() { return description; } /** *

* The time when the version of an environment template was last modified. *

* * @return The time when the version of an environment template was last modified. */ public final Instant lastModifiedAt() { return lastModifiedAt; } /** *

* The latest major version that's associated with the version of an environment template. *

* * @return The latest major version that's associated with the version of an environment template. */ public final String majorVersion() { return majorVersion; } /** *

* The minor version of an environment template. *

* * @return The minor version of an environment template. */ public final String minorVersion() { return minorVersion; } /** *

* The recommended minor version of the environment template. *

* * @return The recommended minor version of the environment template. */ public final String recommendedMinorVersion() { return recommendedMinorVersion; } /** *

* The schema of the version of an environment template. *

* * @return The schema of the version of an environment template. */ public final String schema() { return schema; } /** *

* The status of the version of an environment template. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link TemplateVersionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #statusAsString}. *

* * @return The status of the version of an environment template. * @see TemplateVersionStatus */ public final TemplateVersionStatus status() { return TemplateVersionStatus.fromValue(status); } /** *

* The status of the version of an environment template. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link TemplateVersionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #statusAsString}. *

* * @return The status of the version of an environment template. * @see TemplateVersionStatus */ public final String statusAsString() { return status; } /** *

* The status message of the version of an environment template. *

* * @return The status message of the version of an environment template. */ public final String statusMessage() { return statusMessage; } /** *

* The name of the version of an environment template. *

* * @return The name of the version of an environment template. */ public final String templateName() { return templateName; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(createdAt()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedAt()); hashCode = 31 * hashCode + Objects.hashCode(majorVersion()); hashCode = 31 * hashCode + Objects.hashCode(minorVersion()); hashCode = 31 * hashCode + Objects.hashCode(recommendedMinorVersion()); hashCode = 31 * hashCode + Objects.hashCode(schema()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusMessage()); hashCode = 31 * hashCode + Objects.hashCode(templateName()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof EnvironmentTemplateVersion)) { return false; } EnvironmentTemplateVersion other = (EnvironmentTemplateVersion) obj; return Objects.equals(arn(), other.arn()) && Objects.equals(createdAt(), other.createdAt()) && Objects.equals(description(), other.description()) && Objects.equals(lastModifiedAt(), other.lastModifiedAt()) && Objects.equals(majorVersion(), other.majorVersion()) && Objects.equals(minorVersion(), other.minorVersion()) && Objects.equals(recommendedMinorVersion(), other.recommendedMinorVersion()) && Objects.equals(schema(), other.schema()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(statusMessage(), other.statusMessage()) && Objects.equals(templateName(), other.templateName()); } /** * 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 final String toString() { return ToString.builder("EnvironmentTemplateVersion").add("Arn", arn()).add("CreatedAt", createdAt()) .add("Description", description() == null ? null : "*** Sensitive Data Redacted ***") .add("LastModifiedAt", lastModifiedAt()).add("MajorVersion", majorVersion()).add("MinorVersion", minorVersion()) .add("RecommendedMinorVersion", recommendedMinorVersion()) .add("Schema", schema() == null ? null : "*** Sensitive Data Redacted ***").add("Status", statusAsString()) .add("StatusMessage", statusMessage() == null ? null : "*** Sensitive Data Redacted ***") .add("TemplateName", templateName()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "arn": return Optional.ofNullable(clazz.cast(arn())); case "createdAt": return Optional.ofNullable(clazz.cast(createdAt())); case "description": return Optional.ofNullable(clazz.cast(description())); case "lastModifiedAt": return Optional.ofNullable(clazz.cast(lastModifiedAt())); case "majorVersion": return Optional.ofNullable(clazz.cast(majorVersion())); case "minorVersion": return Optional.ofNullable(clazz.cast(minorVersion())); case "recommendedMinorVersion": return Optional.ofNullable(clazz.cast(recommendedMinorVersion())); case "schema": return Optional.ofNullable(clazz.cast(schema())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "statusMessage": return Optional.ofNullable(clazz.cast(statusMessage())); case "templateName": return Optional.ofNullable(clazz.cast(templateName())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((EnvironmentTemplateVersion) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The Amazon Resource Name (ARN) of the version of an environment template. *

* * @param arn * The Amazon Resource Name (ARN) of the version of an environment template. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

* The time when the version of an environment template was created. *

* * @param createdAt * The time when the version of an environment template was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdAt(Instant createdAt); /** *

* A description of the minor version of an environment template. *

* * @param description * A description of the minor version of an environment template. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The time when the version of an environment template was last modified. *

* * @param lastModifiedAt * The time when the version of an environment template was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedAt(Instant lastModifiedAt); /** *

* The latest major version that's associated with the version of an environment template. *

* * @param majorVersion * The latest major version that's associated with the version of an environment template. * @return Returns a reference to this object so that method calls can be chained together. */ Builder majorVersion(String majorVersion); /** *

* The minor version of an environment template. *

* * @param minorVersion * The minor version of an environment template. * @return Returns a reference to this object so that method calls can be chained together. */ Builder minorVersion(String minorVersion); /** *

* The recommended minor version of the environment template. *

* * @param recommendedMinorVersion * The recommended minor version of the environment template. * @return Returns a reference to this object so that method calls can be chained together. */ Builder recommendedMinorVersion(String recommendedMinorVersion); /** *

* The schema of the version of an environment template. *

* * @param schema * The schema of the version of an environment template. * @return Returns a reference to this object so that method calls can be chained together. */ Builder schema(String schema); /** *

* The status of the version of an environment template. *

* * @param status * The status of the version of an environment template. * @see TemplateVersionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see TemplateVersionStatus */ Builder status(String status); /** *

* The status of the version of an environment template. *

* * @param status * The status of the version of an environment template. * @see TemplateVersionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see TemplateVersionStatus */ Builder status(TemplateVersionStatus status); /** *

* The status message of the version of an environment template. *

* * @param statusMessage * The status message of the version of an environment template. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statusMessage(String statusMessage); /** *

* The name of the version of an environment template. *

* * @param templateName * The name of the version of an environment template. * @return Returns a reference to this object so that method calls can be chained together. */ Builder templateName(String templateName); } static final class BuilderImpl implements Builder { private String arn; private Instant createdAt; private String description; private Instant lastModifiedAt; private String majorVersion; private String minorVersion; private String recommendedMinorVersion; private String schema; private String status; private String statusMessage; private String templateName; private BuilderImpl() { } private BuilderImpl(EnvironmentTemplateVersion model) { arn(model.arn); createdAt(model.createdAt); description(model.description); lastModifiedAt(model.lastModifiedAt); majorVersion(model.majorVersion); minorVersion(model.minorVersion); recommendedMinorVersion(model.recommendedMinorVersion); schema(model.schema); status(model.status); statusMessage(model.statusMessage); templateName(model.templateName); } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final Instant getCreatedAt() { return createdAt; } public final void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; } @Override public final Builder createdAt(Instant createdAt) { this.createdAt = createdAt; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final Instant getLastModifiedAt() { return lastModifiedAt; } public final void setLastModifiedAt(Instant lastModifiedAt) { this.lastModifiedAt = lastModifiedAt; } @Override public final Builder lastModifiedAt(Instant lastModifiedAt) { this.lastModifiedAt = lastModifiedAt; return this; } public final String getMajorVersion() { return majorVersion; } public final void setMajorVersion(String majorVersion) { this.majorVersion = majorVersion; } @Override public final Builder majorVersion(String majorVersion) { this.majorVersion = majorVersion; return this; } public final String getMinorVersion() { return minorVersion; } public final void setMinorVersion(String minorVersion) { this.minorVersion = minorVersion; } @Override public final Builder minorVersion(String minorVersion) { this.minorVersion = minorVersion; return this; } public final String getRecommendedMinorVersion() { return recommendedMinorVersion; } public final void setRecommendedMinorVersion(String recommendedMinorVersion) { this.recommendedMinorVersion = recommendedMinorVersion; } @Override public final Builder recommendedMinorVersion(String recommendedMinorVersion) { this.recommendedMinorVersion = recommendedMinorVersion; return this; } public final String getSchema() { return schema; } public final void setSchema(String schema) { this.schema = schema; } @Override public final Builder schema(String schema) { this.schema = schema; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(TemplateVersionStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getStatusMessage() { return statusMessage; } public final void setStatusMessage(String statusMessage) { this.statusMessage = statusMessage; } @Override public final Builder statusMessage(String statusMessage) { this.statusMessage = statusMessage; return this; } public final String getTemplateName() { return templateName; } public final void setTemplateName(String templateName) { this.templateName = templateName; } @Override public final Builder templateName(String templateName) { this.templateName = templateName; return this; } @Override public EnvironmentTemplateVersion build() { return new EnvironmentTemplateVersion(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy