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

software.amazon.awssdk.services.codeartifact.model.DomainDescription 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. A domain is a container for repositories. When you create a domain, it is empty until you * add one or more repositories. *

*/ @Generated("software.amazon.awssdk:codegen") public final class DomainDescription implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name") .getter(getter(DomainDescription::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(DomainDescription::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(DomainDescription::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(DomainDescription::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(DomainDescription::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(DomainDescription::encryptionKey)).setter(setter(Builder::encryptionKey)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("encryptionKey").build()).build(); private static final SdkField REPOSITORY_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("repositoryCount").getter(getter(DomainDescription::repositoryCount)) .setter(setter(Builder::repositoryCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("repositoryCount").build()).build(); private static final SdkField ASSET_SIZE_BYTES_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("assetSizeBytes").getter(getter(DomainDescription::assetSizeBytes)) .setter(setter(Builder::assetSizeBytes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("assetSizeBytes").build()).build(); private static final SdkField S3_BUCKET_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("s3BucketArn").getter(getter(DomainDescription::s3BucketArn)).setter(setter(Builder::s3BucketArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("s3BucketArn").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, REPOSITORY_COUNT_FIELD, ASSET_SIZE_BYTES_FIELD, S3_BUCKET_ARN_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 final Integer repositoryCount; private final Long assetSizeBytes; private final String s3BucketArn; private DomainDescription(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; this.repositoryCount = builder.repositoryCount; this.assetSizeBytes = builder.assetSizeBytes; this.s3BucketArn = builder.s3BucketArn; } /** *

* The name of the domain. *

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

* The Amazon Web Services account ID that owns the domain. *

* * @return The Amazon Web Services account ID that owns the domain. */ public final String owner() { return owner; } /** *

* The Amazon Resource Name (ARN) of the domain. *

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

* The current status of a domain. *

*

* 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 The current status of a domain. * @see DomainStatus */ public final DomainStatus status() { return DomainStatus.fromValue(status); } /** *

* The current status of a domain. *

*

* 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 The current status of a domain. * @see DomainStatus */ public final String statusAsString() { return status; } /** *

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

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

* The ARN of an Key Management Service (KMS) key associated with a domain. *

* * @return The ARN of an Key Management Service (KMS) key associated with a domain. */ public final String encryptionKey() { return encryptionKey; } /** *

* The number of repositories in the domain. *

* * @return The number of repositories in the domain. */ public final Integer repositoryCount() { return repositoryCount; } /** *

* The total size of all assets in the domain. *

* * @return The total size of all assets in the domain. */ public final Long assetSizeBytes() { return assetSizeBytes; } /** *

* The Amazon Resource Name (ARN) of the Amazon S3 bucket that is used to store package assets in the domain. *

* * @return The Amazon Resource Name (ARN) of the Amazon S3 bucket that is used to store package assets in the * domain. */ public final String s3BucketArn() { return s3BucketArn; } @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()); hashCode = 31 * hashCode + Objects.hashCode(repositoryCount()); hashCode = 31 * hashCode + Objects.hashCode(assetSizeBytes()); hashCode = 31 * hashCode + Objects.hashCode(s3BucketArn()); 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 DomainDescription)) { return false; } DomainDescription other = (DomainDescription) 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()) && Objects.equals(repositoryCount(), other.repositoryCount()) && Objects.equals(assetSizeBytes(), other.assetSizeBytes()) && Objects.equals(s3BucketArn(), other.s3BucketArn()); } /** * 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("DomainDescription").add("Name", name()).add("Owner", owner()).add("Arn", arn()) .add("Status", statusAsString()).add("CreatedTime", createdTime()).add("EncryptionKey", encryptionKey()) .add("RepositoryCount", repositoryCount()).add("AssetSizeBytes", assetSizeBytes()) .add("S3BucketArn", s3BucketArn()).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())); case "repositoryCount": return Optional.ofNullable(clazz.cast(repositoryCount())); case "assetSizeBytes": return Optional.ofNullable(clazz.cast(assetSizeBytes())); case "s3BucketArn": return Optional.ofNullable(clazz.cast(s3BucketArn())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DomainDescription) 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 Amazon Web Services account ID that owns the domain. *

* * @param owner * The Amazon Web Services account ID that owns the domain. * @return Returns a reference to this object so that method calls can be chained together. */ Builder owner(String owner); /** *

* The Amazon Resource Name (ARN) of the domain. *

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

* The current status of a domain. *

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

* The current status of a domain. *

* * @param status * The current status of a domain. * @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 represents the date and time the domain was created. *

* * @param createdTime * A timestamp that represents 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 ARN of an Key Management Service (KMS) key associated with a domain. *

* * @param encryptionKey * The ARN of an Key Management Service (KMS) key associated with a domain. * @return Returns a reference to this object so that method calls can be chained together. */ Builder encryptionKey(String encryptionKey); /** *

* The number of repositories in the domain. *

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

* The total size of all assets in the domain. *

* * @param assetSizeBytes * The total size of all assets in the domain. * @return Returns a reference to this object so that method calls can be chained together. */ Builder assetSizeBytes(Long assetSizeBytes); /** *

* The Amazon Resource Name (ARN) of the Amazon S3 bucket that is used to store package assets in the domain. *

* * @param s3BucketArn * The Amazon Resource Name (ARN) of the Amazon S3 bucket that is used to store package assets in the * domain. * @return Returns a reference to this object so that method calls can be chained together. */ Builder s3BucketArn(String s3BucketArn); } 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 Integer repositoryCount; private Long assetSizeBytes; private String s3BucketArn; private BuilderImpl() { } private BuilderImpl(DomainDescription model) { name(model.name); owner(model.owner); arn(model.arn); status(model.status); createdTime(model.createdTime); encryptionKey(model.encryptionKey); repositoryCount(model.repositoryCount); assetSizeBytes(model.assetSizeBytes); s3BucketArn(model.s3BucketArn); } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getOwner() { return owner; } public final void setOwner(String owner) { this.owner = owner; } @Override public final Builder owner(String owner) { this.owner = owner; return this; } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = 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 Instant getCreatedTime() { return createdTime; } public final void setCreatedTime(Instant createdTime) { this.createdTime = createdTime; } @Override public final Builder createdTime(Instant createdTime) { this.createdTime = createdTime; return this; } public final String getEncryptionKey() { return encryptionKey; } public final void setEncryptionKey(String encryptionKey) { this.encryptionKey = encryptionKey; } @Override public final Builder encryptionKey(String encryptionKey) { this.encryptionKey = encryptionKey; return this; } public final Integer getRepositoryCount() { return repositoryCount; } public final void setRepositoryCount(Integer repositoryCount) { this.repositoryCount = repositoryCount; } @Override public final Builder repositoryCount(Integer repositoryCount) { this.repositoryCount = repositoryCount; return this; } public final Long getAssetSizeBytes() { return assetSizeBytes; } public final void setAssetSizeBytes(Long assetSizeBytes) { this.assetSizeBytes = assetSizeBytes; } @Override public final Builder assetSizeBytes(Long assetSizeBytes) { this.assetSizeBytes = assetSizeBytes; return this; } public final String getS3BucketArn() { return s3BucketArn; } public final void setS3BucketArn(String s3BucketArn) { this.s3BucketArn = s3BucketArn; } @Override public final Builder s3BucketArn(String s3BucketArn) { this.s3BucketArn = s3BucketArn; return this; } @Override public DomainDescription build() { return new DomainDescription(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy