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

software.amazon.awssdk.services.eks.model.Addon Maven / Gradle / Ivy

/*
 * 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.beans.Transient;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* An Amazon EKS add-on. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Addon implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ADDON_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("addonName").getter(getter(Addon::addonName)).setter(setter(Builder::addonName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("addonName").build()).build(); private static final SdkField CLUSTER_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("clusterName").getter(getter(Addon::clusterName)).setter(setter(Builder::clusterName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("clusterName").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status") .getter(getter(Addon::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final SdkField ADDON_VERSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("addonVersion").getter(getter(Addon::addonVersion)).setter(setter(Builder::addonVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("addonVersion").build()).build(); private static final SdkField HEALTH_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("health").getter(getter(Addon::health)).setter(setter(Builder::health)).constructor(AddonHealth::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("health").build()).build(); private static final SdkField ADDON_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("addonArn").getter(getter(Addon::addonArn)).setter(setter(Builder::addonArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("addonArn").build()).build(); private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("createdAt").getter(getter(Addon::createdAt)).setter(setter(Builder::createdAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdAt").build()).build(); private static final SdkField MODIFIED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("modifiedAt").getter(getter(Addon::modifiedAt)).setter(setter(Builder::modifiedAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("modifiedAt").build()).build(); private static final SdkField SERVICE_ACCOUNT_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("serviceAccountRoleArn").getter(getter(Addon::serviceAccountRoleArn)) .setter(setter(Builder::serviceAccountRoleArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceAccountRoleArn").build()) .build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("tags") .getter(getter(Addon::tags)) .setter(setter(Builder::tags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ADDON_NAME_FIELD, CLUSTER_NAME_FIELD, STATUS_FIELD, ADDON_VERSION_FIELD, HEALTH_FIELD, ADDON_ARN_FIELD, CREATED_AT_FIELD, MODIFIED_AT_FIELD, SERVICE_ACCOUNT_ROLE_ARN_FIELD, TAGS_FIELD)); private static final long serialVersionUID = 1L; private final String addonName; private final String clusterName; private final String status; private final String addonVersion; private final AddonHealth health; private final String addonArn; private final Instant createdAt; private final Instant modifiedAt; private final String serviceAccountRoleArn; private final Map tags; private Addon(BuilderImpl builder) { this.addonName = builder.addonName; this.clusterName = builder.clusterName; this.status = builder.status; this.addonVersion = builder.addonVersion; this.health = builder.health; this.addonArn = builder.addonArn; this.createdAt = builder.createdAt; this.modifiedAt = builder.modifiedAt; this.serviceAccountRoleArn = builder.serviceAccountRoleArn; this.tags = builder.tags; } /** *

* The name of the add-on. *

* * @return The name of the add-on. */ public final String addonName() { return addonName; } /** *

* The name of the cluster. *

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

* The status of the add-on. *

*

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

* * @return The status of the add-on. * @see AddonStatus */ public final AddonStatus status() { return AddonStatus.fromValue(status); } /** *

* The status of the add-on. *

*

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

* * @return The status of the add-on. * @see AddonStatus */ public final String statusAsString() { return status; } /** *

* The version of the add-on. *

* * @return The version of the add-on. */ public final String addonVersion() { return addonVersion; } /** *

* An object that represents the health of the add-on. *

* * @return An object that represents the health of the add-on. */ public final AddonHealth health() { return health; } /** *

* The Amazon Resource Name (ARN) of the add-on. *

* * @return The Amazon Resource Name (ARN) of the add-on. */ public final String addonArn() { return addonArn; } /** *

* The date and time that the add-on was created. *

* * @return The date and time that the add-on was created. */ public final Instant createdAt() { return createdAt; } /** *

* The date and time that the add-on was last modified. *

* * @return The date and time that the add-on was last modified. */ public final Instant modifiedAt() { return modifiedAt; } /** *

* The Amazon Resource Name (ARN) of the IAM role that is bound to the Kubernetes service account used by the * add-on. *

* * @return The Amazon Resource Name (ARN) of the IAM role that is bound to the Kubernetes service account used by * the add-on. */ public final String serviceAccountRoleArn() { return serviceAccountRoleArn; } /** * For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that * the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful * because the SDK will never return a null collection or map, but you may need to differentiate between the service * returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true * if a value for the property was specified in the request builder, and false if a value was not specified. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructMap); } /** *

* The metadata that you apply to the add-on to assist with categorization and organization. Each tag consists of a * key and an optional value, both of which you define. Add-on tags do not propagate to any other resources * associated with the cluster. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTags} method. *

* * @return The metadata that you apply to the add-on to assist with categorization and organization. Each tag * consists of a key and an optional value, both of which you define. Add-on tags do not propagate to any * other resources associated with the cluster. */ public final Map tags() { return tags; } @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(addonName()); hashCode = 31 * hashCode + Objects.hashCode(clusterName()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(addonVersion()); hashCode = 31 * hashCode + Objects.hashCode(health()); hashCode = 31 * hashCode + Objects.hashCode(addonArn()); hashCode = 31 * hashCode + Objects.hashCode(createdAt()); hashCode = 31 * hashCode + Objects.hashCode(modifiedAt()); hashCode = 31 * hashCode + Objects.hashCode(serviceAccountRoleArn()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); 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 Addon)) { return false; } Addon other = (Addon) obj; return Objects.equals(addonName(), other.addonName()) && Objects.equals(clusterName(), other.clusterName()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(addonVersion(), other.addonVersion()) && Objects.equals(health(), other.health()) && Objects.equals(addonArn(), other.addonArn()) && Objects.equals(createdAt(), other.createdAt()) && Objects.equals(modifiedAt(), other.modifiedAt()) && Objects.equals(serviceAccountRoleArn(), other.serviceAccountRoleArn()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()); } /** * 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("Addon").add("AddonName", addonName()).add("ClusterName", clusterName()) .add("Status", statusAsString()).add("AddonVersion", addonVersion()).add("Health", health()) .add("AddonArn", addonArn()).add("CreatedAt", createdAt()).add("ModifiedAt", modifiedAt()) .add("ServiceAccountRoleArn", serviceAccountRoleArn()).add("Tags", hasTags() ? tags() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "addonName": return Optional.ofNullable(clazz.cast(addonName())); case "clusterName": return Optional.ofNullable(clazz.cast(clusterName())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "addonVersion": return Optional.ofNullable(clazz.cast(addonVersion())); case "health": return Optional.ofNullable(clazz.cast(health())); case "addonArn": return Optional.ofNullable(clazz.cast(addonArn())); case "createdAt": return Optional.ofNullable(clazz.cast(createdAt())); case "modifiedAt": return Optional.ofNullable(clazz.cast(modifiedAt())); case "serviceAccountRoleArn": return Optional.ofNullable(clazz.cast(serviceAccountRoleArn())); case "tags": return Optional.ofNullable(clazz.cast(tags())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Addon) 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 add-on. *

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

* The name of the cluster. *

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

* The status of the add-on. *

* * @param status * The status of the add-on. * @see AddonStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AddonStatus */ Builder status(String status); /** *

* The status of the add-on. *

* * @param status * The status of the add-on. * @see AddonStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AddonStatus */ Builder status(AddonStatus status); /** *

* The version of the add-on. *

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

* An object that represents the health of the add-on. *

* * @param health * An object that represents the health of the add-on. * @return Returns a reference to this object so that method calls can be chained together. */ Builder health(AddonHealth health); /** *

* An object that represents the health of the add-on. *

* This is a convenience that creates an instance of the {@link AddonHealth.Builder} avoiding the need to create * one manually via {@link AddonHealth#builder()}. * * When the {@link Consumer} completes, {@link AddonHealth.Builder#build()} is called immediately and its result * is passed to {@link #health(AddonHealth)}. * * @param health * a consumer that will call methods on {@link AddonHealth.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #health(AddonHealth) */ default Builder health(Consumer health) { return health(AddonHealth.builder().applyMutation(health).build()); } /** *

* The Amazon Resource Name (ARN) of the add-on. *

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

* The date and time that the add-on was created. *

* * @param createdAt * The date and time that the add-on was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdAt(Instant createdAt); /** *

* The date and time that the add-on was last modified. *

* * @param modifiedAt * The date and time that the add-on was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder modifiedAt(Instant modifiedAt); /** *

* The Amazon Resource Name (ARN) of the IAM role that is bound to the Kubernetes service account used by the * add-on. *

* * @param serviceAccountRoleArn * The Amazon Resource Name (ARN) of the IAM role that is bound to the Kubernetes service account used by * the add-on. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceAccountRoleArn(String serviceAccountRoleArn); /** *

* The metadata that you apply to the add-on to assist with categorization and organization. Each tag consists * of a key and an optional value, both of which you define. Add-on tags do not propagate to any other resources * associated with the cluster. *

* * @param tags * The metadata that you apply to the add-on to assist with categorization and organization. Each tag * consists of a key and an optional value, both of which you define. Add-on tags do not propagate to any * other resources associated with the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); } static final class BuilderImpl implements Builder { private String addonName; private String clusterName; private String status; private String addonVersion; private AddonHealth health; private String addonArn; private Instant createdAt; private Instant modifiedAt; private String serviceAccountRoleArn; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private BuilderImpl() { } private BuilderImpl(Addon model) { addonName(model.addonName); clusterName(model.clusterName); status(model.status); addonVersion(model.addonVersion); health(model.health); addonArn(model.addonArn); createdAt(model.createdAt); modifiedAt(model.modifiedAt); serviceAccountRoleArn(model.serviceAccountRoleArn); tags(model.tags); } public final String getAddonName() { return addonName; } public final void setAddonName(String addonName) { this.addonName = addonName; } @Override @Transient public final Builder addonName(String addonName) { this.addonName = addonName; return this; } public final String getClusterName() { return clusterName; } public final void setClusterName(String clusterName) { this.clusterName = clusterName; } @Override @Transient public final Builder clusterName(String clusterName) { this.clusterName = clusterName; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override @Transient public final Builder status(String status) { this.status = status; return this; } @Override @Transient public final Builder status(AddonStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getAddonVersion() { return addonVersion; } public final void setAddonVersion(String addonVersion) { this.addonVersion = addonVersion; } @Override @Transient public final Builder addonVersion(String addonVersion) { this.addonVersion = addonVersion; return this; } public final AddonHealth.Builder getHealth() { return health != null ? health.toBuilder() : null; } public final void setHealth(AddonHealth.BuilderImpl health) { this.health = health != null ? health.build() : null; } @Override @Transient public final Builder health(AddonHealth health) { this.health = health; return this; } public final String getAddonArn() { return addonArn; } public final void setAddonArn(String addonArn) { this.addonArn = addonArn; } @Override @Transient public final Builder addonArn(String addonArn) { this.addonArn = addonArn; return this; } public final Instant getCreatedAt() { return createdAt; } public final void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; } @Override @Transient public final Builder createdAt(Instant createdAt) { this.createdAt = createdAt; return this; } public final Instant getModifiedAt() { return modifiedAt; } public final void setModifiedAt(Instant modifiedAt) { this.modifiedAt = modifiedAt; } @Override @Transient public final Builder modifiedAt(Instant modifiedAt) { this.modifiedAt = modifiedAt; return this; } public final String getServiceAccountRoleArn() { return serviceAccountRoleArn; } public final void setServiceAccountRoleArn(String serviceAccountRoleArn) { this.serviceAccountRoleArn = serviceAccountRoleArn; } @Override @Transient public final Builder serviceAccountRoleArn(String serviceAccountRoleArn) { this.serviceAccountRoleArn = serviceAccountRoleArn; return this; } public final Map getTags() { if (tags instanceof SdkAutoConstructMap) { return null; } return tags; } public final void setTags(Map tags) { this.tags = TagMapCopier.copy(tags); } @Override @Transient public final Builder tags(Map tags) { this.tags = TagMapCopier.copy(tags); return this; } @Override public Addon build() { return new Addon(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy