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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.synapse.models.EntityResource;
import com.azure.resourcemanager.synapse.models.IntegrationRuntime;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Integration runtime resource type. */
@Fluent
public final class IntegrationRuntimeResourceInner extends EntityResource {
    /*
     * Integration runtime properties.
     */
    @JsonProperty(value = "properties", required = true)
    private IntegrationRuntime properties;

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

    /**
     * Get the properties property: Integration runtime properties.
     *
     * @return the properties value.
     */
    public IntegrationRuntime properties() {
        return this.properties;
    }

    /**
     * Set the properties property: Integration runtime properties.
     *
     * @param properties the properties value to set.
     * @return the IntegrationRuntimeResourceInner object itself.
     */
    public IntegrationRuntimeResourceInner withProperties(IntegrationRuntime properties) {
        this.properties = properties;
        return this;
    }

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

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