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

/** The available data types for office data connector. */
@Fluent
public final class OfficeDataConnectorDataTypes {
    /*
     * Exchange data type connection.
     */
    @JsonProperty(value = "exchange", required = true)
    private OfficeDataConnectorDataTypesExchange exchange;

    /*
     * SharePoint data type connection.
     */
    @JsonProperty(value = "sharePoint", required = true)
    private OfficeDataConnectorDataTypesSharePoint sharePoint;

    /*
     * Teams data type connection.
     */
    @JsonProperty(value = "teams", required = true)
    private OfficeDataConnectorDataTypesTeams teams;

    /**
     * Get the exchange property: Exchange data type connection.
     *
     * @return the exchange value.
     */
    public OfficeDataConnectorDataTypesExchange exchange() {
        return this.exchange;
    }

    /**
     * Set the exchange property: Exchange data type connection.
     *
     * @param exchange the exchange value to set.
     * @return the OfficeDataConnectorDataTypes object itself.
     */
    public OfficeDataConnectorDataTypes withExchange(OfficeDataConnectorDataTypesExchange exchange) {
        this.exchange = exchange;
        return this;
    }

    /**
     * Get the sharePoint property: SharePoint data type connection.
     *
     * @return the sharePoint value.
     */
    public OfficeDataConnectorDataTypesSharePoint sharePoint() {
        return this.sharePoint;
    }

    /**
     * Set the sharePoint property: SharePoint data type connection.
     *
     * @param sharePoint the sharePoint value to set.
     * @return the OfficeDataConnectorDataTypes object itself.
     */
    public OfficeDataConnectorDataTypes withSharePoint(OfficeDataConnectorDataTypesSharePoint sharePoint) {
        this.sharePoint = sharePoint;
        return this;
    }

    /**
     * Get the teams property: Teams data type connection.
     *
     * @return the teams value.
     */
    public OfficeDataConnectorDataTypesTeams teams() {
        return this.teams;
    }

    /**
     * Set the teams property: Teams data type connection.
     *
     * @param teams the teams value to set.
     * @return the OfficeDataConnectorDataTypes object itself.
     */
    public OfficeDataConnectorDataTypes withTeams(OfficeDataConnectorDataTypesTeams teams) {
        this.teams = teams;
        return this;
    }

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

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