software.amazon.awssdk.services.codeartifact.model.RepositorySummary Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codeartifact Show documentation
Show all versions of codeartifact Show documentation
The AWS Java SDK for Codeartifact module holds the client classes that are used for
communicating with Codeartifact.
/*
* 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;
/**
*
* Details about a repository, including its Amazon Resource Name (ARN), description, and domain information. The ListRepositories
* operation returns a list of RepositorySummary
objects.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class RepositorySummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
.getter(getter(RepositorySummary::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField ADMINISTRATOR_ACCOUNT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("administratorAccount").getter(getter(RepositorySummary::administratorAccount))
.setter(setter(Builder::administratorAccount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("administratorAccount").build())
.build();
private static final SdkField DOMAIN_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("domainName").getter(getter(RepositorySummary::domainName)).setter(setter(Builder::domainName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("domainName").build()).build();
private static final SdkField DOMAIN_OWNER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("domainOwner").getter(getter(RepositorySummary::domainOwner)).setter(setter(Builder::domainOwner))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("domainOwner").build()).build();
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn")
.getter(getter(RepositorySummary::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("description").getter(getter(RepositorySummary::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField CREATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("createdTime").getter(getter(RepositorySummary::createdTime)).setter(setter(Builder::createdTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdTime").build()).build();
private static final List> SDK_FIELDS = Collections
.unmodifiableList(Arrays.asList(NAME_FIELD, ADMINISTRATOR_ACCOUNT_FIELD, DOMAIN_NAME_FIELD, DOMAIN_OWNER_FIELD,
ARN_FIELD, DESCRIPTION_FIELD, CREATED_TIME_FIELD));
private static final long serialVersionUID = 1L;
private final String name;
private final String administratorAccount;
private final String domainName;
private final String domainOwner;
private final String arn;
private final String description;
private final Instant createdTime;
private RepositorySummary(BuilderImpl builder) {
this.name = builder.name;
this.administratorAccount = builder.administratorAccount;
this.domainName = builder.domainName;
this.domainOwner = builder.domainOwner;
this.arn = builder.arn;
this.description = builder.description;
this.createdTime = builder.createdTime;
}
/**
*
* The name of the repository.
*
*
* @return The name of the repository.
*/
public final String name() {
return name;
}
/**
*
* The Amazon Web Services account ID that manages the repository.
*
*
* @return The Amazon Web Services account ID that manages the repository.
*/
public final String administratorAccount() {
return administratorAccount;
}
/**
*
* The name of the domain that contains the repository.
*
*
* @return The name of the domain that contains the repository.
*/
public final String domainName() {
return domainName;
}
/**
*
* The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes
* or spaces.
*
*
* @return The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include
* dashes or spaces.
*/
public final String domainOwner() {
return domainOwner;
}
/**
*
* The ARN of the repository.
*
*
* @return The ARN of the repository.
*/
public final String arn() {
return arn;
}
/**
*
* The description of the repository.
*
*
* @return The description of the repository.
*/
public final String description() {
return description;
}
/**
*
* A timestamp that represents the date and time the repository was created.
*
*
* @return A timestamp that represents the date and time the repository was created.
*/
public final Instant createdTime() {
return createdTime;
}
@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 + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(administratorAccount());
hashCode = 31 * hashCode + Objects.hashCode(domainName());
hashCode = 31 * hashCode + Objects.hashCode(domainOwner());
hashCode = 31 * hashCode + Objects.hashCode(arn());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(createdTime());
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 RepositorySummary)) {
return false;
}
RepositorySummary other = (RepositorySummary) obj;
return Objects.equals(name(), other.name()) && Objects.equals(administratorAccount(), other.administratorAccount())
&& Objects.equals(domainName(), other.domainName()) && Objects.equals(domainOwner(), other.domainOwner())
&& Objects.equals(arn(), other.arn()) && Objects.equals(description(), other.description())
&& Objects.equals(createdTime(), other.createdTime());
}
/**
* 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("RepositorySummary").add("Name", name()).add("AdministratorAccount", administratorAccount())
.add("DomainName", domainName()).add("DomainOwner", domainOwner()).add("Arn", arn())
.add("Description", description()).add("CreatedTime", createdTime()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "administratorAccount":
return Optional.ofNullable(clazz.cast(administratorAccount()));
case "domainName":
return Optional.ofNullable(clazz.cast(domainName()));
case "domainOwner":
return Optional.ofNullable(clazz.cast(domainOwner()));
case "arn":
return Optional.ofNullable(clazz.cast(arn()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "createdTime":
return Optional.ofNullable(clazz.cast(createdTime()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy