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

package com.azure.resourcemanager.policyinsights.models;

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

/** Summary results. */
@Fluent
public final class Summary {
    /*
     * OData entity ID; always set to null since summaries do not have an entity ID.
     */
    @JsonProperty(value = "@odata.id")
    private String odataId;

    /*
     * OData context string; used by OData clients to resolve type information based on metadata.
     */
    @JsonProperty(value = "@odata.context")
    private String odataContext;

    /*
     * Compliance summary for all policy assignments.
     */
    @JsonProperty(value = "results")
    private SummaryResults results;

    /*
     * Policy assignments summary.
     */
    @JsonProperty(value = "policyAssignments")
    private List<PolicyAssignmentSummary> policyAssignments;

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

    /**
     * Get the odataId property: OData entity ID; always set to null since summaries do not have an entity ID.
     *
     * @return the odataId value.
     */
    public String odataId() {
        return this.odataId;
    }

    /**
     * Set the odataId property: OData entity ID; always set to null since summaries do not have an entity ID.
     *
     * @param odataId the odataId value to set.
     * @return the Summary object itself.
     */
    public Summary withOdataId(String odataId) {
        this.odataId = odataId;
        return this;
    }

    /**
     * Get the odataContext property: OData context string; used by OData clients to resolve type information based on
     * metadata.
     *
     * @return the odataContext value.
     */
    public String odataContext() {
        return this.odataContext;
    }

    /**
     * Set the odataContext property: OData context string; used by OData clients to resolve type information based on
     * metadata.
     *
     * @param odataContext the odataContext value to set.
     * @return the Summary object itself.
     */
    public Summary withOdataContext(String odataContext) {
        this.odataContext = odataContext;
        return this;
    }

    /**
     * Get the results property: Compliance summary for all policy assignments.
     *
     * @return the results value.
     */
    public SummaryResults results() {
        return this.results;
    }

    /**
     * Set the results property: Compliance summary for all policy assignments.
     *
     * @param results the results value to set.
     * @return the Summary object itself.
     */
    public Summary withResults(SummaryResults results) {
        this.results = results;
        return this;
    }

    /**
     * Get the policyAssignments property: Policy assignments summary.
     *
     * @return the policyAssignments value.
     */
    public List<PolicyAssignmentSummary> policyAssignments() {
        return this.policyAssignments;
    }

    /**
     * Set the policyAssignments property: Policy assignments summary.
     *
     * @param policyAssignments the policyAssignments value to set.
     * @return the Summary object itself.
     */
    public Summary withPolicyAssignments(List<PolicyAssignmentSummary> policyAssignments) {
        this.policyAssignments = policyAssignments;
        return this;
    }

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