/* * Copyright 2010-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.iot.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *

* Creates a domain configuration. *

*

* Requires permission to access the CreateDomainConfiguration action. *

*/ public class CreateDomainConfigurationRequest extends AmazonWebServiceRequest implements Serializable { /** *

* The name of the domain configuration. This value must be unique to a * region. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [\w.-]+
*/ private String domainConfigurationName; /** *

* The name of the domain. *

*

* Constraints:
* Length: 1 - 253
* Pattern: [\s\S]*
*/ private String domainName; /** *

* The ARNs of the certificates that IoT passes to the device during the TLS * handshake. Currently you can specify only one certificate ARN. This value * is not required for Amazon Web Services-managed domains. *

*/ private java.util.List serverCertificateArns; /** *

* The certificate used to validate the server certificate and prove domain * name ownership. This certificate must be signed by a public certificate * authority. This value is not required for Amazon Web Services-managed * domains. *

*

* Constraints:
* Length: 1 - 2048
* Pattern: * arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-| * isob-)?[a-z]{4,9}-\d{1}:\d{12}:certificate/[a-zA-Z0-9/-]+
*/ private String validationCertificateArn; /** *

* An object that specifies the authorization service for a domain. *

*/ private AuthorizerConfig authorizerConfig; /** *

* The type of service delivered by the endpoint. *

* *

* Amazon Web Services IoT Core currently supports only the * DATA service type. *

*
*

* Constraints:
* Allowed Values: DATA, CREDENTIAL_PROVIDER, JOBS */ private String serviceType; /** *

* Metadata which can be used to manage the domain configuration. *

* *

* For URI Request parameters use format: ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags * "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": * "key1=value1&key2=value2..." *

*
*/ private java.util.List tags; /** *

* An object that specifies the TLS configuration for a domain. *

*/ private TlsConfig tlsConfig; /** *

* The name of the domain configuration. This value must be unique to a * region. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [\w.-]+
* * @return

* The name of the domain configuration. This value must be unique * to a region. *

*/ public String getDomainConfigurationName() { return domainConfigurationName; } /** *

* The name of the domain configuration. This value must be unique to a * region. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [\w.-]+
* * @param domainConfigurationName

* The name of the domain configuration. This value must be * unique to a region. *

*/ public void setDomainConfigurationName(String domainConfigurationName) { this.domainConfigurationName = domainConfigurationName; } /** *

* The name of the domain configuration. This value must be unique to a * region. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 128
* Pattern: [\w.-]+
* * @param domainConfigurationName

* The name of the domain configuration. This value must be * unique to a region. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDomainConfigurationRequest withDomainConfigurationName( String domainConfigurationName) { this.domainConfigurationName = domainConfigurationName; return this; } /** *

* The name of the domain. *

*

* Constraints:
* Length: 1 - 253
* Pattern: [\s\S]*
* * @return

* The name of the domain. *

*/ public String getDomainName() { return domainName; } /** *

* The name of the domain. *

*

* Constraints:
* Length: 1 - 253
* Pattern: [\s\S]*
* * @param domainName

* The name of the domain. *

*/ public void setDomainName(String domainName) { this.domainName = domainName; } /** *

* The name of the domain. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 253
* Pattern: [\s\S]*
* * @param domainName

* The name of the domain. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDomainConfigurationRequest withDomainName(String domainName) { this.domainName = domainName; return this; } /** *

* The ARNs of the certificates that IoT passes to the device during the TLS * handshake. Currently you can specify only one certificate ARN. This value * is not required for Amazon Web Services-managed domains. *

* * @return

* The ARNs of the certificates that IoT passes to the device during * the TLS handshake. Currently you can specify only one certificate * ARN. This value is not required for Amazon Web Services-managed * domains. *

*/ public java.util.List getServerCertificateArns() { return serverCertificateArns; } /** *

* The ARNs of the certificates that IoT passes to the device during the TLS * handshake. Currently you can specify only one certificate ARN. This value * is not required for Amazon Web Services-managed domains. *

* * @param serverCertificateArns

* The ARNs of the certificates that IoT passes to the device * during the TLS handshake. Currently you can specify only one * certificate ARN. This value is not required for Amazon Web * Services-managed domains. *

*/ public void setServerCertificateArns(java.util.Collection serverCertificateArns) { if (serverCertificateArns == null) { this.serverCertificateArns = null; return; } this.serverCertificateArns = new java.util.ArrayList(serverCertificateArns); } /** *

* The ARNs of the certificates that IoT passes to the device during the TLS * handshake. Currently you can specify only one certificate ARN. This value * is not required for Amazon Web Services-managed domains. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param serverCertificateArns

* The ARNs of the certificates that IoT passes to the device * during the TLS handshake. Currently you can specify only one * certificate ARN. This value is not required for Amazon Web * Services-managed domains. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDomainConfigurationRequest withServerCertificateArns( String... serverCertificateArns) { if (getServerCertificateArns() == null) { this.serverCertificateArns = new java.util.ArrayList( serverCertificateArns.length); } for (String value : serverCertificateArns) { this.serverCertificateArns.add(value); } return this; } /** *

* The ARNs of the certificates that IoT passes to the device during the TLS * handshake. Currently you can specify only one certificate ARN. This value * is not required for Amazon Web Services-managed domains. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param serverCertificateArns

* The ARNs of the certificates that IoT passes to the device * during the TLS handshake. Currently you can specify only one * certificate ARN. This value is not required for Amazon Web * Services-managed domains. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDomainConfigurationRequest withServerCertificateArns( java.util.Collection serverCertificateArns) { setServerCertificateArns(serverCertificateArns); return this; } /** *

* The certificate used to validate the server certificate and prove domain * name ownership. This certificate must be signed by a public certificate * authority. This value is not required for Amazon Web Services-managed * domains. *

*

* Constraints:
* Length: 1 - 2048
* Pattern: * arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-| * isob-)?[a-z]{4,9}-\d{1}:\d{12}:certificate/[a-zA-Z0-9/-]+
* * @return

* The certificate used to validate the server certificate and prove * domain name ownership. This certificate must be signed by a * public certificate authority. This value is not required for * Amazon Web Services-managed domains. *

*/ public String getValidationCertificateArn() { return validationCertificateArn; } /** *

* The certificate used to validate the server certificate and prove domain * name ownership. This certificate must be signed by a public certificate * authority. This value is not required for Amazon Web Services-managed * domains. *

*

* Constraints:
* Length: 1 - 2048
* Pattern: * arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-| * isob-)?[a-z]{4,9}-\d{1}:\d{12}:certificate/[a-zA-Z0-9/-]+
* * @param validationCertificateArn

* The certificate used to validate the server certificate and * prove domain name ownership. This certificate must be signed * by a public certificate authority. This value is not required * for Amazon Web Services-managed domains. *

*/ public void setValidationCertificateArn(String validationCertificateArn) { this.validationCertificateArn = validationCertificateArn; } /** *

* The certificate used to validate the server certificate and prove domain * name ownership. This certificate must be signed by a public certificate * authority. This value is not required for Amazon Web Services-managed * domains. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 2048
* Pattern: * arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-| * isob-)?[a-z]{4,9}-\d{1}:\d{12}:certificate/[a-zA-Z0-9/-]+
* * @param validationCertificateArn

* The certificate used to validate the server certificate and * prove domain name ownership. This certificate must be signed * by a public certificate authority. This value is not required * for Amazon Web Services-managed domains. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDomainConfigurationRequest withValidationCertificateArn( String validationCertificateArn) { this.validationCertificateArn = validationCertificateArn; return this; } /** *

* An object that specifies the authorization service for a domain. *

* * @return

* An object that specifies the authorization service for a domain. *

*/ public AuthorizerConfig getAuthorizerConfig() { return authorizerConfig; } /** *

* An object that specifies the authorization service for a domain. *

* * @param authorizerConfig

* An object that specifies the authorization service for a * domain. *

*/ public void setAuthorizerConfig(AuthorizerConfig authorizerConfig) { this.authorizerConfig = authorizerConfig; } /** *

* An object that specifies the authorization service for a domain. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param authorizerConfig

* An object that specifies the authorization service for a * domain. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDomainConfigurationRequest withAuthorizerConfig(AuthorizerConfig authorizerConfig) { this.authorizerConfig = authorizerConfig; return this; } /** *

* The type of service delivered by the endpoint. *

* *

* Amazon Web Services IoT Core currently supports only the * DATA service type. *

*
*

* Constraints:
* Allowed Values: DATA, CREDENTIAL_PROVIDER, JOBS * * @return

* The type of service delivered by the endpoint. *

* *

* Amazon Web Services IoT Core currently supports only the * DATA service type. *

*
* @see ServiceType */ public String getServiceType() { return serviceType; } /** *

* The type of service delivered by the endpoint. *

* *

* Amazon Web Services IoT Core currently supports only the * DATA service type. *

*
*

* Constraints:
* Allowed Values: DATA, CREDENTIAL_PROVIDER, JOBS * * @param serviceType

* The type of service delivered by the endpoint. *

* *

* Amazon Web Services IoT Core currently supports only the * DATA service type. *

*
* @see ServiceType */ public void setServiceType(String serviceType) { this.serviceType = serviceType; } /** *

* The type of service delivered by the endpoint. *

* *

* Amazon Web Services IoT Core currently supports only the * DATA service type. *

*
*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: DATA, CREDENTIAL_PROVIDER, JOBS * * @param serviceType

* The type of service delivered by the endpoint. *

* *

* Amazon Web Services IoT Core currently supports only the * DATA service type. *

*
* @return A reference to this updated object so that method calls can be * chained together. * @see ServiceType */ public CreateDomainConfigurationRequest withServiceType(String serviceType) { this.serviceType = serviceType; return this; } /** *

* The type of service delivered by the endpoint. *

* *

* Amazon Web Services IoT Core currently supports only the * DATA service type. *

*
*

* Constraints:
* Allowed Values: DATA, CREDENTIAL_PROVIDER, JOBS * * @param serviceType

* The type of service delivered by the endpoint. *

* *

* Amazon Web Services IoT Core currently supports only the * DATA service type. *

*
* @see ServiceType */ public void setServiceType(ServiceType serviceType) { this.serviceType = serviceType.toString(); } /** *

* The type of service delivered by the endpoint. *

* *

* Amazon Web Services IoT Core currently supports only the * DATA service type. *

*
*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: DATA, CREDENTIAL_PROVIDER, JOBS * * @param serviceType

* The type of service delivered by the endpoint. *

* *

* Amazon Web Services IoT Core currently supports only the * DATA service type. *

*
* @return A reference to this updated object so that method calls can be * chained together. * @see ServiceType */ public CreateDomainConfigurationRequest withServiceType(ServiceType serviceType) { this.serviceType = serviceType.toString(); return this; } /** *

* Metadata which can be used to manage the domain configuration. *

* *

* For URI Request parameters use format: ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags * "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": * "key1=value1&key2=value2..." *

*
* * @return

* Metadata which can be used to manage the domain configuration. *

* *

* For URI Request parameters use format: * ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags * "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": * "key1=value1&key2=value2..." *

*
*/ public java.util.List getTags() { return tags; } /** *

* Metadata which can be used to manage the domain configuration. *

* *

* For URI Request parameters use format: ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags * "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": * "key1=value1&key2=value2..." *

*
* * @param tags

* Metadata which can be used to manage the domain configuration. *

* *

* For URI Request parameters use format: * ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags * "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": * "key1=value1&key2=value2..." *

*
*/ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

* Metadata which can be used to manage the domain configuration. *

* *

* For URI Request parameters use format: ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags * "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": * "key1=value1&key2=value2..." *

*
*

* Returns a reference to this object so that method calls can be chained * together. * * @param tags

* Metadata which can be used to manage the domain configuration. *

* *

* For URI Request parameters use format: * ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags * "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": * "key1=value1&key2=value2..." *

*
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDomainConfigurationRequest withTags(Tag... tags) { if (getTags() == null) { this.tags = new java.util.ArrayList(tags.length); } for (Tag value : tags) { this.tags.add(value); } return this; } /** *

* Metadata which can be used to manage the domain configuration. *

* *

* For URI Request parameters use format: ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags * "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": * "key1=value1&key2=value2..." *

*
*

* Returns a reference to this object so that method calls can be chained * together. * * @param tags

* Metadata which can be used to manage the domain configuration. *

* *

* For URI Request parameters use format: * ...key1=value1&key2=value2... *

*

* For the CLI command-line parameter use format: &&tags * "key1=value1&key2=value2..." *

*

* For the cli-input-json file use format: "tags": * "key1=value1&key2=value2..." *

*
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDomainConfigurationRequest withTags(java.util.Collection tags) { setTags(tags); return this; } /** *

* An object that specifies the TLS configuration for a domain. *

* * @return

* An object that specifies the TLS configuration for a domain. *

*/ public TlsConfig getTlsConfig() { return tlsConfig; } /** *

* An object that specifies the TLS configuration for a domain. *

* * @param tlsConfig

* An object that specifies the TLS configuration for a domain. *

*/ public void setTlsConfig(TlsConfig tlsConfig) { this.tlsConfig = tlsConfig; } /** *

* An object that specifies the TLS configuration for a domain. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param tlsConfig

* An object that specifies the TLS configuration for a domain. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDomainConfigurationRequest withTlsConfig(TlsConfig tlsConfig) { this.tlsConfig = tlsConfig; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDomainConfigurationName() != null) sb.append("domainConfigurationName: " + getDomainConfigurationName() + ","); if (getDomainName() != null) sb.append("domainName: " + getDomainName() + ","); if (getServerCertificateArns() != null) sb.append("serverCertificateArns: " + getServerCertificateArns() + ","); if (getValidationCertificateArn() != null) sb.append("validationCertificateArn: " + getValidationCertificateArn() + ","); if (getAuthorizerConfig() != null) sb.append("authorizerConfig: " + getAuthorizerConfig() + ","); if (getServiceType() != null) sb.append("serviceType: " + getServiceType() + ","); if (getTags() != null) sb.append("tags: " + getTags() + ","); if (getTlsConfig() != null) sb.append("tlsConfig: " + getTlsConfig()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDomainConfigurationName() == null) ? 0 : getDomainConfigurationName() .hashCode()); hashCode = prime * hashCode + ((getDomainName() == null) ? 0 : getDomainName().hashCode()); hashCode = prime * hashCode + ((getServerCertificateArns() == null) ? 0 : getServerCertificateArns().hashCode()); hashCode = prime * hashCode + ((getValidationCertificateArn() == null) ? 0 : getValidationCertificateArn() .hashCode()); hashCode = prime * hashCode + ((getAuthorizerConfig() == null) ? 0 : getAuthorizerConfig().hashCode()); hashCode = prime * hashCode + ((getServiceType() == null) ? 0 : getServiceType().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getTlsConfig() == null) ? 0 : getTlsConfig().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateDomainConfigurationRequest == false) return false; CreateDomainConfigurationRequest other = (CreateDomainConfigurationRequest) obj; if (other.getDomainConfigurationName() == null ^ this.getDomainConfigurationName() == null) return false; if (other.getDomainConfigurationName() != null && other.getDomainConfigurationName().equals(this.getDomainConfigurationName()) == 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.getServerCertificateArns() == null ^ this.getServerCertificateArns() == null) return false; if (other.getServerCertificateArns() != null && other.getServerCertificateArns().equals(this.getServerCertificateArns()) == false) return false; if (other.getValidationCertificateArn() == null ^ this.getValidationCertificateArn() == null) return false; if (other.getValidationCertificateArn() != null && other.getValidationCertificateArn().equals(this.getValidationCertificateArn()) == false) return false; if (other.getAuthorizerConfig() == null ^ this.getAuthorizerConfig() == null) return false; if (other.getAuthorizerConfig() != null && other.getAuthorizerConfig().equals(this.getAuthorizerConfig()) == false) return false; if (other.getServiceType() == null ^ this.getServiceType() == null) return false; if (other.getServiceType() != null && other.getServiceType().equals(this.getServiceType()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getTlsConfig() == null ^ this.getTlsConfig() == null) return false; if (other.getTlsConfig() != null && other.getTlsConfig().equals(this.getTlsConfig()) == false) return false; return true; } }