# 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__ = ['MicrotenantArgs', 'Microtenant']

@pulumi.input_type
class MicrotenantArgs:
    def __init__(__self__, *,
                 criteria_attribute: Optional[pulumi.Input[str]] = None,
                 criteria_attribute_values: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 enabled: Optional[pulumi.Input[bool]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 users: Optional[pulumi.Input[Sequence[pulumi.Input['MicrotenantUserArgs']]]] = None):
        """
        The set of arguments for constructing a Microtenant resource.
        :param pulumi.Input[str] criteria_attribute: (Required) Type of authentication criteria for the microtenant
        :param pulumi.Input[Sequence[pulumi.Input[str]]] criteria_attribute_values: (Required) The domain associated with the respective microtenant controller resource
        :param pulumi.Input[str] description: (Optional) Description of the microtenant controller.
        :param pulumi.Input[bool] enabled: (Optional) Whether this microtenant resource is enabled or not.
        :param pulumi.Input[str] name: (Required) Name of the microtenant controller.
        """
        if criteria_attribute is not None:
            pulumi.set(__self__, "criteria_attribute", criteria_attribute)
        if criteria_attribute_values is not None:
            pulumi.set(__self__, "criteria_attribute_values", criteria_attribute_values)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if enabled is not None:
            pulumi.set(__self__, "enabled", enabled)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if users is not None:
            pulumi.set(__self__, "users", users)

    @property
    @pulumi.getter(name="criteriaAttribute")
    def criteria_attribute(self) -> Optional[pulumi.Input[str]]:
        """
        (Required) Type of authentication criteria for the microtenant
        """
        return pulumi.get(self, "criteria_attribute")

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

    @property
    @pulumi.getter(name="criteriaAttributeValues")
    def criteria_attribute_values(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        (Required) The domain associated with the respective microtenant controller resource
        """
        return pulumi.get(self, "criteria_attribute_values")

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

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[str]]:
        """
        (Optional) Description of the microtenant controller.
        """
        return pulumi.get(self, "description")

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

    @property
    @pulumi.getter
    def enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        (Optional) Whether this microtenant resource is enabled or not.
        """
        return pulumi.get(self, "enabled")

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

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        (Required) Name of the microtenant controller.
        """
        return pulumi.get(self, "name")

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

    @property
    @pulumi.getter
    def users(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['MicrotenantUserArgs']]]]:
        return pulumi.get(self, "users")

    @users.setter
    def users(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['MicrotenantUserArgs']]]]):
        pulumi.set(self, "users", value)


@pulumi.input_type
class _MicrotenantState:
    def __init__(__self__, *,
                 criteria_attribute: Optional[pulumi.Input[str]] = None,
                 criteria_attribute_values: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 enabled: Optional[pulumi.Input[bool]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 users: Optional[pulumi.Input[Sequence[pulumi.Input['MicrotenantUserArgs']]]] = None):
        """
        Input properties used for looking up and filtering Microtenant resources.
        :param pulumi.Input[str] criteria_attribute: (Required) Type of authentication criteria for the microtenant
        :param pulumi.Input[Sequence[pulumi.Input[str]]] criteria_attribute_values: (Required) The domain associated with the respective microtenant controller resource
        :param pulumi.Input[str] description: (Optional) Description of the microtenant controller.
        :param pulumi.Input[bool] enabled: (Optional) Whether this microtenant resource is enabled or not.
        :param pulumi.Input[str] name: (Required) Name of the microtenant controller.
        """
        if criteria_attribute is not None:
            pulumi.set(__self__, "criteria_attribute", criteria_attribute)
        if criteria_attribute_values is not None:
            pulumi.set(__self__, "criteria_attribute_values", criteria_attribute_values)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if enabled is not None:
            pulumi.set(__self__, "enabled", enabled)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if users is not None:
            pulumi.set(__self__, "users", users)

    @property
    @pulumi.getter(name="criteriaAttribute")
    def criteria_attribute(self) -> Optional[pulumi.Input[str]]:
        """
        (Required) Type of authentication criteria for the microtenant
        """
        return pulumi.get(self, "criteria_attribute")

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

    @property
    @pulumi.getter(name="criteriaAttributeValues")
    def criteria_attribute_values(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        (Required) The domain associated with the respective microtenant controller resource
        """
        return pulumi.get(self, "criteria_attribute_values")

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

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[str]]:
        """
        (Optional) Description of the microtenant controller.
        """
        return pulumi.get(self, "description")

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

    @property
    @pulumi.getter
    def enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        (Optional) Whether this microtenant resource is enabled or not.
        """
        return pulumi.get(self, "enabled")

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

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        (Required) Name of the microtenant controller.
        """
        return pulumi.get(self, "name")

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

    @property
    @pulumi.getter
    def users(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['MicrotenantUserArgs']]]]:
        return pulumi.get(self, "users")

    @users.setter
    def users(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['MicrotenantUserArgs']]]]):
        pulumi.set(self, "users", value)


