// 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.core.management.ProxyResource;
import com.azure.core.management.SystemData;
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.JsonProperty;
import java.util.List;
import java.util.Map;

/** Diagnostic resource. */
@Fluent
public final class DiagnosticResourceInner extends ProxyResource {
    /*
     * Diagnostic Resource properties.
     */
    @JsonProperty(value = "properties")
    private DiagnosticResourceProperties innerProperties;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: Diagnostic Resource properties.
     *
     * @return the innerProperties value.
     */
    private DiagnosticResourceProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

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

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

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

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

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

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

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

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