All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.route53domains.model.UpdateDomainContactRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Route53 module holds the client classes that are used for communicating with Amazon Route53 Domain Service

There is a newer version: 2.29.17
Show newest version
/*
 * 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.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 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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* The UpdateDomainContact request includes the following elements. *

*/ @Generated("software.amazon.awssdk:codegen") public final class UpdateDomainContactRequest extends Route53DomainsRequest implements ToCopyableBuilder { private static final SdkField DOMAIN_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DomainName").getter(getter(UpdateDomainContactRequest::domainName)).setter(setter(Builder::domainName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DomainName").build()).build(); private static final SdkField ADMIN_CONTACT_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("AdminContact").getter(getter(UpdateDomainContactRequest::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(UpdateDomainContactRequest::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(UpdateDomainContactRequest::techContact)) .setter(setter(Builder::techContact)).constructor(ContactDetail::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TechContact").build()).build(); private static final SdkField CONSENT_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("Consent").getter(getter(UpdateDomainContactRequest::consent)).setter(setter(Builder::consent)) .constructor(Consent::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Consent").build()).build(); private static final SdkField BILLING_CONTACT_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("BillingContact") .getter(getter(UpdateDomainContactRequest::billingContact)).setter(setter(Builder::billingContact)) .constructor(ContactDetail::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BillingContact").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DOMAIN_NAME_FIELD, ADMIN_CONTACT_FIELD, REGISTRANT_CONTACT_FIELD, TECH_CONTACT_FIELD, CONSENT_FIELD, BILLING_CONTACT_FIELD)); private final String domainName; private final ContactDetail adminContact; private final ContactDetail registrantContact; private final ContactDetail techContact; private final Consent consent; private final ContactDetail billingContact; private UpdateDomainContactRequest(BuilderImpl builder) { super(builder); this.domainName = builder.domainName; this.adminContact = builder.adminContact; this.registrantContact = builder.registrantContact; this.techContact = builder.techContact; this.consent = builder.consent; this.billingContact = builder.billingContact; } /** *

* The name of the domain that you want to update contact information for. *

* * @return The name of the domain that you want to update contact information for. */ public final String domainName() { return domainName; } /** *

* 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; } /** *

* Customer's consent for the owner change request. Required if the domain is not free (consent price is more than * $0.00). *

* * @return Customer's consent for the owner change request. Required if the domain is not free (consent price is * more than $0.00). */ public final Consent consent() { return consent; } /** *

* Provides detailed contact information. *

* * @return Provides detailed contact information. */ public final ContactDetail billingContact() { return billingContact; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class 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(adminContact()); hashCode = 31 * hashCode + Objects.hashCode(registrantContact()); hashCode = 31 * hashCode + Objects.hashCode(techContact()); hashCode = 31 * hashCode + Objects.hashCode(consent()); hashCode = 31 * hashCode + Objects.hashCode(billingContact()); 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 UpdateDomainContactRequest)) { return false; } UpdateDomainContactRequest other = (UpdateDomainContactRequest) obj; return Objects.equals(domainName(), other.domainName()) && Objects.equals(adminContact(), other.adminContact()) && Objects.equals(registrantContact(), other.registrantContact()) && Objects.equals(techContact(), other.techContact()) && Objects.equals(consent(), other.consent()) && Objects.equals(billingContact(), other.billingContact()); } /** * 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("UpdateDomainContactRequest").add("DomainName", domainName()) .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("Consent", consent()) .add("BillingContact", billingContact() == null ? null : "*** Sensitive Data Redacted ***").build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DomainName": return Optional.ofNullable(clazz.cast(domainName())); 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 "Consent": return Optional.ofNullable(clazz.cast(consent())); case "BillingContact": return Optional.ofNullable(clazz.cast(billingContact())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateDomainContactRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends Route53DomainsRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the domain that you want to update contact information for. *

* * @param domainName * The name of the domain that you want to update contact information for. * @return Returns a reference to this object so that method calls can be chained together. */ Builder domainName(String domainName); /** *

* Provides detailed contact information. *

* * @param adminContact * Provides detailed contact information. * @return Returns a reference to this object so that method calls can be chained together. */ Builder adminContact(ContactDetail adminContact); /** *

* Provides detailed contact information. *

* This is a convenience method that creates an instance of the {@link ContactDetail.Builder} avoiding the need * to create one manually via {@link ContactDetail#builder()}. * *

* When the {@link Consumer} completes, {@link ContactDetail.Builder#build()} is called immediately and its * result is passed to {@link #adminContact(ContactDetail)}. * * @param adminContact * a consumer that will call methods on {@link ContactDetail.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #adminContact(ContactDetail) */ default Builder adminContact(Consumer adminContact) { return adminContact(ContactDetail.builder().applyMutation(adminContact).build()); } /** *

* Provides detailed contact information. *

* * @param registrantContact * Provides detailed contact information. * @return Returns a reference to this object so that method calls can be chained together. */ Builder registrantContact(ContactDetail registrantContact); /** *

* Provides detailed contact information. *

* This is a convenience method that creates an instance of the {@link ContactDetail.Builder} avoiding the need * to create one manually via {@link ContactDetail#builder()}. * *

* When the {@link Consumer} completes, {@link ContactDetail.Builder#build()} is called immediately and its * result is passed to {@link #registrantContact(ContactDetail)}. * * @param registrantContact * a consumer that will call methods on {@link ContactDetail.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #registrantContact(ContactDetail) */ default Builder registrantContact(Consumer registrantContact) { return registrantContact(ContactDetail.builder().applyMutation(registrantContact).build()); } /** *

* Provides detailed contact information. *

* * @param techContact * Provides detailed contact information. * @return Returns a reference to this object so that method calls can be chained together. */ Builder techContact(ContactDetail techContact); /** *

* Provides detailed contact information. *

* This is a convenience method that creates an instance of the {@link ContactDetail.Builder} avoiding the need * to create one manually via {@link ContactDetail#builder()}. * *

* When the {@link Consumer} completes, {@link ContactDetail.Builder#build()} is called immediately and its * result is passed to {@link #techContact(ContactDetail)}. * * @param techContact * a consumer that will call methods on {@link ContactDetail.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #techContact(ContactDetail) */ default Builder techContact(Consumer techContact) { return techContact(ContactDetail.builder().applyMutation(techContact).build()); } /** *

* Customer's consent for the owner change request. Required if the domain is not free (consent price is more * than $0.00). *

* * @param consent * Customer's consent for the owner change request. Required if the domain is not free (consent price is * more than $0.00). * @return Returns a reference to this object so that method calls can be chained together. */ Builder consent(Consent consent); /** *

* Customer's consent for the owner change request. Required if the domain is not free (consent price is more * than $0.00). *

* This is a convenience method that creates an instance of the {@link Consent.Builder} avoiding the need to * create one manually via {@link Consent#builder()}. * *

* When the {@link Consumer} completes, {@link Consent.Builder#build()} is called immediately and its result is * passed to {@link #consent(Consent)}. * * @param consent * a consumer that will call methods on {@link Consent.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #consent(Consent) */ default Builder consent(Consumer consent) { return consent(Consent.builder().applyMutation(consent).build()); } /** *

* Provides detailed contact information. *

* * @param billingContact * Provides detailed contact information. * @return Returns a reference to this object so that method calls can be chained together. */ Builder billingContact(ContactDetail billingContact); /** *

* Provides detailed contact information. *

* This is a convenience method that creates an instance of the {@link ContactDetail.Builder} avoiding the need * to create one manually via {@link ContactDetail#builder()}. * *

* When the {@link Consumer} completes, {@link ContactDetail.Builder#build()} is called immediately and its * result is passed to {@link #billingContact(ContactDetail)}. * * @param billingContact * a consumer that will call methods on {@link ContactDetail.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #billingContact(ContactDetail) */ default Builder billingContact(Consumer billingContact) { return billingContact(ContactDetail.builder().applyMutation(billingContact).build()); } @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends Route53DomainsRequest.BuilderImpl implements Builder { private String domainName; private ContactDetail adminContact; private ContactDetail registrantContact; private ContactDetail techContact; private Consent consent; private ContactDetail billingContact; private BuilderImpl() { } private BuilderImpl(UpdateDomainContactRequest model) { super(model); domainName(model.domainName); adminContact(model.adminContact); registrantContact(model.registrantContact); techContact(model.techContact); consent(model.consent); billingContact(model.billingContact); } 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 ContactDetail.Builder getAdminContact() { return adminContact != null ? adminContact.toBuilder() : null; } public final void setAdminContact(ContactDetail.BuilderImpl adminContact) { this.adminContact = adminContact != null ? adminContact.build() : null; } @Override public final Builder adminContact(ContactDetail adminContact) { this.adminContact = adminContact; return this; } public final ContactDetail.Builder getRegistrantContact() { return registrantContact != null ? registrantContact.toBuilder() : null; } public final void setRegistrantContact(ContactDetail.BuilderImpl registrantContact) { this.registrantContact = registrantContact != null ? registrantContact.build() : null; } @Override public final Builder registrantContact(ContactDetail registrantContact) { this.registrantContact = registrantContact; return this; } public final ContactDetail.Builder getTechContact() { return techContact != null ? techContact.toBuilder() : null; } public final void setTechContact(ContactDetail.BuilderImpl techContact) { this.techContact = techContact != null ? techContact.build() : null; } @Override public final Builder techContact(ContactDetail techContact) { this.techContact = techContact; return this; } public final Consent.Builder getConsent() { return consent != null ? consent.toBuilder() : null; } public final void setConsent(Consent.BuilderImpl consent) { this.consent = consent != null ? consent.build() : null; } @Override public final Builder consent(Consent consent) { this.consent = consent; return this; } public final ContactDetail.Builder getBillingContact() { return billingContact != null ? billingContact.toBuilder() : null; } public final void setBillingContact(ContactDetail.BuilderImpl billingContact) { this.billingContact = billingContact != null ? billingContact.build() : null; } @Override public final Builder billingContact(ContactDetail billingContact) { this.billingContact = billingContact; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public UpdateDomainContactRequest build() { return new UpdateDomainContactRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy