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

software.amazon.awssdk.services.worklink.model.DescribeDomainResponse Maven / Gradle / Ivy

/*
 * Copyright 2014-2019 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.worklink.model;

import java.time.Instant;
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.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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class DescribeDomainResponse extends WorkLinkResponse implements
        ToCopyableBuilder {
    private static final SdkField DOMAIN_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(DescribeDomainResponse::domainName)).setter(setter(Builder::domainName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DomainName").build()).build();

    private static final SdkField DISPLAY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(DescribeDomainResponse::displayName)).setter(setter(Builder::displayName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DisplayName").build()).build();

    private static final SdkField CREATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .getter(getter(DescribeDomainResponse::createdTime)).setter(setter(Builder::createdTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedTime").build()).build();

    private static final SdkField DOMAIN_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(DescribeDomainResponse::domainStatusAsString)).setter(setter(Builder::domainStatus))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DomainStatus").build()).build();

    private static final SdkField ACM_CERTIFICATE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(DescribeDomainResponse::acmCertificateArn)).setter(setter(Builder::acmCertificateArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AcmCertificateArn").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DOMAIN_NAME_FIELD,
            DISPLAY_NAME_FIELD, CREATED_TIME_FIELD, DOMAIN_STATUS_FIELD, ACM_CERTIFICATE_ARN_FIELD));

    private final String domainName;

    private final String displayName;

    private final Instant createdTime;

    private final String domainStatus;

    private final String acmCertificateArn;

    private DescribeDomainResponse(BuilderImpl builder) {
        super(builder);
        this.domainName = builder.domainName;
        this.displayName = builder.displayName;
        this.createdTime = builder.createdTime;
        this.domainStatus = builder.domainStatus;
        this.acmCertificateArn = builder.acmCertificateArn;
    }

    /**
     * 

* The name of the domain. *

* * @return The name of the domain. */ public String domainName() { return domainName; } /** *

* The name to display. *

* * @return The name to display. */ public String displayName() { return displayName; } /** *

* The time that the domain was added. *

* * @return The time that the domain was added. */ public Instant createdTime() { return createdTime; } /** *

* The current state for the domain. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #domainStatus} will * return {@link DomainStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #domainStatusAsString}. *

* * @return The current state for the domain. * @see DomainStatus */ public DomainStatus domainStatus() { return DomainStatus.fromValue(domainStatus); } /** *

* The current state for the domain. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #domainStatus} will * return {@link DomainStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #domainStatusAsString}. *

* * @return The current state for the domain. * @see DomainStatus */ public String domainStatusAsString() { return domainStatus; } /** *

* The ARN of an issued ACM certificate that is valid for the domain being associated. *

* * @return The ARN of an issued ACM certificate that is valid for the domain being associated. */ public String acmCertificateArn() { return acmCertificateArn; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(domainName()); hashCode = 31 * hashCode + Objects.hashCode(displayName()); hashCode = 31 * hashCode + Objects.hashCode(createdTime()); hashCode = 31 * hashCode + Objects.hashCode(domainStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(acmCertificateArn()); return hashCode; } @Override public boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof DescribeDomainResponse)) { return false; } DescribeDomainResponse other = (DescribeDomainResponse) obj; return Objects.equals(domainName(), other.domainName()) && Objects.equals(displayName(), other.displayName()) && Objects.equals(createdTime(), other.createdTime()) && Objects.equals(domainStatusAsString(), other.domainStatusAsString()) && Objects.equals(acmCertificateArn(), other.acmCertificateArn()); } /** * 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 String toString() { return ToString.builder("DescribeDomainResponse").add("DomainName", domainName()).add("DisplayName", displayName()) .add("CreatedTime", createdTime()).add("DomainStatus", domainStatusAsString()) .add("AcmCertificateArn", acmCertificateArn()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DomainName": return Optional.ofNullable(clazz.cast(domainName())); case "DisplayName": return Optional.ofNullable(clazz.cast(displayName())); case "CreatedTime": return Optional.ofNullable(clazz.cast(createdTime())); case "DomainStatus": return Optional.ofNullable(clazz.cast(domainStatusAsString())); case "AcmCertificateArn": return Optional.ofNullable(clazz.cast(acmCertificateArn())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DescribeDomainResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends WorkLinkResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the domain. *

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

* The name to display. *

* * @param displayName * The name to display. * @return Returns a reference to this object so that method calls can be chained together. */ Builder displayName(String displayName); /** *

* The time that the domain was added. *

* * @param createdTime * The time that the domain was added. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdTime(Instant createdTime); /** *

* The current state for the domain. *

* * @param domainStatus * The current state for the domain. * @see DomainStatus * @return Returns a reference to this object so that method calls can be chained together. * @see DomainStatus */ Builder domainStatus(String domainStatus); /** *

* The current state for the domain. *

* * @param domainStatus * The current state for the domain. * @see DomainStatus * @return Returns a reference to this object so that method calls can be chained together. * @see DomainStatus */ Builder domainStatus(DomainStatus domainStatus); /** *

* The ARN of an issued ACM certificate that is valid for the domain being associated. *

* * @param acmCertificateArn * The ARN of an issued ACM certificate that is valid for the domain being associated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder acmCertificateArn(String acmCertificateArn); } static final class BuilderImpl extends WorkLinkResponse.BuilderImpl implements Builder { private String domainName; private String displayName; private Instant createdTime; private String domainStatus; private String acmCertificateArn; private BuilderImpl() { } private BuilderImpl(DescribeDomainResponse model) { super(model); domainName(model.domainName); displayName(model.displayName); createdTime(model.createdTime); domainStatus(model.domainStatus); acmCertificateArn(model.acmCertificateArn); } public final String getDomainName() { return domainName; } @Override public final Builder domainName(String domainName) { this.domainName = domainName; return this; } public final void setDomainName(String domainName) { this.domainName = domainName; } public final String getDisplayName() { return displayName; } @Override public final Builder displayName(String displayName) { this.displayName = displayName; return this; } public final void setDisplayName(String displayName) { this.displayName = displayName; } public final Instant getCreatedTime() { return createdTime; } @Override public final Builder createdTime(Instant createdTime) { this.createdTime = createdTime; return this; } public final void setCreatedTime(Instant createdTime) { this.createdTime = createdTime; } public final String getDomainStatusAsString() { return domainStatus; } @Override public final Builder domainStatus(String domainStatus) { this.domainStatus = domainStatus; return this; } @Override public final Builder domainStatus(DomainStatus domainStatus) { this.domainStatus(domainStatus == null ? null : domainStatus.toString()); return this; } public final void setDomainStatus(String domainStatus) { this.domainStatus = domainStatus; } public final String getAcmCertificateArn() { return acmCertificateArn; } @Override public final Builder acmCertificateArn(String acmCertificateArn) { this.acmCertificateArn = acmCertificateArn; return this; } public final void setAcmCertificateArn(String acmCertificateArn) { this.acmCertificateArn = acmCertificateArn; } @Override public DescribeDomainResponse build() { return new DescribeDomainResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy