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

software.amazon.awssdk.services.codebuild.model.CreateProjectRequest 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.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class CreateProjectRequest extends CodeBuildRequest implements
        ToCopyableBuilder {
    private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
            .getter(getter(CreateProjectRequest::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("description").getter(getter(CreateProjectRequest::description)).setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();

    private static final SdkField SOURCE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("source").getter(getter(CreateProjectRequest::source)).setter(setter(Builder::source))
            .constructor(ProjectSource::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("source").build()).build();

    private static final SdkField> SECONDARY_SOURCES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("secondarySources")
            .getter(getter(CreateProjectRequest::secondarySources))
            .setter(setter(Builder::secondarySources))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("secondarySources").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(ProjectSource::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField SOURCE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("sourceVersion").getter(getter(CreateProjectRequest::sourceVersion))
            .setter(setter(Builder::sourceVersion))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sourceVersion").build()).build();

    private static final SdkField> SECONDARY_SOURCE_VERSIONS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("secondarySourceVersions")
            .getter(getter(CreateProjectRequest::secondarySourceVersions))
            .setter(setter(Builder::secondarySourceVersions))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("secondarySourceVersions").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(ProjectSourceVersion::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField ARTIFACTS_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("artifacts")
            .getter(getter(CreateProjectRequest::artifacts)).setter(setter(Builder::artifacts))
            .constructor(ProjectArtifacts::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("artifacts").build()).build();

    private static final SdkField> SECONDARY_ARTIFACTS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("secondaryArtifacts")
            .getter(getter(CreateProjectRequest::secondaryArtifacts))
            .setter(setter(Builder::secondaryArtifacts))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("secondaryArtifacts").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(ProjectArtifacts::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField CACHE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("cache").getter(getter(CreateProjectRequest::cache)).setter(setter(Builder::cache))
            .constructor(ProjectCache::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("cache").build()).build();

    private static final SdkField ENVIRONMENT_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("environment")
            .getter(getter(CreateProjectRequest::environment)).setter(setter(Builder::environment))
            .constructor(ProjectEnvironment::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("environment").build()).build();

    private static final SdkField SERVICE_ROLE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("serviceRole").getter(getter(CreateProjectRequest::serviceRole)).setter(setter(Builder::serviceRole))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceRole").build()).build();

    private static final SdkField TIMEOUT_IN_MINUTES_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("timeoutInMinutes").getter(getter(CreateProjectRequest::timeoutInMinutes))
            .setter(setter(Builder::timeoutInMinutes))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("timeoutInMinutes").build()).build();

    private static final SdkField QUEUED_TIMEOUT_IN_MINUTES_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("queuedTimeoutInMinutes").getter(getter(CreateProjectRequest::queuedTimeoutInMinutes))
            .setter(setter(Builder::queuedTimeoutInMinutes))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("queuedTimeoutInMinutes").build())
            .build();

    private static final SdkField ENCRYPTION_KEY_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("encryptionKey").getter(getter(CreateProjectRequest::encryptionKey))
            .setter(setter(Builder::encryptionKey))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("encryptionKey").build()).build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("tags")
            .getter(getter(CreateProjectRequest::tags))
            .setter(setter(Builder::tags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(Tag::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField VPC_CONFIG_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("vpcConfig").getter(getter(CreateProjectRequest::vpcConfig)).setter(setter(Builder::vpcConfig))
            .constructor(VpcConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("vpcConfig").build()).build();

    private static final SdkField BADGE_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
            .memberName("badgeEnabled").getter(getter(CreateProjectRequest::badgeEnabled)).setter(setter(Builder::badgeEnabled))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("badgeEnabled").build()).build();

    private static final SdkField LOGS_CONFIG_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("logsConfig").getter(getter(CreateProjectRequest::logsConfig)).setter(setter(Builder::logsConfig))
            .constructor(LogsConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("logsConfig").build()).build();

    private static final SdkField> FILE_SYSTEM_LOCATIONS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("fileSystemLocations")
            .getter(getter(CreateProjectRequest::fileSystemLocations))
            .setter(setter(Builder::fileSystemLocations))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("fileSystemLocations").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(ProjectFileSystemLocation::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField BUILD_BATCH_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("buildBatchConfig")
            .getter(getter(CreateProjectRequest::buildBatchConfig)).setter(setter(Builder::buildBatchConfig))
            .constructor(ProjectBuildBatchConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("buildBatchConfig").build()).build();

    private static final SdkField CONCURRENT_BUILD_LIMIT_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("concurrentBuildLimit").getter(getter(CreateProjectRequest::concurrentBuildLimit))
            .setter(setter(Builder::concurrentBuildLimit))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("concurrentBuildLimit").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, DESCRIPTION_FIELD,
            SOURCE_FIELD, SECONDARY_SOURCES_FIELD, SOURCE_VERSION_FIELD, SECONDARY_SOURCE_VERSIONS_FIELD, ARTIFACTS_FIELD,
            SECONDARY_ARTIFACTS_FIELD, CACHE_FIELD, ENVIRONMENT_FIELD, SERVICE_ROLE_FIELD, TIMEOUT_IN_MINUTES_FIELD,
            QUEUED_TIMEOUT_IN_MINUTES_FIELD, ENCRYPTION_KEY_FIELD, TAGS_FIELD, VPC_CONFIG_FIELD, BADGE_ENABLED_FIELD,
            LOGS_CONFIG_FIELD, FILE_SYSTEM_LOCATIONS_FIELD, BUILD_BATCH_CONFIG_FIELD, CONCURRENT_BUILD_LIMIT_FIELD));

    private final String name;

    private final String description;

    private final ProjectSource source;

    private final List secondarySources;

    private final String sourceVersion;

    private final List secondarySourceVersions;

    private final ProjectArtifacts artifacts;

    private final List secondaryArtifacts;

    private final ProjectCache cache;

    private final ProjectEnvironment environment;

    private final String serviceRole;

    private final Integer timeoutInMinutes;

    private final Integer queuedTimeoutInMinutes;

    private final String encryptionKey;

    private final List tags;

    private final VpcConfig vpcConfig;

    private final Boolean badgeEnabled;

    private final LogsConfig logsConfig;

    private final List fileSystemLocations;

    private final ProjectBuildBatchConfig buildBatchConfig;

    private final Integer concurrentBuildLimit;

    private CreateProjectRequest(BuilderImpl builder) {
        super(builder);
        this.name = builder.name;
        this.description = builder.description;
        this.source = builder.source;
        this.secondarySources = builder.secondarySources;
        this.sourceVersion = builder.sourceVersion;
        this.secondarySourceVersions = builder.secondarySourceVersions;
        this.artifacts = builder.artifacts;
        this.secondaryArtifacts = builder.secondaryArtifacts;
        this.cache = builder.cache;
        this.environment = builder.environment;
        this.serviceRole = builder.serviceRole;
        this.timeoutInMinutes = builder.timeoutInMinutes;
        this.queuedTimeoutInMinutes = builder.queuedTimeoutInMinutes;
        this.encryptionKey = builder.encryptionKey;
        this.tags = builder.tags;
        this.vpcConfig = builder.vpcConfig;
        this.badgeEnabled = builder.badgeEnabled;
        this.logsConfig = builder.logsConfig;
        this.fileSystemLocations = builder.fileSystemLocations;
        this.buildBatchConfig = builder.buildBatchConfig;
        this.concurrentBuildLimit = builder.concurrentBuildLimit;
    }

    /**
     * 

* The name of the build project. *

* * @return The name of the build project. */ public final String name() { return name; } /** *

* A description that makes the build project easy to identify. *

* * @return A description that makes the build project easy to identify. */ public final String description() { return description; } /** *

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

* * @return Information about the build input source code for the build project. */ public final ProjectSource source() { return source; } /** * For responses, this returns true if the service returned a value for the SecondarySources property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasSecondarySources() { return secondarySources != null && !(secondarySources instanceof SdkAutoConstructList); } /** *

* An array of ProjectSource objects. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasSecondarySources} method. *

* * @return An array of ProjectSource objects. */ public final List secondarySources() { return secondarySources; } /** *

* A version of the build input to be built for this project. If not specified, the latest version is used. If * specified, it must be one of: *

*
    *
  • *

    * For CodeCommit: the commit ID, branch, or Git tag to use. *

    *
  • *
  • *

    * For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the * source code you want to build. If a pull request ID is specified, it must use the format * pr/pull-request-ID (for example pr/25). If a branch name is specified, the branch's * HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used. *

    *
  • *
  • *

    * For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you * want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default * branch's HEAD commit ID is used. *

    *
  • *
  • *

    * For Amazon S3: the version ID of the object that represents the build input ZIP file to use. *

    *
  • *
*

* If sourceVersion is specified at the build level, then that version takes precedence over this * sourceVersion (at the project level). *

*

* For more information, see Source Version Sample * with CodeBuild in the CodeBuild User Guide. *

* * @return A version of the build input to be built for this project. If not specified, the latest version is used. * If specified, it must be one of:

*
    *
  • *

    * For CodeCommit: the commit ID, branch, or Git tag to use. *

    *
  • *
  • *

    * For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of * the source code you want to build. If a pull request ID is specified, it must use the format * pr/pull-request-ID (for example pr/25). If a branch name is specified, the * branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used. *

    *
  • *
  • *

    * For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code * you want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, * the default branch's HEAD commit ID is used. *

    *
  • *
  • *

    * For Amazon S3: the version ID of the object that represents the build input ZIP file to use. *

    *
  • *
*

* If sourceVersion is specified at the build level, then that version takes precedence over * this sourceVersion (at the project level). *

*

* For more information, see Source Version * Sample with CodeBuild in the CodeBuild User Guide. */ public final String sourceVersion() { return sourceVersion; } /** * For responses, this returns true if the service returned a value for the SecondarySourceVersions property. This * DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasSecondarySourceVersions() { return secondarySourceVersions != null && !(secondarySourceVersions instanceof SdkAutoConstructList); } /** *

* An array of ProjectSourceVersion objects. If secondarySourceVersions is specified at * the build level, then they take precedence over these secondarySourceVersions (at the project * level). *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasSecondarySourceVersions} method. *

* * @return An array of ProjectSourceVersion objects. If secondarySourceVersions is * specified at the build level, then they take precedence over these secondarySourceVersions * (at the project level). */ public final List secondarySourceVersions() { return secondarySourceVersions; } /** *

* Information about the build output artifacts for the build project. *

* * @return Information about the build output artifacts for the build project. */ public final ProjectArtifacts artifacts() { return artifacts; } /** * For responses, this returns true if the service returned a value for the SecondaryArtifacts property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasSecondaryArtifacts() { return secondaryArtifacts != null && !(secondaryArtifacts instanceof SdkAutoConstructList); } /** *

* An array of ProjectArtifacts objects. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasSecondaryArtifacts} method. *

* * @return An array of ProjectArtifacts objects. */ public final List secondaryArtifacts() { return secondaryArtifacts; } /** *

* Stores recently used information so that it can be quickly accessed at a later time. *

* * @return Stores recently used information so that it can be quickly accessed at a later time. */ public final ProjectCache cache() { return cache; } /** *

* Information about the build environment for the build project. *

* * @return Information about the build environment for the build project. */ public final ProjectEnvironment environment() { return environment; } /** *

* The ARN of the IAM role that enables CodeBuild to interact with dependent Amazon Web Services services on behalf * of the Amazon Web Services account. *

* * @return The ARN of the IAM role that enables CodeBuild to interact with dependent Amazon Web Services services on * behalf of the Amazon Web Services account. */ public final String serviceRole() { return serviceRole; } /** *

* How long, in minutes, from 5 to 480 (8 hours), for CodeBuild to wait before it times out any build that has not * been marked as completed. The default is 60 minutes. *

* * @return How long, in minutes, from 5 to 480 (8 hours), for CodeBuild to wait before it times out any build that * has not been marked as completed. The default is 60 minutes. */ public final Integer timeoutInMinutes() { return timeoutInMinutes; } /** *

* The number of minutes a build is allowed to be queued before it times out. *

* * @return The number of minutes a build is allowed to be queued before it times out. */ public final Integer queuedTimeoutInMinutes() { return queuedTimeoutInMinutes; } /** *

* The Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts. *

* *

* You can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission to * that key. *

*
*

* You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias (using the * format alias/<alias-name>). *

* * @return The Key Management Service customer master key (CMK) to be used for encrypting the build output * artifacts.

*

* You can use a cross-account KMS key to encrypt the build output artifacts if your service role has * permission to that key. *

*
*

* You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias (using * the format alias/<alias-name>). */ public final String encryptionKey() { return encryptionKey; } /** * For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that * the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful * because the SDK will never return a null collection or map, but you may need to differentiate between the service * returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true * if a value for the property was specified in the request builder, and false if a value was not specified. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructList); } /** *

* A list of tag key and value pairs associated with this build project. *

*

* These tags are available for use by Amazon Web Services services that support CodeBuild build project tags. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTags} method. *

* * @return A list of tag key and value pairs associated with this build project.

*

* These tags are available for use by Amazon Web Services services that support CodeBuild build project * tags. */ public final List tags() { return tags; } /** *

* VpcConfig enables CodeBuild to access resources in an Amazon VPC. *

* * @return VpcConfig enables CodeBuild to access resources in an Amazon VPC. */ public final VpcConfig vpcConfig() { return vpcConfig; } /** *

* Set this to true to generate a publicly accessible URL for your project's build badge. *

* * @return Set this to true to generate a publicly accessible URL for your project's build badge. */ public final Boolean badgeEnabled() { return badgeEnabled; } /** *

* Information about logs for the build project. These can be logs in CloudWatch Logs, logs uploaded to a specified * S3 bucket, or both. *

* * @return Information about logs for the build project. These can be logs in CloudWatch Logs, logs uploaded to a * specified S3 bucket, or both. */ public final LogsConfig logsConfig() { return logsConfig; } /** * For responses, this returns true if the service returned a value for the FileSystemLocations property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasFileSystemLocations() { return fileSystemLocations != null && !(fileSystemLocations instanceof SdkAutoConstructList); } /** *

* An array of ProjectFileSystemLocation objects for a CodeBuild build project. A * ProjectFileSystemLocation object specifies the identifier, location, * mountOptions, mountPoint, and type of a file system created using Amazon * Elastic File System. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasFileSystemLocations} method. *

* * @return An array of ProjectFileSystemLocation objects for a CodeBuild build project. A * ProjectFileSystemLocation object specifies the identifier, * location, mountOptions, mountPoint, and type of a * file system created using Amazon Elastic File System. */ public final List fileSystemLocations() { return fileSystemLocations; } /** *

* A ProjectBuildBatchConfig object that defines the batch build options for the project. *

* * @return A ProjectBuildBatchConfig object that defines the batch build options for the project. */ public final ProjectBuildBatchConfig buildBatchConfig() { return buildBatchConfig; } /** *

* The maximum number of concurrent builds that are allowed for this project. *

*

* New builds are only started if the current number of builds is less than or equal to this limit. If the current * build count meets this limit, new builds are throttled and are not run. *

* * @return The maximum number of concurrent builds that are allowed for this project.

*

* New builds are only started if the current number of builds is less than or equal to this limit. If the * current build count meets this limit, new builds are throttled and are not run. */ public final Integer concurrentBuildLimit() { return concurrentBuildLimit; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(source()); hashCode = 31 * hashCode + Objects.hashCode(hasSecondarySources() ? secondarySources() : null); hashCode = 31 * hashCode + Objects.hashCode(sourceVersion()); hashCode = 31 * hashCode + Objects.hashCode(hasSecondarySourceVersions() ? secondarySourceVersions() : null); hashCode = 31 * hashCode + Objects.hashCode(artifacts()); hashCode = 31 * hashCode + Objects.hashCode(hasSecondaryArtifacts() ? secondaryArtifacts() : null); hashCode = 31 * hashCode + Objects.hashCode(cache()); hashCode = 31 * hashCode + Objects.hashCode(environment()); hashCode = 31 * hashCode + Objects.hashCode(serviceRole()); hashCode = 31 * hashCode + Objects.hashCode(timeoutInMinutes()); hashCode = 31 * hashCode + Objects.hashCode(queuedTimeoutInMinutes()); hashCode = 31 * hashCode + Objects.hashCode(encryptionKey()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(vpcConfig()); hashCode = 31 * hashCode + Objects.hashCode(badgeEnabled()); hashCode = 31 * hashCode + Objects.hashCode(logsConfig()); hashCode = 31 * hashCode + Objects.hashCode(hasFileSystemLocations() ? fileSystemLocations() : null); hashCode = 31 * hashCode + Objects.hashCode(buildBatchConfig()); hashCode = 31 * hashCode + Objects.hashCode(concurrentBuildLimit()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CreateProjectRequest)) { return false; } CreateProjectRequest other = (CreateProjectRequest) obj; return Objects.equals(name(), other.name()) && Objects.equals(description(), other.description()) && Objects.equals(source(), other.source()) && hasSecondarySources() == other.hasSecondarySources() && Objects.equals(secondarySources(), other.secondarySources()) && Objects.equals(sourceVersion(), other.sourceVersion()) && hasSecondarySourceVersions() == other.hasSecondarySourceVersions() && Objects.equals(secondarySourceVersions(), other.secondarySourceVersions()) && Objects.equals(artifacts(), other.artifacts()) && hasSecondaryArtifacts() == other.hasSecondaryArtifacts() && Objects.equals(secondaryArtifacts(), other.secondaryArtifacts()) && Objects.equals(cache(), other.cache()) && Objects.equals(environment(), other.environment()) && Objects.equals(serviceRole(), other.serviceRole()) && Objects.equals(timeoutInMinutes(), other.timeoutInMinutes()) && Objects.equals(queuedTimeoutInMinutes(), other.queuedTimeoutInMinutes()) && Objects.equals(encryptionKey(), other.encryptionKey()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(vpcConfig(), other.vpcConfig()) && Objects.equals(badgeEnabled(), other.badgeEnabled()) && Objects.equals(logsConfig(), other.logsConfig()) && hasFileSystemLocations() == other.hasFileSystemLocations() && Objects.equals(fileSystemLocations(), other.fileSystemLocations()) && Objects.equals(buildBatchConfig(), other.buildBatchConfig()) && Objects.equals(concurrentBuildLimit(), other.concurrentBuildLimit()); } /** * 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("CreateProjectRequest").add("Name", name()).add("Description", description()) .add("Source", source()).add("SecondarySources", hasSecondarySources() ? secondarySources() : null) .add("SourceVersion", sourceVersion()) .add("SecondarySourceVersions", hasSecondarySourceVersions() ? secondarySourceVersions() : null) .add("Artifacts", artifacts()).add("SecondaryArtifacts", hasSecondaryArtifacts() ? secondaryArtifacts() : null) .add("Cache", cache()).add("Environment", environment()).add("ServiceRole", serviceRole()) .add("TimeoutInMinutes", timeoutInMinutes()).add("QueuedTimeoutInMinutes", queuedTimeoutInMinutes()) .add("EncryptionKey", encryptionKey()).add("Tags", hasTags() ? tags() : null).add("VpcConfig", vpcConfig()) .add("BadgeEnabled", badgeEnabled()).add("LogsConfig", logsConfig()) .add("FileSystemLocations", hasFileSystemLocations() ? fileSystemLocations() : null) .add("BuildBatchConfig", buildBatchConfig()).add("ConcurrentBuildLimit", concurrentBuildLimit()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "name": return Optional.ofNullable(clazz.cast(name())); case "description": return Optional.ofNullable(clazz.cast(description())); case "source": return Optional.ofNullable(clazz.cast(source())); case "secondarySources": return Optional.ofNullable(clazz.cast(secondarySources())); case "sourceVersion": return Optional.ofNullable(clazz.cast(sourceVersion())); case "secondarySourceVersions": return Optional.ofNullable(clazz.cast(secondarySourceVersions())); case "artifacts": return Optional.ofNullable(clazz.cast(artifacts())); case "secondaryArtifacts": return Optional.ofNullable(clazz.cast(secondaryArtifacts())); case "cache": return Optional.ofNullable(clazz.cast(cache())); case "environment": return Optional.ofNullable(clazz.cast(environment())); case "serviceRole": return Optional.ofNullable(clazz.cast(serviceRole())); case "timeoutInMinutes": return Optional.ofNullable(clazz.cast(timeoutInMinutes())); case "queuedTimeoutInMinutes": return Optional.ofNullable(clazz.cast(queuedTimeoutInMinutes())); case "encryptionKey": return Optional.ofNullable(clazz.cast(encryptionKey())); case "tags": return Optional.ofNullable(clazz.cast(tags())); case "vpcConfig": return Optional.ofNullable(clazz.cast(vpcConfig())); case "badgeEnabled": return Optional.ofNullable(clazz.cast(badgeEnabled())); case "logsConfig": return Optional.ofNullable(clazz.cast(logsConfig())); case "fileSystemLocations": return Optional.ofNullable(clazz.cast(fileSystemLocations())); case "buildBatchConfig": return Optional.ofNullable(clazz.cast(buildBatchConfig())); case "concurrentBuildLimit": return Optional.ofNullable(clazz.cast(concurrentBuildLimit())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateProjectRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends CodeBuildRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the build project. *

* * @param name * The name of the build project. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* A description that makes the build project easy to identify. *

* * @param description * A description that makes the build project easy to identify. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

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

* * @param source * Information about the build input source code for the build project. * @return Returns a reference to this object so that method calls can be chained together. */ Builder source(ProjectSource source); /** *

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

* This is a convenience method that creates an instance of the {@link ProjectSource.Builder} avoiding the need * to create one manually via {@link ProjectSource#builder()}. * *

* When the {@link Consumer} completes, {@link ProjectSource.Builder#build()} is called immediately and its * result is passed to {@link #source(ProjectSource)}. * * @param source * a consumer that will call methods on {@link ProjectSource.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #source(ProjectSource) */ default Builder source(Consumer source) { return source(ProjectSource.builder().applyMutation(source).build()); } /** *

* An array of ProjectSource objects. *

* * @param secondarySources * An array of ProjectSource objects. * @return Returns a reference to this object so that method calls can be chained together. */ Builder secondarySources(Collection secondarySources); /** *

* An array of ProjectSource objects. *

* * @param secondarySources * An array of ProjectSource objects. * @return Returns a reference to this object so that method calls can be chained together. */ Builder secondarySources(ProjectSource... secondarySources); /** *

* An array of ProjectSource objects. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.codebuild.model.ProjectSource.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.codebuild.model.ProjectSource#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.codebuild.model.ProjectSource.Builder#build()} is called immediately * and its result is passed to {@link #secondarySources(List)}. * * @param secondarySources * a consumer that will call methods on * {@link software.amazon.awssdk.services.codebuild.model.ProjectSource.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #secondarySources(java.util.Collection) */ Builder secondarySources(Consumer... secondarySources); /** *

* A version of the build input to be built for this project. If not specified, the latest version is used. If * specified, it must be one of: *

*
    *
  • *

    * For CodeCommit: the commit ID, branch, or Git tag to use. *

    *
  • *
  • *

    * For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the * source code you want to build. If a pull request ID is specified, it must use the format * pr/pull-request-ID (for example pr/25). If a branch name is specified, the branch's * HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used. *

    *
  • *
  • *

    * For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you * want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the * default branch's HEAD commit ID is used. *

    *
  • *
  • *

    * For Amazon S3: the version ID of the object that represents the build input ZIP file to use. *

    *
  • *
*

* If sourceVersion is specified at the build level, then that version takes precedence over this * sourceVersion (at the project level). *

*

* For more information, see Source Version * Sample with CodeBuild in the CodeBuild User Guide. *

* * @param sourceVersion * A version of the build input to be built for this project. If not specified, the latest version is * used. If specified, it must be one of:

*
    *
  • *

    * For CodeCommit: the commit ID, branch, or Git tag to use. *

    *
  • *
  • *

    * For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version * of the source code you want to build. If a pull request ID is specified, it must use the format * pr/pull-request-ID (for example pr/25). If a branch name is specified, the * branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used. *

    *
  • *
  • *

    * For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source * code you want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not * specified, the default branch's HEAD commit ID is used. *

    *
  • *
  • *

    * For Amazon S3: the version ID of the object that represents the build input ZIP file to use. *

    *
  • *
*

* If sourceVersion is specified at the build level, then that version takes precedence over * this sourceVersion (at the project level). *

*

* For more information, see Source * Version Sample with CodeBuild in the CodeBuild User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceVersion(String sourceVersion); /** *

* An array of ProjectSourceVersion objects. If secondarySourceVersions is specified * at the build level, then they take precedence over these secondarySourceVersions (at the project * level). *

* * @param secondarySourceVersions * An array of ProjectSourceVersion objects. If secondarySourceVersions is * specified at the build level, then they take precedence over these * secondarySourceVersions (at the project level). * @return Returns a reference to this object so that method calls can be chained together. */ Builder secondarySourceVersions(Collection secondarySourceVersions); /** *

* An array of ProjectSourceVersion objects. If secondarySourceVersions is specified * at the build level, then they take precedence over these secondarySourceVersions (at the project * level). *

* * @param secondarySourceVersions * An array of ProjectSourceVersion objects. If secondarySourceVersions is * specified at the build level, then they take precedence over these * secondarySourceVersions (at the project level). * @return Returns a reference to this object so that method calls can be chained together. */ Builder secondarySourceVersions(ProjectSourceVersion... secondarySourceVersions); /** *

* An array of ProjectSourceVersion objects. If secondarySourceVersions is specified * at the build level, then they take precedence over these secondarySourceVersions (at the project * level). *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.codebuild.model.ProjectSourceVersion.Builder} avoiding the need to * create one manually via * {@link software.amazon.awssdk.services.codebuild.model.ProjectSourceVersion#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.codebuild.model.ProjectSourceVersion.Builder#build()} is called * immediately and its result is passed to {@link #secondarySourceVersions(List)}. * * @param secondarySourceVersions * a consumer that will call methods on * {@link software.amazon.awssdk.services.codebuild.model.ProjectSourceVersion.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #secondarySourceVersions(java.util.Collection) */ Builder secondarySourceVersions(Consumer... secondarySourceVersions); /** *

* Information about the build output artifacts for the build project. *

* * @param artifacts * Information about the build output artifacts for the build project. * @return Returns a reference to this object so that method calls can be chained together. */ Builder artifacts(ProjectArtifacts artifacts); /** *

* Information about the build output artifacts for the build project. *

* This is a convenience method that creates an instance of the {@link ProjectArtifacts.Builder} avoiding the * need to create one manually via {@link ProjectArtifacts#builder()}. * *

* When the {@link Consumer} completes, {@link ProjectArtifacts.Builder#build()} is called immediately and its * result is passed to {@link #artifacts(ProjectArtifacts)}. * * @param artifacts * a consumer that will call methods on {@link ProjectArtifacts.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #artifacts(ProjectArtifacts) */ default Builder artifacts(Consumer artifacts) { return artifacts(ProjectArtifacts.builder().applyMutation(artifacts).build()); } /** *

* An array of ProjectArtifacts objects. *

* * @param secondaryArtifacts * An array of ProjectArtifacts objects. * @return Returns a reference to this object so that method calls can be chained together. */ Builder secondaryArtifacts(Collection secondaryArtifacts); /** *

* An array of ProjectArtifacts objects. *

* * @param secondaryArtifacts * An array of ProjectArtifacts objects. * @return Returns a reference to this object so that method calls can be chained together. */ Builder secondaryArtifacts(ProjectArtifacts... secondaryArtifacts); /** *

* An array of ProjectArtifacts objects. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.codebuild.model.ProjectArtifacts.Builder} avoiding the need to create * one manually via {@link software.amazon.awssdk.services.codebuild.model.ProjectArtifacts#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.codebuild.model.ProjectArtifacts.Builder#build()} is called * immediately and its result is passed to {@link #secondaryArtifacts(List)}. * * @param secondaryArtifacts * a consumer that will call methods on * {@link software.amazon.awssdk.services.codebuild.model.ProjectArtifacts.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #secondaryArtifacts(java.util.Collection) */ Builder secondaryArtifacts(Consumer... secondaryArtifacts); /** *

* Stores recently used information so that it can be quickly accessed at a later time. *

* * @param cache * Stores recently used information so that it can be quickly accessed at a later time. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cache(ProjectCache cache); /** *

* Stores recently used information so that it can be quickly accessed at a later time. *

* This is a convenience method that creates an instance of the {@link ProjectCache.Builder} avoiding the need * to create one manually via {@link ProjectCache#builder()}. * *

* When the {@link Consumer} completes, {@link ProjectCache.Builder#build()} is called immediately and its * result is passed to {@link #cache(ProjectCache)}. * * @param cache * a consumer that will call methods on {@link ProjectCache.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #cache(ProjectCache) */ default Builder cache(Consumer cache) { return cache(ProjectCache.builder().applyMutation(cache).build()); } /** *

* Information about the build environment for the build project. *

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

* Information about the build environment for the build project. *

* This is a convenience method that creates an instance of the {@link ProjectEnvironment.Builder} avoiding the * need to create one manually via {@link ProjectEnvironment#builder()}. * *

* When the {@link Consumer} completes, {@link ProjectEnvironment.Builder#build()} is called immediately and its * result is passed to {@link #environment(ProjectEnvironment)}. * * @param environment * a consumer that will call methods on {@link ProjectEnvironment.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #environment(ProjectEnvironment) */ default Builder environment(Consumer environment) { return environment(ProjectEnvironment.builder().applyMutation(environment).build()); } /** *

* The ARN of the IAM role that enables CodeBuild to interact with dependent Amazon Web Services services on * behalf of the Amazon Web Services account. *

* * @param serviceRole * The ARN of the IAM role that enables CodeBuild to interact with dependent Amazon Web Services services * on behalf of the Amazon Web Services account. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceRole(String serviceRole); /** *

* How long, in minutes, from 5 to 480 (8 hours), for CodeBuild to wait before it times out any build that has * not been marked as completed. The default is 60 minutes. *

* * @param timeoutInMinutes * How long, in minutes, from 5 to 480 (8 hours), for CodeBuild to wait before it times out any build * that has not been marked as completed. The default is 60 minutes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder timeoutInMinutes(Integer timeoutInMinutes); /** *

* The number of minutes a build is allowed to be queued before it times out. *

* * @param queuedTimeoutInMinutes * The number of minutes a build is allowed to be queued before it times out. * @return Returns a reference to this object so that method calls can be chained together. */ Builder queuedTimeoutInMinutes(Integer queuedTimeoutInMinutes); /** *

* The Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts. *

* *

* You can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission * to that key. *

*
*

* You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias (using the * format alias/<alias-name>). *

* * @param encryptionKey * The Key Management Service customer master key (CMK) to be used for encrypting the build output * artifacts.

*

* You can use a cross-account KMS key to encrypt the build output artifacts if your service role has * permission to that key. *

*
*

* You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias * (using the format alias/<alias-name>). * @return Returns a reference to this object so that method calls can be chained together. */ Builder encryptionKey(String encryptionKey); /** *

* A list of tag key and value pairs associated with this build project. *

*

* These tags are available for use by Amazon Web Services services that support CodeBuild build project tags. *

* * @param tags * A list of tag key and value pairs associated with this build project.

*

* These tags are available for use by Amazon Web Services services that support CodeBuild build project * tags. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

* A list of tag key and value pairs associated with this build project. *

*

* These tags are available for use by Amazon Web Services services that support CodeBuild build project tags. *

* * @param tags * A list of tag key and value pairs associated with this build project.

*

* These tags are available for use by Amazon Web Services services that support CodeBuild build project * tags. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

* A list of tag key and value pairs associated with this build project. *

*

* These tags are available for use by Amazon Web Services services that support CodeBuild build project tags. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.codebuild.model.Tag.Builder} avoiding the need to create one manually * via {@link software.amazon.awssdk.services.codebuild.model.Tag#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.codebuild.model.Tag.Builder#build()} is called immediately and its * result is passed to {@link #tags(List)}. * * @param tags * a consumer that will call methods on * {@link software.amazon.awssdk.services.codebuild.model.Tag.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tags(java.util.Collection) */ Builder tags(Consumer... tags); /** *

* VpcConfig enables CodeBuild to access resources in an Amazon VPC. *

* * @param vpcConfig * VpcConfig enables CodeBuild to access resources in an Amazon VPC. * @return Returns a reference to this object so that method calls can be chained together. */ Builder vpcConfig(VpcConfig vpcConfig); /** *

* VpcConfig enables CodeBuild to access resources in an Amazon VPC. *

* This is a convenience method that creates an instance of the {@link VpcConfig.Builder} avoiding the need to * create one manually via {@link VpcConfig#builder()}. * *

* When the {@link Consumer} completes, {@link VpcConfig.Builder#build()} is called immediately and its result * is passed to {@link #vpcConfig(VpcConfig)}. * * @param vpcConfig * a consumer that will call methods on {@link VpcConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #vpcConfig(VpcConfig) */ default Builder vpcConfig(Consumer vpcConfig) { return vpcConfig(VpcConfig.builder().applyMutation(vpcConfig).build()); } /** *

* Set this to true to generate a publicly accessible URL for your project's build badge. *

* * @param badgeEnabled * Set this to true to generate a publicly accessible URL for your project's build badge. * @return Returns a reference to this object so that method calls can be chained together. */ Builder badgeEnabled(Boolean badgeEnabled); /** *

* Information about logs for the build project. These can be logs in CloudWatch Logs, logs uploaded to a * specified S3 bucket, or both. *

* * @param logsConfig * Information about logs for the build project. These can be logs in CloudWatch Logs, logs uploaded to a * specified S3 bucket, or both. * @return Returns a reference to this object so that method calls can be chained together. */ Builder logsConfig(LogsConfig logsConfig); /** *

* Information about logs for the build project. These can be logs in CloudWatch Logs, logs uploaded to a * specified S3 bucket, or both. *

* This is a convenience method that creates an instance of the {@link LogsConfig.Builder} avoiding the need to * create one manually via {@link LogsConfig#builder()}. * *

* When the {@link Consumer} completes, {@link LogsConfig.Builder#build()} is called immediately and its result * is passed to {@link #logsConfig(LogsConfig)}. * * @param logsConfig * a consumer that will call methods on {@link LogsConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #logsConfig(LogsConfig) */ default Builder logsConfig(Consumer logsConfig) { return logsConfig(LogsConfig.builder().applyMutation(logsConfig).build()); } /** *

* An array of ProjectFileSystemLocation objects for a CodeBuild build project. A * ProjectFileSystemLocation object specifies the identifier, location, * mountOptions, mountPoint, and type of a file system created using * Amazon Elastic File System. *

* * @param fileSystemLocations * An array of ProjectFileSystemLocation objects for a CodeBuild build project. A * ProjectFileSystemLocation object specifies the identifier, * location, mountOptions, mountPoint, and type of a * file system created using Amazon Elastic File System. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fileSystemLocations(Collection fileSystemLocations); /** *

* An array of ProjectFileSystemLocation objects for a CodeBuild build project. A * ProjectFileSystemLocation object specifies the identifier, location, * mountOptions, mountPoint, and type of a file system created using * Amazon Elastic File System. *

* * @param fileSystemLocations * An array of ProjectFileSystemLocation objects for a CodeBuild build project. A * ProjectFileSystemLocation object specifies the identifier, * location, mountOptions, mountPoint, and type of a * file system created using Amazon Elastic File System. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fileSystemLocations(ProjectFileSystemLocation... fileSystemLocations); /** *

* An array of ProjectFileSystemLocation objects for a CodeBuild build project. A * ProjectFileSystemLocation object specifies the identifier, location, * mountOptions, mountPoint, and type of a file system created using * Amazon Elastic File System. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.codebuild.model.ProjectFileSystemLocation.Builder} avoiding the need * to create one manually via * {@link software.amazon.awssdk.services.codebuild.model.ProjectFileSystemLocation#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.codebuild.model.ProjectFileSystemLocation.Builder#build()} is called * immediately and its result is passed to {@link #fileSystemLocations(List)}. * * @param fileSystemLocations * a consumer that will call methods on * {@link software.amazon.awssdk.services.codebuild.model.ProjectFileSystemLocation.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #fileSystemLocations(java.util.Collection) */ Builder fileSystemLocations(Consumer... fileSystemLocations); /** *

* A ProjectBuildBatchConfig object that defines the batch build options for the project. *

* * @param buildBatchConfig * A ProjectBuildBatchConfig object that defines the batch build options for the project. * @return Returns a reference to this object so that method calls can be chained together. */ Builder buildBatchConfig(ProjectBuildBatchConfig buildBatchConfig); /** *

* A ProjectBuildBatchConfig object that defines the batch build options for the project. *

* This is a convenience method that creates an instance of the {@link ProjectBuildBatchConfig.Builder} avoiding * the need to create one manually via {@link ProjectBuildBatchConfig#builder()}. * *

* When the {@link Consumer} completes, {@link ProjectBuildBatchConfig.Builder#build()} is called immediately * and its result is passed to {@link #buildBatchConfig(ProjectBuildBatchConfig)}. * * @param buildBatchConfig * a consumer that will call methods on {@link ProjectBuildBatchConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #buildBatchConfig(ProjectBuildBatchConfig) */ default Builder buildBatchConfig(Consumer buildBatchConfig) { return buildBatchConfig(ProjectBuildBatchConfig.builder().applyMutation(buildBatchConfig).build()); } /** *

* The maximum number of concurrent builds that are allowed for this project. *

*

* New builds are only started if the current number of builds is less than or equal to this limit. If the * current build count meets this limit, new builds are throttled and are not run. *

* * @param concurrentBuildLimit * The maximum number of concurrent builds that are allowed for this project.

*

* New builds are only started if the current number of builds is less than or equal to this limit. If * the current build count meets this limit, new builds are throttled and are not run. * @return Returns a reference to this object so that method calls can be chained together. */ Builder concurrentBuildLimit(Integer concurrentBuildLimit); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends CodeBuildRequest.BuilderImpl implements Builder { private String name; private String description; private ProjectSource source; private List secondarySources = DefaultSdkAutoConstructList.getInstance(); private String sourceVersion; private List secondarySourceVersions = DefaultSdkAutoConstructList.getInstance(); private ProjectArtifacts artifacts; private List secondaryArtifacts = DefaultSdkAutoConstructList.getInstance(); private ProjectCache cache; private ProjectEnvironment environment; private String serviceRole; private Integer timeoutInMinutes; private Integer queuedTimeoutInMinutes; private String encryptionKey; private List tags = DefaultSdkAutoConstructList.getInstance(); private VpcConfig vpcConfig; private Boolean badgeEnabled; private LogsConfig logsConfig; private List fileSystemLocations = DefaultSdkAutoConstructList.getInstance(); private ProjectBuildBatchConfig buildBatchConfig; private Integer concurrentBuildLimit; private BuilderImpl() { } private BuilderImpl(CreateProjectRequest model) { super(model); name(model.name); description(model.description); source(model.source); secondarySources(model.secondarySources); sourceVersion(model.sourceVersion); secondarySourceVersions(model.secondarySourceVersions); artifacts(model.artifacts); secondaryArtifacts(model.secondaryArtifacts); cache(model.cache); environment(model.environment); serviceRole(model.serviceRole); timeoutInMinutes(model.timeoutInMinutes); queuedTimeoutInMinutes(model.queuedTimeoutInMinutes); encryptionKey(model.encryptionKey); tags(model.tags); vpcConfig(model.vpcConfig); badgeEnabled(model.badgeEnabled); logsConfig(model.logsConfig); fileSystemLocations(model.fileSystemLocations); buildBatchConfig(model.buildBatchConfig); concurrentBuildLimit(model.concurrentBuildLimit); } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; 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 ProjectSource.Builder getSource() { return source != null ? source.toBuilder() : null; } public final void setSource(ProjectSource.BuilderImpl source) { this.source = source != null ? source.build() : null; } @Override public final Builder source(ProjectSource source) { this.source = source; return this; } public final List getSecondarySources() { List result = ProjectSourcesCopier.copyToBuilder(this.secondarySources); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setSecondarySources(Collection secondarySources) { this.secondarySources = ProjectSourcesCopier.copyFromBuilder(secondarySources); } @Override public final Builder secondarySources(Collection secondarySources) { this.secondarySources = ProjectSourcesCopier.copy(secondarySources); return this; } @Override @SafeVarargs public final Builder secondarySources(ProjectSource... secondarySources) { secondarySources(Arrays.asList(secondarySources)); return this; } @Override @SafeVarargs public final Builder secondarySources(Consumer... secondarySources) { secondarySources(Stream.of(secondarySources).map(c -> ProjectSource.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getSourceVersion() { return sourceVersion; } public final void setSourceVersion(String sourceVersion) { this.sourceVersion = sourceVersion; } @Override public final Builder sourceVersion(String sourceVersion) { this.sourceVersion = sourceVersion; return this; } public final List getSecondarySourceVersions() { List result = ProjectSecondarySourceVersionsCopier .copyToBuilder(this.secondarySourceVersions); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setSecondarySourceVersions(Collection secondarySourceVersions) { this.secondarySourceVersions = ProjectSecondarySourceVersionsCopier.copyFromBuilder(secondarySourceVersions); } @Override public final Builder secondarySourceVersions(Collection secondarySourceVersions) { this.secondarySourceVersions = ProjectSecondarySourceVersionsCopier.copy(secondarySourceVersions); return this; } @Override @SafeVarargs public final Builder secondarySourceVersions(ProjectSourceVersion... secondarySourceVersions) { secondarySourceVersions(Arrays.asList(secondarySourceVersions)); return this; } @Override @SafeVarargs public final Builder secondarySourceVersions(Consumer... secondarySourceVersions) { secondarySourceVersions(Stream.of(secondarySourceVersions) .map(c -> ProjectSourceVersion.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final ProjectArtifacts.Builder getArtifacts() { return artifacts != null ? artifacts.toBuilder() : null; } public final void setArtifacts(ProjectArtifacts.BuilderImpl artifacts) { this.artifacts = artifacts != null ? artifacts.build() : null; } @Override public final Builder artifacts(ProjectArtifacts artifacts) { this.artifacts = artifacts; return this; } public final List getSecondaryArtifacts() { List result = ProjectArtifactsListCopier.copyToBuilder(this.secondaryArtifacts); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setSecondaryArtifacts(Collection secondaryArtifacts) { this.secondaryArtifacts = ProjectArtifactsListCopier.copyFromBuilder(secondaryArtifacts); } @Override public final Builder secondaryArtifacts(Collection secondaryArtifacts) { this.secondaryArtifacts = ProjectArtifactsListCopier.copy(secondaryArtifacts); return this; } @Override @SafeVarargs public final Builder secondaryArtifacts(ProjectArtifacts... secondaryArtifacts) { secondaryArtifacts(Arrays.asList(secondaryArtifacts)); return this; } @Override @SafeVarargs public final Builder secondaryArtifacts(Consumer... secondaryArtifacts) { secondaryArtifacts(Stream.of(secondaryArtifacts).map(c -> ProjectArtifacts.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final ProjectCache.Builder getCache() { return cache != null ? cache.toBuilder() : null; } public final void setCache(ProjectCache.BuilderImpl cache) { this.cache = cache != null ? cache.build() : null; } @Override public final Builder cache(ProjectCache cache) { this.cache = cache; return this; } public final ProjectEnvironment.Builder getEnvironment() { return environment != null ? environment.toBuilder() : null; } public final void setEnvironment(ProjectEnvironment.BuilderImpl environment) { this.environment = environment != null ? environment.build() : null; } @Override public final Builder environment(ProjectEnvironment environment) { this.environment = environment; return this; } public final String getServiceRole() { return serviceRole; } public final void setServiceRole(String serviceRole) { this.serviceRole = serviceRole; } @Override public final Builder serviceRole(String serviceRole) { this.serviceRole = serviceRole; return this; } public final Integer getTimeoutInMinutes() { return timeoutInMinutes; } public final void setTimeoutInMinutes(Integer timeoutInMinutes) { this.timeoutInMinutes = timeoutInMinutes; } @Override public final Builder timeoutInMinutes(Integer timeoutInMinutes) { this.timeoutInMinutes = timeoutInMinutes; return this; } public final Integer getQueuedTimeoutInMinutes() { return queuedTimeoutInMinutes; } public final void setQueuedTimeoutInMinutes(Integer queuedTimeoutInMinutes) { this.queuedTimeoutInMinutes = queuedTimeoutInMinutes; } @Override public final Builder queuedTimeoutInMinutes(Integer queuedTimeoutInMinutes) { this.queuedTimeoutInMinutes = queuedTimeoutInMinutes; return this; } public final String getEncryptionKey() { return encryptionKey; } public final void setEncryptionKey(String encryptionKey) { this.encryptionKey = encryptionKey; } @Override public final Builder encryptionKey(String encryptionKey) { this.encryptionKey = encryptionKey; return this; } public final List getTags() { List result = TagListCopier.copyToBuilder(this.tags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final VpcConfig.Builder getVpcConfig() { return vpcConfig != null ? vpcConfig.toBuilder() : null; } public final void setVpcConfig(VpcConfig.BuilderImpl vpcConfig) { this.vpcConfig = vpcConfig != null ? vpcConfig.build() : null; } @Override public final Builder vpcConfig(VpcConfig vpcConfig) { this.vpcConfig = vpcConfig; return this; } public final Boolean getBadgeEnabled() { return badgeEnabled; } public final void setBadgeEnabled(Boolean badgeEnabled) { this.badgeEnabled = badgeEnabled; } @Override public final Builder badgeEnabled(Boolean badgeEnabled) { this.badgeEnabled = badgeEnabled; return this; } public final LogsConfig.Builder getLogsConfig() { return logsConfig != null ? logsConfig.toBuilder() : null; } public final void setLogsConfig(LogsConfig.BuilderImpl logsConfig) { this.logsConfig = logsConfig != null ? logsConfig.build() : null; } @Override public final Builder logsConfig(LogsConfig logsConfig) { this.logsConfig = logsConfig; return this; } public final List getFileSystemLocations() { List result = ProjectFileSystemLocationsCopier .copyToBuilder(this.fileSystemLocations); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setFileSystemLocations(Collection fileSystemLocations) { this.fileSystemLocations = ProjectFileSystemLocationsCopier.copyFromBuilder(fileSystemLocations); } @Override public final Builder fileSystemLocations(Collection fileSystemLocations) { this.fileSystemLocations = ProjectFileSystemLocationsCopier.copy(fileSystemLocations); return this; } @Override @SafeVarargs public final Builder fileSystemLocations(ProjectFileSystemLocation... fileSystemLocations) { fileSystemLocations(Arrays.asList(fileSystemLocations)); return this; } @Override @SafeVarargs public final Builder fileSystemLocations(Consumer... fileSystemLocations) { fileSystemLocations(Stream.of(fileSystemLocations) .map(c -> ProjectFileSystemLocation.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final ProjectBuildBatchConfig.Builder getBuildBatchConfig() { return buildBatchConfig != null ? buildBatchConfig.toBuilder() : null; } public final void setBuildBatchConfig(ProjectBuildBatchConfig.BuilderImpl buildBatchConfig) { this.buildBatchConfig = buildBatchConfig != null ? buildBatchConfig.build() : null; } @Override public final Builder buildBatchConfig(ProjectBuildBatchConfig buildBatchConfig) { this.buildBatchConfig = buildBatchConfig; return this; } public final Integer getConcurrentBuildLimit() { return concurrentBuildLimit; } public final void setConcurrentBuildLimit(Integer concurrentBuildLimit) { this.concurrentBuildLimit = concurrentBuildLimit; } @Override public final Builder concurrentBuildLimit(Integer concurrentBuildLimit) { this.concurrentBuildLimit = concurrentBuildLimit; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CreateProjectRequest build() { return new CreateProjectRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy