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

software.amazon.awssdk.services.eks.model.UpdateNodegroupConfigRequest 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.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.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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.DefaultValueTrait;
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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class UpdateNodegroupConfigRequest extends EksRequest implements
        ToCopyableBuilder {
    private static final SdkField CLUSTER_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("clusterName").getter(getter(UpdateNodegroupConfigRequest::clusterName))
            .setter(setter(Builder::clusterName))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("name").build()).build();

    private static final SdkField NODEGROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("nodegroupName").getter(getter(UpdateNodegroupConfigRequest::nodegroupName))
            .setter(setter(Builder::nodegroupName))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("nodegroupName").build()).build();

    private static final SdkField LABELS_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("labels")
            .getter(getter(UpdateNodegroupConfigRequest::labels)).setter(setter(Builder::labels))
            .constructor(UpdateLabelsPayload::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("labels").build()).build();

    private static final SdkField TAINTS_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("taints")
            .getter(getter(UpdateNodegroupConfigRequest::taints)).setter(setter(Builder::taints))
            .constructor(UpdateTaintsPayload::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("taints").build()).build();

    private static final SdkField SCALING_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("scalingConfig")
            .getter(getter(UpdateNodegroupConfigRequest::scalingConfig)).setter(setter(Builder::scalingConfig))
            .constructor(NodegroupScalingConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("scalingConfig").build()).build();

    private static final SdkField UPDATE_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("updateConfig")
            .getter(getter(UpdateNodegroupConfigRequest::updateConfig)).setter(setter(Builder::updateConfig))
            .constructor(NodegroupUpdateConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("updateConfig").build()).build();

    private static final SdkField CLIENT_REQUEST_TOKEN_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("clientRequestToken")
            .getter(getter(UpdateNodegroupConfigRequest::clientRequestToken))
            .setter(setter(Builder::clientRequestToken))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("clientRequestToken").build(),
                    DefaultValueTrait.idempotencyToken()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLUSTER_NAME_FIELD,
            NODEGROUP_NAME_FIELD, LABELS_FIELD, TAINTS_FIELD, SCALING_CONFIG_FIELD, UPDATE_CONFIG_FIELD,
            CLIENT_REQUEST_TOKEN_FIELD));

    private final String clusterName;

    private final String nodegroupName;

    private final UpdateLabelsPayload labels;

    private final UpdateTaintsPayload taints;

    private final NodegroupScalingConfig scalingConfig;

    private final NodegroupUpdateConfig updateConfig;

    private final String clientRequestToken;

    private UpdateNodegroupConfigRequest(BuilderImpl builder) {
        super(builder);
        this.clusterName = builder.clusterName;
        this.nodegroupName = builder.nodegroupName;
        this.labels = builder.labels;
        this.taints = builder.taints;
        this.scalingConfig = builder.scalingConfig;
        this.updateConfig = builder.updateConfig;
        this.clientRequestToken = builder.clientRequestToken;
    }

    /**
     * 

* The name of the Amazon EKS cluster that the managed node group resides in. *

* * @return The name of the Amazon EKS cluster that the managed node group resides in. */ public final String clusterName() { return clusterName; } /** *

* The name of the managed node group to update. *

* * @return The name of the managed node group to update. */ public final String nodegroupName() { return nodegroupName; } /** *

* The Kubernetes labels to be applied to the nodes in the node group after the update. *

* * @return The Kubernetes labels to be applied to the nodes in the node group after the update. */ public final UpdateLabelsPayload labels() { return labels; } /** *

* The Kubernetes taints to be applied to the nodes in the node group after the update. For more information, see Node taints on * managed node groups. *

* * @return The Kubernetes taints to be applied to the nodes in the node group after the update. For more * information, see Node taints * on managed node groups. */ public final UpdateTaintsPayload taints() { return taints; } /** *

* The scaling configuration details for the Auto Scaling group after the update. *

* * @return The scaling configuration details for the Auto Scaling group after the update. */ public final NodegroupScalingConfig scalingConfig() { return scalingConfig; } /** *

* The node group update configuration. *

* * @return The node group update configuration. */ public final NodegroupUpdateConfig updateConfig() { return updateConfig; } /** *

* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. *

* * @return Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. */ public final String clientRequestToken() { return clientRequestToken; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(clusterName()); hashCode = 31 * hashCode + Objects.hashCode(nodegroupName()); hashCode = 31 * hashCode + Objects.hashCode(labels()); hashCode = 31 * hashCode + Objects.hashCode(taints()); hashCode = 31 * hashCode + Objects.hashCode(scalingConfig()); hashCode = 31 * hashCode + Objects.hashCode(updateConfig()); hashCode = 31 * hashCode + Objects.hashCode(clientRequestToken()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UpdateNodegroupConfigRequest)) { return false; } UpdateNodegroupConfigRequest other = (UpdateNodegroupConfigRequest) obj; return Objects.equals(clusterName(), other.clusterName()) && Objects.equals(nodegroupName(), other.nodegroupName()) && Objects.equals(labels(), other.labels()) && Objects.equals(taints(), other.taints()) && Objects.equals(scalingConfig(), other.scalingConfig()) && Objects.equals(updateConfig(), other.updateConfig()) && Objects.equals(clientRequestToken(), other.clientRequestToken()); } /** * 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("UpdateNodegroupConfigRequest").add("ClusterName", clusterName()) .add("NodegroupName", nodegroupName()).add("Labels", labels()).add("Taints", taints()) .add("ScalingConfig", scalingConfig()).add("UpdateConfig", updateConfig()) .add("ClientRequestToken", clientRequestToken()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "clusterName": return Optional.ofNullable(clazz.cast(clusterName())); case "nodegroupName": return Optional.ofNullable(clazz.cast(nodegroupName())); case "labels": return Optional.ofNullable(clazz.cast(labels())); case "taints": return Optional.ofNullable(clazz.cast(taints())); case "scalingConfig": return Optional.ofNullable(clazz.cast(scalingConfig())); case "updateConfig": return Optional.ofNullable(clazz.cast(updateConfig())); case "clientRequestToken": return Optional.ofNullable(clazz.cast(clientRequestToken())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateNodegroupConfigRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends EksRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the Amazon EKS cluster that the managed node group resides in. *

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

* The name of the managed node group to update. *

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

* The Kubernetes labels to be applied to the nodes in the node group after the update. *

* * @param labels * The Kubernetes labels to be applied to the nodes in the node group after the update. * @return Returns a reference to this object so that method calls can be chained together. */ Builder labels(UpdateLabelsPayload labels); /** *

* The Kubernetes labels to be applied to the nodes in the node group after the update. *

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

* The Kubernetes taints to be applied to the nodes in the node group after the update. For more information, * see Node * taints on managed node groups. *

* * @param taints * The Kubernetes taints to be applied to the nodes in the node group after the update. For more * information, see Node * taints on managed node groups. * @return Returns a reference to this object so that method calls can be chained together. */ Builder taints(UpdateTaintsPayload taints); /** *

* The Kubernetes taints to be applied to the nodes in the node group after the update. For more information, * see Node * taints on managed node groups. *

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

* The scaling configuration details for the Auto Scaling group after the update. *

* * @param scalingConfig * The scaling configuration details for the Auto Scaling group after the update. * @return Returns a reference to this object so that method calls can be chained together. */ Builder scalingConfig(NodegroupScalingConfig scalingConfig); /** *

* The scaling configuration details for the Auto Scaling group after the update. *

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

* The node group update configuration. *

* * @param updateConfig * The node group update configuration. * @return Returns a reference to this object so that method calls can be chained together. */ Builder updateConfig(NodegroupUpdateConfig updateConfig); /** *

* The node group update configuration. *

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

* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. *

* * @param clientRequestToken * Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. * @return Returns a reference to this object so that method calls can be chained together. */ Builder clientRequestToken(String clientRequestToken); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends EksRequest.BuilderImpl implements Builder { private String clusterName; private String nodegroupName; private UpdateLabelsPayload labels; private UpdateTaintsPayload taints; private NodegroupScalingConfig scalingConfig; private NodegroupUpdateConfig updateConfig; private String clientRequestToken; private BuilderImpl() { } private BuilderImpl(UpdateNodegroupConfigRequest model) { super(model); clusterName(model.clusterName); nodegroupName(model.nodegroupName); labels(model.labels); taints(model.taints); scalingConfig(model.scalingConfig); updateConfig(model.updateConfig); clientRequestToken(model.clientRequestToken); } public final String getClusterName() { return clusterName; } public final void setClusterName(String clusterName) { this.clusterName = clusterName; } @Override public final Builder clusterName(String clusterName) { this.clusterName = clusterName; return this; } public final String getNodegroupName() { return nodegroupName; } public final void setNodegroupName(String nodegroupName) { this.nodegroupName = nodegroupName; } @Override public final Builder nodegroupName(String nodegroupName) { this.nodegroupName = nodegroupName; return this; } public final UpdateLabelsPayload.Builder getLabels() { return labels != null ? labels.toBuilder() : null; } public final void setLabels(UpdateLabelsPayload.BuilderImpl labels) { this.labels = labels != null ? labels.build() : null; } @Override public final Builder labels(UpdateLabelsPayload labels) { this.labels = labels; return this; } public final UpdateTaintsPayload.Builder getTaints() { return taints != null ? taints.toBuilder() : null; } public final void setTaints(UpdateTaintsPayload.BuilderImpl taints) { this.taints = taints != null ? taints.build() : null; } @Override public final Builder taints(UpdateTaintsPayload taints) { this.taints = taints; return this; } public final NodegroupScalingConfig.Builder getScalingConfig() { return scalingConfig != null ? scalingConfig.toBuilder() : null; } public final void setScalingConfig(NodegroupScalingConfig.BuilderImpl scalingConfig) { this.scalingConfig = scalingConfig != null ? scalingConfig.build() : null; } @Override public final Builder scalingConfig(NodegroupScalingConfig scalingConfig) { this.scalingConfig = scalingConfig; return this; } public final NodegroupUpdateConfig.Builder getUpdateConfig() { return updateConfig != null ? updateConfig.toBuilder() : null; } public final void setUpdateConfig(NodegroupUpdateConfig.BuilderImpl updateConfig) { this.updateConfig = updateConfig != null ? updateConfig.build() : null; } @Override public final Builder updateConfig(NodegroupUpdateConfig updateConfig) { this.updateConfig = updateConfig; return this; } public final String getClientRequestToken() { return clientRequestToken; } public final void setClientRequestToken(String clientRequestToken) { this.clientRequestToken = clientRequestToken; } @Override public final Builder clientRequestToken(String clientRequestToken) { this.clientRequestToken = clientRequestToken; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public UpdateNodegroupConfigRequest build() { return new UpdateNodegroupConfigRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy