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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.edgeorder.models.CommonProperties;
import com.azure.resourcemanager.edgeorder.models.ProductLine;
import com.azure.resourcemanager.edgeorder.models.ResourceProviderDetails;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Properties of product family. */
@Fluent
public final class ProductFamilyProperties extends CommonProperties {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductFamilyProperties.class);

    /*
     * List of product lines supported in the product family
     */
    @JsonProperty(value = "productLines", access = JsonProperty.Access.WRITE_ONLY)
    private List<ProductLine> productLines;

    /*
     * Contains details related to resource provider
     */
    @JsonProperty(value = "resourceProviderDetails")
    private List<ResourceProviderDetails> resourceProviderDetails;

    /**
     * Get the productLines property: List of product lines supported in the product family.
     *
     * @return the productLines value.
     */
    public List<ProductLine> productLines() {
        return this.productLines;
    }

    /**
     * Get the resourceProviderDetails property: Contains details related to resource provider.
     *
     * @return the resourceProviderDetails value.
     */
    public List<ResourceProviderDetails> resourceProviderDetails() {
        return this.resourceProviderDetails;
    }

    /**
     * Set the resourceProviderDetails property: Contains details related to resource provider.
     *
     * @param resourceProviderDetails the resourceProviderDetails value to set.
     * @return the ProductFamilyProperties object itself.
     */
    public ProductFamilyProperties withResourceProviderDetails(List<ResourceProviderDetails> resourceProviderDetails) {
        this.resourceProviderDetails = resourceProviderDetails;
        return this;
    }

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