# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from . import outputs
from ._inputs import *

__all__ = ['RestrictWorkspaceAdminsSettingArgs', 'RestrictWorkspaceAdminsSetting']

@pulumi.input_type
class RestrictWorkspaceAdminsSettingArgs:
    def __init__(__self__, *,
                 restrict_workspace_admins: pulumi.Input['RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs'],
                 etag: Optional[pulumi.Input[str]] = None,
                 setting_name: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a RestrictWorkspaceAdminsSetting resource.
        :param pulumi.Input['RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs'] restrict_workspace_admins: The configuration details.
        """
        pulumi.set(__self__, "restrict_workspace_admins", restrict_workspace_admins)
        if etag is not None:
            pulumi.set(__self__, "etag", etag)
        if setting_name is not None:
            pulumi.set(__self__, "setting_name", setting_name)

    @property
    @pulumi.getter(name="restrictWorkspaceAdmins")
    def restrict_workspace_admins(self) -> pulumi.Input['RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs']:
        """
        The configuration details.
        """
        return pulumi.get(self, "restrict_workspace_admins")

    @restrict_workspace_admins.setter
    def restrict_workspace_admins(self, value: pulumi.Input['RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs']):
        pulumi.set(self, "restrict_workspace_admins", value)

    @property
    @pulumi.getter
    def etag(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "etag")

    @etag.setter
    def etag(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "etag", value)

    @property
    @pulumi.getter(name="settingName")
    def setting_name(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "setting_name")

    @setting_name.setter
    def setting_name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "setting_name", value)


@pulumi.input_type
class _RestrictWorkspaceAdminsSettingState:
    def __init__(__self__, *,
                 etag: Optional[pulumi.Input[str]] = None,
                 restrict_workspace_admins: Optional[pulumi.Input['RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs']] = None,
                 setting_name: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering RestrictWorkspaceAdminsSetting resources.
        :param pulumi.Input['RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs'] restrict_workspace_admins: The configuration details.
        """
        if etag is not None:
            pulumi.set(__self__, "etag", etag)
        if restrict_workspace_admins is not None:
            pulumi.set(__self__, "restrict_workspace_admins", restrict_workspace_admins)
        if setting_name is not None:
            pulumi.set(__self__, "setting_name", setting_name)

    @property
    @pulumi.getter
    def etag(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "etag")

    @etag.setter
    def etag(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "etag", value)

    @property
    @pulumi.getter(name="restrictWorkspaceAdmins")
    def restrict_workspace_admins(self) -> Optional[pulumi.Input['RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs']]:
        """
        The configuration details.
        """
        return pulumi.get(self, "restrict_workspace_admins")

    @restrict_workspace_admins.setter
    def restrict_workspace_admins(self, value: Optional[pulumi.Input['RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs']]):
        pulumi.set(self, "restrict_workspace_admins", value)

    @property
    @pulumi.getter(name="settingName")
    def setting_name(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "setting_name")

    @setting_name.setter
    def setting_name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "setting_name", value)


