Class Build
- java.lang.Object
-
- software.amazon.awssdk.services.codebuild.model.Build
-
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<Build.Builder,Build>
@Generated("software.amazon.awssdk:codegen") public final class Build extends Object implements SdkPojo, Serializable, ToCopyableBuilder<Build.Builder,Build>
Information about a build.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBuild.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringarn()The Amazon Resource Name (ARN) of the build.BuildArtifactsartifacts()Information about the output artifacts for the build.StringbuildBatchArn()The ARN of the batch build that this build is a member of, if applicable.BooleanbuildComplete()Whether the build is complete.static Build.Builderbuilder()LongbuildNumber()The number of the build.StatusTypebuildStatus()The current status of the build.StringbuildStatusAsString()The current status of the build.ProjectCachecache()Information about the cache for the build.StringcurrentPhase()The current build phase.DebugSessiondebugSession()Contains information about the debug session for this build.StringencryptionKey()The Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts.InstantendTime()When the build process ended, expressed in Unix time format.ProjectEnvironmentenvironment()Information about the build environment for this build.booleanequals(Object obj)booleanequalsBySdkFields(Object obj)List<ExportedEnvironmentVariable>exportedEnvironmentVariables()A list of exported environment variables for this build.List<ProjectFileSystemLocation>fileSystemLocations()An array ofProjectFileSystemLocationobjects for a CodeBuild build project.<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)booleanhasExportedEnvironmentVariables()For responses, this returns true if the service returned a value for the ExportedEnvironmentVariables property.booleanhasFileSystemLocations()For responses, this returns true if the service returned a value for the FileSystemLocations property.inthashCode()booleanhasPhases()For responses, this returns true if the service returned a value for the Phases property.booleanhasReportArns()For responses, this returns true if the service returned a value for the ReportArns property.booleanhasSecondaryArtifacts()For responses, this returns true if the service returned a value for the SecondaryArtifacts property.booleanhasSecondarySources()For responses, this returns true if the service returned a value for the SecondarySources property.booleanhasSecondarySourceVersions()For responses, this returns true if the service returned a value for the SecondarySourceVersions property.Stringid()The unique ID for the build.Stringinitiator()The entity that started the build.LogsLocationlogs()Information about the build's logs in CloudWatch Logs.NetworkInterfacenetworkInterface()Describes a network interface.List<BuildPhase>phases()Information about all previous build phases that are complete and information about any current build phase that is not yet complete.StringprojectName()The name of the CodeBuild project.IntegerqueuedTimeoutInMinutes()The number of minutes a build is allowed to be queued before it times out.List<String>reportArns()An array of the ARNs associated with this build's reports.StringresolvedSourceVersion()An identifier for the version of this build's source code.List<SdkField<?>>sdkFields()List<BuildArtifacts>secondaryArtifacts()An array ofProjectArtifactsobjects.List<ProjectSource>secondarySources()An array ofProjectSourceobjects.List<ProjectSourceVersion>secondarySourceVersions()An array ofProjectSourceVersionobjects.static Class<? extends Build.Builder>serializableBuilderClass()StringserviceRole()The name of a service role used for this build.ProjectSourcesource()Information about the source code to be built.StringsourceVersion()Any version identifier for the version of the source code to be built.InstantstartTime()When the build process started, expressed in Unix time format.IntegertimeoutInMinutes()How long, in minutes, for CodeBuild to wait before timing out this build if it does not get marked as completed.Build.BuildertoBuilder()StringtoString()Returns a string representation of this object.VpcConfigvpcConfig()If your CodeBuild project accesses resources in an Amazon VPC, you provide this parameter that identifies the VPC ID and the list of security group IDs and subnet IDs.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
id
public final String id()
The unique ID for the build.
- Returns:
- The unique ID for the build.
-
arn
public final String arn()
The Amazon Resource Name (ARN) of the build.
- Returns:
- The Amazon Resource Name (ARN) of the build.
-
buildNumber
public final Long buildNumber()
The number of the build. For each project, the
buildNumberof its first build is1. ThebuildNumberof each subsequent build is incremented by1. If a build is deleted, thebuildNumberof other builds does not change.- Returns:
- The number of the build. For each project, the
buildNumberof its first build is1. ThebuildNumberof each subsequent build is incremented by1. If a build is deleted, thebuildNumberof other builds does not change.
-
startTime
public final Instant startTime()
When the build process started, expressed in Unix time format.
- Returns:
- When the build process started, expressed in Unix time format.
-
endTime
public final Instant endTime()
When the build process ended, expressed in Unix time format.
- Returns:
- When the build process ended, expressed in Unix time format.
-
currentPhase
public final String currentPhase()
The current build phase.
- Returns:
- The current build phase.
-
buildStatus
public final StatusType buildStatus()
The current status of the build. Valid values include:
-
FAILED: The build failed. -
FAULT: The build faulted. -
IN_PROGRESS: The build is still in progress. -
STOPPED: The build stopped. -
SUCCEEDED: The build succeeded. -
TIMED_OUT: The build timed out.
If the service returns an enum value that is not available in the current SDK version,
buildStatuswill returnStatusType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frombuildStatusAsString().- Returns:
- The current status of the build. Valid values include:
-
FAILED: The build failed. -
FAULT: The build faulted. -
IN_PROGRESS: The build is still in progress. -
STOPPED: The build stopped. -
SUCCEEDED: The build succeeded. -
TIMED_OUT: The build timed out.
-
- See Also:
StatusType
-
-
buildStatusAsString
public final String buildStatusAsString()
The current status of the build. Valid values include:
-
FAILED: The build failed. -
FAULT: The build faulted. -
IN_PROGRESS: The build is still in progress. -
STOPPED: The build stopped. -
SUCCEEDED: The build succeeded. -
TIMED_OUT: The build timed out.
If the service returns an enum value that is not available in the current SDK version,
buildStatuswill returnStatusType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frombuildStatusAsString().- Returns:
- The current status of the build. Valid values include:
-
FAILED: The build failed. -
FAULT: The build faulted. -
IN_PROGRESS: The build is still in progress. -
STOPPED: The build stopped. -
SUCCEEDED: The build succeeded. -
TIMED_OUT: The build timed out.
-
- See Also:
StatusType
-
-
sourceVersion
public final String sourceVersion()
Any version identifier for the version of the source code to be built. If
sourceVersionis specified at the project level, then thissourceVersion(at the build level) takes precedence.For more information, see Source Version Sample with CodeBuild in the CodeBuild User Guide.
- Returns:
- Any version identifier for the version of the source code to be built. If
sourceVersionis specified at the project level, then thissourceVersion(at the build level) takes precedence.For more information, see Source Version Sample with CodeBuild in the CodeBuild User Guide.
-
resolvedSourceVersion
public final String resolvedSourceVersion()
An identifier for the version of this build's source code.
-
For CodeCommit, GitHub, GitHub Enterprise, and BitBucket, the commit ID.
-
For CodePipeline, the source revision provided by CodePipeline.
-
For Amazon S3, this does not apply.
- Returns:
- An identifier for the version of this build's source code.
-
For CodeCommit, GitHub, GitHub Enterprise, and BitBucket, the commit ID.
-
For CodePipeline, the source revision provided by CodePipeline.
-
For Amazon S3, this does not apply.
-
-
-
projectName
public final String projectName()
The name of the CodeBuild project.
- Returns:
- The name of the CodeBuild project.
-
hasPhases
public final boolean hasPhases()
For responses, this returns true if the service returned a value for the Phases property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()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.
-
phases
public final List<BuildPhase> phases()
Information about all previous build phases that are complete and information about any current build phase that is not yet complete.
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
hasPhases()method.- Returns:
- Information about all previous build phases that are complete and information about any current build phase that is not yet complete.
-
source
public final ProjectSource source()
Information about the source code to be built.
- Returns:
- Information about the source code to be built.
-
hasSecondarySources
public final boolean hasSecondarySources()
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 theisEmpty()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.
-
secondarySources
public final List<ProjectSource> secondarySources()
An array of
ProjectSourceobjects.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
hasSecondarySources()method.- Returns:
- An array of
ProjectSourceobjects.
-
hasSecondarySourceVersions
public final boolean hasSecondarySourceVersions()
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 theisEmpty()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.
-
secondarySourceVersions
public final List<ProjectSourceVersion> secondarySourceVersions()
An array of
ProjectSourceVersionobjects. EachProjectSourceVersionmust 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.
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
hasSecondarySourceVersions()method.- Returns:
- An array of
ProjectSourceVersionobjects. EachProjectSourceVersionmust 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.
-
-
-
artifacts
public final BuildArtifacts artifacts()
Information about the output artifacts for the build.
- Returns:
- Information about the output artifacts for the build.
-
hasSecondaryArtifacts
public final boolean hasSecondaryArtifacts()
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 theisEmpty()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.
-
secondaryArtifacts
public final List<BuildArtifacts> secondaryArtifacts()
An array of
ProjectArtifactsobjects.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
hasSecondaryArtifacts()method.- Returns:
- An array of
ProjectArtifactsobjects.
-
cache
public final ProjectCache cache()
Information about the cache for the build.
- Returns:
- Information about the cache for the build.
-
environment
public final ProjectEnvironment environment()
Information about the build environment for this build.
- Returns:
- Information about the build environment for this build.
-
serviceRole
public final String serviceRole()
The name of a service role used for this build.
- Returns:
- The name of a service role used for this build.
-
logs
public final LogsLocation logs()
Information about the build's logs in CloudWatch Logs.
- Returns:
- Information about the build's logs in CloudWatch Logs.
-
timeoutInMinutes
public final Integer timeoutInMinutes()
How long, in minutes, for CodeBuild to wait before timing out this build if it does not get marked as completed.
- Returns:
- How long, in minutes, for CodeBuild to wait before timing out this build if it does not get marked as completed.
-
queuedTimeoutInMinutes
public final Integer queuedTimeoutInMinutes()
The number of minutes a build is allowed to be queued before it times out.
- Returns:
- The number of minutes a build is allowed to be queued before it times out.
-
buildComplete
public final Boolean buildComplete()
Whether the build is complete. True if complete; otherwise, false.
- Returns:
- Whether the build is complete. True if complete; otherwise, false.
-
initiator
public final String initiator()
The entity that started the build. Valid values include:
-
If CodePipeline started the build, the pipeline's name (for example,
codepipeline/my-demo-pipeline). -
If a user started the build, the user's name (for example,
MyUserName). -
If the Jenkins plugin for CodeBuild started the build, the string
CodeBuild-Jenkins-Plugin.
- Returns:
- The entity that started the build. Valid values include:
-
If CodePipeline started the build, the pipeline's name (for example,
codepipeline/my-demo-pipeline). -
If a user started the build, the user's name (for example,
MyUserName). -
If the Jenkins plugin for CodeBuild started the build, the string
CodeBuild-Jenkins-Plugin.
-
-
-
vpcConfig
public final VpcConfig vpcConfig()
If your CodeBuild project accesses resources in an Amazon VPC, you provide this parameter that identifies the VPC ID and the list of security group IDs and subnet IDs. The security groups and subnets must belong to the same VPC. You must provide at least one security group and one subnet ID.
- Returns:
- If your CodeBuild project accesses resources in an Amazon VPC, you provide this parameter that identifies the VPC ID and the list of security group IDs and subnet IDs. The security groups and subnets must belong to the same VPC. You must provide at least one security group and one subnet ID.
-
networkInterface
public final NetworkInterface networkInterface()
Describes a network interface.
- Returns:
- Describes a network interface.
-
encryptionKey
public final String 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>).- Returns:
- 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>).
-
hasExportedEnvironmentVariables
public final boolean hasExportedEnvironmentVariables()
For responses, this returns true if the service returned a value for the ExportedEnvironmentVariables property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()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.
-
exportedEnvironmentVariables
public final List<ExportedEnvironmentVariable> exportedEnvironmentVariables()
A list of exported environment variables for this build.
Exported environment variables are used in conjunction with CodePipeline to export environment variables from the current build stage to subsequent stages in the pipeline. For more information, see Working with variables in the CodePipeline User Guide.
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
hasExportedEnvironmentVariables()method.- Returns:
- A list of exported environment variables for this build.
Exported environment variables are used in conjunction with CodePipeline to export environment variables from the current build stage to subsequent stages in the pipeline. For more information, see Working with variables in the CodePipeline User Guide.
-
hasReportArns
public final boolean hasReportArns()
For responses, this returns true if the service returned a value for the ReportArns property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()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.
-
reportArns
public final List<String> reportArns()
An array of the ARNs associated with this build's reports.
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
hasReportArns()method.- Returns:
- An array of the ARNs associated with this build's reports.
-
hasFileSystemLocations
public final boolean hasFileSystemLocations()
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 theisEmpty()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.
-
fileSystemLocations
public final List<ProjectFileSystemLocation> fileSystemLocations()
An array of
ProjectFileSystemLocationobjects for a CodeBuild build project. AProjectFileSystemLocationobject specifies theidentifier,location,mountOptions,mountPoint, andtypeof 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
hasFileSystemLocations()method.- Returns:
- An array of
ProjectFileSystemLocationobjects for a CodeBuild build project. AProjectFileSystemLocationobject specifies theidentifier,location,mountOptions,mountPoint, andtypeof a file system created using Amazon Elastic File System.
-
debugSession
public final DebugSession debugSession()
Contains information about the debug session for this build.
- Returns:
- Contains information about the debug session for this build.
-
buildBatchArn
public final String buildBatchArn()
The ARN of the batch build that this build is a member of, if applicable.
- Returns:
- The ARN of the batch build that this build is a member of, if applicable.
-
toBuilder
public Build.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<Build.Builder,Build>
-
builder
public static Build.Builder builder()
-
serializableBuilderClass
public static Class<? extends Build.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
public final String toString()
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.
-
-