software.amazon.awssdk.services.rds.model.ModifyDbProxyTargetGroupRequest 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.rds.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.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 ModifyDbProxyTargetGroupRequest extends RdsRequest implements
ToCopyableBuilder {
private static final SdkField TARGET_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TargetGroupName").getter(getter(ModifyDbProxyTargetGroupRequest::targetGroupName))
.setter(setter(Builder::targetGroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetGroupName").build()).build();
private static final SdkField DB_PROXY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DBProxyName").getter(getter(ModifyDbProxyTargetGroupRequest::dbProxyName))
.setter(setter(Builder::dbProxyName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBProxyName").build()).build();
private static final SdkField CONNECTION_POOL_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ConnectionPoolConfig")
.getter(getter(ModifyDbProxyTargetGroupRequest::connectionPoolConfig)).setter(setter(Builder::connectionPoolConfig))
.constructor(ConnectionPoolConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConnectionPoolConfig").build())
.build();
private static final SdkField NEW_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NewName").getter(getter(ModifyDbProxyTargetGroupRequest::newName)).setter(setter(Builder::newName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NewName").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TARGET_GROUP_NAME_FIELD,
DB_PROXY_NAME_FIELD, CONNECTION_POOL_CONFIG_FIELD, NEW_NAME_FIELD));
private final String targetGroupName;
private final String dbProxyName;
private final ConnectionPoolConfiguration connectionPoolConfig;
private final String newName;
private ModifyDbProxyTargetGroupRequest(BuilderImpl builder) {
super(builder);
this.targetGroupName = builder.targetGroupName;
this.dbProxyName = builder.dbProxyName;
this.connectionPoolConfig = builder.connectionPoolConfig;
this.newName = builder.newName;
}
/**
*
* The name of the target group to modify.
*
*
* @return The name of the target group to modify.
*/
public final String targetGroupName() {
return targetGroupName;
}
/**
*
* The name of the proxy.
*
*
* @return The name of the proxy.
*/
public final String dbProxyName() {
return dbProxyName;
}
/**
*
* The settings that determine the size and behavior of the connection pool for the target group.
*
*
* @return The settings that determine the size and behavior of the connection pool for the target group.
*/
public final ConnectionPoolConfiguration connectionPoolConfig() {
return connectionPoolConfig;
}
/**
*
* The new name for the modified DBProxyTarget
. An identifier must begin with a letter and must contain
* only ASCII letters, digits, and hyphens; it can't end with a hyphen or contain two consecutive hyphens.
*
*
* @return The new name for the modified DBProxyTarget
. An identifier must begin with a letter and must
* contain only ASCII letters, digits, and hyphens; it can't end with a hyphen or contain two consecutive
* hyphens.
*/
public final String newName() {
return newName;
}
@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(targetGroupName());
hashCode = 31 * hashCode + Objects.hashCode(dbProxyName());
hashCode = 31 * hashCode + Objects.hashCode(connectionPoolConfig());
hashCode = 31 * hashCode + Objects.hashCode(newName());
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 ModifyDbProxyTargetGroupRequest)) {
return false;
}
ModifyDbProxyTargetGroupRequest other = (ModifyDbProxyTargetGroupRequest) obj;
return Objects.equals(targetGroupName(), other.targetGroupName()) && Objects.equals(dbProxyName(), other.dbProxyName())
&& Objects.equals(connectionPoolConfig(), other.connectionPoolConfig())
&& Objects.equals(newName(), other.newName());
}
/**
* 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("ModifyDbProxyTargetGroupRequest").add("TargetGroupName", targetGroupName())
.add("DBProxyName", dbProxyName()).add("ConnectionPoolConfig", connectionPoolConfig()).add("NewName", newName())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "TargetGroupName":
return Optional.ofNullable(clazz.cast(targetGroupName()));
case "DBProxyName":
return Optional.ofNullable(clazz.cast(dbProxyName()));
case "ConnectionPoolConfig":
return Optional.ofNullable(clazz.cast(connectionPoolConfig()));
case "NewName":
return Optional.ofNullable(clazz.cast(newName()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy