/* * 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.elasticloadbalancingv2.model; import java.io.Serializable; import javax.annotation.Generated; /** *

* Information about the current health of a target. *

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

* The state of the target. *

*/ private String state; /** *

* The reason code. *

*

* If the target state is healthy, a reason code is not provided. *

*

* If the target state is initial, the reason code can be one of the following values: *

* *

* If the target state is unhealthy, the reason code can be one of the following values: *

* *

* If the target state is unused, the reason code can be one of the following values: *

* *

* If the target state is draining, the reason code can be the following value: *

* *

* If the target state is unavailable, the reason code can be the following value: *

* */ private String reason; /** *

* A description of the target health that provides additional details. If the state is healthy, a * description is not provided. *

*/ private String description; /** *

* The state of the target. *

* * @param state * The state of the target. * @see TargetHealthStateEnum */ public void setState(String state) { this.state = state; } /** *

* The state of the target. *

* * @return The state of the target. * @see TargetHealthStateEnum */ public String getState() { return this.state; } /** *

* The state of the target. *

* * @param state * The state of the target. * @return Returns a reference to this object so that method calls can be chained together. * @see TargetHealthStateEnum */ public TargetHealth withState(String state) { setState(state); return this; } /** *

* The state of the target. *

* * @param state * The state of the target. * @see TargetHealthStateEnum */ public void setState(TargetHealthStateEnum state) { withState(state); } /** *

* The state of the target. *

* * @param state * The state of the target. * @return Returns a reference to this object so that method calls can be chained together. * @see TargetHealthStateEnum */ public TargetHealth withState(TargetHealthStateEnum state) { this.state = state.toString(); return this; } /** *

* The reason code. *

*

* If the target state is healthy, a reason code is not provided. *

*

* If the target state is initial, the reason code can be one of the following values: *

* *

* If the target state is unhealthy, the reason code can be one of the following values: *

* *

* If the target state is unused, the reason code can be one of the following values: *

* *

* If the target state is draining, the reason code can be the following value: *

* *

* If the target state is unavailable, the reason code can be the following value: *

* * * @param reason * The reason code.

*

* If the target state is healthy, a reason code is not provided. *

*

* If the target state is initial, the reason code can be one of the following values: *

* *

* If the target state is unhealthy, the reason code can be one of the following values: *

* *

* If the target state is unused, the reason code can be one of the following values: *

* *

* If the target state is draining, the reason code can be the following value: *

* *

* If the target state is unavailable, the reason code can be the following value: *

*