/* * 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.route53.model; import java.io.Serializable; import javax.annotation.Generated; /** *
* A complex type that contains settings for the new traffic policy instance. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class TrafficPolicyInstance implements Serializable, Cloneable { /** ** The ID that Amazon Route 53 assigned to the new traffic policy instance. *
*/ private String id; /** ** The ID of the hosted zone that Amazon Route 53 created resource record sets in. *
*/ private String hostedZoneId; /** ** The DNS name, such as www.example.com, for which Amazon Route 53 responds to queries by using the resource record * sets that are associated with this traffic policy instance. *
*/ private String name; /** ** The TTL that Amazon Route 53 assigned to all of the resource record sets that it created in the specified hosted * zone. *
*/ private Long tTL; /** *
* The value of State
is one of the following values:
*
* Amazon Route 53 has finished creating resource record sets, and changes have propagated to all Route 53 edge * locations. *
*
* Route 53 is creating the resource record sets. Use GetTrafficPolicyInstance
to confirm that the
* CreateTrafficPolicyInstance
request completed successfully.
*
* Route 53 wasn't able to create or update the resource record sets. When the value of State
is
* Failed
, see Message
for an explanation of what caused the request to fail.
*
* If State
is Failed
, an explanation of the reason for the failure. If State
* is another value, Message
is empty.
*
* The ID of the traffic policy that Amazon Route 53 used to create resource record sets in the specified hosted * zone. *
*/ private String trafficPolicyId; /** ** The version of the traffic policy that Amazon Route 53 used to create resource record sets in the specified * hosted zone. *
*/ private Integer trafficPolicyVersion; /** ** The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this traffic * policy instance. *
*/ private String trafficPolicyType; /** ** The ID that Amazon Route 53 assigned to the new traffic policy instance. *
* * @param id * The ID that Amazon Route 53 assigned to the new traffic policy instance. */ public void setId(String id) { this.id = id; } /** ** The ID that Amazon Route 53 assigned to the new traffic policy instance. *
* * @return The ID that Amazon Route 53 assigned to the new traffic policy instance. */ public String getId() { return this.id; } /** ** The ID that Amazon Route 53 assigned to the new traffic policy instance. *
* * @param id * The ID that Amazon Route 53 assigned to the new traffic policy instance. * @return Returns a reference to this object so that method calls can be chained together. */ public TrafficPolicyInstance withId(String id) { setId(id); return this; } /** ** The ID of the hosted zone that Amazon Route 53 created resource record sets in. *
* * @param hostedZoneId * The ID of the hosted zone that Amazon Route 53 created resource record sets in. */ public void setHostedZoneId(String hostedZoneId) { this.hostedZoneId = hostedZoneId; } /** ** The ID of the hosted zone that Amazon Route 53 created resource record sets in. *
* * @return The ID of the hosted zone that Amazon Route 53 created resource record sets in. */ public String getHostedZoneId() { return this.hostedZoneId; } /** ** The ID of the hosted zone that Amazon Route 53 created resource record sets in. *
* * @param hostedZoneId * The ID of the hosted zone that Amazon Route 53 created resource record sets in. * @return Returns a reference to this object so that method calls can be chained together. */ public TrafficPolicyInstance withHostedZoneId(String hostedZoneId) { setHostedZoneId(hostedZoneId); return this; } /** ** The DNS name, such as www.example.com, for which Amazon Route 53 responds to queries by using the resource record * sets that are associated with this traffic policy instance. *
* * @param name * The DNS name, such as www.example.com, for which Amazon Route 53 responds to queries by using the resource * record sets that are associated with this traffic policy instance. */ public void setName(String name) { this.name = name; } /** ** The DNS name, such as www.example.com, for which Amazon Route 53 responds to queries by using the resource record * sets that are associated with this traffic policy instance. *
* * @return The DNS name, such as www.example.com, for which Amazon Route 53 responds to queries by using the * resource record sets that are associated with this traffic policy instance. */ public String getName() { return this.name; } /** ** The DNS name, such as www.example.com, for which Amazon Route 53 responds to queries by using the resource record * sets that are associated with this traffic policy instance. *
* * @param name * The DNS name, such as www.example.com, for which Amazon Route 53 responds to queries by using the resource * record sets that are associated with this traffic policy instance. * @return Returns a reference to this object so that method calls can be chained together. */ public TrafficPolicyInstance withName(String name) { setName(name); return this; } /** ** The TTL that Amazon Route 53 assigned to all of the resource record sets that it created in the specified hosted * zone. *
* * @param tTL * The TTL that Amazon Route 53 assigned to all of the resource record sets that it created in the specified * hosted zone. */ public void setTTL(Long tTL) { this.tTL = tTL; } /** ** The TTL that Amazon Route 53 assigned to all of the resource record sets that it created in the specified hosted * zone. *
* * @return The TTL that Amazon Route 53 assigned to all of the resource record sets that it created in the specified * hosted zone. */ public Long getTTL() { return this.tTL; } /** ** The TTL that Amazon Route 53 assigned to all of the resource record sets that it created in the specified hosted * zone. *
* * @param tTL * The TTL that Amazon Route 53 assigned to all of the resource record sets that it created in the specified * hosted zone. * @return Returns a reference to this object so that method calls can be chained together. */ public TrafficPolicyInstance withTTL(Long tTL) { setTTL(tTL); return this; } /** *
* The value of State
is one of the following values:
*
* Amazon Route 53 has finished creating resource record sets, and changes have propagated to all Route 53 edge * locations. *
*
* Route 53 is creating the resource record sets. Use GetTrafficPolicyInstance
to confirm that the
* CreateTrafficPolicyInstance
request completed successfully.
*
* Route 53 wasn't able to create or update the resource record sets. When the value of State
is
* Failed
, see Message
for an explanation of what caused the request to fail.
*
State
is one of the following values:
* * Amazon Route 53 has finished creating resource record sets, and changes have propagated to all Route 53 * edge locations. *
*
* Route 53 is creating the resource record sets. Use GetTrafficPolicyInstance
to confirm that
* the CreateTrafficPolicyInstance
request completed successfully.
*
* Route 53 wasn't able to create or update the resource record sets. When the value of State
is
* Failed
, see Message
for an explanation of what caused the request to fail.
*
* The value of State
is one of the following values:
*
* Amazon Route 53 has finished creating resource record sets, and changes have propagated to all Route 53 edge * locations. *
*
* Route 53 is creating the resource record sets. Use GetTrafficPolicyInstance
to confirm that the
* CreateTrafficPolicyInstance
request completed successfully.
*
* Route 53 wasn't able to create or update the resource record sets. When the value of State
is
* Failed
, see Message
for an explanation of what caused the request to fail.
*
State
is one of the following values:
* * Amazon Route 53 has finished creating resource record sets, and changes have propagated to all Route 53 * edge locations. *
*
* Route 53 is creating the resource record sets. Use GetTrafficPolicyInstance
to confirm that
* the CreateTrafficPolicyInstance
request completed successfully.
*
* Route 53 wasn't able to create or update the resource record sets. When the value of State
* is Failed
, see Message
for an explanation of what caused the request to fail.
*
* The value of State
is one of the following values:
*
* Amazon Route 53 has finished creating resource record sets, and changes have propagated to all Route 53 edge * locations. *
*
* Route 53 is creating the resource record sets. Use GetTrafficPolicyInstance
to confirm that the
* CreateTrafficPolicyInstance
request completed successfully.
*
* Route 53 wasn't able to create or update the resource record sets. When the value of State
is
* Failed
, see Message
for an explanation of what caused the request to fail.
*
State
is one of the following values:
* * Amazon Route 53 has finished creating resource record sets, and changes have propagated to all Route 53 * edge locations. *
*
* Route 53 is creating the resource record sets. Use GetTrafficPolicyInstance
to confirm that
* the CreateTrafficPolicyInstance
request completed successfully.
*
* Route 53 wasn't able to create or update the resource record sets. When the value of State
is
* Failed
, see Message
for an explanation of what caused the request to fail.
*
* If State
is Failed
, an explanation of the reason for the failure. If State
* is another value, Message
is empty.
*
State
is Failed
, an explanation of the reason for the failure. If
* State
is another value, Message
is empty.
*/
public void setMessage(String message) {
this.message = message;
}
/**
*
* If State
is Failed
, an explanation of the reason for the failure. If State
* is another value, Message
is empty.
*
State
is Failed
, an explanation of the reason for the failure. If
* State
is another value, Message
is empty.
*/
public String getMessage() {
return this.message;
}
/**
*
* If State
is Failed
, an explanation of the reason for the failure. If State
* is another value, Message
is empty.
*
State
is Failed
, an explanation of the reason for the failure. If
* State
is another value, Message
is empty.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TrafficPolicyInstance withMessage(String message) {
setMessage(message);
return this;
}
/**
* * The ID of the traffic policy that Amazon Route 53 used to create resource record sets in the specified hosted * zone. *
* * @param trafficPolicyId * The ID of the traffic policy that Amazon Route 53 used to create resource record sets in the specified * hosted zone. */ public void setTrafficPolicyId(String trafficPolicyId) { this.trafficPolicyId = trafficPolicyId; } /** ** The ID of the traffic policy that Amazon Route 53 used to create resource record sets in the specified hosted * zone. *
* * @return The ID of the traffic policy that Amazon Route 53 used to create resource record sets in the specified * hosted zone. */ public String getTrafficPolicyId() { return this.trafficPolicyId; } /** ** The ID of the traffic policy that Amazon Route 53 used to create resource record sets in the specified hosted * zone. *
* * @param trafficPolicyId * The ID of the traffic policy that Amazon Route 53 used to create resource record sets in the specified * hosted zone. * @return Returns a reference to this object so that method calls can be chained together. */ public TrafficPolicyInstance withTrafficPolicyId(String trafficPolicyId) { setTrafficPolicyId(trafficPolicyId); return this; } /** ** The version of the traffic policy that Amazon Route 53 used to create resource record sets in the specified * hosted zone. *
* * @param trafficPolicyVersion * The version of the traffic policy that Amazon Route 53 used to create resource record sets in the * specified hosted zone. */ public void setTrafficPolicyVersion(Integer trafficPolicyVersion) { this.trafficPolicyVersion = trafficPolicyVersion; } /** ** The version of the traffic policy that Amazon Route 53 used to create resource record sets in the specified * hosted zone. *
* * @return The version of the traffic policy that Amazon Route 53 used to create resource record sets in the * specified hosted zone. */ public Integer getTrafficPolicyVersion() { return this.trafficPolicyVersion; } /** ** The version of the traffic policy that Amazon Route 53 used to create resource record sets in the specified * hosted zone. *
* * @param trafficPolicyVersion * The version of the traffic policy that Amazon Route 53 used to create resource record sets in the * specified hosted zone. * @return Returns a reference to this object so that method calls can be chained together. */ public TrafficPolicyInstance withTrafficPolicyVersion(Integer trafficPolicyVersion) { setTrafficPolicyVersion(trafficPolicyVersion); return this; } /** ** The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this traffic * policy instance. *
* * @param trafficPolicyType * The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this * traffic policy instance. * @see RRType */ public void setTrafficPolicyType(String trafficPolicyType) { this.trafficPolicyType = trafficPolicyType; } /** ** The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this traffic * policy instance. *
* * @return The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this * traffic policy instance. * @see RRType */ public String getTrafficPolicyType() { return this.trafficPolicyType; } /** ** The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this traffic * policy instance. *
* * @param trafficPolicyType * The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this * traffic policy instance. * @return Returns a reference to this object so that method calls can be chained together. * @see RRType */ public TrafficPolicyInstance withTrafficPolicyType(String trafficPolicyType) { setTrafficPolicyType(trafficPolicyType); return this; } /** ** The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this traffic * policy instance. *
* * @param trafficPolicyType * The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this * traffic policy instance. * @see RRType */ public void setTrafficPolicyType(RRType trafficPolicyType) { withTrafficPolicyType(trafficPolicyType); } /** ** The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this traffic * policy instance. *
* * @param trafficPolicyType * The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this * traffic policy instance. * @return Returns a reference to this object so that method calls can be chained together. * @see RRType */ public TrafficPolicyInstance withTrafficPolicyType(RRType trafficPolicyType) { this.trafficPolicyType = trafficPolicyType.toString(); 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 (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getHostedZoneId() != null) sb.append("HostedZoneId: ").append(getHostedZoneId()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getTTL() != null) sb.append("TTL: ").append(getTTL()).append(","); if (getState() != null) sb.append("State: ").append(getState()).append(","); if (getMessage() != null) sb.append("Message: ").append(getMessage()).append(","); if (getTrafficPolicyId() != null) sb.append("TrafficPolicyId: ").append(getTrafficPolicyId()).append(","); if (getTrafficPolicyVersion() != null) sb.append("TrafficPolicyVersion: ").append(getTrafficPolicyVersion()).append(","); if (getTrafficPolicyType() != null) sb.append("TrafficPolicyType: ").append(getTrafficPolicyType()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TrafficPolicyInstance == false) return false; TrafficPolicyInstance other = (TrafficPolicyInstance) obj; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getHostedZoneId() == null ^ this.getHostedZoneId() == null) return false; if (other.getHostedZoneId() != null && other.getHostedZoneId().equals(this.getHostedZoneId()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getTTL() == null ^ this.getTTL() == null) return false; if (other.getTTL() != null && other.getTTL().equals(this.getTTL()) == false) return false; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false; if (other.getMessage() == null ^ this.getMessage() == null) return false; if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == false) return false; if (other.getTrafficPolicyId() == null ^ this.getTrafficPolicyId() == null) return false; if (other.getTrafficPolicyId() != null && other.getTrafficPolicyId().equals(this.getTrafficPolicyId()) == false) return false; if (other.getTrafficPolicyVersion() == null ^ this.getTrafficPolicyVersion() == null) return false; if (other.getTrafficPolicyVersion() != null && other.getTrafficPolicyVersion().equals(this.getTrafficPolicyVersion()) == false) return false; if (other.getTrafficPolicyType() == null ^ this.getTrafficPolicyType() == null) return false; if (other.getTrafficPolicyType() != null && other.getTrafficPolicyType().equals(this.getTrafficPolicyType()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getHostedZoneId() == null) ? 0 : getHostedZoneId().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getTTL() == null) ? 0 : getTTL().hashCode()); hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode()); hashCode = prime * hashCode + ((getTrafficPolicyId() == null) ? 0 : getTrafficPolicyId().hashCode()); hashCode = prime * hashCode + ((getTrafficPolicyVersion() == null) ? 0 : getTrafficPolicyVersion().hashCode()); hashCode = prime * hashCode + ((getTrafficPolicyType() == null) ? 0 : getTrafficPolicyType().hashCode()); return hashCode; } @Override public TrafficPolicyInstance clone() { try { return (TrafficPolicyInstance) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }