// 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 Dynamics365 data connector. */
@Fluent
public final class Dynamics365DataConnectorDataTypes {
    /*
     * Common Data Service data type connection.
     */
    @JsonProperty(value = "dynamics365CdsActivities", required = true)
    private Dynamics365DataConnectorDataTypesDynamics365CdsActivities dynamics365CdsActivities;

    /**
     * Get the dynamics365CdsActivities property: Common Data Service data type connection.
     *
     * @return the dynamics365CdsActivities value.
     */
    public Dynamics365DataConnectorDataTypesDynamics365CdsActivities dynamics365CdsActivities() {
        return this.dynamics365CdsActivities;
    }

    /**
     * Set the dynamics365CdsActivities property: Common Data Service data type connection.
     *
     * @param dynamics365CdsActivities the dynamics365CdsActivities value to set.
     * @return the Dynamics365DataConnectorDataTypes object itself.
     */
    public Dynamics365DataConnectorDataTypes withDynamics365CdsActivities(
        Dynamics365DataConnectorDataTypesDynamics365CdsActivities dynamics365CdsActivities) {
        this.dynamics365CdsActivities = dynamics365CdsActivities;
        return this;
    }

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

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