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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.databricks.models.AccessConnectorProperties;
import com.azure.resourcemanager.databricks.models.ManagedServiceIdentity;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Information about azure databricks accessConnector. */
@Fluent
public final class AccessConnectorInner extends Resource {
    /*
     * Managed service identity (system assigned and/or user assigned identities)
     */
    @JsonProperty(value = "identity")
    private ManagedServiceIdentity identity;

    /*
     * The system metadata relating to this resource
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /*
     * Azure Databricks accessConnector properties
     */
    @JsonProperty(value = "properties")
    private AccessConnectorProperties properties;

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

    /**
     * Get the identity property: Managed service identity (system assigned and/or user assigned identities).
     *
     * @return the identity value.
     */
    public ManagedServiceIdentity identity() {
        return this.identity;
    }

    /**
     * Set the identity property: Managed service identity (system assigned and/or user assigned identities).
     *
     * @param identity the identity value to set.
     * @return the AccessConnectorInner object itself.
     */
    public AccessConnectorInner withIdentity(ManagedServiceIdentity identity) {
        this.identity = identity;
        return this;
    }

    /**
     * Get the systemData property: The system metadata relating to this resource.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the properties property: Azure Databricks accessConnector properties.
     *
     * @return the properties value.
     */
    public AccessConnectorProperties properties() {
        return this.properties;
    }

    /**
     * Set the properties property: Azure Databricks accessConnector properties.
     *
     * @param properties the properties value to set.
     * @return the AccessConnectorInner object itself.
     */
    public AccessConnectorInner withProperties(AccessConnectorProperties properties) {
        this.properties = properties;
        return this;
    }

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

    /** {@inheritDoc} */
    @Override
    public AccessConnectorInner 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 (identity() != null) {
            identity().validate();
        }
        if (properties() != null) {
            properties().validate();
        }
    }
}
