com.amazonaws.services.codeartifact.model.CreateDomainRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codeartifact Show documentation
/*
* Copyright 2016-2021 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 CreateDomainRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must be
* unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name
* because it is publicly discoverable.
*
*/
private String domain;
/**
*
* The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key can be a
* key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an
* encryptionKey
, your IAM role must have kms:DescribeKey
and kms:CreateGrant
* permissions on the encryption key that is used. For more information, see DescribeKey in the AWS Key Management Service API Reference and AWS KMS API
* Permissions Reference in the AWS Key Management Service Developer Guide.
*
*
*
* CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more
* information, see Using
* symmetric and asymmetric keys in the AWS Key Management Service Developer Guide.
*
*
*/
private String encryptionKey;
/**
*
* One or more tag key-value pairs for the domain.
*
*/
private java.util.List tags;
/**
*
* The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must be
* unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name
* because it is publicly discoverable.
*
*
* @param domain
* The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must
* be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a
* domain name because it is publicly discoverable.
*/
public void setDomain(String domain) {
this.domain = domain;
}
/**
*
* The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must be
* unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name
* because it is publicly discoverable.
*
*
* @return The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must
* be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a
* domain name because it is publicly discoverable.
*/
public String getDomain() {
return this.domain;
}
/**
*
* The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must be
* unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name
* because it is publicly discoverable.
*
*
* @param domain
* The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must
* be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a
* domain name because it is publicly discoverable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDomainRequest withDomain(String domain) {
setDomain(domain);
return this;
}
/**
*
* The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key can be a
* key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an
* encryptionKey
, your IAM role must have kms:DescribeKey
and kms:CreateGrant
* permissions on the encryption key that is used. For more information, see DescribeKey in the AWS Key Management Service API Reference and AWS KMS API
* Permissions Reference in the AWS Key Management Service Developer Guide.
*
*
*
* CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more
* information, see Using
* symmetric and asymmetric keys in the AWS Key Management Service Developer Guide.
*
*
*
* @param encryptionKey
* The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key
* can be a key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an
* encryptionKey
, your IAM role must have kms:DescribeKey
and
* kms:CreateGrant
permissions on the encryption key that is used. For more information, see DescribeKey in the AWS Key Management Service API Reference and AWS KMS
* API Permissions Reference in the AWS Key Management Service Developer Guide.
*
* CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more
* information, see Using symmetric and
* asymmetric keys in the AWS Key Management Service Developer Guide.
*
*/
public void setEncryptionKey(String encryptionKey) {
this.encryptionKey = encryptionKey;
}
/**
*
* The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key can be a
* key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an
* encryptionKey
, your IAM role must have kms:DescribeKey
and kms:CreateGrant
* permissions on the encryption key that is used. For more information, see DescribeKey in the AWS Key Management Service API Reference and AWS KMS API
* Permissions Reference in the AWS Key Management Service Developer Guide.
*
*
*
* CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more
* information, see Using
* symmetric and asymmetric keys in the AWS Key Management Service Developer Guide.
*
*
*
* @return The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key
* can be a key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an
* encryptionKey
, your IAM role must have kms:DescribeKey
and
* kms:CreateGrant
permissions on the encryption key that is used. For more information, see DescribeKey in the AWS Key Management Service API Reference and AWS KMS
* API Permissions Reference in the AWS Key Management Service Developer Guide.
*
* CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more
* information, see Using symmetric
* and asymmetric keys in the AWS Key Management Service Developer Guide.
*
*/
public String getEncryptionKey() {
return this.encryptionKey;
}
/**
*
* The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key can be a
* key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an
* encryptionKey
, your IAM role must have kms:DescribeKey
and kms:CreateGrant
* permissions on the encryption key that is used. For more information, see DescribeKey in the AWS Key Management Service API Reference and AWS KMS API
* Permissions Reference in the AWS Key Management Service Developer Guide.
*
*
*
* CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more
* information, see Using
* symmetric and asymmetric keys in the AWS Key Management Service Developer Guide.
*
*
*
* @param encryptionKey
* The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key
* can be a key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an
* encryptionKey
, your IAM role must have kms:DescribeKey
and
* kms:CreateGrant
permissions on the encryption key that is used. For more information, see DescribeKey in the AWS Key Management Service API Reference and AWS KMS
* API Permissions Reference in the AWS Key Management Service Developer Guide.
*
* CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more
* information, see Using symmetric and
* asymmetric keys in the AWS Key Management Service Developer Guide.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDomainRequest withEncryptionKey(String encryptionKey) {
setEncryptionKey(encryptionKey);
return this;
}
/**
*
* One or more tag key-value pairs for the domain.
*
*
* @return One or more tag key-value pairs for the domain.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* One or more tag key-value pairs for the domain.
*
*
* @param tags
* One or more tag key-value pairs for the domain.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* One or more tag key-value pairs for the domain.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* One or more tag key-value pairs for the domain.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDomainRequest withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* One or more tag key-value pairs for the domain.
*
*
* @param tags
* One or more tag key-value pairs for the domain.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDomainRequest withTags(java.util.Collection tags) {
setTags(tags);
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 (getDomain() != null)
sb.append("Domain: ").append(getDomain()).append(",");
if (getEncryptionKey() != null)
sb.append("EncryptionKey: ").append(getEncryptionKey()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateDomainRequest == false)
return false;
CreateDomainRequest other = (CreateDomainRequest) obj;
if (other.getDomain() == null ^ this.getDomain() == null)
return false;
if (other.getDomain() != null && other.getDomain().equals(this.getDomain()) == false)
return false;
if (other.getEncryptionKey() == null ^ this.getEncryptionKey() == null)
return false;
if (other.getEncryptionKey() != null && other.getEncryptionKey().equals(this.getEncryptionKey()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == 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 + ((getEncryptionKey() == null) ? 0 : getEncryptionKey().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CreateDomainRequest clone() {
return (CreateDomainRequest) super.clone();
}
}