/* * Copyright 2018-2023 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.AmazonWebServiceRequest; /** * * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CopyPackageVersionsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The name of the domain that contains the source and destination repositories. *
*/ private String domain; /** ** The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes * or spaces. *
*/ private String domainOwner; /** ** The name of the repository that contains the package versions to be copied. *
*/ private String sourceRepository; /** ** The name of the repository into which package versions are copied. *
*/ private String destinationRepository; /** ** The format of the package versions to be copied. *
*/ private String format; /** ** The namespace of the package versions to be copied. The package version component that specifies its namespace * depends on its type. For example: *
*
* The namespace of a Maven package version is its groupId
. The namespace is required when copying
* Maven package versions.
*
* The namespace of an npm package version is its scope
.
*
* Python and NuGet package versions do not contain a corresponding component, package versions of those formats do * not have a namespace. *
*
* The namespace of a generic package is its namespace
.
*
* The name of the package that contains the versions to be copied. *
*/ private String packageValue; /** ** The versions of the package to be copied. *
*
* You must specify versions
or versionRevisions
. You cannot specify both.
*
* A list of key-value pairs. The keys are package versions and the values are package version revisions. A
* CopyPackageVersion
operation succeeds if the specified versions in the source repository match the
* specified package version revision.
*
* You must specify versions
or versionRevisions
. You cannot specify both.
*
* Set to true to overwrite a package version that already exists in the destination repository. If set to false and
* the package version already exists in the destination repository, the package version is returned in the
* failedVersions
field of the response with an ALREADY_EXISTS
error code.
*
* Set to true to copy packages from repositories that are upstream from the source repository to the destination * repository. The default setting is false. For more information, see Working with upstream * repositories. *
*/ private Boolean includeFromUpstream; /** ** The name of the domain that contains the source and destination repositories. *
* * @param domain * The name of the domain that contains the source and destination repositories. */ public void setDomain(String domain) { this.domain = domain; } /** ** The name of the domain that contains the source and destination repositories. *
* * @return The name of the domain that contains the source and destination repositories. */ public String getDomain() { return this.domain; } /** ** The name of the domain that contains the source and destination repositories. *
* * @param domain * The name of the domain that contains the source and destination repositories. * @return Returns a reference to this object so that method calls can be chained together. */ public CopyPackageVersionsRequest withDomain(String domain) { setDomain(domain); return this; } /** ** The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes * or spaces. *
* * @param domainOwner * The 12-digit account number of the Amazon Web Services account that owns the domain. 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. It does not include dashes * or spaces. *
* * @return The 12-digit account number of the Amazon Web Services account that owns the domain. 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. It does not include dashes * or spaces. *
* * @param domainOwner * The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include * dashes or spaces. * @return Returns a reference to this object so that method calls can be chained together. */ public CopyPackageVersionsRequest withDomainOwner(String domainOwner) { setDomainOwner(domainOwner); return this; } /** ** The name of the repository that contains the package versions to be copied. *
* * @param sourceRepository * The name of the repository that contains the package versions to be copied. */ public void setSourceRepository(String sourceRepository) { this.sourceRepository = sourceRepository; } /** ** The name of the repository that contains the package versions to be copied. *
* * @return The name of the repository that contains the package versions to be copied. */ public String getSourceRepository() { return this.sourceRepository; } /** ** The name of the repository that contains the package versions to be copied. *
* * @param sourceRepository * The name of the repository that contains the package versions to be copied. * @return Returns a reference to this object so that method calls can be chained together. */ public CopyPackageVersionsRequest withSourceRepository(String sourceRepository) { setSourceRepository(sourceRepository); return this; } /** ** The name of the repository into which package versions are copied. *
* * @param destinationRepository * The name of the repository into which package versions are copied. */ public void setDestinationRepository(String destinationRepository) { this.destinationRepository = destinationRepository; } /** ** The name of the repository into which package versions are copied. *
* * @return The name of the repository into which package versions are copied. */ public String getDestinationRepository() { return this.destinationRepository; } /** ** The name of the repository into which package versions are copied. *
* * @param destinationRepository * The name of the repository into which package versions are copied. * @return Returns a reference to this object so that method calls can be chained together. */ public CopyPackageVersionsRequest withDestinationRepository(String destinationRepository) { setDestinationRepository(destinationRepository); return this; } /** ** The format of the package versions to be copied. *
* * @param format * The format of the package versions to be copied. * @see PackageFormat */ public void setFormat(String format) { this.format = format; } /** ** The format of the package versions to be copied. *
* * @return The format of the package versions to be copied. * @see PackageFormat */ public String getFormat() { return this.format; } /** ** The format of the package versions to be copied. *
* * @param format * The format of the package versions to be copied. * @return Returns a reference to this object so that method calls can be chained together. * @see PackageFormat */ public CopyPackageVersionsRequest withFormat(String format) { setFormat(format); return this; } /** ** The format of the package versions to be copied. *
* * @param format * The format of the package versions to be copied. * @return Returns a reference to this object so that method calls can be chained together. * @see PackageFormat */ public CopyPackageVersionsRequest withFormat(PackageFormat format) { this.format = format.toString(); return this; } /** ** The namespace of the package versions to be copied. The package version component that specifies its namespace * depends on its type. For example: *
*
* The namespace of a Maven package version is its groupId
. The namespace is required when copying
* Maven package versions.
*
* The namespace of an npm package version is its scope
.
*
* Python and NuGet package versions do not contain a corresponding component, package versions of those formats do * not have a namespace. *
*
* The namespace of a generic package is its namespace
.
*
* The namespace of a Maven package version is its groupId
. The namespace is required when
* copying Maven package versions.
*
* The namespace of an npm package version is its scope
.
*
* Python and NuGet package versions do not contain a corresponding component, package versions of those * formats do not have a namespace. *
*
* The namespace of a generic package is its namespace
.
*
* The namespace of the package versions to be copied. The package version component that specifies its namespace * depends on its type. For example: *
*
* The namespace of a Maven package version is its groupId
. The namespace is required when copying
* Maven package versions.
*
* The namespace of an npm package version is its scope
.
*
* Python and NuGet package versions do not contain a corresponding component, package versions of those formats do * not have a namespace. *
*
* The namespace of a generic package is its namespace
.
*
* The namespace of a Maven package version is its groupId
. The namespace is required when
* copying Maven package versions.
*
* The namespace of an npm package version is its scope
.
*
* Python and NuGet package versions do not contain a corresponding component, package versions of those * formats do not have a namespace. *
*
* The namespace of a generic package is its namespace
.
*
* The namespace of the package versions to be copied. The package version component that specifies its namespace * depends on its type. For example: *
*
* The namespace of a Maven package version is its groupId
. The namespace is required when copying
* Maven package versions.
*
* The namespace of an npm package version is its scope
.
*
* Python and NuGet package versions do not contain a corresponding component, package versions of those formats do * not have a namespace. *
*
* The namespace of a generic package is its namespace
.
*
* The namespace of a Maven package version is its groupId
. The namespace is required when
* copying Maven package versions.
*
* The namespace of an npm package version is its scope
.
*
* Python and NuGet package versions do not contain a corresponding component, package versions of those * formats do not have a namespace. *
*
* The namespace of a generic package is its namespace
.
*
* The name of the package that contains the versions to be copied. *
* * @param packageValue * The name of the package that contains the versions to be copied. */ public void setPackage(String packageValue) { this.packageValue = packageValue; } /** ** The name of the package that contains the versions to be copied. *
* * @return The name of the package that contains the versions to be copied. */ public String getPackage() { return this.packageValue; } /** ** The name of the package that contains the versions to be copied. *
* * @param packageValue * The name of the package that contains the versions to be copied. * @return Returns a reference to this object so that method calls can be chained together. */ public CopyPackageVersionsRequest withPackage(String packageValue) { setPackage(packageValue); return this; } /** ** The versions of the package to be copied. *
*
* You must specify versions
or versionRevisions
. You cannot specify both.
*
* You must specify versions
or versionRevisions
. You cannot specify both.
*
* The versions of the package to be copied. *
*
* You must specify versions
or versionRevisions
. You cannot specify both.
*
* You must specify versions
or versionRevisions
. You cannot specify both.
*
* The versions of the package to be copied. *
*
* You must specify versions
or versionRevisions
. You cannot specify both.
*
* NOTE: This method appends the values to the existing list (if any). Use * {@link #setVersions(java.util.Collection)} or {@link #withVersions(java.util.Collection)} if you want to override * the existing values. *
* * @param versions * The versions of the package to be copied.
* You must specify versions
or versionRevisions
. You cannot specify both.
*
* The versions of the package to be copied. *
*
* You must specify versions
or versionRevisions
. You cannot specify both.
*
* You must specify versions
or versionRevisions
. You cannot specify both.
*
* A list of key-value pairs. The keys are package versions and the values are package version revisions. A
* CopyPackageVersion
operation succeeds if the specified versions in the source repository match the
* specified package version revision.
*
* You must specify versions
or versionRevisions
. You cannot specify both.
*
CopyPackageVersion
operation succeeds if the specified versions in the source repository
* match the specified package version revision.
* You must specify versions
or versionRevisions
. You cannot specify both.
*
* A list of key-value pairs. The keys are package versions and the values are package version revisions. A
* CopyPackageVersion
operation succeeds if the specified versions in the source repository match the
* specified package version revision.
*
* You must specify versions
or versionRevisions
. You cannot specify both.
*
CopyPackageVersion
operation succeeds if the specified versions in the source repository
* match the specified package version revision.
* You must specify versions
or versionRevisions
. You cannot specify both.
*
* A list of key-value pairs. The keys are package versions and the values are package version revisions. A
* CopyPackageVersion
operation succeeds if the specified versions in the source repository match the
* specified package version revision.
*
* You must specify versions
or versionRevisions
. You cannot specify both.
*
CopyPackageVersion
operation succeeds if the specified versions in the source repository
* match the specified package version revision.
* You must specify versions
or versionRevisions
. You cannot specify both.
*
* Set to true to overwrite a package version that already exists in the destination repository. If set to false and
* the package version already exists in the destination repository, the package version is returned in the
* failedVersions
field of the response with an ALREADY_EXISTS
error code.
*
failedVersions
field of the response with an ALREADY_EXISTS
* error code.
*/
public void setAllowOverwrite(Boolean allowOverwrite) {
this.allowOverwrite = allowOverwrite;
}
/**
*
* Set to true to overwrite a package version that already exists in the destination repository. If set to false and
* the package version already exists in the destination repository, the package version is returned in the
* failedVersions
field of the response with an ALREADY_EXISTS
error code.
*
failedVersions
field of the response with an ALREADY_EXISTS
* error code.
*/
public Boolean getAllowOverwrite() {
return this.allowOverwrite;
}
/**
*
* Set to true to overwrite a package version that already exists in the destination repository. If set to false and
* the package version already exists in the destination repository, the package version is returned in the
* failedVersions
field of the response with an ALREADY_EXISTS
error code.
*
failedVersions
field of the response with an ALREADY_EXISTS
* error code.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopyPackageVersionsRequest withAllowOverwrite(Boolean allowOverwrite) {
setAllowOverwrite(allowOverwrite);
return this;
}
/**
*
* Set to true to overwrite a package version that already exists in the destination repository. If set to false and
* the package version already exists in the destination repository, the package version is returned in the
* failedVersions
field of the response with an ALREADY_EXISTS
error code.
*
failedVersions
field of the response with an ALREADY_EXISTS
* error code.
*/
public Boolean isAllowOverwrite() {
return this.allowOverwrite;
}
/**
* * Set to true to copy packages from repositories that are upstream from the source repository to the destination * repository. The default setting is false. For more information, see Working with upstream * repositories. *
* * @param includeFromUpstream * Set to true to copy packages from repositories that are upstream from the source repository to the * destination repository. The default setting is false. For more information, see Working with upstream * repositories. */ public void setIncludeFromUpstream(Boolean includeFromUpstream) { this.includeFromUpstream = includeFromUpstream; } /** ** Set to true to copy packages from repositories that are upstream from the source repository to the destination * repository. The default setting is false. For more information, see Working with upstream * repositories. *
* * @return Set to true to copy packages from repositories that are upstream from the source repository to the * destination repository. The default setting is false. For more information, see Working with upstream * repositories. */ public Boolean getIncludeFromUpstream() { return this.includeFromUpstream; } /** ** Set to true to copy packages from repositories that are upstream from the source repository to the destination * repository. The default setting is false. For more information, see Working with upstream * repositories. *
* * @param includeFromUpstream * Set to true to copy packages from repositories that are upstream from the source repository to the * destination repository. The default setting is false. For more information, see Working with upstream * repositories. * @return Returns a reference to this object so that method calls can be chained together. */ public CopyPackageVersionsRequest withIncludeFromUpstream(Boolean includeFromUpstream) { setIncludeFromUpstream(includeFromUpstream); return this; } /** ** Set to true to copy packages from repositories that are upstream from the source repository to the destination * repository. The default setting is false. For more information, see Working with upstream * repositories. *
* * @return Set to true to copy packages from repositories that are upstream from the source repository to the * destination repository. The default setting is false. For more information, see Working with upstream * repositories. */ public Boolean isIncludeFromUpstream() { return this.includeFromUpstream; } /** * 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 (getDomain() != null) sb.append("Domain: ").append(getDomain()).append(","); if (getDomainOwner() != null) sb.append("DomainOwner: ").append(getDomainOwner()).append(","); if (getSourceRepository() != null) sb.append("SourceRepository: ").append(getSourceRepository()).append(","); if (getDestinationRepository() != null) sb.append("DestinationRepository: ").append(getDestinationRepository()).append(","); if (getFormat() != null) sb.append("Format: ").append(getFormat()).append(","); if (getNamespace() != null) sb.append("Namespace: ").append(getNamespace()).append(","); if (getPackage() != null) sb.append("Package: ").append(getPackage()).append(","); if (getVersions() != null) sb.append("Versions: ").append(getVersions()).append(","); if (getVersionRevisions() != null) sb.append("VersionRevisions: ").append(getVersionRevisions()).append(","); if (getAllowOverwrite() != null) sb.append("AllowOverwrite: ").append(getAllowOverwrite()).append(","); if (getIncludeFromUpstream() != null) sb.append("IncludeFromUpstream: ").append(getIncludeFromUpstream()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CopyPackageVersionsRequest == false) return false; CopyPackageVersionsRequest other = (CopyPackageVersionsRequest) obj; if (other.getDomain() == null ^ this.getDomain() == null) return false; if (other.getDomain() != null && other.getDomain().equals(this.getDomain()) == 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.getSourceRepository() == null ^ this.getSourceRepository() == null) return false; if (other.getSourceRepository() != null && other.getSourceRepository().equals(this.getSourceRepository()) == false) return false; if (other.getDestinationRepository() == null ^ this.getDestinationRepository() == null) return false; if (other.getDestinationRepository() != null && other.getDestinationRepository().equals(this.getDestinationRepository()) == false) return false; if (other.getFormat() == null ^ this.getFormat() == null) return false; if (other.getFormat() != null && other.getFormat().equals(this.getFormat()) == false) return false; if (other.getNamespace() == null ^ this.getNamespace() == null) return false; if (other.getNamespace() != null && other.getNamespace().equals(this.getNamespace()) == false) return false; if (other.getPackage() == null ^ this.getPackage() == null) return false; if (other.getPackage() != null && other.getPackage().equals(this.getPackage()) == false) return false; if (other.getVersions() == null ^ this.getVersions() == null) return false; if (other.getVersions() != null && other.getVersions().equals(this.getVersions()) == false) return false; if (other.getVersionRevisions() == null ^ this.getVersionRevisions() == null) return false; if (other.getVersionRevisions() != null && other.getVersionRevisions().equals(this.getVersionRevisions()) == false) return false; if (other.getAllowOverwrite() == null ^ this.getAllowOverwrite() == null) return false; if (other.getAllowOverwrite() != null && other.getAllowOverwrite().equals(this.getAllowOverwrite()) == false) return false; if (other.getIncludeFromUpstream() == null ^ this.getIncludeFromUpstream() == null) return false; if (other.getIncludeFromUpstream() != null && other.getIncludeFromUpstream().equals(this.getIncludeFromUpstream()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDomain() == null) ? 0 : getDomain().hashCode()); hashCode = prime * hashCode + ((getDomainOwner() == null) ? 0 : getDomainOwner().hashCode()); hashCode = prime * hashCode + ((getSourceRepository() == null) ? 0 : getSourceRepository().hashCode()); hashCode = prime * hashCode + ((getDestinationRepository() == null) ? 0 : getDestinationRepository().hashCode()); hashCode = prime * hashCode + ((getFormat() == null) ? 0 : getFormat().hashCode()); hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode()); hashCode = prime * hashCode + ((getPackage() == null) ? 0 : getPackage().hashCode()); hashCode = prime * hashCode + ((getVersions() == null) ? 0 : getVersions().hashCode()); hashCode = prime * hashCode + ((getVersionRevisions() == null) ? 0 : getVersionRevisions().hashCode()); hashCode = prime * hashCode + ((getAllowOverwrite() == null) ? 0 : getAllowOverwrite().hashCode()); hashCode = prime * hashCode + ((getIncludeFromUpstream() == null) ? 0 : getIncludeFromUpstream().hashCode()); return hashCode; } @Override public CopyPackageVersionsRequest clone() { return (CopyPackageVersionsRequest) super.clone(); } }