# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities

__all__ = ['UserArgs', 'User']

@pulumi.input_type
class UserArgs:
    def __init__(__self__, *,
                 email: pulumi.Input[_builtins.str],
                 site_id: pulumi.Input[_builtins.str],
                 access_groups: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a User resource.
        :param pulumi.Input[_builtins.str] email: The email address of the user to invite. The user will receive an invitation email at this address. IMPORTANT: The email cannot be changed after the user is created. Changing the email will require replacing the resource (delete + recreate).
        :param pulumi.Input[_builtins.str] site_id: The Webflow site ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c3'). You can find your site ID in the Webflow dashboard under Site Settings. This field will be validated before making any API calls.
        :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] access_groups: Optional list of access group slugs to assign to the user. Access groups control what content the user can access. Groups are assigned as type 'admin' (assigned via API or designer). Example: ['premium-members', 'beta-testers']. Access group slugs can be found in the Webflow dashboard under Users > Access Groups.
        :param pulumi.Input[_builtins.str] name: Optional display name for the user. This will be shown in the Webflow dashboard and can be used in site personalization.
        """
        pulumi.set(__self__, "email", email)
        pulumi.set(__self__, "site_id", site_id)
        if access_groups is not None:
            pulumi.set(__self__, "access_groups", access_groups)
        if name is not None:
            pulumi.set(__self__, "name", name)

    @_builtins.property
    @pulumi.getter
    def email(self) -> pulumi.Input[_builtins.str]:
        """
        The email address of the user to invite. The user will receive an invitation email at this address. IMPORTANT: The email cannot be changed after the user is created. Changing the email will require replacing the resource (delete + recreate).
        """
        return pulumi.get(self, "email")

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

    @_builtins.property
    @pulumi.getter(name="siteId")
    def site_id(self) -> pulumi.Input[_builtins.str]:
        """
        The Webflow site ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c3'). You can find your site ID in the Webflow dashboard under Site Settings. This field will be validated before making any API calls.
        """
        return pulumi.get(self, "site_id")

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

    @_builtins.property
    @pulumi.getter(name="accessGroups")
    def access_groups(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]]:
        """
        Optional list of access group slugs to assign to the user. Access groups control what content the user can access. Groups are assigned as type 'admin' (assigned via API or designer). Example: ['premium-members', 'beta-testers']. Access group slugs can be found in the Webflow dashboard under Users > Access Groups.
        """
        return pulumi.get(self, "access_groups")

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

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Optional display name for the user. This will be shown in the Webflow dashboard and can be used in site personalization.
        """
        return pulumi.get(self, "name")

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


