Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.apigateway.model.CreateDomainNameResponse Maven / Gradle / Ivy
Go to download
The AWS Java SDK for Amazon API Gateway module holds the client classes that are used for communicating
with Amazon API
Gateway
/*
* Copyright 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 software.amazon.awssdk.services.apigateway.model;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Represents a custom domain name as a user-friendly host name of an API (RestApi).
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class CreateDomainNameResponse extends ApiGatewayResponse implements
ToCopyableBuilder {
private static final SdkField DOMAIN_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("domainName").getter(getter(CreateDomainNameResponse::domainName)).setter(setter(Builder::domainName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("domainName").build()).build();
private static final SdkField CERTIFICATE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("certificateName").getter(getter(CreateDomainNameResponse::certificateName))
.setter(setter(Builder::certificateName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("certificateName").build()).build();
private static final SdkField CERTIFICATE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("certificateArn").getter(getter(CreateDomainNameResponse::certificateArn))
.setter(setter(Builder::certificateArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("certificateArn").build()).build();
private static final SdkField CERTIFICATE_UPLOAD_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("certificateUploadDate").getter(getter(CreateDomainNameResponse::certificateUploadDate))
.setter(setter(Builder::certificateUploadDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("certificateUploadDate").build())
.build();
private static final SdkField REGIONAL_DOMAIN_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("regionalDomainName").getter(getter(CreateDomainNameResponse::regionalDomainName))
.setter(setter(Builder::regionalDomainName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("regionalDomainName").build())
.build();
private static final SdkField REGIONAL_HOSTED_ZONE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("regionalHostedZoneId").getter(getter(CreateDomainNameResponse::regionalHostedZoneId))
.setter(setter(Builder::regionalHostedZoneId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("regionalHostedZoneId").build())
.build();
private static final SdkField REGIONAL_CERTIFICATE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("regionalCertificateName").getter(getter(CreateDomainNameResponse::regionalCertificateName))
.setter(setter(Builder::regionalCertificateName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("regionalCertificateName").build())
.build();
private static final SdkField REGIONAL_CERTIFICATE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("regionalCertificateArn").getter(getter(CreateDomainNameResponse::regionalCertificateArn))
.setter(setter(Builder::regionalCertificateArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("regionalCertificateArn").build())
.build();
private static final SdkField DISTRIBUTION_DOMAIN_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("distributionDomainName").getter(getter(CreateDomainNameResponse::distributionDomainName))
.setter(setter(Builder::distributionDomainName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("distributionDomainName").build())
.build();
private static final SdkField DISTRIBUTION_HOSTED_ZONE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("distributionHostedZoneId").getter(getter(CreateDomainNameResponse::distributionHostedZoneId))
.setter(setter(Builder::distributionHostedZoneId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("distributionHostedZoneId").build())
.build();
private static final SdkField ENDPOINT_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("endpointConfiguration")
.getter(getter(CreateDomainNameResponse::endpointConfiguration)).setter(setter(Builder::endpointConfiguration))
.constructor(EndpointConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("endpointConfiguration").build())
.build();
private static final SdkField DOMAIN_NAME_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("domainNameStatus").getter(getter(CreateDomainNameResponse::domainNameStatusAsString))
.setter(setter(Builder::domainNameStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("domainNameStatus").build()).build();
private static final SdkField DOMAIN_NAME_STATUS_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("domainNameStatusMessage").getter(getter(CreateDomainNameResponse::domainNameStatusMessage))
.setter(setter(Builder::domainNameStatusMessage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("domainNameStatusMessage").build())
.build();
private static final SdkField SECURITY_POLICY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("securityPolicy").getter(getter(CreateDomainNameResponse::securityPolicyAsString))
.setter(setter(Builder::securityPolicy))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("securityPolicy").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("tags")
.getter(getter(CreateDomainNameResponse::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField MUTUAL_TLS_AUTHENTICATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("mutualTlsAuthentication")
.getter(getter(CreateDomainNameResponse::mutualTlsAuthentication)).setter(setter(Builder::mutualTlsAuthentication))
.constructor(MutualTlsAuthentication::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("mutualTlsAuthentication").build())
.build();
private static final SdkField OWNERSHIP_VERIFICATION_CERTIFICATE_ARN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ownershipVerificationCertificateArn")
.getter(getter(CreateDomainNameResponse::ownershipVerificationCertificateArn))
.setter(setter(Builder::ownershipVerificationCertificateArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("ownershipVerificationCertificateArn").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DOMAIN_NAME_FIELD,
CERTIFICATE_NAME_FIELD, CERTIFICATE_ARN_FIELD, CERTIFICATE_UPLOAD_DATE_FIELD, REGIONAL_DOMAIN_NAME_FIELD,
REGIONAL_HOSTED_ZONE_ID_FIELD, REGIONAL_CERTIFICATE_NAME_FIELD, REGIONAL_CERTIFICATE_ARN_FIELD,
DISTRIBUTION_DOMAIN_NAME_FIELD, DISTRIBUTION_HOSTED_ZONE_ID_FIELD, ENDPOINT_CONFIGURATION_FIELD,
DOMAIN_NAME_STATUS_FIELD, DOMAIN_NAME_STATUS_MESSAGE_FIELD, SECURITY_POLICY_FIELD, TAGS_FIELD,
MUTUAL_TLS_AUTHENTICATION_FIELD, OWNERSHIP_VERIFICATION_CERTIFICATE_ARN_FIELD));
private final String domainName;
private final String certificateName;
private final String certificateArn;
private final Instant certificateUploadDate;
private final String regionalDomainName;
private final String regionalHostedZoneId;
private final String regionalCertificateName;
private final String regionalCertificateArn;
private final String distributionDomainName;
private final String distributionHostedZoneId;
private final EndpointConfiguration endpointConfiguration;
private final String domainNameStatus;
private final String domainNameStatusMessage;
private final String securityPolicy;
private final Map tags;
private final MutualTlsAuthentication mutualTlsAuthentication;
private final String ownershipVerificationCertificateArn;
private CreateDomainNameResponse(BuilderImpl builder) {
super(builder);
this.domainName = builder.domainName;
this.certificateName = builder.certificateName;
this.certificateArn = builder.certificateArn;
this.certificateUploadDate = builder.certificateUploadDate;
this.regionalDomainName = builder.regionalDomainName;
this.regionalHostedZoneId = builder.regionalHostedZoneId;
this.regionalCertificateName = builder.regionalCertificateName;
this.regionalCertificateArn = builder.regionalCertificateArn;
this.distributionDomainName = builder.distributionDomainName;
this.distributionHostedZoneId = builder.distributionHostedZoneId;
this.endpointConfiguration = builder.endpointConfiguration;
this.domainNameStatus = builder.domainNameStatus;
this.domainNameStatusMessage = builder.domainNameStatusMessage;
this.securityPolicy = builder.securityPolicy;
this.tags = builder.tags;
this.mutualTlsAuthentication = builder.mutualTlsAuthentication;
this.ownershipVerificationCertificateArn = builder.ownershipVerificationCertificateArn;
}
/**
*
* The custom domain name as an API host name, for example, my-api.example.com
.
*
*
* @return The custom domain name as an API host name, for example, my-api.example.com
.
*/
public final String domainName() {
return domainName;
}
/**
*
* The name of the certificate that will be used by edge-optimized endpoint for this domain name.
*
*
* @return The name of the certificate that will be used by edge-optimized endpoint for this domain name.
*/
public final String certificateName() {
return certificateName;
}
/**
*
* The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name.
* AWS Certificate Manager is the only supported source.
*
*
* @return The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain
* name. AWS Certificate Manager is the only supported source.
*/
public final String certificateArn() {
return certificateArn;
}
/**
*
* The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was uploaded.
*
*
* @return The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was
* uploaded.
*/
public final Instant certificateUploadDate() {
return certificateUploadDate;
}
/**
*
* The domain name associated with the regional endpoint for this custom domain name. You set up this association by
* adding a DNS record that points the custom domain name to this regional domain name. The regional domain name is
* returned by API Gateway when you create a regional endpoint.
*
*
* @return The domain name associated with the regional endpoint for this custom domain name. You set up this
* association by adding a DNS record that points the custom domain name to this regional domain name. The
* regional domain name is returned by API Gateway when you create a regional endpoint.
*/
public final String regionalDomainName() {
return regionalDomainName;
}
/**
*
* The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see Set up a
* Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
*
*
* @return The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see
* Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
*/
public final String regionalHostedZoneId() {
return regionalHostedZoneId;
}
/**
*
* The name of the certificate that will be used for validating the regional domain name.
*
*
* @return The name of the certificate that will be used for validating the regional domain name.
*/
public final String regionalCertificateName() {
return regionalCertificateName;
}
/**
*
* The reference to an AWS-managed certificate that will be used for validating the regional domain name. AWS
* Certificate Manager is the only supported source.
*
*
* @return The reference to an AWS-managed certificate that will be used for validating the regional domain name.
* AWS Certificate Manager is the only supported source.
*/
public final String regionalCertificateArn() {
return regionalCertificateArn;
}
/**
*
* The domain name of the Amazon CloudFront distribution associated with this custom domain name for an
* edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom domain name to
* this distribution name. For more information about CloudFront distributions, see the Amazon CloudFront
* documentation.
*
*
* @return The domain name of the Amazon CloudFront distribution associated with this custom domain name for an
* edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom domain
* name to this distribution name. For more information about CloudFront distributions, see the Amazon
* CloudFront documentation.
*/
public final String distributionDomainName() {
return distributionDomainName;
}
/**
*
* The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is
* Z2FDTNDATAQYW2
for all the regions. For more information, see Set up a Regional Custom Domain Name
* and AWS Regions and Endpoints for API Gateway.
*
*
* @return The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is
* Z2FDTNDATAQYW2
for all the regions. For more information, see Set up a Regional Custom
* Domain Name and AWS Regions and Endpoints for API Gateway.
*/
public final String distributionHostedZoneId() {
return distributionHostedZoneId;
}
/**
*
* The endpoint configuration of this DomainName showing the endpoint types of the domain name.
*
*
* @return The endpoint configuration of this DomainName showing the endpoint types of the domain name.
*/
public final EndpointConfiguration endpointConfiguration() {
return endpointConfiguration;
}
/**
*
* The status of the DomainName migration. The valid values are AVAILABLE
and UPDATING
. If
* the status is UPDATING
, the domain cannot be modified further until the existing operation is
* complete. If it is AVAILABLE
, the domain can be updated.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #domainNameStatus}
* will return {@link DomainNameStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #domainNameStatusAsString}.
*
*
* @return The status of the DomainName migration. The valid values are AVAILABLE
and
* UPDATING
. If the status is UPDATING
, the domain cannot be modified further
* until the existing operation is complete. If it is AVAILABLE
, the domain can be updated.
* @see DomainNameStatus
*/
public final DomainNameStatus domainNameStatus() {
return DomainNameStatus.fromValue(domainNameStatus);
}
/**
*
* The status of the DomainName migration. The valid values are AVAILABLE
and UPDATING
. If
* the status is UPDATING
, the domain cannot be modified further until the existing operation is
* complete. If it is AVAILABLE
, the domain can be updated.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #domainNameStatus}
* will return {@link DomainNameStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #domainNameStatusAsString}.
*
*
* @return The status of the DomainName migration. The valid values are AVAILABLE
and
* UPDATING
. If the status is UPDATING
, the domain cannot be modified further
* until the existing operation is complete. If it is AVAILABLE
, the domain can be updated.
* @see DomainNameStatus
*/
public final String domainNameStatusAsString() {
return domainNameStatus;
}
/**
*
* An optional text message containing detailed information about status of the DomainName migration.
*
*
* @return An optional text message containing detailed information about status of the DomainName migration.
*/
public final String domainNameStatusMessage() {
return domainNameStatusMessage;
}
/**
*
* The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
* TLS_1_0
and TLS_1_2
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #securityPolicy}
* will return {@link SecurityPolicy#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #securityPolicyAsString}.
*
*
* @return The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
* TLS_1_0
and TLS_1_2
.
* @see SecurityPolicy
*/
public final SecurityPolicy securityPolicy() {
return SecurityPolicy.fromValue(securityPolicy);
}
/**
*
* The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
* TLS_1_0
and TLS_1_2
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #securityPolicy}
* will return {@link SecurityPolicy#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #securityPolicyAsString}.
*
*
* @return The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
* TLS_1_0
and TLS_1_2
.
* @see SecurityPolicy
*/
public final String securityPolicyAsString() {
return securityPolicy;
}
/**
* For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructMap);
}
/**
*
* The collection of tags. Each tag element is associated with a given resource.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTags} method.
*
*
* @return The collection of tags. Each tag element is associated with a given resource.
*/
public final Map tags() {
return tags;
}
/**
*
* The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs two-way
* authentication between the client and the server. Clients must present a trusted certificate to access your API.
*
*
* @return The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs
* two-way authentication between the client and the server. Clients must present a trusted certificate to
* access your API.
*/
public final MutualTlsAuthentication mutualTlsAuthentication() {
return mutualTlsAuthentication;
}
/**
*
* The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only required when
* configuring mutual TLS and using an ACM imported or private CA certificate ARN as the regionalCertificateArn.
*
*
* @return The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only
* required when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the
* regionalCertificateArn.
*/
public final String ownershipVerificationCertificateArn() {
return ownershipVerificationCertificateArn;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(domainName());
hashCode = 31 * hashCode + Objects.hashCode(certificateName());
hashCode = 31 * hashCode + Objects.hashCode(certificateArn());
hashCode = 31 * hashCode + Objects.hashCode(certificateUploadDate());
hashCode = 31 * hashCode + Objects.hashCode(regionalDomainName());
hashCode = 31 * hashCode + Objects.hashCode(regionalHostedZoneId());
hashCode = 31 * hashCode + Objects.hashCode(regionalCertificateName());
hashCode = 31 * hashCode + Objects.hashCode(regionalCertificateArn());
hashCode = 31 * hashCode + Objects.hashCode(distributionDomainName());
hashCode = 31 * hashCode + Objects.hashCode(distributionHostedZoneId());
hashCode = 31 * hashCode + Objects.hashCode(endpointConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(domainNameStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(domainNameStatusMessage());
hashCode = 31 * hashCode + Objects.hashCode(securityPolicyAsString());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
hashCode = 31 * hashCode + Objects.hashCode(mutualTlsAuthentication());
hashCode = 31 * hashCode + Objects.hashCode(ownershipVerificationCertificateArn());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof CreateDomainNameResponse)) {
return false;
}
CreateDomainNameResponse other = (CreateDomainNameResponse) obj;
return Objects.equals(domainName(), other.domainName()) && Objects.equals(certificateName(), other.certificateName())
&& Objects.equals(certificateArn(), other.certificateArn())
&& Objects.equals(certificateUploadDate(), other.certificateUploadDate())
&& Objects.equals(regionalDomainName(), other.regionalDomainName())
&& Objects.equals(regionalHostedZoneId(), other.regionalHostedZoneId())
&& Objects.equals(regionalCertificateName(), other.regionalCertificateName())
&& Objects.equals(regionalCertificateArn(), other.regionalCertificateArn())
&& Objects.equals(distributionDomainName(), other.distributionDomainName())
&& Objects.equals(distributionHostedZoneId(), other.distributionHostedZoneId())
&& Objects.equals(endpointConfiguration(), other.endpointConfiguration())
&& Objects.equals(domainNameStatusAsString(), other.domainNameStatusAsString())
&& Objects.equals(domainNameStatusMessage(), other.domainNameStatusMessage())
&& Objects.equals(securityPolicyAsString(), other.securityPolicyAsString()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags())
&& Objects.equals(mutualTlsAuthentication(), other.mutualTlsAuthentication())
&& Objects.equals(ownershipVerificationCertificateArn(), other.ownershipVerificationCertificateArn());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("CreateDomainNameResponse").add("DomainName", domainName())
.add("CertificateName", certificateName()).add("CertificateArn", certificateArn())
.add("CertificateUploadDate", certificateUploadDate()).add("RegionalDomainName", regionalDomainName())
.add("RegionalHostedZoneId", regionalHostedZoneId()).add("RegionalCertificateName", regionalCertificateName())
.add("RegionalCertificateArn", regionalCertificateArn()).add("DistributionDomainName", distributionDomainName())
.add("DistributionHostedZoneId", distributionHostedZoneId())
.add("EndpointConfiguration", endpointConfiguration()).add("DomainNameStatus", domainNameStatusAsString())
.add("DomainNameStatusMessage", domainNameStatusMessage()).add("SecurityPolicy", securityPolicyAsString())
.add("Tags", hasTags() ? tags() : null).add("MutualTlsAuthentication", mutualTlsAuthentication())
.add("OwnershipVerificationCertificateArn", ownershipVerificationCertificateArn()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "domainName":
return Optional.ofNullable(clazz.cast(domainName()));
case "certificateName":
return Optional.ofNullable(clazz.cast(certificateName()));
case "certificateArn":
return Optional.ofNullable(clazz.cast(certificateArn()));
case "certificateUploadDate":
return Optional.ofNullable(clazz.cast(certificateUploadDate()));
case "regionalDomainName":
return Optional.ofNullable(clazz.cast(regionalDomainName()));
case "regionalHostedZoneId":
return Optional.ofNullable(clazz.cast(regionalHostedZoneId()));
case "regionalCertificateName":
return Optional.ofNullable(clazz.cast(regionalCertificateName()));
case "regionalCertificateArn":
return Optional.ofNullable(clazz.cast(regionalCertificateArn()));
case "distributionDomainName":
return Optional.ofNullable(clazz.cast(distributionDomainName()));
case "distributionHostedZoneId":
return Optional.ofNullable(clazz.cast(distributionHostedZoneId()));
case "endpointConfiguration":
return Optional.ofNullable(clazz.cast(endpointConfiguration()));
case "domainNameStatus":
return Optional.ofNullable(clazz.cast(domainNameStatusAsString()));
case "domainNameStatusMessage":
return Optional.ofNullable(clazz.cast(domainNameStatusMessage()));
case "securityPolicy":
return Optional.ofNullable(clazz.cast(securityPolicyAsString()));
case "tags":
return Optional.ofNullable(clazz.cast(tags()));
case "mutualTlsAuthentication":
return Optional.ofNullable(clazz.cast(mutualTlsAuthentication()));
case "ownershipVerificationCertificateArn":
return Optional.ofNullable(clazz.cast(ownershipVerificationCertificateArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((CreateDomainNameResponse) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends ApiGatewayResponse.Builder, SdkPojo, CopyableBuilder {
/**
*
* The custom domain name as an API host name, for example, my-api.example.com
.
*
*
* @param domainName
* The custom domain name as an API host name, for example, my-api.example.com
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder domainName(String domainName);
/**
*
* The name of the certificate that will be used by edge-optimized endpoint for this domain name.
*
*
* @param certificateName
* The name of the certificate that will be used by edge-optimized endpoint for this domain name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder certificateName(String certificateName);
/**
*
* The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain
* name. AWS Certificate Manager is the only supported source.
*
*
* @param certificateArn
* The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this
* domain name. AWS Certificate Manager is the only supported source.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder certificateArn(String certificateArn);
/**
*
* The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was
* uploaded.
*
*
* @param certificateUploadDate
* The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was
* uploaded.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder certificateUploadDate(Instant certificateUploadDate);
/**
*
* The domain name associated with the regional endpoint for this custom domain name. You set up this
* association by adding a DNS record that points the custom domain name to this regional domain name. The
* regional domain name is returned by API Gateway when you create a regional endpoint.
*
*
* @param regionalDomainName
* The domain name associated with the regional endpoint for this custom domain name. You set up this
* association by adding a DNS record that points the custom domain name to this regional domain name.
* The regional domain name is returned by API Gateway when you create a regional endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder regionalDomainName(String regionalDomainName);
/**
*
* The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see Set up
* a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
*
*
* @param regionalHostedZoneId
* The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see
* Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder regionalHostedZoneId(String regionalHostedZoneId);
/**
*
* The name of the certificate that will be used for validating the regional domain name.
*
*
* @param regionalCertificateName
* The name of the certificate that will be used for validating the regional domain name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder regionalCertificateName(String regionalCertificateName);
/**
*
* The reference to an AWS-managed certificate that will be used for validating the regional domain name. AWS
* Certificate Manager is the only supported source.
*
*
* @param regionalCertificateArn
* The reference to an AWS-managed certificate that will be used for validating the regional domain name.
* AWS Certificate Manager is the only supported source.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder regionalCertificateArn(String regionalCertificateArn);
/**
*
* The domain name of the Amazon CloudFront distribution associated with this custom domain name for an
* edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom domain name
* to this distribution name. For more information about CloudFront distributions, see the Amazon CloudFront
* documentation.
*
*
* @param distributionDomainName
* The domain name of the Amazon CloudFront distribution associated with this custom domain name for an
* edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom
* domain name to this distribution name. For more information about CloudFront distributions, see the
* Amazon CloudFront documentation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder distributionDomainName(String distributionDomainName);
/**
*
* The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is
* Z2FDTNDATAQYW2
for all the regions. For more information, see Set up a Regional Custom Domain
* Name and AWS Regions and Endpoints for API Gateway.
*
*
* @param distributionHostedZoneId
* The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is
* Z2FDTNDATAQYW2
for all the regions. For more information, see Set up a Regional Custom
* Domain Name and AWS Regions and Endpoints for API Gateway.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder distributionHostedZoneId(String distributionHostedZoneId);
/**
*
* The endpoint configuration of this DomainName showing the endpoint types of the domain name.
*
*
* @param endpointConfiguration
* The endpoint configuration of this DomainName showing the endpoint types of the domain name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder endpointConfiguration(EndpointConfiguration endpointConfiguration);
/**
*
* The endpoint configuration of this DomainName showing the endpoint types of the domain name.
*
* This is a convenience method that creates an instance of the {@link EndpointConfiguration.Builder} avoiding
* the need to create one manually via {@link EndpointConfiguration#builder()}.
*
*
* When the {@link Consumer} completes, {@link EndpointConfiguration.Builder#build()} is called immediately and
* its result is passed to {@link #endpointConfiguration(EndpointConfiguration)}.
*
* @param endpointConfiguration
* a consumer that will call methods on {@link EndpointConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #endpointConfiguration(EndpointConfiguration)
*/
default Builder endpointConfiguration(Consumer endpointConfiguration) {
return endpointConfiguration(EndpointConfiguration.builder().applyMutation(endpointConfiguration).build());
}
/**
*
* The status of the DomainName migration. The valid values are AVAILABLE
and UPDATING
* . If the status is UPDATING
, the domain cannot be modified further until the existing operation
* is complete. If it is AVAILABLE
, the domain can be updated.
*
*
* @param domainNameStatus
* The status of the DomainName migration. The valid values are AVAILABLE
and
* UPDATING
. If the status is UPDATING
, the domain cannot be modified further
* until the existing operation is complete. If it is AVAILABLE
, the domain can be updated.
* @see DomainNameStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see DomainNameStatus
*/
Builder domainNameStatus(String domainNameStatus);
/**
*
* The status of the DomainName migration. The valid values are AVAILABLE
and UPDATING
* . If the status is UPDATING
, the domain cannot be modified further until the existing operation
* is complete. If it is AVAILABLE
, the domain can be updated.
*
*
* @param domainNameStatus
* The status of the DomainName migration. The valid values are AVAILABLE
and
* UPDATING
. If the status is UPDATING
, the domain cannot be modified further
* until the existing operation is complete. If it is AVAILABLE
, the domain can be updated.
* @see DomainNameStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see DomainNameStatus
*/
Builder domainNameStatus(DomainNameStatus domainNameStatus);
/**
*
* An optional text message containing detailed information about status of the DomainName migration.
*
*
* @param domainNameStatusMessage
* An optional text message containing detailed information about status of the DomainName migration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder domainNameStatusMessage(String domainNameStatusMessage);
/**
*
* The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
* TLS_1_0
and TLS_1_2
.
*
*
* @param securityPolicy
* The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
* TLS_1_0
and TLS_1_2
.
* @see SecurityPolicy
* @return Returns a reference to this object so that method calls can be chained together.
* @see SecurityPolicy
*/
Builder securityPolicy(String securityPolicy);
/**
*
* The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
* TLS_1_0
and TLS_1_2
.
*
*
* @param securityPolicy
* The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
* TLS_1_0
and TLS_1_2
.
* @see SecurityPolicy
* @return Returns a reference to this object so that method calls can be chained together.
* @see SecurityPolicy
*/
Builder securityPolicy(SecurityPolicy securityPolicy);
/**
*
* The collection of tags. Each tag element is associated with a given resource.
*
*
* @param tags
* The collection of tags. Each tag element is associated with a given resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
/**
*
* The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs
* two-way authentication between the client and the server. Clients must present a trusted certificate to
* access your API.
*
*
* @param mutualTlsAuthentication
* The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway
* performs two-way authentication between the client and the server. Clients must present a trusted
* certificate to access your API.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mutualTlsAuthentication(MutualTlsAuthentication mutualTlsAuthentication);
/**
*
* The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs
* two-way authentication between the client and the server. Clients must present a trusted certificate to
* access your API.
*
* This is a convenience method that creates an instance of the {@link MutualTlsAuthentication.Builder} avoiding
* the need to create one manually via {@link MutualTlsAuthentication#builder()}.
*
*
* When the {@link Consumer} completes, {@link MutualTlsAuthentication.Builder#build()} is called immediately
* and its result is passed to {@link #mutualTlsAuthentication(MutualTlsAuthentication)}.
*
* @param mutualTlsAuthentication
* a consumer that will call methods on {@link MutualTlsAuthentication.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #mutualTlsAuthentication(MutualTlsAuthentication)
*/
default Builder mutualTlsAuthentication(Consumer mutualTlsAuthentication) {
return mutualTlsAuthentication(MutualTlsAuthentication.builder().applyMutation(mutualTlsAuthentication).build());
}
/**
*
* The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only required
* when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the
* regionalCertificateArn.
*
*
* @param ownershipVerificationCertificateArn
* The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only
* required when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the
* regionalCertificateArn.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder ownershipVerificationCertificateArn(String ownershipVerificationCertificateArn);
}
static final class BuilderImpl extends ApiGatewayResponse.BuilderImpl implements Builder {
private String domainName;
private String certificateName;
private String certificateArn;
private Instant certificateUploadDate;
private String regionalDomainName;
private String regionalHostedZoneId;
private String regionalCertificateName;
private String regionalCertificateArn;
private String distributionDomainName;
private String distributionHostedZoneId;
private EndpointConfiguration endpointConfiguration;
private String domainNameStatus;
private String domainNameStatusMessage;
private String securityPolicy;
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private MutualTlsAuthentication mutualTlsAuthentication;
private String ownershipVerificationCertificateArn;
private BuilderImpl() {
}
private BuilderImpl(CreateDomainNameResponse model) {
super(model);
domainName(model.domainName);
certificateName(model.certificateName);
certificateArn(model.certificateArn);
certificateUploadDate(model.certificateUploadDate);
regionalDomainName(model.regionalDomainName);
regionalHostedZoneId(model.regionalHostedZoneId);
regionalCertificateName(model.regionalCertificateName);
regionalCertificateArn(model.regionalCertificateArn);
distributionDomainName(model.distributionDomainName);
distributionHostedZoneId(model.distributionHostedZoneId);
endpointConfiguration(model.endpointConfiguration);
domainNameStatus(model.domainNameStatus);
domainNameStatusMessage(model.domainNameStatusMessage);
securityPolicy(model.securityPolicy);
tags(model.tags);
mutualTlsAuthentication(model.mutualTlsAuthentication);
ownershipVerificationCertificateArn(model.ownershipVerificationCertificateArn);
}
public final String getDomainName() {
return domainName;
}
public final void setDomainName(String domainName) {
this.domainName = domainName;
}
@Override
public final Builder domainName(String domainName) {
this.domainName = domainName;
return this;
}
public final String getCertificateName() {
return certificateName;
}
public final void setCertificateName(String certificateName) {
this.certificateName = certificateName;
}
@Override
public final Builder certificateName(String certificateName) {
this.certificateName = certificateName;
return this;
}
public final String getCertificateArn() {
return certificateArn;
}
public final void setCertificateArn(String certificateArn) {
this.certificateArn = certificateArn;
}
@Override
public final Builder certificateArn(String certificateArn) {
this.certificateArn = certificateArn;
return this;
}
public final Instant getCertificateUploadDate() {
return certificateUploadDate;
}
public final void setCertificateUploadDate(Instant certificateUploadDate) {
this.certificateUploadDate = certificateUploadDate;
}
@Override
public final Builder certificateUploadDate(Instant certificateUploadDate) {
this.certificateUploadDate = certificateUploadDate;
return this;
}
public final String getRegionalDomainName() {
return regionalDomainName;
}
public final void setRegionalDomainName(String regionalDomainName) {
this.regionalDomainName = regionalDomainName;
}
@Override
public final Builder regionalDomainName(String regionalDomainName) {
this.regionalDomainName = regionalDomainName;
return this;
}
public final String getRegionalHostedZoneId() {
return regionalHostedZoneId;
}
public final void setRegionalHostedZoneId(String regionalHostedZoneId) {
this.regionalHostedZoneId = regionalHostedZoneId;
}
@Override
public final Builder regionalHostedZoneId(String regionalHostedZoneId) {
this.regionalHostedZoneId = regionalHostedZoneId;
return this;
}
public final String getRegionalCertificateName() {
return regionalCertificateName;
}
public final void setRegionalCertificateName(String regionalCertificateName) {
this.regionalCertificateName = regionalCertificateName;
}
@Override
public final Builder regionalCertificateName(String regionalCertificateName) {
this.regionalCertificateName = regionalCertificateName;
return this;
}
public final String getRegionalCertificateArn() {
return regionalCertificateArn;
}
public final void setRegionalCertificateArn(String regionalCertificateArn) {
this.regionalCertificateArn = regionalCertificateArn;
}
@Override
public final Builder regionalCertificateArn(String regionalCertificateArn) {
this.regionalCertificateArn = regionalCertificateArn;
return this;
}
public final String getDistributionDomainName() {
return distributionDomainName;
}
public final void setDistributionDomainName(String distributionDomainName) {
this.distributionDomainName = distributionDomainName;
}
@Override
public final Builder distributionDomainName(String distributionDomainName) {
this.distributionDomainName = distributionDomainName;
return this;
}
public final String getDistributionHostedZoneId() {
return distributionHostedZoneId;
}
public final void setDistributionHostedZoneId(String distributionHostedZoneId) {
this.distributionHostedZoneId = distributionHostedZoneId;
}
@Override
public final Builder distributionHostedZoneId(String distributionHostedZoneId) {
this.distributionHostedZoneId = distributionHostedZoneId;
return this;
}
public final EndpointConfiguration.Builder getEndpointConfiguration() {
return endpointConfiguration != null ? endpointConfiguration.toBuilder() : null;
}
public final void setEndpointConfiguration(EndpointConfiguration.BuilderImpl endpointConfiguration) {
this.endpointConfiguration = endpointConfiguration != null ? endpointConfiguration.build() : null;
}
@Override
public final Builder endpointConfiguration(EndpointConfiguration endpointConfiguration) {
this.endpointConfiguration = endpointConfiguration;
return this;
}
public final String getDomainNameStatus() {
return domainNameStatus;
}
public final void setDomainNameStatus(String domainNameStatus) {
this.domainNameStatus = domainNameStatus;
}
@Override
public final Builder domainNameStatus(String domainNameStatus) {
this.domainNameStatus = domainNameStatus;
return this;
}
@Override
public final Builder domainNameStatus(DomainNameStatus domainNameStatus) {
this.domainNameStatus(domainNameStatus == null ? null : domainNameStatus.toString());
return this;
}
public final String getDomainNameStatusMessage() {
return domainNameStatusMessage;
}
public final void setDomainNameStatusMessage(String domainNameStatusMessage) {
this.domainNameStatusMessage = domainNameStatusMessage;
}
@Override
public final Builder domainNameStatusMessage(String domainNameStatusMessage) {
this.domainNameStatusMessage = domainNameStatusMessage;
return this;
}
public final String getSecurityPolicy() {
return securityPolicy;
}
public final void setSecurityPolicy(String securityPolicy) {
this.securityPolicy = securityPolicy;
}
@Override
public final Builder securityPolicy(String securityPolicy) {
this.securityPolicy = securityPolicy;
return this;
}
@Override
public final Builder securityPolicy(SecurityPolicy securityPolicy) {
this.securityPolicy(securityPolicy == null ? null : securityPolicy.toString());
return this;
}
public final Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
public final void setTags(Map tags) {
this.tags = MapOfStringToStringCopier.copy(tags);
}
@Override
public final Builder tags(Map tags) {
this.tags = MapOfStringToStringCopier.copy(tags);
return this;
}
public final MutualTlsAuthentication.Builder getMutualTlsAuthentication() {
return mutualTlsAuthentication != null ? mutualTlsAuthentication.toBuilder() : null;
}
public final void setMutualTlsAuthentication(MutualTlsAuthentication.BuilderImpl mutualTlsAuthentication) {
this.mutualTlsAuthentication = mutualTlsAuthentication != null ? mutualTlsAuthentication.build() : null;
}
@Override
public final Builder mutualTlsAuthentication(MutualTlsAuthentication mutualTlsAuthentication) {
this.mutualTlsAuthentication = mutualTlsAuthentication;
return this;
}
public final String getOwnershipVerificationCertificateArn() {
return ownershipVerificationCertificateArn;
}
public final void setOwnershipVerificationCertificateArn(String ownershipVerificationCertificateArn) {
this.ownershipVerificationCertificateArn = ownershipVerificationCertificateArn;
}
@Override
public final Builder ownershipVerificationCertificateArn(String ownershipVerificationCertificateArn) {
this.ownershipVerificationCertificateArn = ownershipVerificationCertificateArn;
return this;
}
@Override
public CreateDomainNameResponse build() {
return new CreateDomainNameResponse(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}