# 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__ = ['TokenArgs', 'Token']

@pulumi.input_type
class TokenArgs:
    def __init__(__self__, *,
                 client_id: pulumi.Input[_builtins.str],
                 id_property: pulumi.Input[_builtins.str]):
        """
        The set of arguments for constructing a Token resource.
        :param pulumi.Input[_builtins.str] client_id: The unique Okta ID of the application associated with this token. This is typically the `client_id` of an refresh application.
        :param pulumi.Input[_builtins.str] id_property: The unique Okta ID of the refresh token.
        """
        pulumi.set(__self__, "client_id", client_id)
        pulumi.set(__self__, "id_property", id_property)

    @_builtins.property
    @pulumi.getter(name="clientId")
    def client_id(self) -> pulumi.Input[_builtins.str]:
        """
        The unique Okta ID of the application associated with this token. This is typically the `client_id` of an refresh application.
        """
        return pulumi.get(self, "client_id")

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

    @_builtins.property
    @pulumi.getter(name="idProperty")
    def id_property(self) -> pulumi.Input[_builtins.str]:
        """
        The unique Okta ID of the refresh token.
        """
        return pulumi.get(self, "id_property")

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


@pulumi.input_type
class _TokenState:
    def __init__(__self__, *,
                 client_id: Optional[pulumi.Input[_builtins.str]] = None,
                 id_property: Optional[pulumi.Input[_builtins.str]] = None,
                 status: Optional[pulumi.Input[_builtins.str]] = None,
                 user_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering Token resources.
        :param pulumi.Input[_builtins.str] client_id: The unique Okta ID of the application associated with this token. This is typically the `client_id` of an refresh application.
        :param pulumi.Input[_builtins.str] id_property: The unique Okta ID of the refresh token.
        :param pulumi.Input[_builtins.str] status: The current status of the token (e.g., `ACTIVE`, `REVOKED`).
        :param pulumi.Input[_builtins.str] user_id: The unique Okta ID of the user associated with this token.
        """
        if client_id is not None:
            pulumi.set(__self__, "client_id", client_id)
        if id_property is not None:
            pulumi.set(__self__, "id_property", id_property)
        if status is not None:
            pulumi.set(__self__, "status", status)
        if user_id is not None:
            pulumi.set(__self__, "user_id", user_id)

    @_builtins.property
    @pulumi.getter(name="clientId")
    def client_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The unique Okta ID of the application associated with this token. This is typically the `client_id` of an refresh application.
        """
        return pulumi.get(self, "client_id")

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

    @_builtins.property
    @pulumi.getter(name="idProperty")
    def id_property(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The unique Okta ID of the refresh token.
        """
        return pulumi.get(self, "id_property")

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

    @_builtins.property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The current status of the token (e.g., `ACTIVE`, `REVOKED`).
        """
        return pulumi.get(self, "status")

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

    @_builtins.property
    @pulumi.getter(name="userId")
    def user_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The unique Okta ID of the user associated with this token.
        """
        return pulumi.get(self, "user_id")

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


@pulumi.type_token("okta:app/token:Token")
class Token(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 client_id: Optional[pulumi.Input[_builtins.str]] = None,
                 id_property: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        ## Example Usage

        ### Import and Manage Existing Token

        ```python
        import pulumi
        import pulumi_okta as okta

        # Import an existing refresh token
        example = okta.app.Token("example",
            client_id="0oardd5r32PWsF4421d7",
            id_property="oar1godmqw4QUiX4C1d7")
        ```

        ## Import

        Refresh tokens can be imported using the format `{client_id}/{token_id}`:

        bash

        ```sh
        $ pulumi import okta:app/token:Token example 0oardd5r32PWsF4421d7/oar1godmqw4QUiX4C1d7
        ```

        Where:

        - `0oardd5r32PWsF4421d7` is the application's client_id

        - `oar1godmqw4QUiX4C1d7` is the Refresh token ID

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] client_id: The unique Okta ID of the application associated with this token. This is typically the `client_id` of an refresh application.
        :param pulumi.Input[_builtins.str] id_property: The unique Okta ID of the refresh token.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: TokenArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        ## Example Usage

        ### Import and Manage Existing Token

        ```python
        import pulumi
        import pulumi_okta as okta

        # Import an existing refresh token
        example = okta.app.Token("example",
            client_id="0oardd5r32PWsF4421d7",
            id_property="oar1godmqw4QUiX4C1d7")
        ```

        ## Import

        Refresh tokens can be imported using the format `{client_id}/{token_id}`:

        bash

        ```sh
        $ pulumi import okta:app/token:Token example 0oardd5r32PWsF4421d7/oar1godmqw4QUiX4C1d7
        ```

        Where:

        - `0oardd5r32PWsF4421d7` is the application's client_id

        - `oar1godmqw4QUiX4C1d7` is the Refresh token ID

        :param str resource_name: The name of the resource.
        :param TokenArgs 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(TokenArgs, 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,
                 client_id: Optional[pulumi.Input[_builtins.str]] = None,
                 id_property: 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__ = TokenArgs.__new__(TokenArgs)

            if client_id is None and not opts.urn:
                raise TypeError("Missing required property 'client_id'")
            __props__.__dict__["client_id"] = client_id
            if id_property is None and not opts.urn:
                raise TypeError("Missing required property 'id_property'")
            __props__.__dict__["id_property"] = id_property
            __props__.__dict__["status"] = None
            __props__.__dict__["user_id"] = None
        super(Token, __self__).__init__(
            'okta:app/token:Token',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            client_id: Optional[pulumi.Input[_builtins.str]] = None,
            id_property: Optional[pulumi.Input[_builtins.str]] = None,
            status: Optional[pulumi.Input[_builtins.str]] = None,
            user_id: Optional[pulumi.Input[_builtins.str]] = None) -> 'Token':
        """
        Get an existing Token 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[_builtins.str] client_id: The unique Okta ID of the application associated with this token. This is typically the `client_id` of an refresh application.
        :param pulumi.Input[_builtins.str] id_property: The unique Okta ID of the refresh token.
        :param pulumi.Input[_builtins.str] status: The current status of the token (e.g., `ACTIVE`, `REVOKED`).
        :param pulumi.Input[_builtins.str] user_id: The unique Okta ID of the user associated with this token.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _TokenState.__new__(_TokenState)

        __props__.__dict__["client_id"] = client_id
        __props__.__dict__["id_property"] = id_property
        __props__.__dict__["status"] = status
        __props__.__dict__["user_id"] = user_id
        return Token(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="clientId")
    def client_id(self) -> pulumi.Output[_builtins.str]:
        """
        The unique Okta ID of the application associated with this token. This is typically the `client_id` of an refresh application.
        """
        return pulumi.get(self, "client_id")

    @_builtins.property
    @pulumi.getter(name="idProperty")
    def id_property(self) -> pulumi.Output[_builtins.str]:
        """
        The unique Okta ID of the refresh token.
        """
        return pulumi.get(self, "id_property")

    @_builtins.property
    @pulumi.getter
    def status(self) -> pulumi.Output[_builtins.str]:
        """
        The current status of the token (e.g., `ACTIVE`, `REVOKED`).
        """
        return pulumi.get(self, "status")

    @_builtins.property
    @pulumi.getter(name="userId")
    def user_id(self) -> pulumi.Output[_builtins.str]:
        """
        The unique Okta ID of the user associated with this token.
        """
        return pulumi.get(self, "user_id")