@pulumi.type_token("webflow:index:User")
class User(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 access_groups: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
                 email: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 site_id: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        Manages users for a Webflow site. This resource allows you to invite users to your site with specified access groups. Users will receive an invitation email and must accept it to access paid content. Note: The user's email cannot be changed after creation.

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] access_groups: Optional list of access group slugs to assign to the user. Access groups control what content the user can access. Groups are assigned as type 'admin' (assigned via API or designer). Example: ['premium-members', 'beta-testers']. Access group slugs can be found in the Webflow dashboard under Users > Access Groups.
        :param pulumi.Input[_builtins.str] email: The email address of the user to invite. The user will receive an invitation email at this address. IMPORTANT: The email cannot be changed after the user is created. Changing the email will require replacing the resource (delete + recreate).
        :param pulumi.Input[_builtins.str] name: Optional display name for the user. This will be shown in the Webflow dashboard and can be used in site personalization.
        :param pulumi.Input[_builtins.str] site_id: The Webflow site ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c3'). You can find your site ID in the Webflow dashboard under Site Settings. This field will be validated before making any API calls.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: UserArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages users for a Webflow site. This resource allows you to invite users to your site with specified access groups. Users will receive an invitation email and must accept it to access paid content. Note: The user's email cannot be changed after creation.

        :param str resource_name: The name of the resource.
        :param UserArgs 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(UserArgs, 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,
                 access_groups: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
                 email: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 site_id: Optional[pulumi.Input[_builtins.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__ = UserArgs.__new__(UserArgs)

            __props__.__dict__["access_groups"] = access_groups
            if email is None and not opts.urn:
                raise TypeError("Missing required property 'email'")
            __props__.__dict__["email"] = email
            __props__.__dict__["name"] = name
            if site_id is None and not opts.urn:
                raise TypeError("Missing required property 'site_id'")
            __props__.__dict__["site_id"] = site_id
            __props__.__dict__["created_on"] = None
            __props__.__dict__["invited_on"] = None
            __props__.__dict__["is_email_verified"] = None
            __props__.__dict__["last_login"] = None
            __props__.__dict__["last_updated"] = None
            __props__.__dict__["status"] = None
            __props__.__dict__["user_id"] = None
        super(User, __self__).__init__(
            'webflow:index:User',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None) -> 'User':
        """
        Get an existing User 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.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = UserArgs.__new__(UserArgs)

        __props__.__dict__["access_groups"] = None
        __props__.__dict__["created_on"] = None
        __props__.__dict__["email"] = None
        __props__.__dict__["invited_on"] = None
        __props__.__dict__["is_email_verified"] = None
        __props__.__dict__["last_login"] = None
        __props__.__dict__["last_updated"] = None
        __props__.__dict__["name"] = None
        __props__.__dict__["site_id"] = None
        __props__.__dict__["status"] = None
        __props__.__dict__["user_id"] = None
        return User(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="accessGroups")
    def access_groups(self) -> pulumi.Output[Optional[Sequence[_builtins.str]]]:
        """
        Optional list of access group slugs to assign to the user. Access groups control what content the user can access. Groups are assigned as type 'admin' (assigned via API or designer). Example: ['premium-members', 'beta-testers']. Access group slugs can be found in the Webflow dashboard under Users > Access Groups.
        """
        return pulumi.get(self, "access_groups")

    @_builtins.property
    @pulumi.getter(name="createdOn")
    def created_on(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The timestamp when the user was created (RFC3339 format). This is automatically set and is read-only.
        """
        return pulumi.get(self, "created_on")

    @_builtins.property
    @pulumi.getter
    def email(self) -> pulumi.Output[_builtins.str]:
        """
        The email address of the user to invite. The user will receive an invitation email at this address. IMPORTANT: The email cannot be changed after the user is created. Changing the email will require replacing the resource (delete + recreate).
        """
        return pulumi.get(self, "email")

    @_builtins.property
    @pulumi.getter(name="invitedOn")
    def invited_on(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The timestamp when the user was invited (RFC3339 format). This is automatically set and is read-only.
        """
        return pulumi.get(self, "invited_on")

    @_builtins.property
    @pulumi.getter(name="isEmailVerified")
    def is_email_verified(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        Indicates whether the user has verified their email address. This is read-only and set by Webflow when the user verifies their email.
        """
        return pulumi.get(self, "is_email_verified")

    @_builtins.property
    @pulumi.getter(name="lastLogin")
    def last_login(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The timestamp when the user last logged in (RFC3339 format). This is read-only.
        """
        return pulumi.get(self, "last_login")

    @_builtins.property
    @pulumi.getter(name="lastUpdated")
    def last_updated(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The timestamp when the user was last updated (RFC3339 format). This is read-only.
        """
        return pulumi.get(self, "last_updated")

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        Optional display name for the user. This will be shown in the Webflow dashboard and can be used in site personalization.
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter(name="siteId")
    def site_id(self) -> pulumi.Output[_builtins.str]:
        """
        The Webflow site ID (24-character lowercase hexadecimal string, e.g., '5f0c8c9e1c9d440000e8d8c3'). You can find your site ID in the Webflow dashboard under Site Settings. This field will be validated before making any API calls.
        """
        return pulumi.get(self, "site_id")

    @_builtins.property
    @pulumi.getter
    def status(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The status of the user. Possible values: 'invited' (invitation sent but not accepted), 'verified' (email verified), 'unverified' (registered but email not verified). This is read-only.
        """
        return pulumi.get(self, "status")

    @_builtins.property
    @pulumi.getter(name="userId")
    def user_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The Webflow-assigned unique identifier for this user. This is automatically assigned when the user is created and is read-only.
        """
        return pulumi.get(self, "user_id")

