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

package com.azure.resourcemanager.appcontainers.models;

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

/** Details of a diagnostics data provider. */
@Fluent
public final class DiagnosticDataProviderMetadata {
    /*
     * Name of data provider
     */
    @JsonProperty(value = "providerName")
    private String providerName;

    /*
     * Collection of properties
     */
    @JsonProperty(value = "propertyBag")
    private List<DiagnosticDataProviderMetadataPropertyBagItem> propertyBag;

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

    /**
     * Get the providerName property: Name of data provider.
     *
     * @return the providerName value.
     */
    public String providerName() {
        return this.providerName;
    }

    /**
     * Set the providerName property: Name of data provider.
     *
     * @param providerName the providerName value to set.
     * @return the DiagnosticDataProviderMetadata object itself.
     */
    public DiagnosticDataProviderMetadata withProviderName(String providerName) {
        this.providerName = providerName;
        return this;
    }

    /**
     * Get the propertyBag property: Collection of properties.
     *
     * @return the propertyBag value.
     */
    public List<DiagnosticDataProviderMetadataPropertyBagItem> propertyBag() {
        return this.propertyBag;
    }

    /**
     * Set the propertyBag property: Collection of properties.
     *
     * @param propertyBag the propertyBag value to set.
     * @return the DiagnosticDataProviderMetadata object itself.
     */
    public DiagnosticDataProviderMetadata withPropertyBag(
        List<DiagnosticDataProviderMetadataPropertyBagItem> propertyBag) {
        this.propertyBag = propertyBag;
        return this;
    }

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