// 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.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The Edifact message filter for odata query. */
@Fluent
public final class EdifactMessageFilter {
    /*
     * The message filter type.
     */
    @JsonProperty(value = "messageFilterType", required = true)
    private MessageFilterType messageFilterType;

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

    /**
     * Get the messageFilterType property: The message filter type.
     *
     * @return the messageFilterType value.
     */
    public MessageFilterType messageFilterType() {
        return this.messageFilterType;
    }

    /**
     * Set the messageFilterType property: The message filter type.
     *
     * @param messageFilterType the messageFilterType value to set.
     * @return the EdifactMessageFilter object itself.
     */
    public EdifactMessageFilter withMessageFilterType(MessageFilterType messageFilterType) {
        this.messageFilterType = messageFilterType;
        return this;
    }

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

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