class RestrictWorkspaceAdminsSetting(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 etag: Optional[pulumi.Input[str]] = None,
                 restrict_workspace_admins: Optional[pulumi.Input[pulumi.InputType['RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs']]] = None,
                 setting_name: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        > **Note** This resource could be only used with workspace-level provider!

        The `RestrictWorkspaceAdminsSetting` resource lets you control the capabilities of workspace admins.

        With the status set to `ALLOW_ALL`, workspace admins can:

        1. Create service principal personal access tokens on behalf of any service principal in their workspace.
        2. Change a job owner to any user in the workspace.
        3. Change the job run_as setting to any user in their workspace or a service principal on which they have the Service Principal User role.

        With the status set to `RESTRICT_TOKENS_AND_JOB_RUN_AS`, workspace admins can:

        1. Only create personal access tokens on behalf of service principals on which they have the Service Principal User role.
        2. Only change a job owner to themselves.
        3. Only change the job run_as setting to themselves a service principal on which they have the Service Principal User role.

        > **Note** Only account admins can update the setting. And the account admin must be part of the workspace to change the setting status.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_databricks as databricks

        this = databricks.RestrictWorkspaceAdminsSetting("this", restrict_workspace_admins=databricks.RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs(
            status="RESTRICT_TOKENS_AND_JOB_RUN_AS",
        ))
        ```

        ## Import

        This resource can be imported by predefined name `global`:

        bash

        ```sh
        $ pulumi import databricks:index/restrictWorkspaceAdminsSetting:RestrictWorkspaceAdminsSetting this global
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[pulumi.InputType['RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs']] restrict_workspace_admins: The configuration details.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: RestrictWorkspaceAdminsSettingArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        > **Note** This resource could be only used with workspace-level provider!

        The `RestrictWorkspaceAdminsSetting` resource lets you control the capabilities of workspace admins.

        With the status set to `ALLOW_ALL`, workspace admins can:

        1. Create service principal personal access tokens on behalf of any service principal in their workspace.
        2. Change a job owner to any user in the workspace.
        3. Change the job run_as setting to any user in their workspace or a service principal on which they have the Service Principal User role.

        With the status set to `RESTRICT_TOKENS_AND_JOB_RUN_AS`, workspace admins can:

        1. Only create personal access tokens on behalf of service principals on which they have the Service Principal User role.
        2. Only change a job owner to themselves.
        3. Only change the job run_as setting to themselves a service principal on which they have the Service Principal User role.

        > **Note** Only account admins can update the setting. And the account admin must be part of the workspace to change the setting status.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_databricks as databricks

        this = databricks.RestrictWorkspaceAdminsSetting("this", restrict_workspace_admins=databricks.RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs(
            status="RESTRICT_TOKENS_AND_JOB_RUN_AS",
        ))
        ```

        ## Import

        This resource can be imported by predefined name `global`:

        bash

        ```sh
        $ pulumi import databricks:index/restrictWorkspaceAdminsSetting:RestrictWorkspaceAdminsSetting this global
        ```

        :param str resource_name: The name of the resource.
        :param RestrictWorkspaceAdminsSettingArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(RestrictWorkspaceAdminsSettingArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 etag: Optional[pulumi.Input[str]] = None,
                 restrict_workspace_admins: Optional[pulumi.Input[pulumi.InputType['RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs']]] = None,
                 setting_name: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = RestrictWorkspaceAdminsSettingArgs.__new__(RestrictWorkspaceAdminsSettingArgs)

            __props__.__dict__["etag"] = etag
            if restrict_workspace_admins is None and not opts.urn:
                raise TypeError("Missing required property 'restrict_workspace_admins'")
            __props__.__dict__["restrict_workspace_admins"] = restrict_workspace_admins
            __props__.__dict__["setting_name"] = setting_name
        super(RestrictWorkspaceAdminsSetting, __self__).__init__(
            'databricks:index/restrictWorkspaceAdminsSetting:RestrictWorkspaceAdminsSetting',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            etag: Optional[pulumi.Input[str]] = None,
            restrict_workspace_admins: Optional[pulumi.Input[pulumi.InputType['RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs']]] = None,
            setting_name: Optional[pulumi.Input[str]] = None) -> 'RestrictWorkspaceAdminsSetting':
        """
        Get an existing RestrictWorkspaceAdminsSetting resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[pulumi.InputType['RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs']] restrict_workspace_admins: The configuration details.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _RestrictWorkspaceAdminsSettingState.__new__(_RestrictWorkspaceAdminsSettingState)

        __props__.__dict__["etag"] = etag
        __props__.__dict__["restrict_workspace_admins"] = restrict_workspace_admins
        __props__.__dict__["setting_name"] = setting_name
        return RestrictWorkspaceAdminsSetting(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def etag(self) -> pulumi.Output[str]:
        return pulumi.get(self, "etag")

    @property
    @pulumi.getter(name="restrictWorkspaceAdmins")
    def restrict_workspace_admins(self) -> pulumi.Output['outputs.RestrictWorkspaceAdminsSettingRestrictWorkspaceAdmins']:
        """
        The configuration details.
        """
        return pulumi.get(self, "restrict_workspace_admins")

    @property
    @pulumi.getter(name="settingName")
    def setting_name(self) -> pulumi.Output[str]:
        return pulumi.get(self, "setting_name")

