/* * 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.lightsail.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 CreateLoadBalancerRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The name of your load balancer. *

*/ private String loadBalancerName; /** *

* The instance port where you're creating your load balancer. *

*/ private Integer instancePort; /** *

* The path you provided to perform the load balancer health check. If you didn't specify a health check path, * Lightsail uses the root path of your website (e.g., "/"). *

*

* You may want to specify a custom health check path other than the root of your application if your home page * loads slowly or has a lot of media or scripting on it. *

*/ private String healthCheckPath; /** *

* The name of the SSL/TLS certificate. *

*

* If you specify certificateName, then certificateDomainName is required (and * vice-versa). *

*/ private String certificateName; /** *

* The domain name with which your certificate is associated (e.g., example.com). *

*

* If you specify certificateDomainName, then certificateName is required (and * vice-versa). *

*/ private String certificateDomainName; /** *

* The optional alternative domains and subdomains to use with your SSL/TLS certificate (e.g., * www.example.com, example.com, m.example.com, blog.example.com * ). *

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

* The tag keys and optional values to add to the resource during create. *

*

* Use the TagResource action to tag a resource after it's created. *

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

* The IP address type for the load balancer. *

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. *

*/ private String ipAddressType; /** *

* The name of the TLS policy to apply to the load balancer. *

*

* Use the GetLoadBalancerTlsPolicies action to get a list of TLS policy names that you can specify. *

*

* For more information about load balancer TLS policies, see Configuring TLS security policies on your Amazon Lightsail load balancers in the Amazon Lightsail * Developer Guide. *

*/ private String tlsPolicyName; /** *

* The name of your load balancer. *

* * @param loadBalancerName * The name of your load balancer. */ public void setLoadBalancerName(String loadBalancerName) { this.loadBalancerName = loadBalancerName; } /** *

* The name of your load balancer. *

* * @return The name of your load balancer. */ public String getLoadBalancerName() { return this.loadBalancerName; } /** *

* The name of your load balancer. *

* * @param loadBalancerName * The name of your load balancer. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLoadBalancerRequest withLoadBalancerName(String loadBalancerName) { setLoadBalancerName(loadBalancerName); return this; } /** *

* The instance port where you're creating your load balancer. *

* * @param instancePort * The instance port where you're creating your load balancer. */ public void setInstancePort(Integer instancePort) { this.instancePort = instancePort; } /** *

* The instance port where you're creating your load balancer. *

* * @return The instance port where you're creating your load balancer. */ public Integer getInstancePort() { return this.instancePort; } /** *

* The instance port where you're creating your load balancer. *

* * @param instancePort * The instance port where you're creating your load balancer. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLoadBalancerRequest withInstancePort(Integer instancePort) { setInstancePort(instancePort); return this; } /** *

* The path you provided to perform the load balancer health check. If you didn't specify a health check path, * Lightsail uses the root path of your website (e.g., "/"). *

*

* You may want to specify a custom health check path other than the root of your application if your home page * loads slowly or has a lot of media or scripting on it. *

* * @param healthCheckPath * The path you provided to perform the load balancer health check. If you didn't specify a health check * path, Lightsail uses the root path of your website (e.g., "/").

*

* You may want to specify a custom health check path other than the root of your application if your home * page loads slowly or has a lot of media or scripting on it. */ public void setHealthCheckPath(String healthCheckPath) { this.healthCheckPath = healthCheckPath; } /** *

* The path you provided to perform the load balancer health check. If you didn't specify a health check path, * Lightsail uses the root path of your website (e.g., "/"). *

*

* You may want to specify a custom health check path other than the root of your application if your home page * loads slowly or has a lot of media or scripting on it. *

* * @return The path you provided to perform the load balancer health check. If you didn't specify a health check * path, Lightsail uses the root path of your website (e.g., "/").

*

* You may want to specify a custom health check path other than the root of your application if your home * page loads slowly or has a lot of media or scripting on it. */ public String getHealthCheckPath() { return this.healthCheckPath; } /** *

* The path you provided to perform the load balancer health check. If you didn't specify a health check path, * Lightsail uses the root path of your website (e.g., "/"). *

*

* You may want to specify a custom health check path other than the root of your application if your home page * loads slowly or has a lot of media or scripting on it. *

* * @param healthCheckPath * The path you provided to perform the load balancer health check. If you didn't specify a health check * path, Lightsail uses the root path of your website (e.g., "/").

*

* You may want to specify a custom health check path other than the root of your application if your home * page loads slowly or has a lot of media or scripting on it. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLoadBalancerRequest withHealthCheckPath(String healthCheckPath) { setHealthCheckPath(healthCheckPath); return this; } /** *

* The name of the SSL/TLS certificate. *

*

* If you specify certificateName, then certificateDomainName is required (and * vice-versa). *

* * @param certificateName * The name of the SSL/TLS certificate.

*

* If you specify certificateName, then certificateDomainName is required (and * vice-versa). */ public void setCertificateName(String certificateName) { this.certificateName = certificateName; } /** *

* The name of the SSL/TLS certificate. *

*

* If you specify certificateName, then certificateDomainName is required (and * vice-versa). *

* * @return The name of the SSL/TLS certificate.

*

* If you specify certificateName, then certificateDomainName is required (and * vice-versa). */ public String getCertificateName() { return this.certificateName; } /** *

* The name of the SSL/TLS certificate. *

*

* If you specify certificateName, then certificateDomainName is required (and * vice-versa). *

* * @param certificateName * The name of the SSL/TLS certificate.

*

* If you specify certificateName, then certificateDomainName is required (and * vice-versa). * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLoadBalancerRequest withCertificateName(String certificateName) { setCertificateName(certificateName); return this; } /** *

* The domain name with which your certificate is associated (e.g., example.com). *

*

* If you specify certificateDomainName, then certificateName is required (and * vice-versa). *

* * @param certificateDomainName * The domain name with which your certificate is associated (e.g., example.com).

*

* If you specify certificateDomainName, then certificateName is required (and * vice-versa). */ public void setCertificateDomainName(String certificateDomainName) { this.certificateDomainName = certificateDomainName; } /** *

* The domain name with which your certificate is associated (e.g., example.com). *

*

* If you specify certificateDomainName, then certificateName is required (and * vice-versa). *

* * @return The domain name with which your certificate is associated (e.g., example.com).

*

* If you specify certificateDomainName, then certificateName is required (and * vice-versa). */ public String getCertificateDomainName() { return this.certificateDomainName; } /** *

* The domain name with which your certificate is associated (e.g., example.com). *

*

* If you specify certificateDomainName, then certificateName is required (and * vice-versa). *

* * @param certificateDomainName * The domain name with which your certificate is associated (e.g., example.com).

*

* If you specify certificateDomainName, then certificateName is required (and * vice-versa). * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLoadBalancerRequest withCertificateDomainName(String certificateDomainName) { setCertificateDomainName(certificateDomainName); return this; } /** *

* The optional alternative domains and subdomains to use with your SSL/TLS certificate (e.g., * www.example.com, example.com, m.example.com, blog.example.com * ). *

* * @return The optional alternative domains and subdomains to use with your SSL/TLS certificate (e.g., * www.example.com, example.com, m.example.com, * blog.example.com). */ public java.util.List getCertificateAlternativeNames() { return certificateAlternativeNames; } /** *

* The optional alternative domains and subdomains to use with your SSL/TLS certificate (e.g., * www.example.com, example.com, m.example.com, blog.example.com * ). *

* * @param certificateAlternativeNames * The optional alternative domains and subdomains to use with your SSL/TLS certificate (e.g., * www.example.com, example.com, m.example.com, * blog.example.com). */ public void setCertificateAlternativeNames(java.util.Collection certificateAlternativeNames) { if (certificateAlternativeNames == null) { this.certificateAlternativeNames = null; return; } this.certificateAlternativeNames = new java.util.ArrayList(certificateAlternativeNames); } /** *

* The optional alternative domains and subdomains to use with your SSL/TLS certificate (e.g., * www.example.com, example.com, m.example.com, blog.example.com * ). *

*

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

* * @param certificateAlternativeNames * The optional alternative domains and subdomains to use with your SSL/TLS certificate (e.g., * www.example.com, example.com, m.example.com, * blog.example.com). * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLoadBalancerRequest withCertificateAlternativeNames(String... certificateAlternativeNames) { if (this.certificateAlternativeNames == null) { setCertificateAlternativeNames(new java.util.ArrayList(certificateAlternativeNames.length)); } for (String ele : certificateAlternativeNames) { this.certificateAlternativeNames.add(ele); } return this; } /** *

* The optional alternative domains and subdomains to use with your SSL/TLS certificate (e.g., * www.example.com, example.com, m.example.com, blog.example.com * ). *

* * @param certificateAlternativeNames * The optional alternative domains and subdomains to use with your SSL/TLS certificate (e.g., * www.example.com, example.com, m.example.com, * blog.example.com). * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLoadBalancerRequest withCertificateAlternativeNames(java.util.Collection certificateAlternativeNames) { setCertificateAlternativeNames(certificateAlternativeNames); return this; } /** *

* The tag keys and optional values to add to the resource during create. *

*

* Use the TagResource action to tag a resource after it's created. *

* * @return The tag keys and optional values to add to the resource during create.

*

* Use the TagResource action to tag a resource after it's created. */ public java.util.List getTags() { return tags; } /** *

* The tag keys and optional values to add to the resource during create. *

*

* Use the TagResource action to tag a resource after it's created. *

* * @param tags * The tag keys and optional values to add to the resource during create.

*

* Use the TagResource action to tag a resource after it's created. */ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

* The tag keys and optional values to add to the resource during create. *

*

* Use the TagResource action to tag a resource after it's created. *

*

* 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 * The tag keys and optional values to add to the resource during create.

*

* Use the TagResource action to tag a resource after it's created. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLoadBalancerRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } return this; } /** *

* The tag keys and optional values to add to the resource during create. *

*

* Use the TagResource action to tag a resource after it's created. *

* * @param tags * The tag keys and optional values to add to the resource during create.

*

* Use the TagResource action to tag a resource after it's created. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLoadBalancerRequest withTags(java.util.Collection tags) { setTags(tags); return this; } /** *

* The IP address type for the load balancer. *

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. *

* * @param ipAddressType * The IP address type for the load balancer.

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. * @see IpAddressType */ public void setIpAddressType(String ipAddressType) { this.ipAddressType = ipAddressType; } /** *

* The IP address type for the load balancer. *

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. *

* * @return The IP address type for the load balancer.

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. * @see IpAddressType */ public String getIpAddressType() { return this.ipAddressType; } /** *

* The IP address type for the load balancer. *

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. *

* * @param ipAddressType * The IP address type for the load balancer.

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. * @return Returns a reference to this object so that method calls can be chained together. * @see IpAddressType */ public CreateLoadBalancerRequest withIpAddressType(String ipAddressType) { setIpAddressType(ipAddressType); return this; } /** *

* The IP address type for the load balancer. *

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. *

* * @param ipAddressType * The IP address type for the load balancer.

*

* The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. *

*

* The default value is dualstack. * @return Returns a reference to this object so that method calls can be chained together. * @see IpAddressType */ public CreateLoadBalancerRequest withIpAddressType(IpAddressType ipAddressType) { this.ipAddressType = ipAddressType.toString(); return this; } /** *

* The name of the TLS policy to apply to the load balancer. *

*

* Use the GetLoadBalancerTlsPolicies action to get a list of TLS policy names that you can specify. *

*

* For more information about load balancer TLS policies, see Configuring TLS security policies on your Amazon Lightsail load balancers in the Amazon Lightsail * Developer Guide. *

* * @param tlsPolicyName * The name of the TLS policy to apply to the load balancer.

*

* Use the GetLoadBalancerTlsPolicies action to get a list of TLS policy names that you can specify. *

*

* For more information about load balancer TLS policies, see Configuring TLS security policies on your Amazon Lightsail load balancers in the Amazon Lightsail * Developer Guide. */ public void setTlsPolicyName(String tlsPolicyName) { this.tlsPolicyName = tlsPolicyName; } /** *

* The name of the TLS policy to apply to the load balancer. *

*

* Use the GetLoadBalancerTlsPolicies action to get a list of TLS policy names that you can specify. *

*

* For more information about load balancer TLS policies, see Configuring TLS security policies on your Amazon Lightsail load balancers in the Amazon Lightsail * Developer Guide. *

* * @return The name of the TLS policy to apply to the load balancer.

*

* Use the GetLoadBalancerTlsPolicies action to get a list of TLS policy names that you can specify. *

*

* For more information about load balancer TLS policies, see Configuring TLS security policies on your Amazon Lightsail load balancers in the Amazon Lightsail * Developer Guide. */ public String getTlsPolicyName() { return this.tlsPolicyName; } /** *

* The name of the TLS policy to apply to the load balancer. *

*

* Use the GetLoadBalancerTlsPolicies action to get a list of TLS policy names that you can specify. *

*

* For more information about load balancer TLS policies, see Configuring TLS security policies on your Amazon Lightsail load balancers in the Amazon Lightsail * Developer Guide. *

* * @param tlsPolicyName * The name of the TLS policy to apply to the load balancer.

*

* Use the GetLoadBalancerTlsPolicies action to get a list of TLS policy names that you can specify. *

*

* For more information about load balancer TLS policies, see Configuring TLS security policies on your Amazon Lightsail load balancers in the Amazon Lightsail * Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateLoadBalancerRequest withTlsPolicyName(String tlsPolicyName) { setTlsPolicyName(tlsPolicyName); 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 (getLoadBalancerName() != null) sb.append("LoadBalancerName: ").append(getLoadBalancerName()).append(","); if (getInstancePort() != null) sb.append("InstancePort: ").append(getInstancePort()).append(","); if (getHealthCheckPath() != null) sb.append("HealthCheckPath: ").append(getHealthCheckPath()).append(","); if (getCertificateName() != null) sb.append("CertificateName: ").append(getCertificateName()).append(","); if (getCertificateDomainName() != null) sb.append("CertificateDomainName: ").append(getCertificateDomainName()).append(","); if (getCertificateAlternativeNames() != null) sb.append("CertificateAlternativeNames: ").append(getCertificateAlternativeNames()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getIpAddressType() != null) sb.append("IpAddressType: ").append(getIpAddressType()).append(","); if (getTlsPolicyName() != null) sb.append("TlsPolicyName: ").append(getTlsPolicyName()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateLoadBalancerRequest == false) return false; CreateLoadBalancerRequest other = (CreateLoadBalancerRequest) obj; if (other.getLoadBalancerName() == null ^ this.getLoadBalancerName() == null) return false; if (other.getLoadBalancerName() != null && other.getLoadBalancerName().equals(this.getLoadBalancerName()) == false) return false; if (other.getInstancePort() == null ^ this.getInstancePort() == null) return false; if (other.getInstancePort() != null && other.getInstancePort().equals(this.getInstancePort()) == false) return false; if (other.getHealthCheckPath() == null ^ this.getHealthCheckPath() == null) return false; if (other.getHealthCheckPath() != null && other.getHealthCheckPath().equals(this.getHealthCheckPath()) == false) return false; if (other.getCertificateName() == null ^ this.getCertificateName() == null) return false; if (other.getCertificateName() != null && other.getCertificateName().equals(this.getCertificateName()) == false) return false; if (other.getCertificateDomainName() == null ^ this.getCertificateDomainName() == null) return false; if (other.getCertificateDomainName() != null && other.getCertificateDomainName().equals(this.getCertificateDomainName()) == false) return false; if (other.getCertificateAlternativeNames() == null ^ this.getCertificateAlternativeNames() == null) return false; if (other.getCertificateAlternativeNames() != null && other.getCertificateAlternativeNames().equals(this.getCertificateAlternativeNames()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getIpAddressType() == null ^ this.getIpAddressType() == null) return false; if (other.getIpAddressType() != null && other.getIpAddressType().equals(this.getIpAddressType()) == false) return false; if (other.getTlsPolicyName() == null ^ this.getTlsPolicyName() == null) return false; if (other.getTlsPolicyName() != null && other.getTlsPolicyName().equals(this.getTlsPolicyName()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLoadBalancerName() == null) ? 0 : getLoadBalancerName().hashCode()); hashCode = prime * hashCode + ((getInstancePort() == null) ? 0 : getInstancePort().hashCode()); hashCode = prime * hashCode + ((getHealthCheckPath() == null) ? 0 : getHealthCheckPath().hashCode()); hashCode = prime * hashCode + ((getCertificateName() == null) ? 0 : getCertificateName().hashCode()); hashCode = prime * hashCode + ((getCertificateDomainName() == null) ? 0 : getCertificateDomainName().hashCode()); hashCode = prime * hashCode + ((getCertificateAlternativeNames() == null) ? 0 : getCertificateAlternativeNames().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getIpAddressType() == null) ? 0 : getIpAddressType().hashCode()); hashCode = prime * hashCode + ((getTlsPolicyName() == null) ? 0 : getTlsPolicyName().hashCode()); return hashCode; } @Override public CreateLoadBalancerRequest clone() { return (CreateLoadBalancerRequest) super.clone(); } }