// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.postgresqlflexibleserver.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** High availability properties of a server. */
@Fluent
public final class HighAvailability {
    /*
     * The HA mode for the server.
     */
    @JsonProperty(value = "mode")
    private HighAvailabilityMode mode;

    /*
     * A state of a HA server that is visible to user.
     */
    @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY)
    private ServerHAState state;

    /*
     * availability zone information of the standby.
     */
    @JsonProperty(value = "standbyAvailabilityZone")
    private String standbyAvailabilityZone;

    /** Creates an instance of HighAvailability class. */
    public HighAvailability() {
    }

    /**
     * Get the mode property: The HA mode for the server.
     *
     * @return the mode value.
     */
    public HighAvailabilityMode mode() {
        return this.mode;
    }

    /**
     * Set the mode property: The HA mode for the server.
     *
     * @param mode the mode value to set.
     * @return the HighAvailability object itself.
     */
    public HighAvailability withMode(HighAvailabilityMode mode) {
        this.mode = mode;
        return this;
    }

    /**
     * Get the state property: A state of a HA server that is visible to user.
     *
     * @return the state value.
     */
    public ServerHAState state() {
        return this.state;
    }

    /**
     * Get the standbyAvailabilityZone property: availability zone information of the standby.
     *
     * @return the standbyAvailabilityZone value.
     */
    public String standbyAvailabilityZone() {
        return this.standbyAvailabilityZone;
    }

    /**
     * Set the standbyAvailabilityZone property: availability zone information of the standby.
     *
     * @param standbyAvailabilityZone the standbyAvailabilityZone value to set.
     * @return the HighAvailability object itself.
     */
    public HighAvailability withStandbyAvailabilityZone(String standbyAvailabilityZone) {
        this.standbyAvailabilityZone = standbyAvailabilityZone;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}
