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

package com.azure.resourcemanager.customerinsights.models;

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

/** Definition of canonical profile. */
@Fluent
public final class CanonicalProfileDefinition {
    /*
     * Canonical profile ID.
     */
    @JsonProperty(value = "canonicalProfileId")
    private Integer canonicalProfileId;

    /*
     * Properties of the canonical profile.
     */
    @JsonProperty(value = "properties")
    private List<CanonicalProfileDefinitionPropertiesItem> properties;

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

    /**
     * Get the canonicalProfileId property: Canonical profile ID.
     *
     * @return the canonicalProfileId value.
     */
    public Integer canonicalProfileId() {
        return this.canonicalProfileId;
    }

    /**
     * Set the canonicalProfileId property: Canonical profile ID.
     *
     * @param canonicalProfileId the canonicalProfileId value to set.
     * @return the CanonicalProfileDefinition object itself.
     */
    public CanonicalProfileDefinition withCanonicalProfileId(Integer canonicalProfileId) {
        this.canonicalProfileId = canonicalProfileId;
        return this;
    }

    /**
     * Get the properties property: Properties of the canonical profile.
     *
     * @return the properties value.
     */
    public List<CanonicalProfileDefinitionPropertiesItem> properties() {
        return this.properties;
    }

    /**
     * Set the properties property: Properties of the canonical profile.
     *
     * @param properties the properties value to set.
     * @return the CanonicalProfileDefinition object itself.
     */
    public CanonicalProfileDefinition withProperties(List<CanonicalProfileDefinitionPropertiesItem> properties) {
        this.properties = properties;
        return this;
    }

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