/* * Copyright 2018-2023 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.kafka.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 CreateVpcConnectionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The cluster Amazon Resource Name (ARN) for the VPC connection. *

*/ private String targetClusterArn; /** *

* The authentication type of VPC connection. *

*/ private String authentication; /** *

* The VPC ID of VPC connection. *

*/ private String vpcId; /** *

* The list of client subnets. *

*/ private java.util.List clientSubnets; /** *

* The list of security groups. *

*/ private java.util.List securityGroups; /** *

* A map of tags for the VPC connection. *

*/ private java.util.Map tags; /** *

* The cluster Amazon Resource Name (ARN) for the VPC connection. *

* * @param targetClusterArn *

* The cluster Amazon Resource Name (ARN) for the VPC connection. *

*/ public void setTargetClusterArn(String targetClusterArn) { this.targetClusterArn = targetClusterArn; } /** *

* The cluster Amazon Resource Name (ARN) for the VPC connection. *

* * @return

* The cluster Amazon Resource Name (ARN) for the VPC connection. *

*/ public String getTargetClusterArn() { return this.targetClusterArn; } /** *

* The cluster Amazon Resource Name (ARN) for the VPC connection. *

* * @param targetClusterArn *

* The cluster Amazon Resource Name (ARN) for the VPC connection. *

* @return Returns a reference to this object so that method calls can be chained together. */ public CreateVpcConnectionRequest withTargetClusterArn(String targetClusterArn) { setTargetClusterArn(targetClusterArn); return this; } /** *

* The authentication type of VPC connection. *

* * @param authentication *

* The authentication type of VPC connection. *

*/ public void setAuthentication(String authentication) { this.authentication = authentication; } /** *

* The authentication type of VPC connection. *

* * @return

* The authentication type of VPC connection. *

*/ public String getAuthentication() { return this.authentication; } /** *

* The authentication type of VPC connection. *

* * @param authentication *

* The authentication type of VPC connection. *

* @return Returns a reference to this object so that method calls can be chained together. */ public CreateVpcConnectionRequest withAuthentication(String authentication) { setAuthentication(authentication); return this; } /** *

* The VPC ID of VPC connection. *

* * @param vpcId *

* The VPC ID of VPC connection. *

*/ public void setVpcId(String vpcId) { this.vpcId = vpcId; } /** *

* The VPC ID of VPC connection. *

* * @return

* The VPC ID of VPC connection. *

*/ public String getVpcId() { return this.vpcId; } /** *

* The VPC ID of VPC connection. *

* * @param vpcId *

* The VPC ID of VPC connection. *

* @return Returns a reference to this object so that method calls can be chained together. */ public CreateVpcConnectionRequest withVpcId(String vpcId) { setVpcId(vpcId); return this; } /** *

* The list of client subnets. *

* * @return

* The list of client subnets. *

*/ public java.util.List getClientSubnets() { return clientSubnets; } /** *

* The list of client subnets. *

* * @param clientSubnets *

* The list of client subnets. *

*/ public void setClientSubnets(java.util.Collection clientSubnets) { if (clientSubnets == null) { this.clientSubnets = null; return; } this.clientSubnets = new java.util.ArrayList(clientSubnets); } /** *

* The list of client subnets. *

* *

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setClientSubnets(java.util.Collection)} or {@link #withClientSubnets(java.util.Collection)} if you want * to override the existing values. *

* * @param clientSubnets *

* The list of client subnets. *

* @return Returns a reference to this object so that method calls can be chained together. */ public CreateVpcConnectionRequest withClientSubnets(String... clientSubnets) { if (this.clientSubnets == null) { setClientSubnets(new java.util.ArrayList(clientSubnets.length)); } for (String ele : clientSubnets) { this.clientSubnets.add(ele); } return this; } /** *

* The list of client subnets. *

* * @param clientSubnets *

* The list of client subnets. *

* @return Returns a reference to this object so that method calls can be chained together. */ public CreateVpcConnectionRequest withClientSubnets(java.util.Collection clientSubnets) { setClientSubnets(clientSubnets); return this; } /** *

* The list of security groups. *

* * @return

* The list of security groups. *

*/ public java.util.List getSecurityGroups() { return securityGroups; } /** *

* The list of security groups. *

* * @param securityGroups *

* The list of security groups. *

*/ public void setSecurityGroups(java.util.Collection securityGroups) { if (securityGroups == null) { this.securityGroups = null; return; } this.securityGroups = new java.util.ArrayList(securityGroups); } /** *

* The list of security groups. *

* *

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setSecurityGroups(java.util.Collection)} or {@link #withSecurityGroups(java.util.Collection)} if you want * to override the existing values. *

* * @param securityGroups *

* The list of security groups. *

* @return Returns a reference to this object so that method calls can be chained together. */ public CreateVpcConnectionRequest withSecurityGroups(String... securityGroups) { if (this.securityGroups == null) { setSecurityGroups(new java.util.ArrayList(securityGroups.length)); } for (String ele : securityGroups) { this.securityGroups.add(ele); } return this; } /** *

* The list of security groups. *

* * @param securityGroups *

* The list of security groups. *

* @return Returns a reference to this object so that method calls can be chained together. */ public CreateVpcConnectionRequest withSecurityGroups(java.util.Collection securityGroups) { setSecurityGroups(securityGroups); return this; } /** *

* A map of tags for the VPC connection. *

* * @return

* A map of tags for the VPC connection. *

*/ public java.util.Map getTags() { return tags; } /** *

* A map of tags for the VPC connection. *

* * @param tags *

* A map of tags for the VPC connection. *

*/ public void setTags(java.util.Map tags) { this.tags = tags; } /** *

* A map of tags for the VPC connection. *

* * @param tags *

* A map of tags for the VPC connection. *

* @return Returns a reference to this object so that method calls can be chained together. */ public CreateVpcConnectionRequest withTags(java.util.Map tags) { setTags(tags); return this; } /** * Add a single Tags entry * * @see CreateVpcConnectionRequest#withTags * @returns a reference to this object so that method calls can be chained together. */ public CreateVpcConnectionRequest addTagsEntry(String key, String value) { if (null == this.tags) { this.tags = new java.util.HashMap(); } if (this.tags.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.tags.put(key, value); return this; } /** * Removes all the entries added into Tags. * * @return Returns a reference to this object so that method calls can be chained together. */ public CreateVpcConnectionRequest clearTagsEntries() { this.tags = null; 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 (getTargetClusterArn() != null) sb.append("TargetClusterArn: ").append(getTargetClusterArn()).append(","); if (getAuthentication() != null) sb.append("Authentication: ").append(getAuthentication()).append(","); if (getVpcId() != null) sb.append("VpcId: ").append(getVpcId()).append(","); if (getClientSubnets() != null) sb.append("ClientSubnets: ").append(getClientSubnets()).append(","); if (getSecurityGroups() != null) sb.append("SecurityGroups: ").append(getSecurityGroups()).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 CreateVpcConnectionRequest == false) return false; CreateVpcConnectionRequest other = (CreateVpcConnectionRequest) obj; if (other.getTargetClusterArn() == null ^ this.getTargetClusterArn() == null) return false; if (other.getTargetClusterArn() != null && other.getTargetClusterArn().equals(this.getTargetClusterArn()) == false) return false; if (other.getAuthentication() == null ^ this.getAuthentication() == null) return false; if (other.getAuthentication() != null && other.getAuthentication().equals(this.getAuthentication()) == false) return false; if (other.getVpcId() == null ^ this.getVpcId() == null) return false; if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == false) return false; if (other.getClientSubnets() == null ^ this.getClientSubnets() == null) return false; if (other.getClientSubnets() != null && other.getClientSubnets().equals(this.getClientSubnets()) == false) return false; if (other.getSecurityGroups() == null ^ this.getSecurityGroups() == null) return false; if (other.getSecurityGroups() != null && other.getSecurityGroups().equals(this.getSecurityGroups()) == 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 + ((getTargetClusterArn() == null) ? 0 : getTargetClusterArn().hashCode()); hashCode = prime * hashCode + ((getAuthentication() == null) ? 0 : getAuthentication().hashCode()); hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); hashCode = prime * hashCode + ((getClientSubnets() == null) ? 0 : getClientSubnets().hashCode()); hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public CreateVpcConnectionRequest clone() { return (CreateVpcConnectionRequest) super.clone(); } }