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

software.amazon.awssdk.services.codebuild.model.ProjectSource Maven / Gradle / Ivy

Go to download

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

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.codebuild.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.Consumer;
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;

/**
 * 

* Information about the build input source code for the build project. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ProjectSource implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("type") .getter(getter(ProjectSource::typeAsString)).setter(setter(Builder::type)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("type").build()).build(); private static final SdkField LOCATION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("location").getter(getter(ProjectSource::location)).setter(setter(Builder::location)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("location").build()).build(); private static final SdkField GIT_CLONE_DEPTH_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("gitCloneDepth").getter(getter(ProjectSource::gitCloneDepth)).setter(setter(Builder::gitCloneDepth)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("gitCloneDepth").build()).build(); private static final SdkField GIT_SUBMODULES_CONFIG_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("gitSubmodulesConfig") .getter(getter(ProjectSource::gitSubmodulesConfig)).setter(setter(Builder::gitSubmodulesConfig)) .constructor(GitSubmodulesConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("gitSubmodulesConfig").build()) .build(); private static final SdkField BUILDSPEC_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("buildspec").getter(getter(ProjectSource::buildspec)).setter(setter(Builder::buildspec)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("buildspec").build()).build(); private static final SdkField AUTH_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("auth").getter(getter(ProjectSource::auth)).setter(setter(Builder::auth)) .constructor(SourceAuth::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("auth").build()).build(); private static final SdkField REPORT_BUILD_STATUS_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("reportBuildStatus").getter(getter(ProjectSource::reportBuildStatus)) .setter(setter(Builder::reportBuildStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("reportBuildStatus").build()).build(); private static final SdkField BUILD_STATUS_CONFIG_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("buildStatusConfig") .getter(getter(ProjectSource::buildStatusConfig)).setter(setter(Builder::buildStatusConfig)) .constructor(BuildStatusConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("buildStatusConfig").build()).build(); private static final SdkField INSECURE_SSL_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("insecureSsl").getter(getter(ProjectSource::insecureSsl)).setter(setter(Builder::insecureSsl)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("insecureSsl").build()).build(); private static final SdkField SOURCE_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("sourceIdentifier").getter(getter(ProjectSource::sourceIdentifier)) .setter(setter(Builder::sourceIdentifier)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sourceIdentifier").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TYPE_FIELD, LOCATION_FIELD, GIT_CLONE_DEPTH_FIELD, GIT_SUBMODULES_CONFIG_FIELD, BUILDSPEC_FIELD, AUTH_FIELD, REPORT_BUILD_STATUS_FIELD, BUILD_STATUS_CONFIG_FIELD, INSECURE_SSL_FIELD, SOURCE_IDENTIFIER_FIELD)); private static final long serialVersionUID = 1L; private final String type; private final String location; private final Integer gitCloneDepth; private final GitSubmodulesConfig gitSubmodulesConfig; private final String buildspec; private final SourceAuth auth; private final Boolean reportBuildStatus; private final BuildStatusConfig buildStatusConfig; private final Boolean insecureSsl; private final String sourceIdentifier; private ProjectSource(BuilderImpl builder) { this.type = builder.type; this.location = builder.location; this.gitCloneDepth = builder.gitCloneDepth; this.gitSubmodulesConfig = builder.gitSubmodulesConfig; this.buildspec = builder.buildspec; this.auth = builder.auth; this.reportBuildStatus = builder.reportBuildStatus; this.buildStatusConfig = builder.buildStatusConfig; this.insecureSsl = builder.insecureSsl; this.sourceIdentifier = builder.sourceIdentifier; } /** *

* The type of repository that contains the source code to be built. Valid values include: *

*
    *
  • *

    * BITBUCKET: The source code is in a Bitbucket repository. *

    *
  • *
  • *

    * CODECOMMIT: The source code is in an CodeCommit repository. *

    *
  • *
  • *

    * CODEPIPELINE: The source code settings are specified in the source action of a pipeline in * CodePipeline. *

    *
  • *
  • *

    * GITHUB: The source code is in a GitHub or GitHub Enterprise Cloud repository. *

    *
  • *
  • *

    * GITHUB_ENTERPRISE: The source code is in a GitHub Enterprise Server repository. *

    *
  • *
  • *

    * NO_SOURCE: The project does not have input source code. *

    *
  • *
  • *

    * S3: The source code is in an Amazon S3 bucket. *

    *
  • *
*

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

* * @return The type of repository that contains the source code to be built. Valid values include:

*
    *
  • *

    * BITBUCKET: The source code is in a Bitbucket repository. *

    *
  • *
  • *

    * CODECOMMIT: The source code is in an CodeCommit repository. *

    *
  • *
  • *

    * CODEPIPELINE: The source code settings are specified in the source action of a pipeline in * CodePipeline. *

    *
  • *
  • *

    * GITHUB: The source code is in a GitHub or GitHub Enterprise Cloud repository. *

    *
  • *
  • *

    * GITHUB_ENTERPRISE: The source code is in a GitHub Enterprise Server repository. *

    *
  • *
  • *

    * NO_SOURCE: The project does not have input source code. *

    *
  • *
  • *

    * S3: The source code is in an Amazon S3 bucket. *

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

    * The type of repository that contains the source code to be built. Valid values include: *

    *
      *
    • *

      * BITBUCKET: The source code is in a Bitbucket repository. *

      *
    • *
    • *

      * CODECOMMIT: The source code is in an CodeCommit repository. *

      *
    • *
    • *

      * CODEPIPELINE: The source code settings are specified in the source action of a pipeline in * CodePipeline. *

      *
    • *
    • *

      * GITHUB: The source code is in a GitHub or GitHub Enterprise Cloud repository. *

      *
    • *
    • *

      * GITHUB_ENTERPRISE: The source code is in a GitHub Enterprise Server repository. *

      *
    • *
    • *

      * NO_SOURCE: The project does not have input source code. *

      *
    • *
    • *

      * S3: The source code is in an Amazon S3 bucket. *

      *
    • *
    *

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

    * * @return The type of repository that contains the source code to be built. Valid values include:

    *
      *
    • *

      * BITBUCKET: The source code is in a Bitbucket repository. *

      *
    • *
    • *

      * CODECOMMIT: The source code is in an CodeCommit repository. *

      *
    • *
    • *

      * CODEPIPELINE: The source code settings are specified in the source action of a pipeline in * CodePipeline. *

      *
    • *
    • *

      * GITHUB: The source code is in a GitHub or GitHub Enterprise Cloud repository. *

      *
    • *
    • *

      * GITHUB_ENTERPRISE: The source code is in a GitHub Enterprise Server repository. *

      *
    • *
    • *

      * NO_SOURCE: The project does not have input source code. *

      *
    • *
    • *

      * S3: The source code is in an Amazon S3 bucket. *

      *
    • * @see SourceType */ public final String typeAsString() { return type; } /** *

      * Information about the location of the source code to be built. Valid values include: *

      *
        *
      • *

        * For source code settings that are specified in the source action of a pipeline in CodePipeline, * location should not be specified. If it is specified, CodePipeline ignores it. This is because * CodePipeline uses the settings in a pipeline's source action instead of this value. *

        *
      • *
      • *

        * For source code in an CodeCommit repository, the HTTPS clone URL to the repository that contains the source code * and the buildspec file (for example, * https://git-codecommit.<region-ID>.amazonaws.com/v1/repos/<repo-name>). *

        *
      • *
      • *

        * For source code in an Amazon S3 input bucket, one of the following. *

        *
          *
        • *

          * The path to the ZIP file that contains the source code (for example, * <bucket-name>/<path>/<object-name>.zip). *

          *
        • *
        • *

          * The path to the folder that contains the source code (for example, * <bucket-name>/<path-to-source-code>/<folder>/). *

          *
        • *
        *
      • *
      • *

        * For source code in a GitHub repository, the HTTPS clone URL to the repository that contains the source and the * buildspec file. You must connect your Amazon Web Services account to your GitHub account. Use the CodeBuild * console to start creating a build project. When you use the console to connect (or reconnect) with GitHub, on the * GitHub Authorize application page, for Organization access, choose Request access next to * each repository you want to allow CodeBuild to have access to, and then choose Authorize application. * (After you have connected to your GitHub account, you do not need to finish creating the build project. You can * leave the CodeBuild console.) To instruct CodeBuild to use this connection, in the source object, * set the auth object's type value to OAUTH. *

        *
      • *
      • *

        * For source code in a Bitbucket repository, the HTTPS clone URL to the repository that contains the source and the * buildspec file. You must connect your Amazon Web Services account to your Bitbucket account. Use the CodeBuild * console to start creating a build project. When you use the console to connect (or reconnect) with Bitbucket, on * the Bitbucket Confirm access to your account page, choose Grant access. (After you have connected * to your Bitbucket account, you do not need to finish creating the build project. You can leave the CodeBuild * console.) To instruct CodeBuild to use this connection, in the source object, set the * auth object's type value to OAUTH. *

        *
      • *
      *

      * If you specify CODEPIPELINE for the Type property, don't specify this property. For all * of the other types, you must specify Location. *

      * * @return Information about the location of the source code to be built. Valid values include:

      *
        *
      • *

        * For source code settings that are specified in the source action of a pipeline in CodePipeline, * location should not be specified. If it is specified, CodePipeline ignores it. This is * because CodePipeline uses the settings in a pipeline's source action instead of this value. *

        *
      • *
      • *

        * For source code in an CodeCommit repository, the HTTPS clone URL to the repository that contains the * source code and the buildspec file (for example, * https://git-codecommit.<region-ID>.amazonaws.com/v1/repos/<repo-name>). *

        *
      • *
      • *

        * For source code in an Amazon S3 input bucket, one of the following. *

        *
          *
        • *

          * The path to the ZIP file that contains the source code (for example, * <bucket-name>/<path>/<object-name>.zip). *

          *
        • *
        • *

          * The path to the folder that contains the source code (for example, * <bucket-name>/<path-to-source-code>/<folder>/). *

          *
        • *
        *
      • *
      • *

        * For source code in a GitHub repository, the HTTPS clone URL to the repository that contains the source * and the buildspec file. You must connect your Amazon Web Services account to your GitHub account. Use the * CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) * with GitHub, on the GitHub Authorize application page, for Organization access, choose * Request access next to each repository you want to allow CodeBuild to have access to, and then * choose Authorize application. (After you have connected to your GitHub account, you do not need to * finish creating the build project. You can leave the CodeBuild console.) To instruct CodeBuild to use * this connection, in the source object, set the auth object's type * value to OAUTH. *

        *
      • *
      • *

        * For source code in a Bitbucket repository, the HTTPS clone URL to the repository that contains the source * and the buildspec file. You must connect your Amazon Web Services account to your Bitbucket account. Use * the CodeBuild console to start creating a build project. When you use the console to connect (or * reconnect) with Bitbucket, on the Bitbucket Confirm access to your account page, choose Grant * access. (After you have connected to your Bitbucket account, you do not need to finish creating the * build project. You can leave the CodeBuild console.) To instruct CodeBuild to use this connection, in the * source object, set the auth object's type value to * OAUTH. *

        *
      • *
      *

      * If you specify CODEPIPELINE for the Type property, don't specify this property. * For all of the other types, you must specify Location. */ public final String location() { return location; } /** *

      * Information about the Git clone depth for the build project. *

      * * @return Information about the Git clone depth for the build project. */ public final Integer gitCloneDepth() { return gitCloneDepth; } /** *

      * Information about the Git submodules configuration for the build project. *

      * * @return Information about the Git submodules configuration for the build project. */ public final GitSubmodulesConfig gitSubmodulesConfig() { return gitSubmodulesConfig; } /** *

      * The buildspec file declaration to use for the builds in this build project. *

      *

      * If this value is set, it can be either an inline buildspec definition, the path to an alternate buildspec file * relative to the value of the built-in CODEBUILD_SRC_DIR environment variable, or the path to an S3 * bucket. The bucket must be in the same Amazon Web Services Region as the build project. Specify the buildspec * file using its ARN (for example, arn:aws:s3:::my-codebuild-sample2/buildspec.yml). If this value is * not provided or is set to an empty string, the source code must contain a buildspec file in its root directory. * For more information, see Buildspec File Name and Storage Location. *

      * * @return The buildspec file declaration to use for the builds in this build project.

      *

      * If this value is set, it can be either an inline buildspec definition, the path to an alternate buildspec * file relative to the value of the built-in CODEBUILD_SRC_DIR environment variable, or the * path to an S3 bucket. The bucket must be in the same Amazon Web Services Region as the build project. * Specify the buildspec file using its ARN (for example, * arn:aws:s3:::my-codebuild-sample2/buildspec.yml). If this value is not provided or is set to * an empty string, the source code must contain a buildspec file in its root directory. For more * information, see Buildspec File Name and Storage Location. */ public final String buildspec() { return buildspec; } /** *

      * Information about the authorization settings for CodeBuild to access the source code to be built. *

      *

      * This information is for the CodeBuild console's use only. Your code should not get or set this information * directly. *

      * * @return Information about the authorization settings for CodeBuild to access the source code to be built.

      *

      * This information is for the CodeBuild console's use only. Your code should not get or set this * information directly. */ public final SourceAuth auth() { return auth; } /** *

      * Set to true to report the status of a build's start and finish to your source provider. This option is valid only * when your source provider is GitHub, GitHub Enterprise, or Bitbucket. If this is set and you use a different * source provider, an invalidInputException is thrown. *

      *

      * To be able to report the build status to the source provider, the user associated with the source provider must * have write access to the repo. If the user does not have write access, the build status cannot be updated. For * more information, see Source * provider access in the CodeBuild User Guide. *

      *

      * The status of a build triggered by a webhook is always reported to your source provider. *

      *

      * If your project's builds are triggered by a webhook, you must push a new commit to the repo for a change to this * property to take effect. *

      * * @return Set to true to report the status of a build's start and finish to your source provider. This option is * valid only when your source provider is GitHub, GitHub Enterprise, or Bitbucket. If this is set and you * use a different source provider, an invalidInputException is thrown.

      *

      * To be able to report the build status to the source provider, the user associated with the source * provider must have write access to the repo. If the user does not have write access, the build status * cannot be updated. For more information, see Source provider * access in the CodeBuild User Guide. *

      *

      * The status of a build triggered by a webhook is always reported to your source provider. *

      *

      * If your project's builds are triggered by a webhook, you must push a new commit to the repo for a change * to this property to take effect. */ public final Boolean reportBuildStatus() { return reportBuildStatus; } /** *

      * Contains information that defines how the build project reports the build status to the source provider. This * option is only used when the source provider is GITHUB, GITHUB_ENTERPRISE, or * BITBUCKET. *

      * * @return Contains information that defines how the build project reports the build status to the source provider. * This option is only used when the source provider is GITHUB, GITHUB_ENTERPRISE, * or BITBUCKET. */ public final BuildStatusConfig buildStatusConfig() { return buildStatusConfig; } /** *

      * Enable this flag to ignore SSL warnings while connecting to the project source code. *

      * * @return Enable this flag to ignore SSL warnings while connecting to the project source code. */ public final Boolean insecureSsl() { return insecureSsl; } /** *

      * An identifier for this project source. The identifier can only contain alphanumeric characters and underscores, * and must be less than 128 characters in length. *

      * * @return An identifier for this project source. The identifier can only contain alphanumeric characters and * underscores, and must be less than 128 characters in length. */ public final String sourceIdentifier() { return sourceIdentifier; } @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(typeAsString()); hashCode = 31 * hashCode + Objects.hashCode(location()); hashCode = 31 * hashCode + Objects.hashCode(gitCloneDepth()); hashCode = 31 * hashCode + Objects.hashCode(gitSubmodulesConfig()); hashCode = 31 * hashCode + Objects.hashCode(buildspec()); hashCode = 31 * hashCode + Objects.hashCode(auth()); hashCode = 31 * hashCode + Objects.hashCode(reportBuildStatus()); hashCode = 31 * hashCode + Objects.hashCode(buildStatusConfig()); hashCode = 31 * hashCode + Objects.hashCode(insecureSsl()); hashCode = 31 * hashCode + Objects.hashCode(sourceIdentifier()); 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 ProjectSource)) { return false; } ProjectSource other = (ProjectSource) obj; return Objects.equals(typeAsString(), other.typeAsString()) && Objects.equals(location(), other.location()) && Objects.equals(gitCloneDepth(), other.gitCloneDepth()) && Objects.equals(gitSubmodulesConfig(), other.gitSubmodulesConfig()) && Objects.equals(buildspec(), other.buildspec()) && Objects.equals(auth(), other.auth()) && Objects.equals(reportBuildStatus(), other.reportBuildStatus()) && Objects.equals(buildStatusConfig(), other.buildStatusConfig()) && Objects.equals(insecureSsl(), other.insecureSsl()) && Objects.equals(sourceIdentifier(), other.sourceIdentifier()); } /** * 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("ProjectSource").add("Type", typeAsString()).add("Location", location()) .add("GitCloneDepth", gitCloneDepth()).add("GitSubmodulesConfig", gitSubmodulesConfig()) .add("Buildspec", buildspec()).add("Auth", auth()).add("ReportBuildStatus", reportBuildStatus()) .add("BuildStatusConfig", buildStatusConfig()).add("InsecureSsl", insecureSsl()) .add("SourceIdentifier", sourceIdentifier()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "type": return Optional.ofNullable(clazz.cast(typeAsString())); case "location": return Optional.ofNullable(clazz.cast(location())); case "gitCloneDepth": return Optional.ofNullable(clazz.cast(gitCloneDepth())); case "gitSubmodulesConfig": return Optional.ofNullable(clazz.cast(gitSubmodulesConfig())); case "buildspec": return Optional.ofNullable(clazz.cast(buildspec())); case "auth": return Optional.ofNullable(clazz.cast(auth())); case "reportBuildStatus": return Optional.ofNullable(clazz.cast(reportBuildStatus())); case "buildStatusConfig": return Optional.ofNullable(clazz.cast(buildStatusConfig())); case "insecureSsl": return Optional.ofNullable(clazz.cast(insecureSsl())); case "sourceIdentifier": return Optional.ofNullable(clazz.cast(sourceIdentifier())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ProjectSource) 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 that contains the source code to be built. Valid values include: *

      *
        *
      • *

        * BITBUCKET: The source code is in a Bitbucket repository. *

        *
      • *
      • *

        * CODECOMMIT: The source code is in an CodeCommit repository. *

        *
      • *
      • *

        * CODEPIPELINE: The source code settings are specified in the source action of a pipeline in * CodePipeline. *

        *
      • *
      • *

        * GITHUB: The source code is in a GitHub or GitHub Enterprise Cloud repository. *

        *
      • *
      • *

        * GITHUB_ENTERPRISE: The source code is in a GitHub Enterprise Server repository. *

        *
      • *
      • *

        * NO_SOURCE: The project does not have input source code. *

        *
      • *
      • *

        * S3: The source code is in an Amazon S3 bucket. *

        *
      • *
      * * @param type * The type of repository that contains the source code to be built. Valid values include:

      *
        *
      • *

        * BITBUCKET: The source code is in a Bitbucket repository. *

        *
      • *
      • *

        * CODECOMMIT: The source code is in an CodeCommit repository. *

        *
      • *
      • *

        * CODEPIPELINE: The source code settings are specified in the source action of a pipeline * in CodePipeline. *

        *
      • *
      • *

        * GITHUB: The source code is in a GitHub or GitHub Enterprise Cloud repository. *

        *
      • *
      • *

        * GITHUB_ENTERPRISE: The source code is in a GitHub Enterprise Server repository. *

        *
      • *
      • *

        * NO_SOURCE: The project does not have input source code. *

        *
      • *
      • *

        * S3: The source code is in an Amazon S3 bucket. *

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

        * The type of repository that contains the source code to be built. Valid values include: *

        *
          *
        • *

          * BITBUCKET: The source code is in a Bitbucket repository. *

          *
        • *
        • *

          * CODECOMMIT: The source code is in an CodeCommit repository. *

          *
        • *
        • *

          * CODEPIPELINE: The source code settings are specified in the source action of a pipeline in * CodePipeline. *

          *
        • *
        • *

          * GITHUB: The source code is in a GitHub or GitHub Enterprise Cloud repository. *

          *
        • *
        • *

          * GITHUB_ENTERPRISE: The source code is in a GitHub Enterprise Server repository. *

          *
        • *
        • *

          * NO_SOURCE: The project does not have input source code. *

          *
        • *
        • *

          * S3: The source code is in an Amazon S3 bucket. *

          *
        • *
        * * @param type * The type of repository that contains the source code to be built. Valid values include:

        *
          *
        • *

          * BITBUCKET: The source code is in a Bitbucket repository. *

          *
        • *
        • *

          * CODECOMMIT: The source code is in an CodeCommit repository. *

          *
        • *
        • *

          * CODEPIPELINE: The source code settings are specified in the source action of a pipeline * in CodePipeline. *

          *
        • *
        • *

          * GITHUB: The source code is in a GitHub or GitHub Enterprise Cloud repository. *

          *
        • *
        • *

          * GITHUB_ENTERPRISE: The source code is in a GitHub Enterprise Server repository. *

          *
        • *
        • *

          * NO_SOURCE: The project does not have input source code. *

          *
        • *
        • *

          * S3: The source code is in an Amazon S3 bucket. *

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

          * Information about the location of the source code to be built. Valid values include: *

          *
            *
          • *

            * For source code settings that are specified in the source action of a pipeline in CodePipeline, * location should not be specified. If it is specified, CodePipeline ignores it. This is because * CodePipeline uses the settings in a pipeline's source action instead of this value. *

            *
          • *
          • *

            * For source code in an CodeCommit repository, the HTTPS clone URL to the repository that contains the source * code and the buildspec file (for example, * https://git-codecommit.<region-ID>.amazonaws.com/v1/repos/<repo-name>). *

            *
          • *
          • *

            * For source code in an Amazon S3 input bucket, one of the following. *

            *
              *
            • *

              * The path to the ZIP file that contains the source code (for example, * <bucket-name>/<path>/<object-name>.zip). *

              *
            • *
            • *

              * The path to the folder that contains the source code (for example, * <bucket-name>/<path-to-source-code>/<folder>/). *

              *
            • *
            *
          • *
          • *

            * For source code in a GitHub repository, the HTTPS clone URL to the repository that contains the source and * the buildspec file. You must connect your Amazon Web Services account to your GitHub account. Use the * CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with * GitHub, on the GitHub Authorize application page, for Organization access, choose Request * access next to each repository you want to allow CodeBuild to have access to, and then choose * Authorize application. (After you have connected to your GitHub account, you do not need to finish * creating the build project. You can leave the CodeBuild console.) To instruct CodeBuild to use this * connection, in the source object, set the auth object's type value to * OAUTH. *

            *
          • *
          • *

            * For source code in a Bitbucket repository, the HTTPS clone URL to the repository that contains the source and * the buildspec file. You must connect your Amazon Web Services account to your Bitbucket account. Use the * CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with * Bitbucket, on the Bitbucket Confirm access to your account page, choose Grant access. (After * you have connected to your Bitbucket account, you do not need to finish creating the build project. You can * leave the CodeBuild console.) To instruct CodeBuild to use this connection, in the source * object, set the auth object's type value to OAUTH. *

            *
          • *
          *

          * If you specify CODEPIPELINE for the Type property, don't specify this property. For * all of the other types, you must specify Location. *

          * * @param location * Information about the location of the source code to be built. Valid values include:

          *
            *
          • *

            * For source code settings that are specified in the source action of a pipeline in CodePipeline, * location should not be specified. If it is specified, CodePipeline ignores it. This is * because CodePipeline uses the settings in a pipeline's source action instead of this value. *

            *
          • *
          • *

            * For source code in an CodeCommit repository, the HTTPS clone URL to the repository that contains the * source code and the buildspec file (for example, * https://git-codecommit.<region-ID>.amazonaws.com/v1/repos/<repo-name>). *

            *
          • *
          • *

            * For source code in an Amazon S3 input bucket, one of the following. *

            *
              *
            • *

              * The path to the ZIP file that contains the source code (for example, * <bucket-name>/<path>/<object-name>.zip). *

              *
            • *
            • *

              * The path to the folder that contains the source code (for example, * <bucket-name>/<path-to-source-code>/<folder>/). *

              *
            • *
            *
          • *
          • *

            * For source code in a GitHub repository, the HTTPS clone URL to the repository that contains the source * and the buildspec file. You must connect your Amazon Web Services account to your GitHub account. Use * the CodeBuild console to start creating a build project. When you use the console to connect (or * reconnect) with GitHub, on the GitHub Authorize application page, for Organization * access, choose Request access next to each repository you want to allow CodeBuild to have * access to, and then choose Authorize application. (After you have connected to your GitHub * account, you do not need to finish creating the build project. You can leave the CodeBuild console.) * To instruct CodeBuild to use this connection, in the source object, set the * auth object's type value to OAUTH. *

            *
          • *
          • *

            * For source code in a Bitbucket repository, the HTTPS clone URL to the repository that contains the * source and the buildspec file. You must connect your Amazon Web Services account to your Bitbucket * account. Use the CodeBuild console to start creating a build project. When you use the console to * connect (or reconnect) with Bitbucket, on the Bitbucket Confirm access to your account page, * choose Grant access. (After you have connected to your Bitbucket account, you do not need to * finish creating the build project. You can leave the CodeBuild console.) To instruct CodeBuild to use * this connection, in the source object, set the auth object's * type value to OAUTH. *

            *
          • *
          *

          * If you specify CODEPIPELINE for the Type property, don't specify this * property. For all of the other types, you must specify Location. * @return Returns a reference to this object so that method calls can be chained together. */ Builder location(String location); /** *

          * Information about the Git clone depth for the build project. *

          * * @param gitCloneDepth * Information about the Git clone depth for the build project. * @return Returns a reference to this object so that method calls can be chained together. */ Builder gitCloneDepth(Integer gitCloneDepth); /** *

          * Information about the Git submodules configuration for the build project. *

          * * @param gitSubmodulesConfig * Information about the Git submodules configuration for the build project. * @return Returns a reference to this object so that method calls can be chained together. */ Builder gitSubmodulesConfig(GitSubmodulesConfig gitSubmodulesConfig); /** *

          * Information about the Git submodules configuration for the build project. *

          * This is a convenience method that creates an instance of the {@link GitSubmodulesConfig.Builder} avoiding the * need to create one manually via {@link GitSubmodulesConfig#builder()}. * * When the {@link Consumer} completes, {@link GitSubmodulesConfig.Builder#build()} is called immediately and * its result is passed to {@link #gitSubmodulesConfig(GitSubmodulesConfig)}. * * @param gitSubmodulesConfig * a consumer that will call methods on {@link GitSubmodulesConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #gitSubmodulesConfig(GitSubmodulesConfig) */ default Builder gitSubmodulesConfig(Consumer gitSubmodulesConfig) { return gitSubmodulesConfig(GitSubmodulesConfig.builder().applyMutation(gitSubmodulesConfig).build()); } /** *

          * The buildspec file declaration to use for the builds in this build project. *

          *

          * If this value is set, it can be either an inline buildspec definition, the path to an alternate buildspec * file relative to the value of the built-in CODEBUILD_SRC_DIR environment variable, or the path * to an S3 bucket. The bucket must be in the same Amazon Web Services Region as the build project. Specify the * buildspec file using its ARN (for example, arn:aws:s3:::my-codebuild-sample2/buildspec.yml). If * this value is not provided or is set to an empty string, the source code must contain a buildspec file in its * root directory. For more information, see Buildspec File Name and Storage Location. *

          * * @param buildspec * The buildspec file declaration to use for the builds in this build project.

          *

          * If this value is set, it can be either an inline buildspec definition, the path to an alternate * buildspec file relative to the value of the built-in CODEBUILD_SRC_DIR environment * variable, or the path to an S3 bucket. The bucket must be in the same Amazon Web Services Region as * the build project. Specify the buildspec file using its ARN (for example, * arn:aws:s3:::my-codebuild-sample2/buildspec.yml). If this value is not provided or is set * to an empty string, the source code must contain a buildspec file in its root directory. For more * information, see Buildspec File Name and Storage Location. * @return Returns a reference to this object so that method calls can be chained together. */ Builder buildspec(String buildspec); /** *

          * Information about the authorization settings for CodeBuild to access the source code to be built. *

          *

          * This information is for the CodeBuild console's use only. Your code should not get or set this information * directly. *

          * * @param auth * Information about the authorization settings for CodeBuild to access the source code to be built.

          *

          * This information is for the CodeBuild console's use only. Your code should not get or set this * information directly. * @return Returns a reference to this object so that method calls can be chained together. */ Builder auth(SourceAuth auth); /** *

          * Information about the authorization settings for CodeBuild to access the source code to be built. *

          *

          * This information is for the CodeBuild console's use only. Your code should not get or set this information * directly. *

          * This is a convenience method that creates an instance of the {@link SourceAuth.Builder} avoiding the need to * create one manually via {@link SourceAuth#builder()}. * * When the {@link Consumer} completes, {@link SourceAuth.Builder#build()} is called immediately and its result * is passed to {@link #auth(SourceAuth)}. * * @param auth * a consumer that will call methods on {@link SourceAuth.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #auth(SourceAuth) */ default Builder auth(Consumer auth) { return auth(SourceAuth.builder().applyMutation(auth).build()); } /** *

          * Set to true to report the status of a build's start and finish to your source provider. This option is valid * only when your source provider is GitHub, GitHub Enterprise, or Bitbucket. If this is set and you use a * different source provider, an invalidInputException is thrown. *

          *

          * To be able to report the build status to the source provider, the user associated with the source provider * must have write access to the repo. If the user does not have write access, the build status cannot be * updated. For more information, see Source provider access * in the CodeBuild User Guide. *

          *

          * The status of a build triggered by a webhook is always reported to your source provider. *

          *

          * If your project's builds are triggered by a webhook, you must push a new commit to the repo for a change to * this property to take effect. *

          * * @param reportBuildStatus * Set to true to report the status of a build's start and finish to your source provider. This option is * valid only when your source provider is GitHub, GitHub Enterprise, or Bitbucket. If this is set and * you use a different source provider, an invalidInputException is thrown.

          *

          * To be able to report the build status to the source provider, the user associated with the source * provider must have write access to the repo. If the user does not have write access, the build status * cannot be updated. For more information, see Source provider * access in the CodeBuild User Guide. *

          *

          * The status of a build triggered by a webhook is always reported to your source provider. *

          *

          * If your project's builds are triggered by a webhook, you must push a new commit to the repo for a * change to this property to take effect. * @return Returns a reference to this object so that method calls can be chained together. */ Builder reportBuildStatus(Boolean reportBuildStatus); /** *

          * Contains information that defines how the build project reports the build status to the source provider. This * option is only used when the source provider is GITHUB, GITHUB_ENTERPRISE, or * BITBUCKET. *

          * * @param buildStatusConfig * Contains information that defines how the build project reports the build status to the source * provider. This option is only used when the source provider is GITHUB, * GITHUB_ENTERPRISE, or BITBUCKET. * @return Returns a reference to this object so that method calls can be chained together. */ Builder buildStatusConfig(BuildStatusConfig buildStatusConfig); /** *

          * Contains information that defines how the build project reports the build status to the source provider. This * option is only used when the source provider is GITHUB, GITHUB_ENTERPRISE, or * BITBUCKET. *

          * This is a convenience method that creates an instance of the {@link BuildStatusConfig.Builder} avoiding the * need to create one manually via {@link BuildStatusConfig#builder()}. * * When the {@link Consumer} completes, {@link BuildStatusConfig.Builder#build()} is called immediately and its * result is passed to {@link #buildStatusConfig(BuildStatusConfig)}. * * @param buildStatusConfig * a consumer that will call methods on {@link BuildStatusConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #buildStatusConfig(BuildStatusConfig) */ default Builder buildStatusConfig(Consumer buildStatusConfig) { return buildStatusConfig(BuildStatusConfig.builder().applyMutation(buildStatusConfig).build()); } /** *

          * Enable this flag to ignore SSL warnings while connecting to the project source code. *

          * * @param insecureSsl * Enable this flag to ignore SSL warnings while connecting to the project source code. * @return Returns a reference to this object so that method calls can be chained together. */ Builder insecureSsl(Boolean insecureSsl); /** *

          * An identifier for this project source. The identifier can only contain alphanumeric characters and * underscores, and must be less than 128 characters in length. *

          * * @param sourceIdentifier * An identifier for this project source. The identifier can only contain alphanumeric characters and * underscores, and must be less than 128 characters in length. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceIdentifier(String sourceIdentifier); } static final class BuilderImpl implements Builder { private String type; private String location; private Integer gitCloneDepth; private GitSubmodulesConfig gitSubmodulesConfig; private String buildspec; private SourceAuth auth; private Boolean reportBuildStatus; private BuildStatusConfig buildStatusConfig; private Boolean insecureSsl; private String sourceIdentifier; private BuilderImpl() { } private BuilderImpl(ProjectSource model) { type(model.type); location(model.location); gitCloneDepth(model.gitCloneDepth); gitSubmodulesConfig(model.gitSubmodulesConfig); buildspec(model.buildspec); auth(model.auth); reportBuildStatus(model.reportBuildStatus); buildStatusConfig(model.buildStatusConfig); insecureSsl(model.insecureSsl); sourceIdentifier(model.sourceIdentifier); } public final String getType() { return type; } public final void setType(String type) { this.type = type; } @Override public final Builder type(String type) { this.type = type; return this; } @Override public final Builder type(SourceType type) { this.type(type == null ? null : type.toString()); return this; } public final String getLocation() { return location; } public final void setLocation(String location) { this.location = location; } @Override public final Builder location(String location) { this.location = location; return this; } public final Integer getGitCloneDepth() { return gitCloneDepth; } public final void setGitCloneDepth(Integer gitCloneDepth) { this.gitCloneDepth = gitCloneDepth; } @Override public final Builder gitCloneDepth(Integer gitCloneDepth) { this.gitCloneDepth = gitCloneDepth; return this; } public final GitSubmodulesConfig.Builder getGitSubmodulesConfig() { return gitSubmodulesConfig != null ? gitSubmodulesConfig.toBuilder() : null; } public final void setGitSubmodulesConfig(GitSubmodulesConfig.BuilderImpl gitSubmodulesConfig) { this.gitSubmodulesConfig = gitSubmodulesConfig != null ? gitSubmodulesConfig.build() : null; } @Override public final Builder gitSubmodulesConfig(GitSubmodulesConfig gitSubmodulesConfig) { this.gitSubmodulesConfig = gitSubmodulesConfig; return this; } public final String getBuildspec() { return buildspec; } public final void setBuildspec(String buildspec) { this.buildspec = buildspec; } @Override public final Builder buildspec(String buildspec) { this.buildspec = buildspec; return this; } public final SourceAuth.Builder getAuth() { return auth != null ? auth.toBuilder() : null; } public final void setAuth(SourceAuth.BuilderImpl auth) { this.auth = auth != null ? auth.build() : null; } @Override public final Builder auth(SourceAuth auth) { this.auth = auth; return this; } public final Boolean getReportBuildStatus() { return reportBuildStatus; } public final void setReportBuildStatus(Boolean reportBuildStatus) { this.reportBuildStatus = reportBuildStatus; } @Override public final Builder reportBuildStatus(Boolean reportBuildStatus) { this.reportBuildStatus = reportBuildStatus; return this; } public final BuildStatusConfig.Builder getBuildStatusConfig() { return buildStatusConfig != null ? buildStatusConfig.toBuilder() : null; } public final void setBuildStatusConfig(BuildStatusConfig.BuilderImpl buildStatusConfig) { this.buildStatusConfig = buildStatusConfig != null ? buildStatusConfig.build() : null; } @Override public final Builder buildStatusConfig(BuildStatusConfig buildStatusConfig) { this.buildStatusConfig = buildStatusConfig; return this; } public final Boolean getInsecureSsl() { return insecureSsl; } public final void setInsecureSsl(Boolean insecureSsl) { this.insecureSsl = insecureSsl; } @Override public final Builder insecureSsl(Boolean insecureSsl) { this.insecureSsl = insecureSsl; return this; } public final String getSourceIdentifier() { return sourceIdentifier; } public final void setSourceIdentifier(String sourceIdentifier) { this.sourceIdentifier = sourceIdentifier; } @Override public final Builder sourceIdentifier(String sourceIdentifier) { this.sourceIdentifier = sourceIdentifier; return this; } @Override public ProjectSource build() { return new ProjectSource(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy