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

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

Go to download

The AWS Java SDK for Proton module holds the client classes that are used for communicating with Proton.

The newest version!
/*
 * 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.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 detailed data about the current state of the service pipeline. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ServicePipelineState implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField SPEC_FIELD = SdkField. builder(MarshallingType.STRING).memberName("spec") .getter(getter(ServicePipelineState::spec)).setter(setter(Builder::spec)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("spec").build()).build(); private static final SdkField TEMPLATE_MAJOR_VERSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("templateMajorVersion").getter(getter(ServicePipelineState::templateMajorVersion)) .setter(setter(Builder::templateMajorVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("templateMajorVersion").build()) .build(); private static final SdkField TEMPLATE_MINOR_VERSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("templateMinorVersion").getter(getter(ServicePipelineState::templateMinorVersion)) .setter(setter(Builder::templateMinorVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("templateMinorVersion").build()) .build(); private static final SdkField TEMPLATE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("templateName").getter(getter(ServicePipelineState::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(SPEC_FIELD, TEMPLATE_MAJOR_VERSION_FIELD, TEMPLATE_MINOR_VERSION_FIELD, TEMPLATE_NAME_FIELD)); private static final long serialVersionUID = 1L; private final String spec; private final String templateMajorVersion; private final String templateMinorVersion; private final String templateName; private ServicePipelineState(BuilderImpl builder) { this.spec = builder.spec; this.templateMajorVersion = builder.templateMajorVersion; this.templateMinorVersion = builder.templateMinorVersion; this.templateName = builder.templateName; } /** *

* The service spec that was used to create the service pipeline. *

* * @return The service spec that was used to create the service pipeline. */ public final String spec() { return spec; } /** *

* The major version of the service template that was used to create the service pipeline. *

* * @return The major version of the service template that was used to create the service pipeline. */ public final String templateMajorVersion() { return templateMajorVersion; } /** *

* The minor version of the service template that was used to create the service pipeline. *

* * @return The minor version of the service template that was used to create the service pipeline. */ public final String templateMinorVersion() { return templateMinorVersion; } /** *

* The name of the service template that was used to create the service pipeline. *

* * @return The name of the service template that was used to create the service pipeline. */ 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(spec()); hashCode = 31 * hashCode + Objects.hashCode(templateMajorVersion()); hashCode = 31 * hashCode + Objects.hashCode(templateMinorVersion()); 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 ServicePipelineState)) { return false; } ServicePipelineState other = (ServicePipelineState) obj; return Objects.equals(spec(), other.spec()) && Objects.equals(templateMajorVersion(), other.templateMajorVersion()) && Objects.equals(templateMinorVersion(), other.templateMinorVersion()) && 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("ServicePipelineState").add("Spec", spec() == null ? null : "*** Sensitive Data Redacted ***") .add("TemplateMajorVersion", templateMajorVersion()).add("TemplateMinorVersion", templateMinorVersion()) .add("TemplateName", templateName()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "spec": return Optional.ofNullable(clazz.cast(spec())); case "templateMajorVersion": return Optional.ofNullable(clazz.cast(templateMajorVersion())); case "templateMinorVersion": return Optional.ofNullable(clazz.cast(templateMinorVersion())); 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((ServicePipelineState) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The service spec that was used to create the service pipeline. *

* * @param spec * The service spec that was used to create the service pipeline. * @return Returns a reference to this object so that method calls can be chained together. */ Builder spec(String spec); /** *

* The major version of the service template that was used to create the service pipeline. *

* * @param templateMajorVersion * The major version of the service template that was used to create the service pipeline. * @return Returns a reference to this object so that method calls can be chained together. */ Builder templateMajorVersion(String templateMajorVersion); /** *

* The minor version of the service template that was used to create the service pipeline. *

* * @param templateMinorVersion * The minor version of the service template that was used to create the service pipeline. * @return Returns a reference to this object so that method calls can be chained together. */ Builder templateMinorVersion(String templateMinorVersion); /** *

* The name of the service template that was used to create the service pipeline. *

* * @param templateName * The name of the service template that was used to create the service pipeline. * @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 spec; private String templateMajorVersion; private String templateMinorVersion; private String templateName; private BuilderImpl() { } private BuilderImpl(ServicePipelineState model) { spec(model.spec); templateMajorVersion(model.templateMajorVersion); templateMinorVersion(model.templateMinorVersion); templateName(model.templateName); } public final String getSpec() { return spec; } public final void setSpec(String spec) { this.spec = spec; } @Override public final Builder spec(String spec) { this.spec = spec; return this; } public final String getTemplateMajorVersion() { return templateMajorVersion; } public final void setTemplateMajorVersion(String templateMajorVersion) { this.templateMajorVersion = templateMajorVersion; } @Override public final Builder templateMajorVersion(String templateMajorVersion) { this.templateMajorVersion = templateMajorVersion; return this; } public final String getTemplateMinorVersion() { return templateMinorVersion; } public final void setTemplateMinorVersion(String templateMinorVersion) { this.templateMinorVersion = templateMinorVersion; } @Override public final Builder templateMinorVersion(String templateMinorVersion) { this.templateMinorVersion = templateMinorVersion; 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 ServicePipelineState build() { return new ServicePipelineState(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy