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

package com.azure.resourcemanager.selfhelp.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.selfhelp.models.Diagnostic;
import com.azure.resourcemanager.selfhelp.models.DiagnosticInvocation;
import com.azure.resourcemanager.selfhelp.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Diagnostic resource properties. */
@Fluent
public final class DiagnosticResourceProperties {
    /*
     * Global parameters that can be passed to all solutionIds.
     */
    @JsonProperty(value = "globalParameters")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> globalParameters;

    /*
     * SolutionIds that are needed to be invoked.
     */
    @JsonProperty(value = "insights")
    private List<DiagnosticInvocation> insights;

    /*
     * Diagnostic Request Accepted time.
     */
    @JsonProperty(value = "acceptedAt", access = JsonProperty.Access.WRITE_ONLY)
    private String acceptedAt;

    /*
     * Status of diagnostic provisioning.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * Array of Diagnostics.
     */
    @JsonProperty(value = "diagnostics", access = JsonProperty.Access.WRITE_ONLY)
    private List<Diagnostic> diagnostics;

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

    /**
     * Get the globalParameters property: Global parameters that can be passed to all solutionIds.
     *
     * @return the globalParameters value.
     */
    public Map<String, String> globalParameters() {
        return this.globalParameters;
    }

    /**
     * Set the globalParameters property: Global parameters that can be passed to all solutionIds.
     *
     * @param globalParameters the globalParameters value to set.
     * @return the DiagnosticResourceProperties object itself.
     */
    public DiagnosticResourceProperties withGlobalParameters(Map<String, String> globalParameters) {
        this.globalParameters = globalParameters;
        return this;
    }

    /**
     * Get the insights property: SolutionIds that are needed to be invoked.
     *
     * @return the insights value.
     */
    public List<DiagnosticInvocation> insights() {
        return this.insights;
    }

    /**
     * Set the insights property: SolutionIds that are needed to be invoked.
     *
     * @param insights the insights value to set.
     * @return the DiagnosticResourceProperties object itself.
     */
    public DiagnosticResourceProperties withInsights(List<DiagnosticInvocation> insights) {
        this.insights = insights;
        return this;
    }

    /**
     * Get the acceptedAt property: Diagnostic Request Accepted time.
     *
     * @return the acceptedAt value.
     */
    public String acceptedAt() {
        return this.acceptedAt;
    }

    /**
     * Get the provisioningState property: Status of diagnostic provisioning.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the diagnostics property: Array of Diagnostics.
     *
     * @return the diagnostics value.
     */
    public List<Diagnostic> diagnostics() {
        return this.diagnostics;
    }

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