com.amazonaws.services.codeartifact.model.RepositoryDescription Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codeartifact 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.codeartifact.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The details of a repository stored in CodeArtifact. A CodeArtifact repository contains a set of package versions,
* each of which maps to a set of assets. Repositories are polyglot—a single repository can contain packages of any
* supported type. Each repository exposes endpoints for fetching and publishing packages using tools like the
* npm
CLI, the Maven CLI (mvn
), and pip
. You can create up to 100 repositories
* per Amazon Web Services account.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RepositoryDescription implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the repository.
*
*/
private String name;
/**
*
* The 12-digit account number of the Amazon Web Services account that manages the repository.
*
*/
private String administratorAccount;
/**
*
* The name of the domain that contains the repository.
*
*/
private String domainName;
/**
*
* The 12-digit account number of the Amazon Web Services account that owns the domain that contains the repository.
* It does not include dashes or spaces.
*
*/
private String domainOwner;
/**
*
* The Amazon Resource Name (ARN) of the repository.
*
*/
private String arn;
/**
*
* A text description of the repository.
*
*/
private String description;
/**
*
* A list of upstream repositories to associate with the repository. The order of the upstream repositories in the
* list determines their priority order when CodeArtifact looks for a requested package version. For more
* information, see Working with
* upstream repositories.
*
*/
private java.util.List upstreams;
/**
*
* An array of external connections associated with the repository.
*
*/
private java.util.List externalConnections;
/**
*
* A timestamp that represents the date and time the repository was created.
*
*/
private java.util.Date createdTime;
/**
*
* The name of the repository.
*
*
* @param name
* The name of the repository.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the repository.
*
*
* @return The name of the repository.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the repository.
*
*
* @param name
* The name of the repository.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RepositoryDescription withName(String name) {
setName(name);
return this;
}
/**
*
* The 12-digit account number of the Amazon Web Services account that manages the repository.
*
*
* @param administratorAccount
* The 12-digit account number of the Amazon Web Services account that manages the repository.
*/
public void setAdministratorAccount(String administratorAccount) {
this.administratorAccount = administratorAccount;
}
/**
*
* The 12-digit account number of the Amazon Web Services account that manages the repository.
*
*
* @return The 12-digit account number of the Amazon Web Services account that manages the repository.
*/
public String getAdministratorAccount() {
return this.administratorAccount;
}
/**
*
* The 12-digit account number of the Amazon Web Services account that manages the repository.
*
*
* @param administratorAccount
* The 12-digit account number of the Amazon Web Services account that manages the repository.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RepositoryDescription withAdministratorAccount(String administratorAccount) {
setAdministratorAccount(administratorAccount);
return this;
}
/**
*
* The name of the domain that contains the repository.
*
*
* @param domainName
* The name of the domain that contains the repository.
*/
public void setDomainName(String domainName) {
this.domainName = domainName;
}
/**
*
* The name of the domain that contains the repository.
*
*
* @return The name of the domain that contains the repository.
*/
public String getDomainName() {
return this.domainName;
}
/**
*
* The name of the domain that contains the repository.
*
*
* @param domainName
* The name of the domain that contains the repository.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RepositoryDescription withDomainName(String domainName) {
setDomainName(domainName);
return this;
}
/**
*
* The 12-digit account number of the Amazon Web Services account that owns the domain that contains the repository.
* It does not include dashes or spaces.
*
*
* @param domainOwner
* The 12-digit account number of the Amazon Web Services account that owns the domain that contains the
* repository. It does not include dashes or spaces.
*/
public void setDomainOwner(String domainOwner) {
this.domainOwner = domainOwner;
}
/**
*
* The 12-digit account number of the Amazon Web Services account that owns the domain that contains the repository.
* It does not include dashes or spaces.
*
*
* @return The 12-digit account number of the Amazon Web Services account that owns the domain that contains the
* repository. It does not include dashes or spaces.
*/
public String getDomainOwner() {
return this.domainOwner;
}
/**
*
* The 12-digit account number of the Amazon Web Services account that owns the domain that contains the repository.
* It does not include dashes or spaces.
*
*
* @param domainOwner
* The 12-digit account number of the Amazon Web Services account that owns the domain that contains the
* repository. It does not include dashes or spaces.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RepositoryDescription withDomainOwner(String domainOwner) {
setDomainOwner(domainOwner);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the repository.
*
*
* @param arn
* The Amazon Resource Name (ARN) of the repository.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The Amazon Resource Name (ARN) of the repository.
*
*
* @return The Amazon Resource Name (ARN) of the repository.
*/
public String getArn() {
return this.arn;
}
/**
*
* The Amazon Resource Name (ARN) of the repository.
*
*
* @param arn
* The Amazon Resource Name (ARN) of the repository.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RepositoryDescription withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* A text description of the repository.
*
*
* @param description
* A text description of the repository.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* A text description of the repository.
*
*
* @return A text description of the repository.
*/
public String getDescription() {
return this.description;
}
/**
*
* A text description of the repository.
*
*
* @param description
* A text description of the repository.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RepositoryDescription withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* A list of upstream repositories to associate with the repository. The order of the upstream repositories in the
* list determines their priority order when CodeArtifact looks for a requested package version. For more
* information, see Working with
* upstream repositories.
*
*
* @return A list of upstream repositories to associate with the repository. The order of the upstream repositories
* in the list determines their priority order when CodeArtifact looks for a requested package version. For
* more information, see Working with upstream
* repositories.
*/
public java.util.List getUpstreams() {
return upstreams;
}
/**
*
* A list of upstream repositories to associate with the repository. The order of the upstream repositories in the
* list determines their priority order when CodeArtifact looks for a requested package version. For more
* information, see Working with
* upstream repositories.
*
*
* @param upstreams
* A list of upstream repositories to associate with the repository. The order of the upstream repositories
* in the list determines their priority order when CodeArtifact looks for a requested package version. For
* more information, see Working with upstream
* repositories.
*/
public void setUpstreams(java.util.Collection upstreams) {
if (upstreams == null) {
this.upstreams = null;
return;
}
this.upstreams = new java.util.ArrayList(upstreams);
}
/**
*
* A list of upstream repositories to associate with the repository. The order of the upstream repositories in the
* list determines their priority order when CodeArtifact looks for a requested package version. For more
* information, see Working with
* upstream repositories.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setUpstreams(java.util.Collection)} or {@link #withUpstreams(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param upstreams
* A list of upstream repositories to associate with the repository. The order of the upstream repositories
* in the list determines their priority order when CodeArtifact looks for a requested package version. For
* more information, see Working with upstream
* repositories.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RepositoryDescription withUpstreams(UpstreamRepositoryInfo... upstreams) {
if (this.upstreams == null) {
setUpstreams(new java.util.ArrayList(upstreams.length));
}
for (UpstreamRepositoryInfo ele : upstreams) {
this.upstreams.add(ele);
}
return this;
}
/**
*
* A list of upstream repositories to associate with the repository. The order of the upstream repositories in the
* list determines their priority order when CodeArtifact looks for a requested package version. For more
* information, see Working with
* upstream repositories.
*
*
* @param upstreams
* A list of upstream repositories to associate with the repository. The order of the upstream repositories
* in the list determines their priority order when CodeArtifact looks for a requested package version. For
* more information, see Working with upstream
* repositories.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RepositoryDescription withUpstreams(java.util.Collection upstreams) {
setUpstreams(upstreams);
return this;
}
/**
*
* An array of external connections associated with the repository.
*
*
* @return An array of external connections associated with the repository.
*/
public java.util.List getExternalConnections() {
return externalConnections;
}
/**
*
* An array of external connections associated with the repository.
*
*
* @param externalConnections
* An array of external connections associated with the repository.
*/
public void setExternalConnections(java.util.Collection externalConnections) {
if (externalConnections == null) {
this.externalConnections = null;
return;
}
this.externalConnections = new java.util.ArrayList(externalConnections);
}
/**
*
* An array of external connections associated with the repository.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setExternalConnections(java.util.Collection)} or {@link #withExternalConnections(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param externalConnections
* An array of external connections associated with the repository.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RepositoryDescription withExternalConnections(RepositoryExternalConnectionInfo... externalConnections) {
if (this.externalConnections == null) {
setExternalConnections(new java.util.ArrayList(externalConnections.length));
}
for (RepositoryExternalConnectionInfo ele : externalConnections) {
this.externalConnections.add(ele);
}
return this;
}
/**
*
* An array of external connections associated with the repository.
*
*
* @param externalConnections
* An array of external connections associated with the repository.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RepositoryDescription withExternalConnections(java.util.Collection externalConnections) {
setExternalConnections(externalConnections);
return this;
}
/**
*
* A timestamp that represents the date and time the repository was created.
*
*
* @param createdTime
* A timestamp that represents the date and time the repository was created.
*/
public void setCreatedTime(java.util.Date createdTime) {
this.createdTime = createdTime;
}
/**
*
* A timestamp that represents the date and time the repository was created.
*
*
* @return A timestamp that represents the date and time the repository was created.
*/
public java.util.Date getCreatedTime() {
return this.createdTime;
}
/**
*
* A timestamp that represents the date and time the repository was created.
*
*
* @param createdTime
* A timestamp that represents the date and time the repository was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RepositoryDescription withCreatedTime(java.util.Date createdTime) {
setCreatedTime(createdTime);
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 (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getAdministratorAccount() != null)
sb.append("AdministratorAccount: ").append(getAdministratorAccount()).append(",");
if (getDomainName() != null)
sb.append("DomainName: ").append(getDomainName()).append(",");
if (getDomainOwner() != null)
sb.append("DomainOwner: ").append(getDomainOwner()).append(",");
if (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getUpstreams() != null)
sb.append("Upstreams: ").append(getUpstreams()).append(",");
if (getExternalConnections() != null)
sb.append("ExternalConnections: ").append(getExternalConnections()).append(",");
if (getCreatedTime() != null)
sb.append("CreatedTime: ").append(getCreatedTime());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RepositoryDescription == false)
return false;
RepositoryDescription other = (RepositoryDescription) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getAdministratorAccount() == null ^ this.getAdministratorAccount() == null)
return false;
if (other.getAdministratorAccount() != null && other.getAdministratorAccount().equals(this.getAdministratorAccount()) == false)
return false;
if (other.getDomainName() == null ^ this.getDomainName() == null)
return false;
if (other.getDomainName() != null && other.getDomainName().equals(this.getDomainName()) == false)
return false;
if (other.getDomainOwner() == null ^ this.getDomainOwner() == null)
return false;
if (other.getDomainOwner() != null && other.getDomainOwner().equals(this.getDomainOwner()) == false)
return false;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getUpstreams() == null ^ this.getUpstreams() == null)
return false;
if (other.getUpstreams() != null && other.getUpstreams().equals(this.getUpstreams()) == false)
return false;
if (other.getExternalConnections() == null ^ this.getExternalConnections() == null)
return false;
if (other.getExternalConnections() != null && other.getExternalConnections().equals(this.getExternalConnections()) == false)
return false;
if (other.getCreatedTime() == null ^ this.getCreatedTime() == null)
return false;
if (other.getCreatedTime() != null && other.getCreatedTime().equals(this.getCreatedTime()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getAdministratorAccount() == null) ? 0 : getAdministratorAccount().hashCode());
hashCode = prime * hashCode + ((getDomainName() == null) ? 0 : getDomainName().hashCode());
hashCode = prime * hashCode + ((getDomainOwner() == null) ? 0 : getDomainOwner().hashCode());
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getUpstreams() == null) ? 0 : getUpstreams().hashCode());
hashCode = prime * hashCode + ((getExternalConnections() == null) ? 0 : getExternalConnections().hashCode());
hashCode = prime * hashCode + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
return hashCode;
}
@Override
public RepositoryDescription clone() {
try {
return (RepositoryDescription) 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.codeartifact.model.transform.RepositoryDescriptionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}