software.amazon.awssdk.services.route53domains.model.TransferDomainRequest Maven / Gradle / Ivy
Show all versions of route53domains Show documentation
/*
* 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.route53domains.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The TransferDomain request includes the following elements.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class TransferDomainRequest extends Route53DomainsRequest implements
ToCopyableBuilder {
private static final SdkField DOMAIN_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DomainName").getter(getter(TransferDomainRequest::domainName)).setter(setter(Builder::domainName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DomainName").build()).build();
private static final SdkField IDN_LANG_CODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("IdnLangCode").getter(getter(TransferDomainRequest::idnLangCode)).setter(setter(Builder::idnLangCode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdnLangCode").build()).build();
private static final SdkField DURATION_IN_YEARS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("DurationInYears").getter(getter(TransferDomainRequest::durationInYears))
.setter(setter(Builder::durationInYears))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DurationInYears").build()).build();
private static final SdkField> NAMESERVERS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Nameservers")
.getter(getter(TransferDomainRequest::nameservers))
.setter(setter(Builder::nameservers))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Nameservers").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Nameserver::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField AUTH_CODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AuthCode").getter(getter(TransferDomainRequest::authCode)).setter(setter(Builder::authCode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AuthCode").build()).build();
private static final SdkField AUTO_RENEW_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("AutoRenew").getter(getter(TransferDomainRequest::autoRenew)).setter(setter(Builder::autoRenew))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutoRenew").build()).build();
private static final SdkField ADMIN_CONTACT_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("AdminContact").getter(getter(TransferDomainRequest::adminContact)).setter(setter(Builder::adminContact))
.constructor(ContactDetail::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AdminContact").build()).build();
private static final SdkField REGISTRANT_CONTACT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RegistrantContact")
.getter(getter(TransferDomainRequest::registrantContact)).setter(setter(Builder::registrantContact))
.constructor(ContactDetail::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RegistrantContact").build()).build();
private static final SdkField TECH_CONTACT_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("TechContact").getter(getter(TransferDomainRequest::techContact)).setter(setter(Builder::techContact))
.constructor(ContactDetail::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TechContact").build()).build();
private static final SdkField PRIVACY_PROTECT_ADMIN_CONTACT_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("PrivacyProtectAdminContact")
.getter(getter(TransferDomainRequest::privacyProtectAdminContact))
.setter(setter(Builder::privacyProtectAdminContact))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PrivacyProtectAdminContact").build())
.build();
private static final SdkField PRIVACY_PROTECT_REGISTRANT_CONTACT_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("PrivacyProtectRegistrantContact")
.getter(getter(TransferDomainRequest::privacyProtectRegistrantContact))
.setter(setter(Builder::privacyProtectRegistrantContact))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PrivacyProtectRegistrantContact")
.build()).build();
private static final SdkField PRIVACY_PROTECT_TECH_CONTACT_FIELD = SdkField
. builder(MarshallingType.BOOLEAN).memberName("PrivacyProtectTechContact")
.getter(getter(TransferDomainRequest::privacyProtectTechContact)).setter(setter(Builder::privacyProtectTechContact))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PrivacyProtectTechContact").build())
.build();
private static final SdkField BILLING_CONTACT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("BillingContact")
.getter(getter(TransferDomainRequest::billingContact)).setter(setter(Builder::billingContact))
.constructor(ContactDetail::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BillingContact").build()).build();
private static final SdkField PRIVACY_PROTECT_BILLING_CONTACT_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("PrivacyProtectBillingContact")
.getter(getter(TransferDomainRequest::privacyProtectBillingContact))
.setter(setter(Builder::privacyProtectBillingContact))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PrivacyProtectBillingContact")
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DOMAIN_NAME_FIELD,
IDN_LANG_CODE_FIELD, DURATION_IN_YEARS_FIELD, NAMESERVERS_FIELD, AUTH_CODE_FIELD, AUTO_RENEW_FIELD,
ADMIN_CONTACT_FIELD, REGISTRANT_CONTACT_FIELD, TECH_CONTACT_FIELD, PRIVACY_PROTECT_ADMIN_CONTACT_FIELD,
PRIVACY_PROTECT_REGISTRANT_CONTACT_FIELD, PRIVACY_PROTECT_TECH_CONTACT_FIELD, BILLING_CONTACT_FIELD,
PRIVACY_PROTECT_BILLING_CONTACT_FIELD));
private final String domainName;
private final String idnLangCode;
private final Integer durationInYears;
private final List nameservers;
private final String authCode;
private final Boolean autoRenew;
private final ContactDetail adminContact;
private final ContactDetail registrantContact;
private final ContactDetail techContact;
private final Boolean privacyProtectAdminContact;
private final Boolean privacyProtectRegistrantContact;
private final Boolean privacyProtectTechContact;
private final ContactDetail billingContact;
private final Boolean privacyProtectBillingContact;
private TransferDomainRequest(BuilderImpl builder) {
super(builder);
this.domainName = builder.domainName;
this.idnLangCode = builder.idnLangCode;
this.durationInYears = builder.durationInYears;
this.nameservers = builder.nameservers;
this.authCode = builder.authCode;
this.autoRenew = builder.autoRenew;
this.adminContact = builder.adminContact;
this.registrantContact = builder.registrantContact;
this.techContact = builder.techContact;
this.privacyProtectAdminContact = builder.privacyProtectAdminContact;
this.privacyProtectRegistrantContact = builder.privacyProtectRegistrantContact;
this.privacyProtectTechContact = builder.privacyProtectTechContact;
this.billingContact = builder.billingContact;
this.privacyProtectBillingContact = builder.privacyProtectBillingContact;
}
/**
*
* The name of the domain that you want to transfer to Route 53. The top-level domain (TLD), such as .com, must be a
* TLD that Route 53 supports. For a list of supported TLDs, see Domains that You Can
* Register with Amazon Route 53 in the Amazon Route 53 Developer Guide.
*
*
* The domain name can contain only the following characters:
*
*
* -
*
* Letters a through z. Domain names are not case sensitive.
*
*
* -
*
* Numbers 0 through 9.
*
*
* -
*
* Hyphen (-). You can't specify a hyphen at the beginning or end of a label.
*
*
* -
*
* Period (.) to separate the labels in the name, such as the .
in example.com
.
*
*
*
*
* @return The name of the domain that you want to transfer to Route 53. The top-level domain (TLD), such as .com,
* must be a TLD that Route 53 supports. For a list of supported TLDs, see Domains that You
* Can Register with Amazon Route 53 in the Amazon Route 53 Developer Guide.
*
* The domain name can contain only the following characters:
*
*
* -
*
* Letters a through z. Domain names are not case sensitive.
*
*
* -
*
* Numbers 0 through 9.
*
*
* -
*
* Hyphen (-). You can't specify a hyphen at the beginning or end of a label.
*
*
* -
*
* Period (.) to separate the labels in the name, such as the .
in example.com
.
*
*
*/
public final String domainName() {
return domainName;
}
/**
*
* Reserved for future use.
*
*
* @return Reserved for future use.
*/
public final String idnLangCode() {
return idnLangCode;
}
/**
*
* The number of years that you want to register the domain for. Domains are registered for a minimum of one year.
* The maximum period depends on the top-level domain.
*
*
* Default: 1
*
*
* @return The number of years that you want to register the domain for. Domains are registered for a minimum of one
* year. The maximum period depends on the top-level domain.
*
* Default: 1
*/
public final Integer durationInYears() {
return durationInYears;
}
/**
* For responses, this returns true if the service returned a value for the Nameservers 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 hasNameservers() {
return nameservers != null && !(nameservers instanceof SdkAutoConstructList);
}
/**
*
* Contains details for the host and glue IP addresses.
*
*
* 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 #hasNameservers} method.
*
*
* @return Contains details for the host and glue IP addresses.
*/
public final List nameservers() {
return nameservers;
}
/**
*
* The authorization code for the domain. You get this value from the current registrar.
*
*
* @return The authorization code for the domain. You get this value from the current registrar.
*/
public final String authCode() {
return authCode;
}
/**
*
* Indicates whether the domain will be automatically renewed (true) or not (false). Auto renewal only takes effect
* after the account is charged.
*
*
* Default: true
*
*
* @return Indicates whether the domain will be automatically renewed (true) or not (false). Auto renewal only takes
* effect after the account is charged.
*
* Default: true
*/
public final Boolean autoRenew() {
return autoRenew;
}
/**
*
* Provides detailed contact information.
*
*
* @return Provides detailed contact information.
*/
public final ContactDetail adminContact() {
return adminContact;
}
/**
*
* Provides detailed contact information.
*
*
* @return Provides detailed contact information.
*/
public final ContactDetail registrantContact() {
return registrantContact;
}
/**
*
* Provides detailed contact information.
*
*
* @return Provides detailed contact information.
*/
public final ContactDetail techContact() {
return techContact;
}
/**
*
* Whether you want to conceal contact information from WHOIS queries. If you specify true
, WHOIS
* ("who is") queries return contact information for the registrar, the phrase "REDACTED FOR PRIVACY", or
* "On behalf of <domain name> owner.".
*
*
*
* While some domains may allow different privacy settings per contact, we recommend specifying the same privacy
* setting for all contacts.
*
*
*
* Default: true
*
*
* @return Whether you want to conceal contact information from WHOIS queries. If you specify true
,
* WHOIS ("who is") queries return contact information for the registrar, the phrase "REDACTED FOR PRIVACY",
* or "On behalf of <domain name> owner.".
*
* While some domains may allow different privacy settings per contact, we recommend specifying the same
* privacy setting for all contacts.
*
*
*
* Default: true
*/
public final Boolean privacyProtectAdminContact() {
return privacyProtectAdminContact;
}
/**
*
* Whether you want to conceal contact information from WHOIS queries. If you specify true
, WHOIS
* ("who is") queries return contact information either for Amazon Registrar or for our registrar associate, Gandi.
* If you specify false
, WHOIS queries return the information that you entered for the registrant
* contact (domain owner).
*
*
*
* You must specify the same privacy setting for the administrative, billing, registrant, and technical contacts.
*
*
*
* Default: true
*
*
* @return Whether you want to conceal contact information from WHOIS queries. If you specify true
,
* WHOIS ("who is") queries return contact information either for Amazon Registrar or for our registrar
* associate, Gandi. If you specify false
, WHOIS queries return the information that you
* entered for the registrant contact (domain owner).
*
* You must specify the same privacy setting for the administrative, billing, registrant, and technical
* contacts.
*
*
*
* Default: true
*/
public final Boolean privacyProtectRegistrantContact() {
return privacyProtectRegistrantContact;
}
/**
*
* Whether you want to conceal contact information from WHOIS queries. If you specify true
, WHOIS
* ("who is") queries return contact information either for Amazon Registrar or for our registrar associate, Gandi.
* If you specify false
, WHOIS queries return the information that you entered for the technical
* contact.
*
*
*
* You must specify the same privacy setting for the administrative, billing, registrant, and technical contacts.
*
*
*
* Default: true
*
*
* @return Whether you want to conceal contact information from WHOIS queries. If you specify true
,
* WHOIS ("who is") queries return contact information either for Amazon Registrar or for our registrar
* associate, Gandi. If you specify false
, WHOIS queries return the information that you
* entered for the technical contact.
*
* You must specify the same privacy setting for the administrative, billing, registrant, and technical
* contacts.
*
*
*
* Default: true
*/
public final Boolean privacyProtectTechContact() {
return privacyProtectTechContact;
}
/**
*
* Provides detailed contact information.
*
*
* @return Provides detailed contact information.
*/
public final ContactDetail billingContact() {
return billingContact;
}
/**
*
* Whether you want to conceal contact information from WHOIS queries. If you specify true
, WHOIS
* ("who is") queries return contact information either for Amazon Registrar or for our registrar associate, Gandi.
* If you specify false
, WHOIS queries return the information that you entered for the billing contact.
*
*
*
* You must specify the same privacy setting for the administrative, billing, registrant, and technical contacts.
*
*
*
* @return Whether you want to conceal contact information from WHOIS queries. If you specify true
,
* WHOIS ("who is") queries return contact information either for Amazon Registrar or for our registrar
* associate, Gandi. If you specify false
, WHOIS queries return the information that you
* entered for the billing contact.
*
* You must specify the same privacy setting for the administrative, billing, registrant, and technical
* contacts.
*
*/
public final Boolean privacyProtectBillingContact() {
return privacyProtectBillingContact;
}
@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(idnLangCode());
hashCode = 31 * hashCode + Objects.hashCode(durationInYears());
hashCode = 31 * hashCode + Objects.hashCode(hasNameservers() ? nameservers() : null);
hashCode = 31 * hashCode + Objects.hashCode(authCode());
hashCode = 31 * hashCode + Objects.hashCode(autoRenew());
hashCode = 31 * hashCode + Objects.hashCode(adminContact());
hashCode = 31 * hashCode + Objects.hashCode(registrantContact());
hashCode = 31 * hashCode + Objects.hashCode(techContact());
hashCode = 31 * hashCode + Objects.hashCode(privacyProtectAdminContact());
hashCode = 31 * hashCode + Objects.hashCode(privacyProtectRegistrantContact());
hashCode = 31 * hashCode + Objects.hashCode(privacyProtectTechContact());
hashCode = 31 * hashCode + Objects.hashCode(billingContact());
hashCode = 31 * hashCode + Objects.hashCode(privacyProtectBillingContact());
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 TransferDomainRequest)) {
return false;
}
TransferDomainRequest other = (TransferDomainRequest) obj;
return Objects.equals(domainName(), other.domainName()) && Objects.equals(idnLangCode(), other.idnLangCode())
&& Objects.equals(durationInYears(), other.durationInYears()) && hasNameservers() == other.hasNameservers()
&& Objects.equals(nameservers(), other.nameservers()) && Objects.equals(authCode(), other.authCode())
&& Objects.equals(autoRenew(), other.autoRenew()) && Objects.equals(adminContact(), other.adminContact())
&& Objects.equals(registrantContact(), other.registrantContact())
&& Objects.equals(techContact(), other.techContact())
&& Objects.equals(privacyProtectAdminContact(), other.privacyProtectAdminContact())
&& Objects.equals(privacyProtectRegistrantContact(), other.privacyProtectRegistrantContact())
&& Objects.equals(privacyProtectTechContact(), other.privacyProtectTechContact())
&& Objects.equals(billingContact(), other.billingContact())
&& Objects.equals(privacyProtectBillingContact(), other.privacyProtectBillingContact());
}
/**
* 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("TransferDomainRequest").add("DomainName", domainName()).add("IdnLangCode", idnLangCode())
.add("DurationInYears", durationInYears()).add("Nameservers", hasNameservers() ? nameservers() : null)
.add("AuthCode", authCode() == null ? null : "*** Sensitive Data Redacted ***").add("AutoRenew", autoRenew())
.add("AdminContact", adminContact() == null ? null : "*** Sensitive Data Redacted ***")
.add("RegistrantContact", registrantContact() == null ? null : "*** Sensitive Data Redacted ***")
.add("TechContact", techContact() == null ? null : "*** Sensitive Data Redacted ***")
.add("PrivacyProtectAdminContact", privacyProtectAdminContact())
.add("PrivacyProtectRegistrantContact", privacyProtectRegistrantContact())
.add("PrivacyProtectTechContact", privacyProtectTechContact())
.add("BillingContact", billingContact() == null ? null : "*** Sensitive Data Redacted ***")
.add("PrivacyProtectBillingContact", privacyProtectBillingContact()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "DomainName":
return Optional.ofNullable(clazz.cast(domainName()));
case "IdnLangCode":
return Optional.ofNullable(clazz.cast(idnLangCode()));
case "DurationInYears":
return Optional.ofNullable(clazz.cast(durationInYears()));
case "Nameservers":
return Optional.ofNullable(clazz.cast(nameservers()));
case "AuthCode":
return Optional.ofNullable(clazz.cast(authCode()));
case "AutoRenew":
return Optional.ofNullable(clazz.cast(autoRenew()));
case "AdminContact":
return Optional.ofNullable(clazz.cast(adminContact()));
case "RegistrantContact":
return Optional.ofNullable(clazz.cast(registrantContact()));
case "TechContact":
return Optional.ofNullable(clazz.cast(techContact()));
case "PrivacyProtectAdminContact":
return Optional.ofNullable(clazz.cast(privacyProtectAdminContact()));
case "PrivacyProtectRegistrantContact":
return Optional.ofNullable(clazz.cast(privacyProtectRegistrantContact()));
case "PrivacyProtectTechContact":
return Optional.ofNullable(clazz.cast(privacyProtectTechContact()));
case "BillingContact":
return Optional.ofNullable(clazz.cast(billingContact()));
case "PrivacyProtectBillingContact":
return Optional.ofNullable(clazz.cast(privacyProtectBillingContact()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function