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

software.amazon.awssdk.services.route53.model.GeoProximityLocation Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Route53 module holds the client classes that are used for communicating with Amazon Route53 Service

There is a newer version: 2.28.4
Show newest version
/*
 * 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.route53.model;

import java.io.Serializable;
import java.util.Arrays;
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 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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* (Resource record sets only): A complex type that lets you specify where your resources are located. Only one of * LocalZoneGroup, Coordinates, or Amazon Web ServicesRegion is allowed per * request at a time. *

*

* For more information about geoproximity routing, see Geoproximity * routing in the Amazon Route 53 Developer Guide. *

*/ @Generated("software.amazon.awssdk:codegen") public final class GeoProximityLocation implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField AWS_REGION_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("AWSRegion") .getter(getter(GeoProximityLocation::awsRegion)) .setter(setter(Builder::awsRegion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AWSRegion") .unmarshallLocationName("AWSRegion").build()).build(); private static final SdkField LOCAL_ZONE_GROUP_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("LocalZoneGroup") .getter(getter(GeoProximityLocation::localZoneGroup)) .setter(setter(Builder::localZoneGroup)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LocalZoneGroup") .unmarshallLocationName("LocalZoneGroup").build()).build(); private static final SdkField COORDINATES_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("Coordinates") .getter(getter(GeoProximityLocation::coordinates)) .setter(setter(Builder::coordinates)) .constructor(Coordinates::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Coordinates") .unmarshallLocationName("Coordinates").build()).build(); private static final SdkField BIAS_FIELD = SdkField . builder(MarshallingType.INTEGER) .memberName("Bias") .getter(getter(GeoProximityLocation::bias)) .setter(setter(Builder::bias)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Bias") .unmarshallLocationName("Bias").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AWS_REGION_FIELD, LOCAL_ZONE_GROUP_FIELD, COORDINATES_FIELD, BIAS_FIELD)); private static final long serialVersionUID = 1L; private final String awsRegion; private final String localZoneGroup; private final Coordinates coordinates; private final Integer bias; private GeoProximityLocation(BuilderImpl builder) { this.awsRegion = builder.awsRegion; this.localZoneGroup = builder.localZoneGroup; this.coordinates = builder.coordinates; this.bias = builder.bias; } /** *

* The Amazon Web Services Region the resource you are directing DNS traffic to, is in. *

* * @return The Amazon Web Services Region the resource you are directing DNS traffic to, is in. */ public final String awsRegion() { return awsRegion; } /** *

* Specifies an Amazon Web Services Local Zone Group. *

*

* A local Zone Group is usually the Local Zone code without the ending character. For example, if the Local Zone is * us-east-1-bue-1a the Local Zone Group is us-east-1-bue-1. *

*

* You can identify the Local Zones Group for a specific Local Zone by using the describe-availability-zones CLI command: *

*

* This command returns: "GroupName": "us-west-2-den-1", specifying that the Local Zone * us-west-2-den-1a belongs to the Local Zone Group us-west-2-den-1. *

* * @return Specifies an Amazon Web Services Local Zone Group.

*

* A local Zone Group is usually the Local Zone code without the ending character. For example, if the Local * Zone is us-east-1-bue-1a the Local Zone Group is us-east-1-bue-1. *

*

* You can identify the Local Zones Group for a specific Local Zone by using the describe-availability-zones CLI command: *

*

* This command returns: "GroupName": "us-west-2-den-1", specifying that the Local Zone * us-west-2-den-1a belongs to the Local Zone Group us-west-2-den-1. */ public final String localZoneGroup() { return localZoneGroup; } /** *

* Contains the longitude and latitude for a geographic region. *

* * @return Contains the longitude and latitude for a geographic region. */ public final Coordinates coordinates() { return coordinates; } /** *

* The bias increases or decreases the size of the geographic region from which Route 53 routes traffic to a * resource. *

*

* To use Bias to change the size of the geographic region, specify the applicable value for the bias: *

*
    *
  • *

    * To expand the size of the geographic region from which Route 53 routes traffic to a resource, specify a positive * integer from 1 to 99 for the bias. Route 53 shrinks the size of adjacent regions. *

    *
  • *
  • *

    * To shrink the size of the geographic region from which Route 53 routes traffic to a resource, specify a negative * bias of -1 to -99. Route 53 expands the size of adjacent regions. *

    *
  • *
* * @return The bias increases or decreases the size of the geographic region from which Route 53 routes traffic to a * resource.

*

* To use Bias to change the size of the geographic region, specify the applicable value for * the bias: *

*
    *
  • *

    * To expand the size of the geographic region from which Route 53 routes traffic to a resource, specify a * positive integer from 1 to 99 for the bias. Route 53 shrinks the size of adjacent regions. *

    *
  • *
  • *

    * To shrink the size of the geographic region from which Route 53 routes traffic to a resource, specify a * negative bias of -1 to -99. Route 53 expands the size of adjacent regions. *

    *
  • */ public final Integer bias() { return bias; } @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(awsRegion()); hashCode = 31 * hashCode + Objects.hashCode(localZoneGroup()); hashCode = 31 * hashCode + Objects.hashCode(coordinates()); hashCode = 31 * hashCode + Objects.hashCode(bias()); 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 GeoProximityLocation)) { return false; } GeoProximityLocation other = (GeoProximityLocation) obj; return Objects.equals(awsRegion(), other.awsRegion()) && Objects.equals(localZoneGroup(), other.localZoneGroup()) && Objects.equals(coordinates(), other.coordinates()) && Objects.equals(bias(), other.bias()); } /** * 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("GeoProximityLocation").add("AWSRegion", awsRegion()).add("LocalZoneGroup", localZoneGroup()) .add("Coordinates", coordinates()).add("Bias", bias()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AWSRegion": return Optional.ofNullable(clazz.cast(awsRegion())); case "LocalZoneGroup": return Optional.ofNullable(clazz.cast(localZoneGroup())); case "Coordinates": return Optional.ofNullable(clazz.cast(coordinates())); case "Bias": return Optional.ofNullable(clazz.cast(bias())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((GeoProximityLocation) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

    * The Amazon Web Services Region the resource you are directing DNS traffic to, is in. *

    * * @param awsRegion * The Amazon Web Services Region the resource you are directing DNS traffic to, is in. * @return Returns a reference to this object so that method calls can be chained together. */ Builder awsRegion(String awsRegion); /** *

    * Specifies an Amazon Web Services Local Zone Group. *

    *

    * A local Zone Group is usually the Local Zone code without the ending character. For example, if the Local * Zone is us-east-1-bue-1a the Local Zone Group is us-east-1-bue-1. *

    *

    * You can identify the Local Zones Group for a specific Local Zone by using the describe-availability-zones CLI command: *

    *

    * This command returns: "GroupName": "us-west-2-den-1", specifying that the Local Zone * us-west-2-den-1a belongs to the Local Zone Group us-west-2-den-1. *

    * * @param localZoneGroup * Specifies an Amazon Web Services Local Zone Group.

    *

    * A local Zone Group is usually the Local Zone code without the ending character. For example, if the * Local Zone is us-east-1-bue-1a the Local Zone Group is us-east-1-bue-1. *

    *

    * You can identify the Local Zones Group for a specific Local Zone by using the describe-availability-zones CLI command: *

    *

    * This command returns: "GroupName": "us-west-2-den-1", specifying that the Local Zone * us-west-2-den-1a belongs to the Local Zone Group us-west-2-den-1. * @return Returns a reference to this object so that method calls can be chained together. */ Builder localZoneGroup(String localZoneGroup); /** *

    * Contains the longitude and latitude for a geographic region. *

    * * @param coordinates * Contains the longitude and latitude for a geographic region. * @return Returns a reference to this object so that method calls can be chained together. */ Builder coordinates(Coordinates coordinates); /** *

    * Contains the longitude and latitude for a geographic region. *

    * This is a convenience method that creates an instance of the {@link Coordinates.Builder} avoiding the need to * create one manually via {@link Coordinates#builder()}. * *

    * When the {@link Consumer} completes, {@link Coordinates.Builder#build()} is called immediately and its result * is passed to {@link #coordinates(Coordinates)}. * * @param coordinates * a consumer that will call methods on {@link Coordinates.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #coordinates(Coordinates) */ default Builder coordinates(Consumer coordinates) { return coordinates(Coordinates.builder().applyMutation(coordinates).build()); } /** *

    * The bias increases or decreases the size of the geographic region from which Route 53 routes traffic to a * resource. *

    *

    * To use Bias to change the size of the geographic region, specify the applicable value for the * bias: *

    *
      *
    • *

      * To expand the size of the geographic region from which Route 53 routes traffic to a resource, specify a * positive integer from 1 to 99 for the bias. Route 53 shrinks the size of adjacent regions. *

      *
    • *
    • *

      * To shrink the size of the geographic region from which Route 53 routes traffic to a resource, specify a * negative bias of -1 to -99. Route 53 expands the size of adjacent regions. *

      *
    • *
    * * @param bias * The bias increases or decreases the size of the geographic region from which Route 53 routes traffic * to a resource.

    *

    * To use Bias to change the size of the geographic region, specify the applicable value for * the bias: *

    *
      *
    • *

      * To expand the size of the geographic region from which Route 53 routes traffic to a resource, specify * a positive integer from 1 to 99 for the bias. Route 53 shrinks the size of adjacent regions. *

      *
    • *
    • *

      * To shrink the size of the geographic region from which Route 53 routes traffic to a resource, specify * a negative bias of -1 to -99. Route 53 expands the size of adjacent regions. *

      *
    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder bias(Integer bias); } static final class BuilderImpl implements Builder { private String awsRegion; private String localZoneGroup; private Coordinates coordinates; private Integer bias; private BuilderImpl() { } private BuilderImpl(GeoProximityLocation model) { awsRegion(model.awsRegion); localZoneGroup(model.localZoneGroup); coordinates(model.coordinates); bias(model.bias); } public final String getAwsRegion() { return awsRegion; } public final void setAwsRegion(String awsRegion) { this.awsRegion = awsRegion; } @Override public final Builder awsRegion(String awsRegion) { this.awsRegion = awsRegion; return this; } public final String getLocalZoneGroup() { return localZoneGroup; } public final void setLocalZoneGroup(String localZoneGroup) { this.localZoneGroup = localZoneGroup; } @Override public final Builder localZoneGroup(String localZoneGroup) { this.localZoneGroup = localZoneGroup; return this; } public final Coordinates.Builder getCoordinates() { return coordinates != null ? coordinates.toBuilder() : null; } public final void setCoordinates(Coordinates.BuilderImpl coordinates) { this.coordinates = coordinates != null ? coordinates.build() : null; } @Override public final Builder coordinates(Coordinates coordinates) { this.coordinates = coordinates; return this; } public final Integer getBias() { return bias; } public final void setBias(Integer bias) { this.bias = bias; } @Override public final Builder bias(Integer bias) { this.bias = bias; return this; } @Override public GeoProximityLocation build() { return new GeoProximityLocation(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy