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

package com.azure.resourcemanager.sqlvirtualmachine.models;

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

/** Availability group replica configuration. */
@Fluent
public final class AgReplica {
    /*
     * Sql VirtualMachine Instance Id.
     */
    @JsonProperty(value = "sqlVirtualMachineInstanceId")
    private String sqlVirtualMachineInstanceId;

    /*
     * Replica Role in availability group.
     */
    @JsonProperty(value = "role")
    private Role role;

    /*
     * Replica commit mode in availability group.
     */
    @JsonProperty(value = "commit")
    private Commit commit;

    /*
     * Replica failover mode in availability group.
     */
    @JsonProperty(value = "failover")
    private Failover failover;

    /*
     * Replica readable secondary mode in availability group.
     */
    @JsonProperty(value = "readableSecondary")
    private ReadableSecondary readableSecondary;

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

    /**
     * Get the sqlVirtualMachineInstanceId property: Sql VirtualMachine Instance Id.
     *
     * @return the sqlVirtualMachineInstanceId value.
     */
    public String sqlVirtualMachineInstanceId() {
        return this.sqlVirtualMachineInstanceId;
    }

    /**
     * Set the sqlVirtualMachineInstanceId property: Sql VirtualMachine Instance Id.
     *
     * @param sqlVirtualMachineInstanceId the sqlVirtualMachineInstanceId value to set.
     * @return the AgReplica object itself.
     */
    public AgReplica withSqlVirtualMachineInstanceId(String sqlVirtualMachineInstanceId) {
        this.sqlVirtualMachineInstanceId = sqlVirtualMachineInstanceId;
        return this;
    }

    /**
     * Get the role property: Replica Role in availability group.
     *
     * @return the role value.
     */
    public Role role() {
        return this.role;
    }

    /**
     * Set the role property: Replica Role in availability group.
     *
     * @param role the role value to set.
     * @return the AgReplica object itself.
     */
    public AgReplica withRole(Role role) {
        this.role = role;
        return this;
    }

    /**
     * Get the commit property: Replica commit mode in availability group.
     *
     * @return the commit value.
     */
    public Commit commit() {
        return this.commit;
    }

    /**
     * Set the commit property: Replica commit mode in availability group.
     *
     * @param commit the commit value to set.
     * @return the AgReplica object itself.
     */
    public AgReplica withCommit(Commit commit) {
        this.commit = commit;
        return this;
    }

    /**
     * Get the failover property: Replica failover mode in availability group.
     *
     * @return the failover value.
     */
    public Failover failover() {
        return this.failover;
    }

    /**
     * Set the failover property: Replica failover mode in availability group.
     *
     * @param failover the failover value to set.
     * @return the AgReplica object itself.
     */
    public AgReplica withFailover(Failover failover) {
        this.failover = failover;
        return this;
    }

    /**
     * Get the readableSecondary property: Replica readable secondary mode in availability group.
     *
     * @return the readableSecondary value.
     */
    public ReadableSecondary readableSecondary() {
        return this.readableSecondary;
    }

    /**
     * Set the readableSecondary property: Replica readable secondary mode in availability group.
     *
     * @param readableSecondary the readableSecondary value to set.
     * @return the AgReplica object itself.
     */
    public AgReplica withReadableSecondary(ReadableSecondary readableSecondary) {
        this.readableSecondary = readableSecondary;
        return this;
    }

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