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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.appservice.models.DetectorInfo;
import com.azure.resourcemanager.appservice.models.DiagnosticData;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** DetectorResponse resource specific properties. */
@Fluent
public final class DetectorResponseProperties {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(DetectorResponseProperties.class);

    /*
     * metadata for the detector
     */
    @JsonProperty(value = "metadata")
    private DetectorInfo metadata;

    /*
     * Data Set
     */
    @JsonProperty(value = "dataset")
    private List<DiagnosticData> dataset;

    /**
     * Get the metadata property: metadata for the detector.
     *
     * @return the metadata value.
     */
    public DetectorInfo metadata() {
        return this.metadata;
    }

    /**
     * Set the metadata property: metadata for the detector.
     *
     * @param metadata the metadata value to set.
     * @return the DetectorResponseProperties object itself.
     */
    public DetectorResponseProperties withMetadata(DetectorInfo metadata) {
        this.metadata = metadata;
        return this;
    }

    /**
     * Get the dataset property: Data Set.
     *
     * @return the dataset value.
     */
    public List<DiagnosticData> dataset() {
        return this.dataset;
    }

    /**
     * Set the dataset property: Data Set.
     *
     * @param dataset the dataset value to set.
     * @return the DetectorResponseProperties object itself.
     */
    public DetectorResponseProperties withDataset(List<DiagnosticData> dataset) {
        this.dataset = dataset;
        return this;
    }

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