All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.route53resolver.model.ResolverRule 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.route53resolver.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* For queries that originate in your VPC, detailed information about a Resolver rule, which specifies how to route DNS * queries out of the VPC. The ResolverRule parameter appears in the response to a CreateResolverRule, DeleteResolverRule, GetResolverRule, ListResolverRules, or UpdateResolverRule request. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ResolverRule implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Id") .getter(getter(ResolverRule::id)).setter(setter(Builder::id)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build(); private static final SdkField CREATOR_REQUEST_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CreatorRequestId").getter(getter(ResolverRule::creatorRequestId)) .setter(setter(Builder::creatorRequestId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatorRequestId").build()).build(); private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn") .getter(getter(ResolverRule::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build(); private static final SdkField DOMAIN_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DomainName").getter(getter(ResolverRule::domainName)).setter(setter(Builder::domainName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DomainName").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(ResolverRule::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField STATUS_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("StatusMessage").getter(getter(ResolverRule::statusMessage)).setter(setter(Builder::statusMessage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatusMessage").build()).build(); private static final SdkField RULE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("RuleType").getter(getter(ResolverRule::ruleTypeAsString)).setter(setter(Builder::ruleType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RuleType").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name") .getter(getter(ResolverRule::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build(); private static final SdkField> TARGET_IPS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("TargetIps") .getter(getter(ResolverRule::targetIps)) .setter(setter(Builder::targetIps)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetIps").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(TargetAddress::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField RESOLVER_ENDPOINT_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ResolverEndpointId").getter(getter(ResolverRule::resolverEndpointId)) .setter(setter(Builder::resolverEndpointId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResolverEndpointId").build()) .build(); private static final SdkField OWNER_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("OwnerId").getter(getter(ResolverRule::ownerId)).setter(setter(Builder::ownerId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OwnerId").build()).build(); private static final SdkField SHARE_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ShareStatus").getter(getter(ResolverRule::shareStatusAsString)).setter(setter(Builder::shareStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShareStatus").build()).build(); private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CreationTime").getter(getter(ResolverRule::creationTime)).setter(setter(Builder::creationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build(); private static final SdkField MODIFICATION_TIME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ModificationTime").getter(getter(ResolverRule::modificationTime)) .setter(setter(Builder::modificationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModificationTime").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, CREATOR_REQUEST_ID_FIELD, ARN_FIELD, DOMAIN_NAME_FIELD, STATUS_FIELD, STATUS_MESSAGE_FIELD, RULE_TYPE_FIELD, NAME_FIELD, TARGET_IPS_FIELD, RESOLVER_ENDPOINT_ID_FIELD, OWNER_ID_FIELD, SHARE_STATUS_FIELD, CREATION_TIME_FIELD, MODIFICATION_TIME_FIELD)); private static final long serialVersionUID = 1L; private final String id; private final String creatorRequestId; private final String arn; private final String domainName; private final String status; private final String statusMessage; private final String ruleType; private final String name; private final List targetIps; private final String resolverEndpointId; private final String ownerId; private final String shareStatus; private final String creationTime; private final String modificationTime; private ResolverRule(BuilderImpl builder) { this.id = builder.id; this.creatorRequestId = builder.creatorRequestId; this.arn = builder.arn; this.domainName = builder.domainName; this.status = builder.status; this.statusMessage = builder.statusMessage; this.ruleType = builder.ruleType; this.name = builder.name; this.targetIps = builder.targetIps; this.resolverEndpointId = builder.resolverEndpointId; this.ownerId = builder.ownerId; this.shareStatus = builder.shareStatus; this.creationTime = builder.creationTime; this.modificationTime = builder.modificationTime; } /** *

* The ID that Resolver assigned to the Resolver rule when you created it. *

* * @return The ID that Resolver assigned to the Resolver rule when you created it. */ public final String id() { return id; } /** *

* A unique string that you specified when you created the Resolver rule. CreatorRequestId identifies * the request and allows failed requests to be retried without the risk of running the operation twice. *

* * @return A unique string that you specified when you created the Resolver rule. CreatorRequestId * identifies the request and allows failed requests to be retried without the risk of running the operation * twice. */ public final String creatorRequestId() { return creatorRequestId; } /** *

* The ARN (Amazon Resource Name) for the Resolver rule specified by Id. *

* * @return The ARN (Amazon Resource Name) for the Resolver rule specified by Id. */ public final String arn() { return arn; } /** *

* DNS queries for this domain name are forwarded to the IP addresses that are specified in TargetIps. * If a query matches multiple Resolver rules (example.com and www.example.com), the query is routed using the * Resolver rule that contains the most specific domain name (www.example.com). *

* * @return DNS queries for this domain name are forwarded to the IP addresses that are specified in * TargetIps. If a query matches multiple Resolver rules (example.com and www.example.com), the * query is routed using the Resolver rule that contains the most specific domain name (www.example.com). */ public final String domainName() { return domainName; } /** *

* A code that specifies the current status of the Resolver rule. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link ResolverRuleStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return A code that specifies the current status of the Resolver rule. * @see ResolverRuleStatus */ public final ResolverRuleStatus status() { return ResolverRuleStatus.fromValue(status); } /** *

* A code that specifies the current status of the Resolver rule. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link ResolverRuleStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return A code that specifies the current status of the Resolver rule. * @see ResolverRuleStatus */ public final String statusAsString() { return status; } /** *

* A detailed description of the status of a Resolver rule. *

* * @return A detailed description of the status of a Resolver rule. */ public final String statusMessage() { return statusMessage; } /** *

* When you want to forward DNS queries for specified domain name to resolvers on your network, specify * FORWARD. *

*

* When you have a forwarding rule to forward DNS queries for a domain to your network and you want Resolver to * process queries for a subdomain of that domain, specify SYSTEM. *

*

* For example, to forward DNS queries for example.com to resolvers on your network, you create a rule and specify * FORWARD for RuleType. To then have Resolver process queries for apex.example.com, you * create a rule and specify SYSTEM for RuleType. *

*

* Currently, only Resolver can create rules that have a value of RECURSIVE for RuleType. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #ruleType} will * return {@link RuleTypeOption#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #ruleTypeAsString}. *

* * @return When you want to forward DNS queries for specified domain name to resolvers on your network, specify * FORWARD.

*

* When you have a forwarding rule to forward DNS queries for a domain to your network and you want Resolver * to process queries for a subdomain of that domain, specify SYSTEM. *

*

* For example, to forward DNS queries for example.com to resolvers on your network, you create a rule and * specify FORWARD for RuleType. To then have Resolver process queries for * apex.example.com, you create a rule and specify SYSTEM for RuleType. *

*

* Currently, only Resolver can create rules that have a value of RECURSIVE for * RuleType. * @see RuleTypeOption */ public final RuleTypeOption ruleType() { return RuleTypeOption.fromValue(ruleType); } /** *

* When you want to forward DNS queries for specified domain name to resolvers on your network, specify * FORWARD. *

*

* When you have a forwarding rule to forward DNS queries for a domain to your network and you want Resolver to * process queries for a subdomain of that domain, specify SYSTEM. *

*

* For example, to forward DNS queries for example.com to resolvers on your network, you create a rule and specify * FORWARD for RuleType. To then have Resolver process queries for apex.example.com, you * create a rule and specify SYSTEM for RuleType. *

*

* Currently, only Resolver can create rules that have a value of RECURSIVE for RuleType. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #ruleType} will * return {@link RuleTypeOption#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #ruleTypeAsString}. *

* * @return When you want to forward DNS queries for specified domain name to resolvers on your network, specify * FORWARD.

*

* When you have a forwarding rule to forward DNS queries for a domain to your network and you want Resolver * to process queries for a subdomain of that domain, specify SYSTEM. *

*

* For example, to forward DNS queries for example.com to resolvers on your network, you create a rule and * specify FORWARD for RuleType. To then have Resolver process queries for * apex.example.com, you create a rule and specify SYSTEM for RuleType. *

*

* Currently, only Resolver can create rules that have a value of RECURSIVE for * RuleType. * @see RuleTypeOption */ public final String ruleTypeAsString() { return ruleType; } /** *

* The name for the Resolver rule, which you specified when you created the Resolver rule. *

* * @return The name for the Resolver rule, which you specified when you created the Resolver rule. */ public final String name() { return name; } /** * For responses, this returns true if the service returned a value for the TargetIps property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasTargetIps() { return targetIps != null && !(targetIps instanceof SdkAutoConstructList); } /** *

* An array that contains the IP addresses and ports that an outbound endpoint forwards DNS queries to. Typically, * these are the IP addresses of DNS resolvers on your network. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTargetIps} method. *

* * @return An array that contains the IP addresses and ports that an outbound endpoint forwards DNS queries to. * Typically, these are the IP addresses of DNS resolvers on your network. */ public final List targetIps() { return targetIps; } /** *

* The ID of the endpoint that the rule is associated with. *

* * @return The ID of the endpoint that the rule is associated with. */ public final String resolverEndpointId() { return resolverEndpointId; } /** *

* When a rule is shared with another Amazon Web Services account, the account ID of the account that the rule is * shared with. *

* * @return When a rule is shared with another Amazon Web Services account, the account ID of the account that the * rule is shared with. */ public final String ownerId() { return ownerId; } /** *

* Whether the rule is shared and, if so, whether the current account is sharing the rule with another account, or * another account is sharing the rule with the current account. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #shareStatus} will * return {@link ShareStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #shareStatusAsString}. *

* * @return Whether the rule is shared and, if so, whether the current account is sharing the rule with another * account, or another account is sharing the rule with the current account. * @see ShareStatus */ public final ShareStatus shareStatus() { return ShareStatus.fromValue(shareStatus); } /** *

* Whether the rule is shared and, if so, whether the current account is sharing the rule with another account, or * another account is sharing the rule with the current account. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #shareStatus} will * return {@link ShareStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #shareStatusAsString}. *

* * @return Whether the rule is shared and, if so, whether the current account is sharing the rule with another * account, or another account is sharing the rule with the current account. * @see ShareStatus */ public final String shareStatusAsString() { return shareStatus; } /** *

* The date and time that the Resolver rule was created, in Unix time format and Coordinated Universal Time (UTC). *

* * @return The date and time that the Resolver rule was created, in Unix time format and Coordinated Universal Time * (UTC). */ public final String creationTime() { return creationTime; } /** *

* The date and time that the Resolver rule was last updated, in Unix time format and Coordinated Universal Time * (UTC). *

* * @return The date and time that the Resolver rule was last updated, in Unix time format and Coordinated Universal * Time (UTC). */ public final String modificationTime() { return modificationTime; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(id()); hashCode = 31 * hashCode + Objects.hashCode(creatorRequestId()); hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(domainName()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusMessage()); hashCode = 31 * hashCode + Objects.hashCode(ruleTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(hasTargetIps() ? targetIps() : null); hashCode = 31 * hashCode + Objects.hashCode(resolverEndpointId()); hashCode = 31 * hashCode + Objects.hashCode(ownerId()); hashCode = 31 * hashCode + Objects.hashCode(shareStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(modificationTime()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ResolverRule)) { return false; } ResolverRule other = (ResolverRule) obj; return Objects.equals(id(), other.id()) && Objects.equals(creatorRequestId(), other.creatorRequestId()) && Objects.equals(arn(), other.arn()) && Objects.equals(domainName(), other.domainName()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(statusMessage(), other.statusMessage()) && Objects.equals(ruleTypeAsString(), other.ruleTypeAsString()) && Objects.equals(name(), other.name()) && hasTargetIps() == other.hasTargetIps() && Objects.equals(targetIps(), other.targetIps()) && Objects.equals(resolverEndpointId(), other.resolverEndpointId()) && Objects.equals(ownerId(), other.ownerId()) && Objects.equals(shareStatusAsString(), other.shareStatusAsString()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(modificationTime(), other.modificationTime()); } /** * 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("ResolverRule").add("Id", id()).add("CreatorRequestId", creatorRequestId()).add("Arn", arn()) .add("DomainName", domainName()).add("Status", statusAsString()).add("StatusMessage", statusMessage()) .add("RuleType", ruleTypeAsString()).add("Name", name()).add("TargetIps", hasTargetIps() ? targetIps() : null) .add("ResolverEndpointId", resolverEndpointId()).add("OwnerId", ownerId()) .add("ShareStatus", shareStatusAsString()).add("CreationTime", creationTime()) .add("ModificationTime", modificationTime()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Id": return Optional.ofNullable(clazz.cast(id())); case "CreatorRequestId": return Optional.ofNullable(clazz.cast(creatorRequestId())); case "Arn": return Optional.ofNullable(clazz.cast(arn())); case "DomainName": return Optional.ofNullable(clazz.cast(domainName())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "StatusMessage": return Optional.ofNullable(clazz.cast(statusMessage())); case "RuleType": return Optional.ofNullable(clazz.cast(ruleTypeAsString())); case "Name": return Optional.ofNullable(clazz.cast(name())); case "TargetIps": return Optional.ofNullable(clazz.cast(targetIps())); case "ResolverEndpointId": return Optional.ofNullable(clazz.cast(resolverEndpointId())); case "OwnerId": return Optional.ofNullable(clazz.cast(ownerId())); case "ShareStatus": return Optional.ofNullable(clazz.cast(shareStatusAsString())); case "CreationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "ModificationTime": return Optional.ofNullable(clazz.cast(modificationTime())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ResolverRule) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ID that Resolver assigned to the Resolver rule when you created it. *

* * @param id * The ID that Resolver assigned to the Resolver rule when you created it. * @return Returns a reference to this object so that method calls can be chained together. */ Builder id(String id); /** *

* A unique string that you specified when you created the Resolver rule. CreatorRequestId * identifies the request and allows failed requests to be retried without the risk of running the operation * twice. *

* * @param creatorRequestId * A unique string that you specified when you created the Resolver rule. CreatorRequestId * identifies the request and allows failed requests to be retried without the risk of running the * operation twice. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creatorRequestId(String creatorRequestId); /** *

* The ARN (Amazon Resource Name) for the Resolver rule specified by Id. *

* * @param arn * The ARN (Amazon Resource Name) for the Resolver rule specified by Id. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

* DNS queries for this domain name are forwarded to the IP addresses that are specified in * TargetIps. If a query matches multiple Resolver rules (example.com and www.example.com), the * query is routed using the Resolver rule that contains the most specific domain name (www.example.com). *

* * @param domainName * DNS queries for this domain name are forwarded to the IP addresses that are specified in * TargetIps. If a query matches multiple Resolver rules (example.com and www.example.com), * the query is routed using the Resolver rule that contains the most specific domain name * (www.example.com). * @return Returns a reference to this object so that method calls can be chained together. */ Builder domainName(String domainName); /** *

* A code that specifies the current status of the Resolver rule. *

* * @param status * A code that specifies the current status of the Resolver rule. * @see ResolverRuleStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ResolverRuleStatus */ Builder status(String status); /** *

* A code that specifies the current status of the Resolver rule. *

* * @param status * A code that specifies the current status of the Resolver rule. * @see ResolverRuleStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ResolverRuleStatus */ Builder status(ResolverRuleStatus status); /** *

* A detailed description of the status of a Resolver rule. *

* * @param statusMessage * A detailed description of the status of a Resolver rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statusMessage(String statusMessage); /** *

* When you want to forward DNS queries for specified domain name to resolvers on your network, specify * FORWARD. *

*

* When you have a forwarding rule to forward DNS queries for a domain to your network and you want Resolver to * process queries for a subdomain of that domain, specify SYSTEM. *

*

* For example, to forward DNS queries for example.com to resolvers on your network, you create a rule and * specify FORWARD for RuleType. To then have Resolver process queries for * apex.example.com, you create a rule and specify SYSTEM for RuleType. *

*

* Currently, only Resolver can create rules that have a value of RECURSIVE for * RuleType. *

* * @param ruleType * When you want to forward DNS queries for specified domain name to resolvers on your network, specify * FORWARD.

*

* When you have a forwarding rule to forward DNS queries for a domain to your network and you want * Resolver to process queries for a subdomain of that domain, specify SYSTEM. *

*

* For example, to forward DNS queries for example.com to resolvers on your network, you create a rule * and specify FORWARD for RuleType. To then have Resolver process queries for * apex.example.com, you create a rule and specify SYSTEM for RuleType. *

*

* Currently, only Resolver can create rules that have a value of RECURSIVE for * RuleType. * @see RuleTypeOption * @return Returns a reference to this object so that method calls can be chained together. * @see RuleTypeOption */ Builder ruleType(String ruleType); /** *

* When you want to forward DNS queries for specified domain name to resolvers on your network, specify * FORWARD. *

*

* When you have a forwarding rule to forward DNS queries for a domain to your network and you want Resolver to * process queries for a subdomain of that domain, specify SYSTEM. *

*

* For example, to forward DNS queries for example.com to resolvers on your network, you create a rule and * specify FORWARD for RuleType. To then have Resolver process queries for * apex.example.com, you create a rule and specify SYSTEM for RuleType. *

*

* Currently, only Resolver can create rules that have a value of RECURSIVE for * RuleType. *

* * @param ruleType * When you want to forward DNS queries for specified domain name to resolvers on your network, specify * FORWARD.

*

* When you have a forwarding rule to forward DNS queries for a domain to your network and you want * Resolver to process queries for a subdomain of that domain, specify SYSTEM. *

*

* For example, to forward DNS queries for example.com to resolvers on your network, you create a rule * and specify FORWARD for RuleType. To then have Resolver process queries for * apex.example.com, you create a rule and specify SYSTEM for RuleType. *

*

* Currently, only Resolver can create rules that have a value of RECURSIVE for * RuleType. * @see RuleTypeOption * @return Returns a reference to this object so that method calls can be chained together. * @see RuleTypeOption */ Builder ruleType(RuleTypeOption ruleType); /** *

* The name for the Resolver rule, which you specified when you created the Resolver rule. *

* * @param name * The name for the Resolver rule, which you specified when you created the Resolver rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* An array that contains the IP addresses and ports that an outbound endpoint forwards DNS queries to. * Typically, these are the IP addresses of DNS resolvers on your network. *

* * @param targetIps * An array that contains the IP addresses and ports that an outbound endpoint forwards DNS queries to. * Typically, these are the IP addresses of DNS resolvers on your network. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetIps(Collection targetIps); /** *

* An array that contains the IP addresses and ports that an outbound endpoint forwards DNS queries to. * Typically, these are the IP addresses of DNS resolvers on your network. *

* * @param targetIps * An array that contains the IP addresses and ports that an outbound endpoint forwards DNS queries to. * Typically, these are the IP addresses of DNS resolvers on your network. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetIps(TargetAddress... targetIps); /** *

* An array that contains the IP addresses and ports that an outbound endpoint forwards DNS queries to. * Typically, these are the IP addresses of DNS resolvers on your network. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.route53resolver.model.TargetAddress.Builder} avoiding the need to * create one manually via {@link software.amazon.awssdk.services.route53resolver.model.TargetAddress#builder()} * . * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.route53resolver.model.TargetAddress.Builder#build()} is called * immediately and its result is passed to {@link #targetIps(List)}. * * @param targetIps * a consumer that will call methods on * {@link software.amazon.awssdk.services.route53resolver.model.TargetAddress.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #targetIps(java.util.Collection) */ Builder targetIps(Consumer... targetIps); /** *

* The ID of the endpoint that the rule is associated with. *

* * @param resolverEndpointId * The ID of the endpoint that the rule is associated with. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resolverEndpointId(String resolverEndpointId); /** *

* When a rule is shared with another Amazon Web Services account, the account ID of the account that the rule * is shared with. *

* * @param ownerId * When a rule is shared with another Amazon Web Services account, the account ID of the account that the * rule is shared with. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ownerId(String ownerId); /** *

* Whether the rule is shared and, if so, whether the current account is sharing the rule with another account, * or another account is sharing the rule with the current account. *

* * @param shareStatus * Whether the rule is shared and, if so, whether the current account is sharing the rule with another * account, or another account is sharing the rule with the current account. * @see ShareStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ShareStatus */ Builder shareStatus(String shareStatus); /** *

* Whether the rule is shared and, if so, whether the current account is sharing the rule with another account, * or another account is sharing the rule with the current account. *

* * @param shareStatus * Whether the rule is shared and, if so, whether the current account is sharing the rule with another * account, or another account is sharing the rule with the current account. * @see ShareStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ShareStatus */ Builder shareStatus(ShareStatus shareStatus); /** *

* The date and time that the Resolver rule was created, in Unix time format and Coordinated Universal Time * (UTC). *

* * @param creationTime * The date and time that the Resolver rule was created, in Unix time format and Coordinated Universal * Time (UTC). * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(String creationTime); /** *

* The date and time that the Resolver rule was last updated, in Unix time format and Coordinated Universal Time * (UTC). *

* * @param modificationTime * The date and time that the Resolver rule was last updated, in Unix time format and Coordinated * Universal Time (UTC). * @return Returns a reference to this object so that method calls can be chained together. */ Builder modificationTime(String modificationTime); } static final class BuilderImpl implements Builder { private String id; private String creatorRequestId; private String arn; private String domainName; private String status; private String statusMessage; private String ruleType; private String name; private List targetIps = DefaultSdkAutoConstructList.getInstance(); private String resolverEndpointId; private String ownerId; private String shareStatus; private String creationTime; private String modificationTime; private BuilderImpl() { } private BuilderImpl(ResolverRule model) { id(model.id); creatorRequestId(model.creatorRequestId); arn(model.arn); domainName(model.domainName); status(model.status); statusMessage(model.statusMessage); ruleType(model.ruleType); name(model.name); targetIps(model.targetIps); resolverEndpointId(model.resolverEndpointId); ownerId(model.ownerId); shareStatus(model.shareStatus); creationTime(model.creationTime); modificationTime(model.modificationTime); } public final String getId() { return id; } public final void setId(String id) { this.id = id; } @Override public final Builder id(String id) { this.id = id; return this; } public final String getCreatorRequestId() { return creatorRequestId; } public final void setCreatorRequestId(String creatorRequestId) { this.creatorRequestId = creatorRequestId; } @Override public final Builder creatorRequestId(String creatorRequestId) { this.creatorRequestId = creatorRequestId; return this; } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final String getDomainName() { return domainName; } public final void setDomainName(String domainName) { this.domainName = domainName; } @Override public final Builder domainName(String domainName) { this.domainName = domainName; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(ResolverRuleStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getStatusMessage() { return statusMessage; } public final void setStatusMessage(String statusMessage) { this.statusMessage = statusMessage; } @Override public final Builder statusMessage(String statusMessage) { this.statusMessage = statusMessage; return this; } public final String getRuleType() { return ruleType; } public final void setRuleType(String ruleType) { this.ruleType = ruleType; } @Override public final Builder ruleType(String ruleType) { this.ruleType = ruleType; return this; } @Override public final Builder ruleType(RuleTypeOption ruleType) { this.ruleType(ruleType == null ? null : ruleType.toString()); return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final List getTargetIps() { List result = TargetListCopier.copyToBuilder(this.targetIps); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setTargetIps(Collection targetIps) { this.targetIps = TargetListCopier.copyFromBuilder(targetIps); } @Override public final Builder targetIps(Collection targetIps) { this.targetIps = TargetListCopier.copy(targetIps); return this; } @Override @SafeVarargs public final Builder targetIps(TargetAddress... targetIps) { targetIps(Arrays.asList(targetIps)); return this; } @Override @SafeVarargs public final Builder targetIps(Consumer... targetIps) { targetIps(Stream.of(targetIps).map(c -> TargetAddress.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getResolverEndpointId() { return resolverEndpointId; } public final void setResolverEndpointId(String resolverEndpointId) { this.resolverEndpointId = resolverEndpointId; } @Override public final Builder resolverEndpointId(String resolverEndpointId) { this.resolverEndpointId = resolverEndpointId; return this; } public final String getOwnerId() { return ownerId; } public final void setOwnerId(String ownerId) { this.ownerId = ownerId; } @Override public final Builder ownerId(String ownerId) { this.ownerId = ownerId; return this; } public final String getShareStatus() { return shareStatus; } public final void setShareStatus(String shareStatus) { this.shareStatus = shareStatus; } @Override public final Builder shareStatus(String shareStatus) { this.shareStatus = shareStatus; return this; } @Override public final Builder shareStatus(ShareStatus shareStatus) { this.shareStatus(shareStatus == null ? null : shareStatus.toString()); return this; } public final String getCreationTime() { return creationTime; } public final void setCreationTime(String creationTime) { this.creationTime = creationTime; } @Override public final Builder creationTime(String creationTime) { this.creationTime = creationTime; return this; } public final String getModificationTime() { return modificationTime; } public final void setModificationTime(String modificationTime) { this.modificationTime = modificationTime; } @Override public final Builder modificationTime(String modificationTime) { this.modificationTime = modificationTime; return this; } @Override public ResolverRule build() { return new ResolverRule(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy