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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.resourcemanager.logic.models.IntegrationServiceEnvironmentProperties;
import com.azure.resourcemanager.logic.models.IntegrationServiceEnvironmentSku;
import com.azure.resourcemanager.logic.models.ManagedServiceIdentity;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The integration service environment. */
@Fluent
public final class IntegrationServiceEnvironmentInner extends Resource {
    /*
     * The integration service environment properties.
     */
    @JsonProperty(value = "properties")
    private IntegrationServiceEnvironmentProperties properties;

    /*
     * The sku.
     */
    @JsonProperty(value = "sku")
    private IntegrationServiceEnvironmentSku sku;

    /*
     * Managed service identity properties.
     */
    @JsonProperty(value = "identity")
    private ManagedServiceIdentity identity;

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

    /**
     * Get the properties property: The integration service environment properties.
     *
     * @return the properties value.
     */
    public IntegrationServiceEnvironmentProperties properties() {
        return this.properties;
    }

    /**
     * Set the properties property: The integration service environment properties.
     *
     * @param properties the properties value to set.
     * @return the IntegrationServiceEnvironmentInner object itself.
     */
    public IntegrationServiceEnvironmentInner withProperties(IntegrationServiceEnvironmentProperties properties) {
        this.properties = properties;
        return this;
    }

    /**
     * Get the sku property: The sku.
     *
     * @return the sku value.
     */
    public IntegrationServiceEnvironmentSku sku() {
        return this.sku;
    }

    /**
     * Set the sku property: The sku.
     *
     * @param sku the sku value to set.
     * @return the IntegrationServiceEnvironmentInner object itself.
     */
    public IntegrationServiceEnvironmentInner withSku(IntegrationServiceEnvironmentSku sku) {
        this.sku = sku;
        return this;
    }

    /**
     * Get the identity property: Managed service identity properties.
     *
     * @return the identity value.
     */
    public ManagedServiceIdentity identity() {
        return this.identity;
    }

    /**
     * Set the identity property: Managed service identity properties.
     *
     * @param identity the identity value to set.
     * @return the IntegrationServiceEnvironmentInner object itself.
     */
    public IntegrationServiceEnvironmentInner withIdentity(ManagedServiceIdentity identity) {
        this.identity = identity;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public IntegrationServiceEnvironmentInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public IntegrationServiceEnvironmentInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

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