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

package com.azure.resourcemanager.healthcareapis.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.healthcareapis.models.IotEventHubIngestionEndpointConfiguration;
import com.azure.resourcemanager.healthcareapis.models.IotMappingProperties;
import com.azure.resourcemanager.healthcareapis.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;

/** IoT Connector properties. */
@Fluent
public final class IotConnectorProperties {
    /*
     * The provisioning state.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * Source configuration.
     */
    @JsonProperty(value = "ingestionEndpointConfiguration")
    private IotEventHubIngestionEndpointConfiguration ingestionEndpointConfiguration;

    /*
     * Device Mappings.
     */
    @JsonProperty(value = "deviceMapping")
    private IotMappingProperties deviceMapping;

    /**
     * Get the provisioningState property: The provisioning state.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the ingestionEndpointConfiguration property: Source configuration.
     *
     * @return the ingestionEndpointConfiguration value.
     */
    public IotEventHubIngestionEndpointConfiguration ingestionEndpointConfiguration() {
        return this.ingestionEndpointConfiguration;
    }

    /**
     * Set the ingestionEndpointConfiguration property: Source configuration.
     *
     * @param ingestionEndpointConfiguration the ingestionEndpointConfiguration value to set.
     * @return the IotConnectorProperties object itself.
     */
    public IotConnectorProperties withIngestionEndpointConfiguration(
        IotEventHubIngestionEndpointConfiguration ingestionEndpointConfiguration) {
        this.ingestionEndpointConfiguration = ingestionEndpointConfiguration;
        return this;
    }

    /**
     * Get the deviceMapping property: Device Mappings.
     *
     * @return the deviceMapping value.
     */
    public IotMappingProperties deviceMapping() {
        return this.deviceMapping;
    }

    /**
     * Set the deviceMapping property: Device Mappings.
     *
     * @param deviceMapping the deviceMapping value to set.
     * @return the IotConnectorProperties object itself.
     */
    public IotConnectorProperties withDeviceMapping(IotMappingProperties deviceMapping) {
        this.deviceMapping = deviceMapping;
        return this;
    }

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