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

package com.azure.resourcemanager.logic.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The batch release criteria. */
@Fluent
public final class BatchReleaseCriteria {
    /*
     * The message count.
     */
    @JsonProperty(value = "messageCount")
    private Integer messageCount;

    /*
     * The batch size in bytes.
     */
    @JsonProperty(value = "batchSize")
    private Integer batchSize;

    /*
     * The recurrence.
     */
    @JsonProperty(value = "recurrence")
    private WorkflowTriggerRecurrence recurrence;

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

    /**
     * Get the messageCount property: The message count.
     *
     * @return the messageCount value.
     */
    public Integer messageCount() {
        return this.messageCount;
    }

    /**
     * Set the messageCount property: The message count.
     *
     * @param messageCount the messageCount value to set.
     * @return the BatchReleaseCriteria object itself.
     */
    public BatchReleaseCriteria withMessageCount(Integer messageCount) {
        this.messageCount = messageCount;
        return this;
    }

    /**
     * Get the batchSize property: The batch size in bytes.
     *
     * @return the batchSize value.
     */
    public Integer batchSize() {
        return this.batchSize;
    }

    /**
     * Set the batchSize property: The batch size in bytes.
     *
     * @param batchSize the batchSize value to set.
     * @return the BatchReleaseCriteria object itself.
     */
    public BatchReleaseCriteria withBatchSize(Integer batchSize) {
        this.batchSize = batchSize;
        return this;
    }

    /**
     * Get the recurrence property: The recurrence.
     *
     * @return the recurrence value.
     */
    public WorkflowTriggerRecurrence recurrence() {
        return this.recurrence;
    }

    /**
     * Set the recurrence property: The recurrence.
     *
     * @param recurrence the recurrence value to set.
     * @return the BatchReleaseCriteria object itself.
     */
    public BatchReleaseCriteria withRecurrence(WorkflowTriggerRecurrence recurrence) {
        this.recurrence = recurrence;
        return this;
    }

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