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

software.amazon.awssdk.services.elasticbeanstalk.model.SourceBuildInformation Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Elastic Beanstalk module holds the client classes that are used for communicating with AWS Elastic Beanstalk Service

There is a newer version: 2.29.39
Show 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.elasticbeanstalk.model;

import java.beans.Transient;
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;

/**
 * 

* Location of the source code for an application version. *

*/ @Generated("software.amazon.awssdk:codegen") public final class SourceBuildInformation implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField SOURCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SourceType").getter(getter(SourceBuildInformation::sourceTypeAsString)) .setter(setter(Builder::sourceType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceType").build()).build(); private static final SdkField SOURCE_REPOSITORY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SourceRepository").getter(getter(SourceBuildInformation::sourceRepositoryAsString)) .setter(setter(Builder::sourceRepository)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceRepository").build()).build(); private static final SdkField SOURCE_LOCATION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SourceLocation").getter(getter(SourceBuildInformation::sourceLocation)) .setter(setter(Builder::sourceLocation)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceLocation").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SOURCE_TYPE_FIELD, SOURCE_REPOSITORY_FIELD, SOURCE_LOCATION_FIELD)); private static final long serialVersionUID = 1L; private final String sourceType; private final String sourceRepository; private final String sourceLocation; private SourceBuildInformation(BuilderImpl builder) { this.sourceType = builder.sourceType; this.sourceRepository = builder.sourceRepository; this.sourceLocation = builder.sourceLocation; } /** *

* The type of repository. *

*
    *
  • *

    * Git *

    *
  • *
  • *

    * Zip *

    *
  • *
*

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

* * @return The type of repository.

*
    *
  • *

    * Git *

    *
  • *
  • *

    * Zip *

    *
  • * @see SourceType */ public final SourceType sourceType() { return SourceType.fromValue(sourceType); } /** *

    * The type of repository. *

    *
      *
    • *

      * Git *

      *
    • *
    • *

      * Zip *

      *
    • *
    *

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

    * * @return The type of repository.

    *
      *
    • *

      * Git *

      *
    • *
    • *

      * Zip *

      *
    • * @see SourceType */ public final String sourceTypeAsString() { return sourceType; } /** *

      * Location where the repository is stored. *

      *
        *
      • *

        * CodeCommit *

        *
      • *
      • *

        * S3 *

        *
      • *
      *

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

      * * @return Location where the repository is stored.

      *
        *
      • *

        * CodeCommit *

        *
      • *
      • *

        * S3 *

        *
      • * @see SourceRepository */ public final SourceRepository sourceRepository() { return SourceRepository.fromValue(sourceRepository); } /** *

        * Location where the repository is stored. *

        *
          *
        • *

          * CodeCommit *

          *
        • *
        • *

          * S3 *

          *
        • *
        *

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

        * * @return Location where the repository is stored.

        *
          *
        • *

          * CodeCommit *

          *
        • *
        • *

          * S3 *

          *
        • * @see SourceRepository */ public final String sourceRepositoryAsString() { return sourceRepository; } /** *

          * The location of the source code, as a formatted string, depending on the value of SourceRepository *

          *
            *
          • *

            * For CodeCommit, the format is the repository name and commit ID, separated by a forward slash. For * example, my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a. *

            *
          • *
          • *

            * For S3, the format is the S3 bucket name and object key, separated by a forward slash. For example, * my-s3-bucket/Folders/my-source-file. *

            *
          • *
          * * @return The location of the source code, as a formatted string, depending on the value of * SourceRepository

          *
            *
          • *

            * For CodeCommit, the format is the repository name and commit ID, separated by a forward * slash. For example, my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a. *

            *
          • *
          • *

            * For S3, the format is the S3 bucket name and object key, separated by a forward slash. For * example, my-s3-bucket/Folders/my-source-file. *

            *
          • */ public final String sourceLocation() { return sourceLocation; } @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(sourceTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(sourceRepositoryAsString()); hashCode = 31 * hashCode + Objects.hashCode(sourceLocation()); 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 SourceBuildInformation)) { return false; } SourceBuildInformation other = (SourceBuildInformation) obj; return Objects.equals(sourceTypeAsString(), other.sourceTypeAsString()) && Objects.equals(sourceRepositoryAsString(), other.sourceRepositoryAsString()) && Objects.equals(sourceLocation(), other.sourceLocation()); } /** * 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("SourceBuildInformation").add("SourceType", sourceTypeAsString()) .add("SourceRepository", sourceRepositoryAsString()).add("SourceLocation", sourceLocation()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "SourceType": return Optional.ofNullable(clazz.cast(sourceTypeAsString())); case "SourceRepository": return Optional.ofNullable(clazz.cast(sourceRepositoryAsString())); case "SourceLocation": return Optional.ofNullable(clazz.cast(sourceLocation())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((SourceBuildInformation) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

            * The type of repository. *

            *
              *
            • *

              * Git *

              *
            • *
            • *

              * Zip *

              *
            • *
            * * @param sourceType * The type of repository.

            *
              *
            • *

              * Git *

              *
            • *
            • *

              * Zip *

              *
            • * @see SourceType * @return Returns a reference to this object so that method calls can be chained together. * @see SourceType */ Builder sourceType(String sourceType); /** *

              * The type of repository. *

              *
                *
              • *

                * Git *

                *
              • *
              • *

                * Zip *

                *
              • *
              * * @param sourceType * The type of repository.

              *
                *
              • *

                * Git *

                *
              • *
              • *

                * Zip *

                *
              • * @see SourceType * @return Returns a reference to this object so that method calls can be chained together. * @see SourceType */ Builder sourceType(SourceType sourceType); /** *

                * Location where the repository is stored. *

                *
                  *
                • *

                  * CodeCommit *

                  *
                • *
                • *

                  * S3 *

                  *
                • *
                * * @param sourceRepository * Location where the repository is stored.

                *
                  *
                • *

                  * CodeCommit *

                  *
                • *
                • *

                  * S3 *

                  *
                • * @see SourceRepository * @return Returns a reference to this object so that method calls can be chained together. * @see SourceRepository */ Builder sourceRepository(String sourceRepository); /** *

                  * Location where the repository is stored. *

                  *
                    *
                  • *

                    * CodeCommit *

                    *
                  • *
                  • *

                    * S3 *

                    *
                  • *
                  * * @param sourceRepository * Location where the repository is stored.

                  *
                    *
                  • *

                    * CodeCommit *

                    *
                  • *
                  • *

                    * S3 *

                    *
                  • * @see SourceRepository * @return Returns a reference to this object so that method calls can be chained together. * @see SourceRepository */ Builder sourceRepository(SourceRepository sourceRepository); /** *

                    * The location of the source code, as a formatted string, depending on the value of * SourceRepository *

                    *
                      *
                    • *

                      * For CodeCommit, the format is the repository name and commit ID, separated by a forward slash. * For example, my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a. *

                      *
                    • *
                    • *

                      * For S3, the format is the S3 bucket name and object key, separated by a forward slash. For * example, my-s3-bucket/Folders/my-source-file. *

                      *
                    • *
                    * * @param sourceLocation * The location of the source code, as a formatted string, depending on the value of * SourceRepository

                    *
                      *
                    • *

                      * For CodeCommit, the format is the repository name and commit ID, separated by a forward * slash. For example, my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a. *

                      *
                    • *
                    • *

                      * For S3, the format is the S3 bucket name and object key, separated by a forward slash. * For example, my-s3-bucket/Folders/my-source-file. *

                      *
                    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceLocation(String sourceLocation); } static final class BuilderImpl implements Builder { private String sourceType; private String sourceRepository; private String sourceLocation; private BuilderImpl() { } private BuilderImpl(SourceBuildInformation model) { sourceType(model.sourceType); sourceRepository(model.sourceRepository); sourceLocation(model.sourceLocation); } public final String getSourceType() { return sourceType; } public final void setSourceType(String sourceType) { this.sourceType = sourceType; } @Override @Transient public final Builder sourceType(String sourceType) { this.sourceType = sourceType; return this; } @Override @Transient public final Builder sourceType(SourceType sourceType) { this.sourceType(sourceType == null ? null : sourceType.toString()); return this; } public final String getSourceRepository() { return sourceRepository; } public final void setSourceRepository(String sourceRepository) { this.sourceRepository = sourceRepository; } @Override @Transient public final Builder sourceRepository(String sourceRepository) { this.sourceRepository = sourceRepository; return this; } @Override @Transient public final Builder sourceRepository(SourceRepository sourceRepository) { this.sourceRepository(sourceRepository == null ? null : sourceRepository.toString()); return this; } public final String getSourceLocation() { return sourceLocation; } public final void setSourceLocation(String sourceLocation) { this.sourceLocation = sourceLocation; } @Override @Transient public final Builder sourceLocation(String sourceLocation) { this.sourceLocation = sourceLocation; return this; } @Override public SourceBuildInformation build() { return new SourceBuildInformation(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy