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

package com.azure.resourcemanager.recoveryservicesbackup.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Details about inquired protectable items under a given container. */
@Fluent
public final class InquiryInfo {
    /*
     * Inquiry Status for this container such as
     * InProgress | Failed | Succeeded
     */
    @JsonProperty(value = "status")
    private String status;

    /*
     * Error Details if the Status is non-success.
     */
    @JsonProperty(value = "errorDetail")
    private ErrorDetail errorDetail;

    /*
     * Inquiry Details which will have workload specific details.
     * For e.g. - For SQL and oracle this will contain different details.
     */
    @JsonProperty(value = "inquiryDetails")
    private List<WorkloadInquiryDetails> inquiryDetails;

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

    /**
     * Get the status property: Inquiry Status for this container such as InProgress | Failed | Succeeded.
     *
     * @return the status value.
     */
    public String status() {
        return this.status;
    }

    /**
     * Set the status property: Inquiry Status for this container such as InProgress | Failed | Succeeded.
     *
     * @param status the status value to set.
     * @return the InquiryInfo object itself.
     */
    public InquiryInfo withStatus(String status) {
        this.status = status;
        return this;
    }

    /**
     * Get the errorDetail property: Error Details if the Status is non-success.
     *
     * @return the errorDetail value.
     */
    public ErrorDetail errorDetail() {
        return this.errorDetail;
    }

    /**
     * Set the errorDetail property: Error Details if the Status is non-success.
     *
     * @param errorDetail the errorDetail value to set.
     * @return the InquiryInfo object itself.
     */
    public InquiryInfo withErrorDetail(ErrorDetail errorDetail) {
        this.errorDetail = errorDetail;
        return this;
    }

    /**
     * Get the inquiryDetails property: Inquiry Details which will have workload specific details. For e.g. - For SQL
     * and oracle this will contain different details.
     *
     * @return the inquiryDetails value.
     */
    public List<WorkloadInquiryDetails> inquiryDetails() {
        return this.inquiryDetails;
    }

    /**
     * Set the inquiryDetails property: Inquiry Details which will have workload specific details. For e.g. - For SQL
     * and oracle this will contain different details.
     *
     * @param inquiryDetails the inquiryDetails value to set.
     * @return the InquiryInfo object itself.
     */
    public InquiryInfo withInquiryDetails(List<WorkloadInquiryDetails> inquiryDetails) {
        this.inquiryDetails = inquiryDetails;
        return this;
    }

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