com.amazonaws.services.route53recoverycontrolconfig.model.RoutingControl Maven / Gradle / Ivy
/*
 * Copyright 2019-2024 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.route53recoverycontrolconfig.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
 * 
 * A routing control has one of two states: ON and OFF. You can map the routing control state to the state of an Amazon
 * Route 53 health check, which can be used to control traffic routing.
 * 
 * 
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RoutingControl implements Serializable, Cloneable, StructuredPojo {
    /**
     * 
     * The Amazon Resource Name (ARN) of the control panel that includes the routing control.
     * 
     */
    private String controlPanelArn;
    /**
     * 
     * The name of the routing control.
     * 
     */
    private String name;
    /**
     * 
     * The Amazon Resource Name (ARN) of the routing control.
     * 
     */
    private String routingControlArn;
    /**
     * 
     * The deployment status of a routing control. Status can be one of the following: PENDING, DEPLOYED,
     * PENDING_DELETION.
     * 
     */
    private String status;
    /**
     * 
     * The Amazon Web Services account ID of the routing control owner.
     * 
     */
    private String owner;
    /**
     * 
     * The Amazon Resource Name (ARN) of the control panel that includes the routing control.
     * 
     * 
     * @param controlPanelArn
     *        The Amazon Resource Name (ARN) of the control panel that includes the routing control.
     */
    public void setControlPanelArn(String controlPanelArn) {
        this.controlPanelArn = controlPanelArn;
    }
    /**
     * 
     * The Amazon Resource Name (ARN) of the control panel that includes the routing control.
     * 
     * 
     * @return The Amazon Resource Name (ARN) of the control panel that includes the routing control.
     */
    public String getControlPanelArn() {
        return this.controlPanelArn;
    }
    /**
     * 
     * The Amazon Resource Name (ARN) of the control panel that includes the routing control.
     * 
     * 
     * @param controlPanelArn
     *        The Amazon Resource Name (ARN) of the control panel that includes the routing control.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public RoutingControl withControlPanelArn(String controlPanelArn) {
        setControlPanelArn(controlPanelArn);
        return this;
    }
    /**
     * 
     * The name of the routing control.
     * 
     * 
     * @param name
     *        The name of the routing control.
     */
    public void setName(String name) {
        this.name = name;
    }
    /**
     * 
     * The name of the routing control.
     * 
     * 
     * @return The name of the routing control.
     */
    public String getName() {
        return this.name;
    }
    /**
     * 
     * The name of the routing control.
     * 
     * 
     * @param name
     *        The name of the routing control.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public RoutingControl withName(String name) {
        setName(name);
        return this;
    }
    /**
     * 
     * The Amazon Resource Name (ARN) of the routing control.
     * 
     * 
     * @param routingControlArn
     *        The Amazon Resource Name (ARN) of the routing control.
     */
    public void setRoutingControlArn(String routingControlArn) {
        this.routingControlArn = routingControlArn;
    }
    /**
     * 
     * The Amazon Resource Name (ARN) of the routing control.
     * 
     * 
     * @return The Amazon Resource Name (ARN) of the routing control.
     */
    public String getRoutingControlArn() {
        return this.routingControlArn;
    }
    /**
     * 
     * The Amazon Resource Name (ARN) of the routing control.
     * 
     * 
     * @param routingControlArn
     *        The Amazon Resource Name (ARN) of the routing control.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public RoutingControl withRoutingControlArn(String routingControlArn) {
        setRoutingControlArn(routingControlArn);
        return this;
    }
    /**
     * 
     * The deployment status of a routing control. Status can be one of the following: PENDING, DEPLOYED,
     * PENDING_DELETION.
     * 
     * 
     * @param status
     *        The deployment status of a routing control. Status can be one of the following: PENDING, DEPLOYED,
     *        PENDING_DELETION.
     * @see Status
     */
    public void setStatus(String status) {
        this.status = status;
    }
    /**
     * 
     * The deployment status of a routing control. Status can be one of the following: PENDING, DEPLOYED,
     * PENDING_DELETION.
     * 
     * 
     * @return The deployment status of a routing control. Status can be one of the following: PENDING, DEPLOYED,
     *         PENDING_DELETION.
     * @see Status
     */
    public String getStatus() {
        return this.status;
    }
    /**
     * 
     * The deployment status of a routing control. Status can be one of the following: PENDING, DEPLOYED,
     * PENDING_DELETION.
     * 
     * 
     * @param status
     *        The deployment status of a routing control. Status can be one of the following: PENDING, DEPLOYED,
     *        PENDING_DELETION.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see Status
     */
    public RoutingControl withStatus(String status) {
        setStatus(status);
        return this;
    }
    /**
     * 
     * The deployment status of a routing control. Status can be one of the following: PENDING, DEPLOYED,
     * PENDING_DELETION.
     * 
     * 
     * @param status
     *        The deployment status of a routing control. Status can be one of the following: PENDING, DEPLOYED,
     *        PENDING_DELETION.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see Status
     */
    public RoutingControl withStatus(Status status) {
        this.status = status.toString();
        return this;
    }
    /**
     * 
     * The Amazon Web Services account ID of the routing control owner.
     * 
     * 
     * @param owner
     *        The Amazon Web Services account ID of the routing control owner.
     */
    public void setOwner(String owner) {
        this.owner = owner;
    }
    /**
     * 
     * The Amazon Web Services account ID of the routing control owner.
     * 
     * 
     * @return The Amazon Web Services account ID of the routing control owner.
     */
    public String getOwner() {
        return this.owner;
    }
    /**
     * 
     * The Amazon Web Services account ID of the routing control owner.
     * 
     * 
     * @param owner
     *        The Amazon Web Services account ID of the routing control owner.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public RoutingControl withOwner(String owner) {
        setOwner(owner);
        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 (getControlPanelArn() != null)
            sb.append("ControlPanelArn: ").append(getControlPanelArn()).append(",");
        if (getName() != null)
            sb.append("Name: ").append(getName()).append(",");
        if (getRoutingControlArn() != null)
            sb.append("RoutingControlArn: ").append(getRoutingControlArn()).append(",");
        if (getStatus() != null)
            sb.append("Status: ").append(getStatus()).append(",");
        if (getOwner() != null)
            sb.append("Owner: ").append(getOwner());
        sb.append("}");
        return sb.toString();
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (obj instanceof RoutingControl == false)
            return false;
        RoutingControl other = (RoutingControl) obj;
        if (other.getControlPanelArn() == null ^ this.getControlPanelArn() == null)
            return false;
        if (other.getControlPanelArn() != null && other.getControlPanelArn().equals(this.getControlPanelArn()) == 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.getRoutingControlArn() == null ^ this.getRoutingControlArn() == null)
            return false;
        if (other.getRoutingControlArn() != null && other.getRoutingControlArn().equals(this.getRoutingControlArn()) == false)
            return false;
        if (other.getStatus() == null ^ this.getStatus() == null)
            return false;
        if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
            return false;
        if (other.getOwner() == null ^ this.getOwner() == null)
            return false;
        if (other.getOwner() != null && other.getOwner().equals(this.getOwner()) == false)
            return false;
        return true;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        hashCode = prime * hashCode + ((getControlPanelArn() == null) ? 0 : getControlPanelArn().hashCode());
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
        hashCode = prime * hashCode + ((getRoutingControlArn() == null) ? 0 : getRoutingControlArn().hashCode());
        hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
        hashCode = prime * hashCode + ((getOwner() == null) ? 0 : getOwner().hashCode());
        return hashCode;
    }
    @Override
    public RoutingControl clone() {
        try {
            return (RoutingControl) 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.route53recoverycontrolconfig.model.transform.RoutingControlMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}