com.amazonaws.services.rds.model.CreateDBProxyEndpointRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-rds Show documentation
/*
* Copyright 2016-2021 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 com.amazonaws.services.rds.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateDBProxyEndpointRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the DB proxy associated with the DB proxy endpoint that you create.
*
*/
private String dBProxyName;
/**
*
* The name of the DB proxy endpoint to create.
*
*/
private String dBProxyEndpointName;
/**
*
* The VPC subnet IDs for the DB proxy endpoint that you create. You can specify a different set of subnet IDs than
* for the original DB proxy.
*
*/
private com.amazonaws.internal.SdkInternalList vpcSubnetIds;
/**
*
* The VPC security group IDs for the DB proxy endpoint that you create. You can specify a different set of security
* group IDs than for the original DB proxy. The default is the default security group for the VPC.
*
*/
private com.amazonaws.internal.SdkInternalList vpcSecurityGroupIds;
/**
*
* A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations. The
* default is READ_WRITE
.
*
*/
private String targetRole;
private com.amazonaws.internal.SdkInternalList tags;
/**
*
* The name of the DB proxy associated with the DB proxy endpoint that you create.
*
*
* @param dBProxyName
* The name of the DB proxy associated with the DB proxy endpoint that you create.
*/
public void setDBProxyName(String dBProxyName) {
this.dBProxyName = dBProxyName;
}
/**
*
* The name of the DB proxy associated with the DB proxy endpoint that you create.
*
*
* @return The name of the DB proxy associated with the DB proxy endpoint that you create.
*/
public String getDBProxyName() {
return this.dBProxyName;
}
/**
*
* The name of the DB proxy associated with the DB proxy endpoint that you create.
*
*
* @param dBProxyName
* The name of the DB proxy associated with the DB proxy endpoint that you create.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBProxyEndpointRequest withDBProxyName(String dBProxyName) {
setDBProxyName(dBProxyName);
return this;
}
/**
*
* The name of the DB proxy endpoint to create.
*
*
* @param dBProxyEndpointName
* The name of the DB proxy endpoint to create.
*/
public void setDBProxyEndpointName(String dBProxyEndpointName) {
this.dBProxyEndpointName = dBProxyEndpointName;
}
/**
*
* The name of the DB proxy endpoint to create.
*
*
* @return The name of the DB proxy endpoint to create.
*/
public String getDBProxyEndpointName() {
return this.dBProxyEndpointName;
}
/**
*
* The name of the DB proxy endpoint to create.
*
*
* @param dBProxyEndpointName
* The name of the DB proxy endpoint to create.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBProxyEndpointRequest withDBProxyEndpointName(String dBProxyEndpointName) {
setDBProxyEndpointName(dBProxyEndpointName);
return this;
}
/**
*
* The VPC subnet IDs for the DB proxy endpoint that you create. You can specify a different set of subnet IDs than
* for the original DB proxy.
*
*
* @return The VPC subnet IDs for the DB proxy endpoint that you create. You can specify a different set of subnet
* IDs than for the original DB proxy.
*/
public java.util.List getVpcSubnetIds() {
if (vpcSubnetIds == null) {
vpcSubnetIds = new com.amazonaws.internal.SdkInternalList();
}
return vpcSubnetIds;
}
/**
*
* The VPC subnet IDs for the DB proxy endpoint that you create. You can specify a different set of subnet IDs than
* for the original DB proxy.
*
*
* @param vpcSubnetIds
* The VPC subnet IDs for the DB proxy endpoint that you create. You can specify a different set of subnet
* IDs than for the original DB proxy.
*/
public void setVpcSubnetIds(java.util.Collection vpcSubnetIds) {
if (vpcSubnetIds == null) {
this.vpcSubnetIds = null;
return;
}
this.vpcSubnetIds = new com.amazonaws.internal.SdkInternalList(vpcSubnetIds);
}
/**
*
* The VPC subnet IDs for the DB proxy endpoint that you create. You can specify a different set of subnet IDs than
* for the original DB proxy.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setVpcSubnetIds(java.util.Collection)} or {@link #withVpcSubnetIds(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param vpcSubnetIds
* The VPC subnet IDs for the DB proxy endpoint that you create. You can specify a different set of subnet
* IDs than for the original DB proxy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBProxyEndpointRequest withVpcSubnetIds(String... vpcSubnetIds) {
if (this.vpcSubnetIds == null) {
setVpcSubnetIds(new com.amazonaws.internal.SdkInternalList(vpcSubnetIds.length));
}
for (String ele : vpcSubnetIds) {
this.vpcSubnetIds.add(ele);
}
return this;
}
/**
*
* The VPC subnet IDs for the DB proxy endpoint that you create. You can specify a different set of subnet IDs than
* for the original DB proxy.
*
*
* @param vpcSubnetIds
* The VPC subnet IDs for the DB proxy endpoint that you create. You can specify a different set of subnet
* IDs than for the original DB proxy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBProxyEndpointRequest withVpcSubnetIds(java.util.Collection vpcSubnetIds) {
setVpcSubnetIds(vpcSubnetIds);
return this;
}
/**
*
* The VPC security group IDs for the DB proxy endpoint that you create. You can specify a different set of security
* group IDs than for the original DB proxy. The default is the default security group for the VPC.
*
*
* @return The VPC security group IDs for the DB proxy endpoint that you create. You can specify a different set of
* security group IDs than for the original DB proxy. The default is the default security group for the VPC.
*/
public java.util.List getVpcSecurityGroupIds() {
if (vpcSecurityGroupIds == null) {
vpcSecurityGroupIds = new com.amazonaws.internal.SdkInternalList();
}
return vpcSecurityGroupIds;
}
/**
*
* The VPC security group IDs for the DB proxy endpoint that you create. You can specify a different set of security
* group IDs than for the original DB proxy. The default is the default security group for the VPC.
*
*
* @param vpcSecurityGroupIds
* The VPC security group IDs for the DB proxy endpoint that you create. You can specify a different set of
* security group IDs than for the original DB proxy. The default is the default security group for the VPC.
*/
public void setVpcSecurityGroupIds(java.util.Collection vpcSecurityGroupIds) {
if (vpcSecurityGroupIds == null) {
this.vpcSecurityGroupIds = null;
return;
}
this.vpcSecurityGroupIds = new com.amazonaws.internal.SdkInternalList(vpcSecurityGroupIds);
}
/**
*
* The VPC security group IDs for the DB proxy endpoint that you create. You can specify a different set of security
* group IDs than for the original DB proxy. The default is the default security group for the VPC.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setVpcSecurityGroupIds(java.util.Collection)} or {@link #withVpcSecurityGroupIds(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param vpcSecurityGroupIds
* The VPC security group IDs for the DB proxy endpoint that you create. You can specify a different set of
* security group IDs than for the original DB proxy. The default is the default security group for the VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBProxyEndpointRequest withVpcSecurityGroupIds(String... vpcSecurityGroupIds) {
if (this.vpcSecurityGroupIds == null) {
setVpcSecurityGroupIds(new com.amazonaws.internal.SdkInternalList(vpcSecurityGroupIds.length));
}
for (String ele : vpcSecurityGroupIds) {
this.vpcSecurityGroupIds.add(ele);
}
return this;
}
/**
*
* The VPC security group IDs for the DB proxy endpoint that you create. You can specify a different set of security
* group IDs than for the original DB proxy. The default is the default security group for the VPC.
*
*
* @param vpcSecurityGroupIds
* The VPC security group IDs for the DB proxy endpoint that you create. You can specify a different set of
* security group IDs than for the original DB proxy. The default is the default security group for the VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBProxyEndpointRequest withVpcSecurityGroupIds(java.util.Collection vpcSecurityGroupIds) {
setVpcSecurityGroupIds(vpcSecurityGroupIds);
return this;
}
/**
*
* A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations. The
* default is READ_WRITE
.
*
*
* @param targetRole
* A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations.
* The default is READ_WRITE
.
* @see DBProxyEndpointTargetRole
*/
public void setTargetRole(String targetRole) {
this.targetRole = targetRole;
}
/**
*
* A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations. The
* default is READ_WRITE
.
*
*
* @return A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations.
* The default is READ_WRITE
.
* @see DBProxyEndpointTargetRole
*/
public String getTargetRole() {
return this.targetRole;
}
/**
*
* A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations. The
* default is READ_WRITE
.
*
*
* @param targetRole
* A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations.
* The default is READ_WRITE
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DBProxyEndpointTargetRole
*/
public CreateDBProxyEndpointRequest withTargetRole(String targetRole) {
setTargetRole(targetRole);
return this;
}
/**
*
* A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations. The
* default is READ_WRITE
.
*
*
* @param targetRole
* A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations.
* The default is READ_WRITE
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DBProxyEndpointTargetRole
*/
public CreateDBProxyEndpointRequest withTargetRole(DBProxyEndpointTargetRole targetRole) {
this.targetRole = targetRole.toString();
return this;
}
/**
* @return
*/
public java.util.List getTags() {
if (tags == null) {
tags = new com.amazonaws.internal.SdkInternalList();
}
return tags;
}
/**
* @param tags
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new com.amazonaws.internal.SdkInternalList(tags);
}
/**
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBProxyEndpointRequest withTags(Tag... tags) {
if (this.tags == null) {
setTags(new com.amazonaws.internal.SdkInternalList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
* @param tags
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBProxyEndpointRequest withTags(java.util.Collection tags) {
setTags(tags);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getDBProxyName() != null)
sb.append("DBProxyName: ").append(getDBProxyName()).append(",");
if (getDBProxyEndpointName() != null)
sb.append("DBProxyEndpointName: ").append(getDBProxyEndpointName()).append(",");
if (getVpcSubnetIds() != null)
sb.append("VpcSubnetIds: ").append(getVpcSubnetIds()).append(",");
if (getVpcSecurityGroupIds() != null)
sb.append("VpcSecurityGroupIds: ").append(getVpcSecurityGroupIds()).append(",");
if (getTargetRole() != null)
sb.append("TargetRole: ").append(getTargetRole()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateDBProxyEndpointRequest == false)
return false;
CreateDBProxyEndpointRequest other = (CreateDBProxyEndpointRequest) obj;
if (other.getDBProxyName() == null ^ this.getDBProxyName() == null)
return false;
if (other.getDBProxyName() != null && other.getDBProxyName().equals(this.getDBProxyName()) == false)
return false;
if (other.getDBProxyEndpointName() == null ^ this.getDBProxyEndpointName() == null)
return false;
if (other.getDBProxyEndpointName() != null && other.getDBProxyEndpointName().equals(this.getDBProxyEndpointName()) == false)
return false;
if (other.getVpcSubnetIds() == null ^ this.getVpcSubnetIds() == null)
return false;
if (other.getVpcSubnetIds() != null && other.getVpcSubnetIds().equals(this.getVpcSubnetIds()) == false)
return false;
if (other.getVpcSecurityGroupIds() == null ^ this.getVpcSecurityGroupIds() == null)
return false;
if (other.getVpcSecurityGroupIds() != null && other.getVpcSecurityGroupIds().equals(this.getVpcSecurityGroupIds()) == false)
return false;
if (other.getTargetRole() == null ^ this.getTargetRole() == null)
return false;
if (other.getTargetRole() != null && other.getTargetRole().equals(this.getTargetRole()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDBProxyName() == null) ? 0 : getDBProxyName().hashCode());
hashCode = prime * hashCode + ((getDBProxyEndpointName() == null) ? 0 : getDBProxyEndpointName().hashCode());
hashCode = prime * hashCode + ((getVpcSubnetIds() == null) ? 0 : getVpcSubnetIds().hashCode());
hashCode = prime * hashCode + ((getVpcSecurityGroupIds() == null) ? 0 : getVpcSecurityGroupIds().hashCode());
hashCode = prime * hashCode + ((getTargetRole() == null) ? 0 : getTargetRole().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CreateDBProxyEndpointRequest clone() {
return (CreateDBProxyEndpointRequest) super.clone();
}
}