
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 extends Builder> 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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy