/* * 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.route53resolver.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* In an * UpdateResolverRule request, information about the changes that you want to make. *

* * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ResolverRuleConfig implements Serializable, Cloneable, StructuredPojo { /** *

* The new name for the Resolver rule. The name that you specify appears in the Resolver dashboard in the Route 53 * console. *

*/ private String name; /** *

* For DNS queries that originate in your VPC, the new IP addresses that you want to route outbound DNS queries to. *

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

* The ID of the new outbound Resolver endpoint that you want to use to route DNS queries to the IP addresses that * you specify in TargetIps. *

*/ private String resolverEndpointId; /** *

* The new name for the Resolver rule. The name that you specify appears in the Resolver dashboard in the Route 53 * console. *

* * @param name * The new name for the Resolver rule. The name that you specify appears in the Resolver dashboard in the * Route 53 console. */ public void setName(String name) { this.name = name; } /** *

* The new name for the Resolver rule. The name that you specify appears in the Resolver dashboard in the Route 53 * console. *

* * @return The new name for the Resolver rule. The name that you specify appears in the Resolver dashboard in the * Route 53 console. */ public String getName() { return this.name; } /** *

* The new name for the Resolver rule. The name that you specify appears in the Resolver dashboard in the Route 53 * console. *

* * @param name * The new name for the Resolver rule. The name that you specify appears in the Resolver dashboard in the * Route 53 console. * @return Returns a reference to this object so that method calls can be chained together. */ public ResolverRuleConfig withName(String name) { setName(name); return this; } /** *

* For DNS queries that originate in your VPC, the new IP addresses that you want to route outbound DNS queries to. *

* * @return For DNS queries that originate in your VPC, the new IP addresses that you want to route outbound DNS * queries to. */ public java.util.List getTargetIps() { return targetIps; } /** *

* For DNS queries that originate in your VPC, the new IP addresses that you want to route outbound DNS queries to. *

* * @param targetIps * For DNS queries that originate in your VPC, the new IP addresses that you want to route outbound DNS * queries to. */ public void setTargetIps(java.util.Collection targetIps) { if (targetIps == null) { this.targetIps = null; return; } this.targetIps = new java.util.ArrayList(targetIps); } /** *

* For DNS queries that originate in your VPC, the new IP addresses that you want to route outbound DNS queries to. *

*

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

* * @param targetIps * For DNS queries that originate in your VPC, the new IP addresses that you want to route outbound DNS * queries to. * @return Returns a reference to this object so that method calls can be chained together. */ public ResolverRuleConfig withTargetIps(TargetAddress... targetIps) { if (this.targetIps == null) { setTargetIps(new java.util.ArrayList(targetIps.length)); } for (TargetAddress ele : targetIps) { this.targetIps.add(ele); } return this; } /** *

* For DNS queries that originate in your VPC, the new IP addresses that you want to route outbound DNS queries to. *

* * @param targetIps * For DNS queries that originate in your VPC, the new IP addresses that you want to route outbound DNS * queries to. * @return Returns a reference to this object so that method calls can be chained together. */ public ResolverRuleConfig withTargetIps(java.util.Collection targetIps) { setTargetIps(targetIps); return this; } /** *

* The ID of the new outbound Resolver endpoint that you want to use to route DNS queries to the IP addresses that * you specify in TargetIps. *

* * @param resolverEndpointId * The ID of the new outbound Resolver endpoint that you want to use to route DNS queries to the IP addresses * that you specify in TargetIps. */ public void setResolverEndpointId(String resolverEndpointId) { this.resolverEndpointId = resolverEndpointId; } /** *

* The ID of the new outbound Resolver endpoint that you want to use to route DNS queries to the IP addresses that * you specify in TargetIps. *

* * @return The ID of the new outbound Resolver endpoint that you want to use to route DNS queries to the IP * addresses that you specify in TargetIps. */ public String getResolverEndpointId() { return this.resolverEndpointId; } /** *

* The ID of the new outbound Resolver endpoint that you want to use to route DNS queries to the IP addresses that * you specify in TargetIps. *

* * @param resolverEndpointId * The ID of the new outbound Resolver endpoint that you want to use to route DNS queries to the IP addresses * that you specify in TargetIps. * @return Returns a reference to this object so that method calls can be chained together. */ public ResolverRuleConfig withResolverEndpointId(String resolverEndpointId) { setResolverEndpointId(resolverEndpointId); 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 (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getTargetIps() != null) sb.append("TargetIps: ").append(getTargetIps()).append(","); if (getResolverEndpointId() != null) sb.append("ResolverEndpointId: ").append(getResolverEndpointId()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ResolverRuleConfig == false) return false; ResolverRuleConfig other = (ResolverRuleConfig) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getTargetIps() == null ^ this.getTargetIps() == null) return false; if (other.getTargetIps() != null && other.getTargetIps().equals(this.getTargetIps()) == false) return false; if (other.getResolverEndpointId() == null ^ this.getResolverEndpointId() == null) return false; if (other.getResolverEndpointId() != null && other.getResolverEndpointId().equals(this.getResolverEndpointId()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getTargetIps() == null) ? 0 : getTargetIps().hashCode()); hashCode = prime * hashCode + ((getResolverEndpointId() == null) ? 0 : getResolverEndpointId().hashCode()); return hashCode; } @Override public ResolverRuleConfig clone() { try { return (ResolverRuleConfig) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.route53resolver.model.transform.ResolverRuleConfigMarshaller.getInstance().marshall(this, protocolMarshaller); } }