software.amazon.awssdk.services.codebuild.model.Project Maven / Gradle / Ivy
Show all versions of codebuild Show documentation
/*
* 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.beans.Transient;
import java.io.Serializable;
import java.time.Instant;
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.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;
/**
*
* Information about a build project.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Project implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
.getter(getter(Project::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn")
.getter(getter(Project::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("description").getter(getter(Project::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(Project::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(Project::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(Project::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(Project::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(Project::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(Project::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(Project::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(Project::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(Project::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(Project::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(Project::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(Project::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(Project::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 CREATED_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("created").getter(getter(Project::created)).setter(setter(Builder::created))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("created").build()).build();
private static final SdkField LAST_MODIFIED_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("lastModified").getter(getter(Project::lastModified)).setter(setter(Builder::lastModified))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastModified").build()).build();
private static final SdkField WEBHOOK_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("webhook").getter(getter(Project::webhook)).setter(setter(Builder::webhook))
.constructor(Webhook::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("webhook").build()).build();
private static final SdkField VPC_CONFIG_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("vpcConfig").getter(getter(Project::vpcConfig)).setter(setter(Builder::vpcConfig))
.constructor(VpcConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("vpcConfig").build()).build();
private static final SdkField BADGE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("badge").getter(getter(Project::badge)).setter(setter(Builder::badge)).constructor(ProjectBadge::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("badge").build()).build();
private static final SdkField LOGS_CONFIG_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("logsConfig").getter(getter(Project::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(Project::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(Project::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(Project::concurrentBuildLimit))
.setter(setter(Builder::concurrentBuildLimit))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("concurrentBuildLimit").build())
.build();
private static final SdkField PROJECT_VISIBILITY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("projectVisibility").getter(getter(Project::projectVisibilityAsString))
.setter(setter(Builder::projectVisibility))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("projectVisibility").build()).build();
private static final SdkField PUBLIC_PROJECT_ALIAS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("publicProjectAlias").getter(getter(Project::publicProjectAlias))
.setter(setter(Builder::publicProjectAlias))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("publicProjectAlias").build())
.build();
private static final SdkField RESOURCE_ACCESS_ROLE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("resourceAccessRole").getter(getter(Project::resourceAccessRole))
.setter(setter(Builder::resourceAccessRole))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("resourceAccessRole").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, ARN_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, CREATED_FIELD,
LAST_MODIFIED_FIELD, WEBHOOK_FIELD, VPC_CONFIG_FIELD, BADGE_FIELD, LOGS_CONFIG_FIELD, FILE_SYSTEM_LOCATIONS_FIELD,
BUILD_BATCH_CONFIG_FIELD, CONCURRENT_BUILD_LIMIT_FIELD, PROJECT_VISIBILITY_FIELD, PUBLIC_PROJECT_ALIAS_FIELD,
RESOURCE_ACCESS_ROLE_FIELD));
private static final long serialVersionUID = 1L;
private final String name;
private final String arn;
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 Instant created;
private final Instant lastModified;
private final Webhook webhook;
private final VpcConfig vpcConfig;
private final ProjectBadge badge;
private final LogsConfig logsConfig;
private final List fileSystemLocations;
private final ProjectBuildBatchConfig buildBatchConfig;
private final Integer concurrentBuildLimit;
private final String projectVisibility;
private final String publicProjectAlias;
private final String resourceAccessRole;
private Project(BuilderImpl builder) {
this.name = builder.name;
this.arn = builder.arn;
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.created = builder.created;
this.lastModified = builder.lastModified;
this.webhook = builder.webhook;
this.vpcConfig = builder.vpcConfig;
this.badge = builder.badge;
this.logsConfig = builder.logsConfig;
this.fileSystemLocations = builder.fileSystemLocations;
this.buildBatchConfig = builder.buildBatchConfig;
this.concurrentBuildLimit = builder.concurrentBuildLimit;
this.projectVisibility = builder.projectVisibility;
this.publicProjectAlias = builder.publicProjectAlias;
this.resourceAccessRole = builder.resourceAccessRole;
}
/**
*
* The name of the build project.
*
*
* @return The name of the build project.
*/
public final String name() {
return name;
}
/**
*
* The Amazon Resource Name (ARN) of the build project.
*
*
* @return The Amazon Resource Name (ARN) of the build project.
*/
public final String arn() {
return arn;
}
/**
*
* 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 this build project.
*
*
* @return Information about the build input source code for this 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 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 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;
}
/**
*
* Information about the cache for the build project.
*
*
* @return Information about the cache for the build project.
*/
public final ProjectCache cache() {
return cache;
}
/**
*
* Information about the build environment for this build project.
*
*
* @return Information about the build environment for this 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 timing out any related build that did
* not get marked as completed. The default is 60 minutes.
*
*
* @return How long, in minutes, from 5 to 480 (8 hours), for CodeBuild to wait before timing out any related build
* that did not get 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>
). If you don't specify a value, CodeBuild uses the managed CMK for
* Amazon Simple Storage Service (Amazon S3).
*
*
* @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>
). If you don't specify a value, CodeBuild uses the
* managed CMK for Amazon Simple Storage Service (Amazon S3).
*/
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;
}
/**
*
* When the build project was created, expressed in Unix time format.
*
*
* @return When the build project was created, expressed in Unix time format.
*/
public final Instant created() {
return created;
}
/**
*
* When the build project's settings were last modified, expressed in Unix time format.
*
*
* @return When the build project's settings were last modified, expressed in Unix time format.
*/
public final Instant lastModified() {
return lastModified;
}
/**
*
* Information about a webhook that connects repository events to a build project in CodeBuild.
*
*
* @return Information about a webhook that connects repository events to a build project in CodeBuild.
*/
public final Webhook webhook() {
return webhook;
}
/**
*
* Information about the VPC configuration that CodeBuild accesses.
*
*
* @return Information about the VPC configuration that CodeBuild accesses.
*/
public final VpcConfig vpcConfig() {
return vpcConfig;
}
/**
*
* Information about the build badge for the build project.
*
*
* @return Information about the build badge for the build project.
*/
public final ProjectBadge badge() {
return badge;
}
/**
*
* Information about logs for the build project. A project can create logs in CloudWatch Logs, an S3 bucket, or
* both.
*
*
* @return Information about logs for the build project. A project can create logs in CloudWatch Logs, an 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;
}
/**
* Returns the value of the ProjectVisibility property for this object.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #projectVisibility}
* will return {@link ProjectVisibilityType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #projectVisibilityAsString}.
*
*
* @return The value of the ProjectVisibility property for this object.
* @see ProjectVisibilityType
*/
public final ProjectVisibilityType projectVisibility() {
return ProjectVisibilityType.fromValue(projectVisibility);
}
/**
* Returns the value of the ProjectVisibility property for this object.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #projectVisibility}
* will return {@link ProjectVisibilityType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #projectVisibilityAsString}.
*
*
* @return The value of the ProjectVisibility property for this object.
* @see ProjectVisibilityType
*/
public final String projectVisibilityAsString() {
return projectVisibility;
}
/**
*
* Contains the project identifier used with the public build APIs.
*
*
* @return Contains the project identifier used with the public build APIs.
*/
public final String publicProjectAlias() {
return publicProjectAlias;
}
/**
*
* The ARN of the IAM role that enables CodeBuild to access the CloudWatch Logs and Amazon S3 artifacts for the
* project's builds.
*
*
* @return The ARN of the IAM role that enables CodeBuild to access the CloudWatch Logs and Amazon S3 artifacts for
* the project's builds.
*/
public final String resourceAccessRole() {
return resourceAccessRole;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(arn());
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(created());
hashCode = 31 * hashCode + Objects.hashCode(lastModified());
hashCode = 31 * hashCode + Objects.hashCode(webhook());
hashCode = 31 * hashCode + Objects.hashCode(vpcConfig());
hashCode = 31 * hashCode + Objects.hashCode(badge());
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());
hashCode = 31 * hashCode + Objects.hashCode(projectVisibilityAsString());
hashCode = 31 * hashCode + Objects.hashCode(publicProjectAlias());
hashCode = 31 * hashCode + Objects.hashCode(resourceAccessRole());
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 Project)) {
return false;
}
Project other = (Project) obj;
return Objects.equals(name(), other.name()) && Objects.equals(arn(), other.arn())
&& 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(created(), other.created())
&& Objects.equals(lastModified(), other.lastModified()) && Objects.equals(webhook(), other.webhook())
&& Objects.equals(vpcConfig(), other.vpcConfig()) && Objects.equals(badge(), other.badge())
&& Objects.equals(logsConfig(), other.logsConfig()) && hasFileSystemLocations() == other.hasFileSystemLocations()
&& Objects.equals(fileSystemLocations(), other.fileSystemLocations())
&& Objects.equals(buildBatchConfig(), other.buildBatchConfig())
&& Objects.equals(concurrentBuildLimit(), other.concurrentBuildLimit())
&& Objects.equals(projectVisibilityAsString(), other.projectVisibilityAsString())
&& Objects.equals(publicProjectAlias(), other.publicProjectAlias())
&& Objects.equals(resourceAccessRole(), other.resourceAccessRole());
}
/**
* 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("Project").add("Name", name()).add("Arn", arn()).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("Created", created())
.add("LastModified", lastModified()).add("Webhook", webhook()).add("VpcConfig", vpcConfig())
.add("Badge", badge()).add("LogsConfig", logsConfig())
.add("FileSystemLocations", hasFileSystemLocations() ? fileSystemLocations() : null)
.add("BuildBatchConfig", buildBatchConfig()).add("ConcurrentBuildLimit", concurrentBuildLimit())
.add("ProjectVisibility", projectVisibilityAsString()).add("PublicProjectAlias", publicProjectAlias())
.add("ResourceAccessRole", resourceAccessRole()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "arn":
return Optional.ofNullable(clazz.cast(arn()));
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 "created":
return Optional.ofNullable(clazz.cast(created()));
case "lastModified":
return Optional.ofNullable(clazz.cast(lastModified()));
case "webhook":
return Optional.ofNullable(clazz.cast(webhook()));
case "vpcConfig":
return Optional.ofNullable(clazz.cast(vpcConfig()));
case "badge":
return Optional.ofNullable(clazz.cast(badge()));
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()));
case "projectVisibility":
return Optional.ofNullable(clazz.cast(projectVisibilityAsString()));
case "publicProjectAlias":
return Optional.ofNullable(clazz.cast(publicProjectAlias()));
case "resourceAccessRole":
return Optional.ofNullable(clazz.cast(resourceAccessRole()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function