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

package com.azure.resourcemanager.recoveryservicessiterecovery.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** DRA details. */
@Immutable
public final class DraDetails {
    /*
     * The DRA Id.
     */
    @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
    private String id;

    /*
     * The DRA name.
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * The DRA Bios Id.
     */
    @JsonProperty(value = "biosId", access = JsonProperty.Access.WRITE_ONLY)
    private String biosId;

    /*
     * The version.
     */
    @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY)
    private String version;

    /*
     * The last heartbeat received from the DRA.
     */
    @JsonProperty(value = "lastHeartbeatUtc", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime lastHeartbeatUtc;

    /*
     * The health.
     */
    @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY)
    private ProtectionHealth health;

    /*
     * The health errors.
     */
    @JsonProperty(value = "healthErrors", access = JsonProperty.Access.WRITE_ONLY)
    private List<HealthError> healthErrors;

    /*
     * The count of protected items which are protected in forward direction.
     */
    @JsonProperty(value = "forwardProtectedItemCount", access = JsonProperty.Access.WRITE_ONLY)
    private Integer forwardProtectedItemCount;

    /*
     * The count of protected items which are protected in reverse direction.
     */
    @JsonProperty(value = "reverseProtectedItemCount", access = JsonProperty.Access.WRITE_ONLY)
    private Integer reverseProtectedItemCount;

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

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

    /**
     * Get the name property: The DRA name.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the biosId property: The DRA Bios Id.
     *
     * @return the biosId value.
     */
    public String biosId() {
        return this.biosId;
    }

    /**
     * Get the version property: The version.
     *
     * @return the version value.
     */
    public String version() {
        return this.version;
    }

    /**
     * Get the lastHeartbeatUtc property: The last heartbeat received from the DRA.
     *
     * @return the lastHeartbeatUtc value.
     */
    public OffsetDateTime lastHeartbeatUtc() {
        return this.lastHeartbeatUtc;
    }

    /**
     * Get the health property: The health.
     *
     * @return the health value.
     */
    public ProtectionHealth health() {
        return this.health;
    }

    /**
     * Get the healthErrors property: The health errors.
     *
     * @return the healthErrors value.
     */
    public List<HealthError> healthErrors() {
        return this.healthErrors;
    }

    /**
     * Get the forwardProtectedItemCount property: The count of protected items which are protected in forward
     * direction.
     *
     * @return the forwardProtectedItemCount value.
     */
    public Integer forwardProtectedItemCount() {
        return this.forwardProtectedItemCount;
    }

    /**
     * Get the reverseProtectedItemCount property: The count of protected items which are protected in reverse
     * direction.
     *
     * @return the reverseProtectedItemCount value.
     */
    public Integer reverseProtectedItemCount() {
        return this.reverseProtectedItemCount;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (healthErrors() != null) {
            healthErrors().forEach(e -> e.validate());
        }
    }
}
