software.amazon.awssdk.services.eks.model.PodIdentityAssociationSummary Maven / Gradle / Ivy
Show all versions of eks Show documentation
/*
* 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.eks.model;
import java.io.Serializable;
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;
/**
*
* The summarized description of the association.
*
*
* Each summary is simplified by removing these fields compared to the full PodIdentityAssociation
* :
*
*
* -
*
* The IAM role: roleArn
*
*
* -
*
* The timestamp that the association was created at: createdAt
*
*
* -
*
* The most recent timestamp that the association was modified at:. modifiedAt
*
*
* -
*
* The tags on the association: tags
*
*
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class PodIdentityAssociationSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField CLUSTER_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("clusterName").getter(getter(PodIdentityAssociationSummary::clusterName))
.setter(setter(Builder::clusterName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("clusterName").build()).build();
private static final SdkField NAMESPACE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("namespace").getter(getter(PodIdentityAssociationSummary::namespace)).setter(setter(Builder::namespace))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("namespace").build()).build();
private static final SdkField SERVICE_ACCOUNT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("serviceAccount").getter(getter(PodIdentityAssociationSummary::serviceAccount))
.setter(setter(Builder::serviceAccount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceAccount").build()).build();
private static final SdkField ASSOCIATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("associationArn").getter(getter(PodIdentityAssociationSummary::associationArn))
.setter(setter(Builder::associationArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("associationArn").build()).build();
private static final SdkField ASSOCIATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("associationId").getter(getter(PodIdentityAssociationSummary::associationId))
.setter(setter(Builder::associationId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("associationId").build()).build();
private static final SdkField OWNER_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ownerArn").getter(getter(PodIdentityAssociationSummary::ownerArn)).setter(setter(Builder::ownerArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ownerArn").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLUSTER_NAME_FIELD,
NAMESPACE_FIELD, SERVICE_ACCOUNT_FIELD, ASSOCIATION_ARN_FIELD, ASSOCIATION_ID_FIELD, OWNER_ARN_FIELD));
private static final long serialVersionUID = 1L;
private final String clusterName;
private final String namespace;
private final String serviceAccount;
private final String associationArn;
private final String associationId;
private final String ownerArn;
private PodIdentityAssociationSummary(BuilderImpl builder) {
this.clusterName = builder.clusterName;
this.namespace = builder.namespace;
this.serviceAccount = builder.serviceAccount;
this.associationArn = builder.associationArn;
this.associationId = builder.associationId;
this.ownerArn = builder.ownerArn;
}
/**
*
* The name of the cluster that the association is in.
*
*
* @return The name of the cluster that the association is in.
*/
public final String clusterName() {
return clusterName;
}
/**
*
* The name of the Kubernetes namespace inside the cluster to create the association in. The service account and the
* pods that use the service account must be in this namespace.
*
*
* @return The name of the Kubernetes namespace inside the cluster to create the association in. The service account
* and the pods that use the service account must be in this namespace.
*/
public final String namespace() {
return namespace;
}
/**
*
* The name of the Kubernetes service account inside the cluster to associate the IAM credentials with.
*
*
* @return The name of the Kubernetes service account inside the cluster to associate the IAM credentials with.
*/
public final String serviceAccount() {
return serviceAccount;
}
/**
*
* The Amazon Resource Name (ARN) of the association.
*
*
* @return The Amazon Resource Name (ARN) of the association.
*/
public final String associationArn() {
return associationArn;
}
/**
*
* The ID of the association.
*
*
* @return The ID of the association.
*/
public final String associationId() {
return associationId;
}
/**
*
* If defined, the Pod Identity Association is owned by an Amazon EKS Addon.
*
*
* @return If defined, the Pod Identity Association is owned by an Amazon EKS Addon.
*/
public final String ownerArn() {
return ownerArn;
}
@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(clusterName());
hashCode = 31 * hashCode + Objects.hashCode(namespace());
hashCode = 31 * hashCode + Objects.hashCode(serviceAccount());
hashCode = 31 * hashCode + Objects.hashCode(associationArn());
hashCode = 31 * hashCode + Objects.hashCode(associationId());
hashCode = 31 * hashCode + Objects.hashCode(ownerArn());
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 PodIdentityAssociationSummary)) {
return false;
}
PodIdentityAssociationSummary other = (PodIdentityAssociationSummary) obj;
return Objects.equals(clusterName(), other.clusterName()) && Objects.equals(namespace(), other.namespace())
&& Objects.equals(serviceAccount(), other.serviceAccount())
&& Objects.equals(associationArn(), other.associationArn())
&& Objects.equals(associationId(), other.associationId()) && Objects.equals(ownerArn(), other.ownerArn());
}
/**
* 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("PodIdentityAssociationSummary").add("ClusterName", clusterName()).add("Namespace", namespace())
.add("ServiceAccount", serviceAccount()).add("AssociationArn", associationArn())
.add("AssociationId", associationId()).add("OwnerArn", ownerArn()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "clusterName":
return Optional.ofNullable(clazz.cast(clusterName()));
case "namespace":
return Optional.ofNullable(clazz.cast(namespace()));
case "serviceAccount":
return Optional.ofNullable(clazz.cast(serviceAccount()));
case "associationArn":
return Optional.ofNullable(clazz.cast(associationArn()));
case "associationId":
return Optional.ofNullable(clazz.cast(associationId()));
case "ownerArn":
return Optional.ofNullable(clazz.cast(ownerArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function