com.amazonaws.services.apprunner.model.CodeRepository Maven / Gradle / Ivy
Show all versions of aws-java-sdk-apprunner 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.apprunner.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes a source code repository.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CodeRepository implements Serializable, Cloneable, StructuredPojo {
/**
*
* The location of the repository that contains the source code.
*
*/
private String repositoryUrl;
/**
*
* The version that should be used within the source code repository.
*
*/
private SourceCodeVersion sourceCodeVersion;
/**
*
* Configuration for building and running the service from a source code repository.
*
*
*
* CodeConfiguration
is required only for CreateService
request.
*
*
*/
private CodeConfiguration codeConfiguration;
/**
*
* The path of the directory that stores source code and configuration files. The build and start commands also
* execute from here. The path is absolute from root and, if not specified, defaults to the repository root.
*
*/
private String sourceDirectory;
/**
*
* The location of the repository that contains the source code.
*
*
* @param repositoryUrl
* The location of the repository that contains the source code.
*/
public void setRepositoryUrl(String repositoryUrl) {
this.repositoryUrl = repositoryUrl;
}
/**
*
* The location of the repository that contains the source code.
*
*
* @return The location of the repository that contains the source code.
*/
public String getRepositoryUrl() {
return this.repositoryUrl;
}
/**
*
* The location of the repository that contains the source code.
*
*
* @param repositoryUrl
* The location of the repository that contains the source code.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CodeRepository withRepositoryUrl(String repositoryUrl) {
setRepositoryUrl(repositoryUrl);
return this;
}
/**
*
* The version that should be used within the source code repository.
*
*
* @param sourceCodeVersion
* The version that should be used within the source code repository.
*/
public void setSourceCodeVersion(SourceCodeVersion sourceCodeVersion) {
this.sourceCodeVersion = sourceCodeVersion;
}
/**
*
* The version that should be used within the source code repository.
*
*
* @return The version that should be used within the source code repository.
*/
public SourceCodeVersion getSourceCodeVersion() {
return this.sourceCodeVersion;
}
/**
*
* The version that should be used within the source code repository.
*
*
* @param sourceCodeVersion
* The version that should be used within the source code repository.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CodeRepository withSourceCodeVersion(SourceCodeVersion sourceCodeVersion) {
setSourceCodeVersion(sourceCodeVersion);
return this;
}
/**
*
* Configuration for building and running the service from a source code repository.
*
*
*
* CodeConfiguration
is required only for CreateService
request.
*
*
*
* @param codeConfiguration
* Configuration for building and running the service from a source code repository.
*
* CodeConfiguration
is required only for CreateService
request.
*
*/
public void setCodeConfiguration(CodeConfiguration codeConfiguration) {
this.codeConfiguration = codeConfiguration;
}
/**
*
* Configuration for building and running the service from a source code repository.
*
*
*
* CodeConfiguration
is required only for CreateService
request.
*
*
*
* @return Configuration for building and running the service from a source code repository.
*
* CodeConfiguration
is required only for CreateService
request.
*
*/
public CodeConfiguration getCodeConfiguration() {
return this.codeConfiguration;
}
/**
*
* Configuration for building and running the service from a source code repository.
*
*
*
* CodeConfiguration
is required only for CreateService
request.
*
*
*
* @param codeConfiguration
* Configuration for building and running the service from a source code repository.
*
* CodeConfiguration
is required only for CreateService
request.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CodeRepository withCodeConfiguration(CodeConfiguration codeConfiguration) {
setCodeConfiguration(codeConfiguration);
return this;
}
/**
*
* The path of the directory that stores source code and configuration files. The build and start commands also
* execute from here. The path is absolute from root and, if not specified, defaults to the repository root.
*
*
* @param sourceDirectory
* The path of the directory that stores source code and configuration files. The build and start commands
* also execute from here. The path is absolute from root and, if not specified, defaults to the repository
* root.
*/
public void setSourceDirectory(String sourceDirectory) {
this.sourceDirectory = sourceDirectory;
}
/**
*
* The path of the directory that stores source code and configuration files. The build and start commands also
* execute from here. The path is absolute from root and, if not specified, defaults to the repository root.
*
*
* @return The path of the directory that stores source code and configuration files. The build and start commands
* also execute from here. The path is absolute from root and, if not specified, defaults to the repository
* root.
*/
public String getSourceDirectory() {
return this.sourceDirectory;
}
/**
*
* The path of the directory that stores source code and configuration files. The build and start commands also
* execute from here. The path is absolute from root and, if not specified, defaults to the repository root.
*
*
* @param sourceDirectory
* The path of the directory that stores source code and configuration files. The build and start commands
* also execute from here. The path is absolute from root and, if not specified, defaults to the repository
* root.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CodeRepository withSourceDirectory(String sourceDirectory) {
setSourceDirectory(sourceDirectory);
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 (getRepositoryUrl() != null)
sb.append("RepositoryUrl: ").append(getRepositoryUrl()).append(",");
if (getSourceCodeVersion() != null)
sb.append("SourceCodeVersion: ").append(getSourceCodeVersion()).append(",");
if (getCodeConfiguration() != null)
sb.append("CodeConfiguration: ").append(getCodeConfiguration()).append(",");
if (getSourceDirectory() != null)
sb.append("SourceDirectory: ").append(getSourceDirectory());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CodeRepository == false)
return false;
CodeRepository other = (CodeRepository) obj;
if (other.getRepositoryUrl() == null ^ this.getRepositoryUrl() == null)
return false;
if (other.getRepositoryUrl() != null && other.getRepositoryUrl().equals(this.getRepositoryUrl()) == false)
return false;
if (other.getSourceCodeVersion() == null ^ this.getSourceCodeVersion() == null)
return false;
if (other.getSourceCodeVersion() != null && other.getSourceCodeVersion().equals(this.getSourceCodeVersion()) == false)
return false;
if (other.getCodeConfiguration() == null ^ this.getCodeConfiguration() == null)
return false;
if (other.getCodeConfiguration() != null && other.getCodeConfiguration().equals(this.getCodeConfiguration()) == false)
return false;
if (other.getSourceDirectory() == null ^ this.getSourceDirectory() == null)
return false;
if (other.getSourceDirectory() != null && other.getSourceDirectory().equals(this.getSourceDirectory()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getRepositoryUrl() == null) ? 0 : getRepositoryUrl().hashCode());
hashCode = prime * hashCode + ((getSourceCodeVersion() == null) ? 0 : getSourceCodeVersion().hashCode());
hashCode = prime * hashCode + ((getCodeConfiguration() == null) ? 0 : getCodeConfiguration().hashCode());
hashCode = prime * hashCode + ((getSourceDirectory() == null) ? 0 : getSourceDirectory().hashCode());
return hashCode;
}
@Override
public CodeRepository clone() {
try {
return (CodeRepository) 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.apprunner.model.transform.CodeRepositoryMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}