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

package com.azure.resourcemanager.workloads.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Gets or sets the HA software configuration. */
@Fluent
public final class HighAvailabilitySoftwareConfiguration {
    /*
     * The fencing client id.
     */
    @JsonProperty(value = "fencingClientId", required = true)
    private String fencingClientId;

    /*
     * The fencing client id secret/password. The secret should never expire. This will be used pacemaker to start/stop
     * the cluster VMs.
     */
    @JsonProperty(value = "fencingClientPassword", required = true)
    private String fencingClientPassword;

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

    /**
     * Get the fencingClientId property: The fencing client id.
     *
     * @return the fencingClientId value.
     */
    public String fencingClientId() {
        return this.fencingClientId;
    }

    /**
     * Set the fencingClientId property: The fencing client id.
     *
     * @param fencingClientId the fencingClientId value to set.
     * @return the HighAvailabilitySoftwareConfiguration object itself.
     */
    public HighAvailabilitySoftwareConfiguration withFencingClientId(String fencingClientId) {
        this.fencingClientId = fencingClientId;
        return this;
    }

    /**
     * Get the fencingClientPassword property: The fencing client id secret/password. The secret should never expire.
     * This will be used pacemaker to start/stop the cluster VMs.
     *
     * @return the fencingClientPassword value.
     */
    public String fencingClientPassword() {
        return this.fencingClientPassword;
    }

    /**
     * Set the fencingClientPassword property: The fencing client id secret/password. The secret should never expire.
     * This will be used pacemaker to start/stop the cluster VMs.
     *
     * @param fencingClientPassword the fencingClientPassword value to set.
     * @return the HighAvailabilitySoftwareConfiguration object itself.
     */
    public HighAvailabilitySoftwareConfiguration withFencingClientPassword(String fencingClientPassword) {
        this.fencingClientPassword = fencingClientPassword;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (fencingClientId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property fencingClientId in model HighAvailabilitySoftwareConfiguration"));
        }
        if (fencingClientPassword() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property fencingClientPassword in model"
                            + " HighAvailabilitySoftwareConfiguration"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(HighAvailabilitySoftwareConfiguration.class);
}
