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

package com.azure.resourcemanager.securityinsights.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** timeline aggregation information per kind. */
@Fluent
public final class TimelineAggregation {
    /*
     * the total items found for a kind
     */
    @JsonProperty(value = "count", required = true)
    private int count;

    /*
     * the query kind
     */
    @JsonProperty(value = "kind", required = true)
    private EntityTimelineKind kind;

    /**
     * Get the count property: the total items found for a kind.
     *
     * @return the count value.
     */
    public int count() {
        return this.count;
    }

    /**
     * Set the count property: the total items found for a kind.
     *
     * @param count the count value to set.
     * @return the TimelineAggregation object itself.
     */
    public TimelineAggregation withCount(int count) {
        this.count = count;
        return this;
    }

    /**
     * Get the kind property: the query kind.
     *
     * @return the kind value.
     */
    public EntityTimelineKind kind() {
        return this.kind;
    }

    /**
     * Set the kind property: the query kind.
     *
     * @param kind the kind value to set.
     * @return the TimelineAggregation object itself.
     */
    public TimelineAggregation withKind(EntityTimelineKind kind) {
        this.kind = kind;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (kind() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property kind in model TimelineAggregation"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(TimelineAggregation.class);
}
