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

software.amazon.awssdk.services.codeartifact.model.DomainSummary Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Codeartifact module holds the client classes that are used for communicating with Codeartifact.

There is a newer version: 2.29.39
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.codeartifact.model;

import java.io.Serializable;
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;

/**
 * 

* Information about a domain, including its name, Amazon Resource Name (ARN), and status. The ListDomains operation * returns a list of DomainSummary objects. *

*/ @Generated("software.amazon.awssdk:codegen") public final class DomainSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name") .getter(getter(DomainSummary::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build(); private static final SdkField OWNER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("owner") .getter(getter(DomainSummary::owner)).setter(setter(Builder::owner)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("owner").build()).build(); private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn") .getter(getter(DomainSummary::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status") .getter(getter(DomainSummary::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final SdkField CREATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("createdTime").getter(getter(DomainSummary::createdTime)).setter(setter(Builder::createdTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdTime").build()).build(); private static final SdkField ENCRYPTION_KEY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("encryptionKey").getter(getter(DomainSummary::encryptionKey)).setter(setter(Builder::encryptionKey)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("encryptionKey").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, OWNER_FIELD, ARN_FIELD, STATUS_FIELD, CREATED_TIME_FIELD, ENCRYPTION_KEY_FIELD)); private static final long serialVersionUID = 1L; private final String name; private final String owner; private final String arn; private final String status; private final Instant createdTime; private final String encryptionKey; private DomainSummary(BuilderImpl builder) { this.name = builder.name; this.owner = builder.owner; this.arn = builder.arn; this.status = builder.status; this.createdTime = builder.createdTime; this.encryptionKey = builder.encryptionKey; } /** *

* The name of the domain. *

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

* The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces. *

* * @return The 12-digit account number of the AWS account that owns the domain. It does not include dashes or * spaces. */ public final String owner() { return owner; } /** *

* The ARN of the domain. *

* * @return The ARN of the domain. */ public final String arn() { return arn; } /** *

* A string that contains the status of the domain. The valid values are: *

*
    *
  • *

    * Active *

    *
  • *
  • *

    * Deleted *

    *
  • *
*

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

* * @return A string that contains the status of the domain. The valid values are:

*
    *
  • *

    * Active *

    *
  • *
  • *

    * Deleted *

    *
  • * @see DomainStatus */ public final DomainStatus status() { return DomainStatus.fromValue(status); } /** *

    * A string that contains the status of the domain. The valid values are: *

    *
      *
    • *

      * Active *

      *
    • *
    • *

      * Deleted *

      *
    • *
    *

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

    * * @return A string that contains the status of the domain. The valid values are:

    *
      *
    • *

      * Active *

      *
    • *
    • *

      * Deleted *

      *
    • * @see DomainStatus */ public final String statusAsString() { return status; } /** *

      * A timestamp that contains the date and time the domain was created. *

      * * @return A timestamp that contains the date and time the domain was created. */ public final Instant createdTime() { return createdTime; } /** *

      * The key used to encrypt the domain. *

      * * @return The key used to encrypt the domain. */ public final String encryptionKey() { return encryptionKey; } @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 + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(owner()); hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(createdTime()); hashCode = 31 * hashCode + Objects.hashCode(encryptionKey()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof DomainSummary)) { return false; } DomainSummary other = (DomainSummary) obj; return Objects.equals(name(), other.name()) && Objects.equals(owner(), other.owner()) && Objects.equals(arn(), other.arn()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(createdTime(), other.createdTime()) && Objects.equals(encryptionKey(), other.encryptionKey()); } /** * 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("DomainSummary").add("Name", name()).add("Owner", owner()).add("Arn", arn()) .add("Status", statusAsString()).add("CreatedTime", createdTime()).add("EncryptionKey", encryptionKey()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "name": return Optional.ofNullable(clazz.cast(name())); case "owner": return Optional.ofNullable(clazz.cast(owner())); case "arn": return Optional.ofNullable(clazz.cast(arn())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "createdTime": return Optional.ofNullable(clazz.cast(createdTime())); case "encryptionKey": return Optional.ofNullable(clazz.cast(encryptionKey())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DomainSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The name of the domain. *

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

      * The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces. *

      * * @param owner * The 12-digit account number of the AWS account that owns the domain. It does not include dashes or * spaces. * @return Returns a reference to this object so that method calls can be chained together. */ Builder owner(String owner); /** *

      * The ARN of the domain. *

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

      * A string that contains the status of the domain. The valid values are: *

      *
        *
      • *

        * Active *

        *
      • *
      • *

        * Deleted *

        *
      • *
      * * @param status * A string that contains the status of the domain. The valid values are:

      *
        *
      • *

        * Active *

        *
      • *
      • *

        * Deleted *

        *
      • * @see DomainStatus * @return Returns a reference to this object so that method calls can be chained together. * @see DomainStatus */ Builder status(String status); /** *

        * A string that contains the status of the domain. The valid values are: *

        *
          *
        • *

          * Active *

          *
        • *
        • *

          * Deleted *

          *
        • *
        * * @param status * A string that contains the status of the domain. The valid values are:

        *
          *
        • *

          * Active *

          *
        • *
        • *

          * Deleted *

          *
        • * @see DomainStatus * @return Returns a reference to this object so that method calls can be chained together. * @see DomainStatus */ Builder status(DomainStatus status); /** *

          * A timestamp that contains the date and time the domain was created. *

          * * @param createdTime * A timestamp that contains the date and time the domain was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdTime(Instant createdTime); /** *

          * The key used to encrypt the domain. *

          * * @param encryptionKey * The key used to encrypt the domain. * @return Returns a reference to this object so that method calls can be chained together. */ Builder encryptionKey(String encryptionKey); } static final class BuilderImpl implements Builder { private String name; private String owner; private String arn; private String status; private Instant createdTime; private String encryptionKey; private BuilderImpl() { } private BuilderImpl(DomainSummary model) { name(model.name); owner(model.owner); arn(model.arn); status(model.status); createdTime(model.createdTime); encryptionKey(model.encryptionKey); } public final String getName() { return name; } @Override public final Builder name(String name) { this.name = name; return this; } public final void setName(String name) { this.name = name; } public final String getOwner() { return owner; } @Override public final Builder owner(String owner) { this.owner = owner; return this; } public final void setOwner(String owner) { this.owner = owner; } public final String getArn() { return arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final void setArn(String arn) { this.arn = arn; } public final String getStatus() { return status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(DomainStatus status) { this.status(status == null ? null : status.toString()); return this; } public final void setStatus(String status) { this.status = status; } 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 getEncryptionKey() { return encryptionKey; } @Override public final Builder encryptionKey(String encryptionKey) { this.encryptionKey = encryptionKey; return this; } public final void setEncryptionKey(String encryptionKey) { this.encryptionKey = encryptionKey; } @Override public DomainSummary build() { return new DomainSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy