// 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;

/** Common field for data type in data connectors. */
@Fluent
public class DataConnectorDataTypeCommon {
    /*
     * Describe whether this data type connection is enabled or not.
     */
    @JsonProperty(value = "state", required = true)
    private DataTypeState state;

    /**
     * Get the state property: Describe whether this data type connection is enabled or not.
     *
     * @return the state value.
     */
    public DataTypeState state() {
        return this.state;
    }

    /**
     * Set the state property: Describe whether this data type connection is enabled or not.
     *
     * @param state the state value to set.
     * @return the DataConnectorDataTypeCommon object itself.
     */
    public DataConnectorDataTypeCommon withState(DataTypeState state) {
        this.state = state;
        return this;
    }

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

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