com.amazonaws.services.codebuild.model.ProjectSourceVersion Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codebuild Show documentation
/*
* Copyright 2019-2024 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 com.amazonaws.services.codebuild.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A source identifier and its corresponding version.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ProjectSourceVersion implements Serializable, Cloneable, StructuredPojo {
/**
*
* An identifier for a source in the build project. The identifier can only contain alphanumeric characters and
* underscores, and must be less than 128 characters in length.
*
*/
private String sourceIdentifier;
/**
*
* The source version for the corresponding source identifier. If specified, 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 GitLab: the commit ID, branch, or Git tag to use.
*
*
* -
*
* 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.
*
*
*
*
* For more information, see Source Version Sample
* with CodeBuild in the CodeBuild User Guide.
*
*/
private String sourceVersion;
/**
*
* An identifier for a source in the build project. The identifier can only contain alphanumeric characters and
* underscores, and must be less than 128 characters in length.
*
*
* @param sourceIdentifier
* An identifier for a source in the build project. The identifier can only contain alphanumeric characters
* and underscores, and must be less than 128 characters in length.
*/
public void setSourceIdentifier(String sourceIdentifier) {
this.sourceIdentifier = sourceIdentifier;
}
/**
*
* An identifier for a source in the build project. The identifier can only contain alphanumeric characters and
* underscores, and must be less than 128 characters in length.
*
*
* @return An identifier for a source in the build project. The identifier can only contain alphanumeric characters
* and underscores, and must be less than 128 characters in length.
*/
public String getSourceIdentifier() {
return this.sourceIdentifier;
}
/**
*
* An identifier for a source in the build project. The identifier can only contain alphanumeric characters and
* underscores, and must be less than 128 characters in length.
*
*
* @param sourceIdentifier
* An identifier for a source in the build project. The identifier can only contain alphanumeric characters
* and underscores, and must be less than 128 characters in length.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ProjectSourceVersion withSourceIdentifier(String sourceIdentifier) {
setSourceIdentifier(sourceIdentifier);
return this;
}
/**
*
* The source version for the corresponding source identifier. If specified, 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 GitLab: the commit ID, branch, or Git tag to use.
*
*
* -
*
* 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.
*
*
*
*
* For more information, see Source Version Sample
* with CodeBuild in the CodeBuild User Guide.
*
*
* @param sourceVersion
* The source version for the corresponding source identifier. If specified, 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 GitLab: the commit ID, branch, or Git tag to use.
*
*
* -
*
* 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.
*
*
*
*
* For more information, see Source Version
* Sample with CodeBuild in the CodeBuild User Guide.
*/
public void setSourceVersion(String sourceVersion) {
this.sourceVersion = sourceVersion;
}
/**
*
* The source version for the corresponding source identifier. If specified, 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 GitLab: the commit ID, branch, or Git tag to use.
*
*
* -
*
* 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.
*
*
*
*
* For more information, see Source Version Sample
* with CodeBuild in the CodeBuild User Guide.
*
*
* @return The source version for the corresponding source identifier. If specified, 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 GitLab: the commit ID, branch, or Git tag to use.
*
*
* -
*
* 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.
*
*
*
*
* For more information, see Source Version
* Sample with CodeBuild in the CodeBuild User Guide.
*/
public String getSourceVersion() {
return this.sourceVersion;
}
/**
*
* The source version for the corresponding source identifier. If specified, 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 GitLab: the commit ID, branch, or Git tag to use.
*
*
* -
*
* 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.
*
*
*
*
* For more information, see Source Version Sample
* with CodeBuild in the CodeBuild User Guide.
*
*
* @param sourceVersion
* The source version for the corresponding source identifier. If specified, 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 GitLab: the commit ID, branch, or Git tag to use.
*
*
* -
*
* 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.
*
*
*
*
* 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.
*/
public ProjectSourceVersion withSourceVersion(String sourceVersion) {
setSourceVersion(sourceVersion);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getSourceIdentifier() != null)
sb.append("SourceIdentifier: ").append(getSourceIdentifier()).append(",");
if (getSourceVersion() != null)
sb.append("SourceVersion: ").append(getSourceVersion());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ProjectSourceVersion == false)
return false;
ProjectSourceVersion other = (ProjectSourceVersion) obj;
if (other.getSourceIdentifier() == null ^ this.getSourceIdentifier() == null)
return false;
if (other.getSourceIdentifier() != null && other.getSourceIdentifier().equals(this.getSourceIdentifier()) == false)
return false;
if (other.getSourceVersion() == null ^ this.getSourceVersion() == null)
return false;
if (other.getSourceVersion() != null && other.getSourceVersion().equals(this.getSourceVersion()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getSourceIdentifier() == null) ? 0 : getSourceIdentifier().hashCode());
hashCode = prime * hashCode + ((getSourceVersion() == null) ? 0 : getSourceVersion().hashCode());
return hashCode;
}
@Override
public ProjectSourceVersion clone() {
try {
return (ProjectSourceVersion) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.codebuild.model.transform.ProjectSourceVersionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}