class Microtenant(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 criteria_attribute: Optional[pulumi.Input[str]] = None,
                 criteria_attribute_values: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 enabled: Optional[pulumi.Input[bool]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 users: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['MicrotenantUserArgs']]]]] = None,
                 __props__=None):
        """
        The **zpa_microtenant_controller** resource creates a microtenant controller in the Zscaler Private Access cloud. This resource allows organizations to delegate responsibilities of admins directly to the acquired or merged company admins so that they can manage their configurations independently

        ⚠️ **WARNING:**: This feature is in limited availability and requires additional license. To learn more, contact Zscaler Support or your local account team.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_zpa as zpa

        # ZPA Microtenant Controller resource
        this = zpa.Microtenant("this",
            description="Microtenant_A",
            enabled=True,
            criteria_attribute="AuthDomain",
            criteria_attribute_values=["acme.com"])
        pulumi.export("zpaMicrotenantController1", this.users.apply(lambda users: [{
            "microtenant_id": u.microtenant_id,
            "username": u.username,
            "password": u.password,
        } for u in users]))
        ```

        ## Import

        Zscaler offers a dedicated tool called Zscaler-Terraformer to allow the automated import of ZPA configurations into Terraform-compliant HashiCorp Configuration Language. Visit **microtenant_controller** can be imported by using `<MICROTENANT ID>` or `<MICROTENANT NAME>` as the import ID. For example

        ```sh
         $ pulumi import zpa:index/microtenant:Microtenant example <microtenant_id>
        ```

         or

        ```sh
         $ pulumi import zpa:index/microtenant:Microtenant example <microtenant_name>
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] criteria_attribute: (Required) Type of authentication criteria for the microtenant
        :param pulumi.Input[Sequence[pulumi.Input[str]]] criteria_attribute_values: (Required) The domain associated with the respective microtenant controller resource
        :param pulumi.Input[str] description: (Optional) Description of the microtenant controller.
        :param pulumi.Input[bool] enabled: (Optional) Whether this microtenant resource is enabled or not.
        :param pulumi.Input[str] name: (Required) Name of the microtenant controller.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: Optional[MicrotenantArgs] = None,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        The **zpa_microtenant_controller** resource creates a microtenant controller in the Zscaler Private Access cloud. This resource allows organizations to delegate responsibilities of admins directly to the acquired or merged company admins so that they can manage their configurations independently

        ⚠️ **WARNING:**: This feature is in limited availability and requires additional license. To learn more, contact Zscaler Support or your local account team.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_zpa as zpa

        # ZPA Microtenant Controller resource
        this = zpa.Microtenant("this",
            description="Microtenant_A",
            enabled=True,
            criteria_attribute="AuthDomain",
            criteria_attribute_values=["acme.com"])
        pulumi.export("zpaMicrotenantController1", this.users.apply(lambda users: [{
            "microtenant_id": u.microtenant_id,
            "username": u.username,
            "password": u.password,
        } for u in users]))
        ```

        ## Import

        Zscaler offers a dedicated tool called Zscaler-Terraformer to allow the automated import of ZPA configurations into Terraform-compliant HashiCorp Configuration Language. Visit **microtenant_controller** can be imported by using `<MICROTENANT ID>` or `<MICROTENANT NAME>` as the import ID. For example

        ```sh
         $ pulumi import zpa:index/microtenant:Microtenant example <microtenant_id>
        ```

         or

        ```sh
         $ pulumi import zpa:index/microtenant:Microtenant example <microtenant_name>
        ```

        :param str resource_name: The name of the resource.
        :param MicrotenantArgs 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(MicrotenantArgs, 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,
                 criteria_attribute: Optional[pulumi.Input[str]] = None,
                 criteria_attribute_values: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 enabled: Optional[pulumi.Input[bool]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 users: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['MicrotenantUserArgs']]]]] = 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__ = MicrotenantArgs.__new__(MicrotenantArgs)

            __props__.__dict__["criteria_attribute"] = criteria_attribute
            __props__.__dict__["criteria_attribute_values"] = criteria_attribute_values
            __props__.__dict__["description"] = description
            __props__.__dict__["enabled"] = enabled
            __props__.__dict__["name"] = name
            __props__.__dict__["users"] = users
        super(Microtenant, __self__).__init__(
            'zpa:index/microtenant:Microtenant',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            criteria_attribute: Optional[pulumi.Input[str]] = None,
            criteria_attribute_values: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            description: Optional[pulumi.Input[str]] = None,
            enabled: Optional[pulumi.Input[bool]] = None,
            name: Optional[pulumi.Input[str]] = None,
            users: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['MicrotenantUserArgs']]]]] = None) -> 'Microtenant':
        """
        Get an existing Microtenant 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[str] criteria_attribute: (Required) Type of authentication criteria for the microtenant
        :param pulumi.Input[Sequence[pulumi.Input[str]]] criteria_attribute_values: (Required) The domain associated with the respective microtenant controller resource
        :param pulumi.Input[str] description: (Optional) Description of the microtenant controller.
        :param pulumi.Input[bool] enabled: (Optional) Whether this microtenant resource is enabled or not.
        :param pulumi.Input[str] name: (Required) Name of the microtenant controller.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _MicrotenantState.__new__(_MicrotenantState)

        __props__.__dict__["criteria_attribute"] = criteria_attribute
        __props__.__dict__["criteria_attribute_values"] = criteria_attribute_values
        __props__.__dict__["description"] = description
        __props__.__dict__["enabled"] = enabled
        __props__.__dict__["name"] = name
        __props__.__dict__["users"] = users
        return Microtenant(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="criteriaAttribute")
    def criteria_attribute(self) -> pulumi.Output[Optional[str]]:
        """
        (Required) Type of authentication criteria for the microtenant
        """
        return pulumi.get(self, "criteria_attribute")

    @property
    @pulumi.getter(name="criteriaAttributeValues")
    def criteria_attribute_values(self) -> pulumi.Output[Sequence[str]]:
        """
        (Required) The domain associated with the respective microtenant controller resource
        """
        return pulumi.get(self, "criteria_attribute_values")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[Optional[str]]:
        """
        (Optional) Description of the microtenant controller.
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter
    def enabled(self) -> pulumi.Output[bool]:
        """
        (Optional) Whether this microtenant resource is enabled or not.
        """
        return pulumi.get(self, "enabled")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        (Required) Name of the microtenant controller.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def users(self) -> pulumi.Output[Sequence['outputs.MicrotenantUser']]:
        return pulumi.get(self, "users")

