# 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
from . import outputs
from ._inputs import *

__all__ = [
    'GetApiTokenResult',
    'AwaitableGetApiTokenResult',
    'get_api_token',
    'get_api_token_output',
]

@pulumi.output_type
class GetApiTokenResult:
    """
    A collection of values returned by getApiToken.
    """
    def __init__(__self__, client_name=None, created=None, id=None, name=None, network=None, user_id=None):
        if client_name and not isinstance(client_name, str):
            raise TypeError("Expected argument 'client_name' to be a str")
        pulumi.set(__self__, "client_name", client_name)
        if created and not isinstance(created, str):
            raise TypeError("Expected argument 'created' to be a str")
        pulumi.set(__self__, "created", created)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if network and not isinstance(network, dict):
            raise TypeError("Expected argument 'network' to be a dict")
        pulumi.set(__self__, "network", network)
        if user_id and not isinstance(user_id, str):
            raise TypeError("Expected argument 'user_id' to be a str")
        pulumi.set(__self__, "user_id", user_id)

    @_builtins.property
    @pulumi.getter(name="clientName")
    def client_name(self) -> _builtins.str:
        """
        The name of the API token client.
        """
        return pulumi.get(self, "client_name")

    @_builtins.property
    @pulumi.getter
    def created(self) -> _builtins.str:
        """
        The date and time the API token was created.
        """
        return pulumi.get(self, "created")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        The unique identifier of the API token.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter
    def name(self) -> _builtins.str:
        """
        The name of the API token.
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter
    def network(self) -> Optional['outputs.GetApiTokenNetworkResult']:
        """
        The network configuration of the API token.
        """
        return pulumi.get(self, "network")

    @_builtins.property
    @pulumi.getter(name="userId")
    def user_id(self) -> _builtins.str:
        """
        The userId of the user who created the API Token.
        """
        return pulumi.get(self, "user_id")


class AwaitableGetApiTokenResult(GetApiTokenResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetApiTokenResult(
            client_name=self.client_name,
            created=self.created,
            id=self.id,
            name=self.name,
            network=self.network,
            user_id=self.user_id)


def get_api_token(id: Optional[_builtins.str] = None,
                  network: Optional[Union['GetApiTokenNetworkArgs', 'GetApiTokenNetworkArgsDict']] = None,
                  opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetApiTokenResult:
    """
    Use this data source to retrieve information about an Okta API token.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_okta as okta

    example = okta.get_api_token(id="00T1fxzubpq2epw11d38")
    ```


    :param _builtins.str id: The unique identifier of the API token.
    :param Union['GetApiTokenNetworkArgs', 'GetApiTokenNetworkArgsDict'] network: The network configuration of the API token.
    """
    __args__ = dict()
    __args__['id'] = id
    __args__['network'] = network
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('okta:index/getApiToken:getApiToken', __args__, opts=opts, typ=GetApiTokenResult).value

    return AwaitableGetApiTokenResult(
        client_name=pulumi.get(__ret__, 'client_name'),
        created=pulumi.get(__ret__, 'created'),
        id=pulumi.get(__ret__, 'id'),
        name=pulumi.get(__ret__, 'name'),
        network=pulumi.get(__ret__, 'network'),
        user_id=pulumi.get(__ret__, 'user_id'))
def get_api_token_output(id: Optional[pulumi.Input[_builtins.str]] = None,
                         network: Optional[pulumi.Input[Optional[Union['GetApiTokenNetworkArgs', 'GetApiTokenNetworkArgsDict']]]] = None,
                         opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetApiTokenResult]:
    """
    Use this data source to retrieve information about an Okta API token.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_okta as okta

    example = okta.get_api_token(id="00T1fxzubpq2epw11d38")
    ```


    :param _builtins.str id: The unique identifier of the API token.
    :param Union['GetApiTokenNetworkArgs', 'GetApiTokenNetworkArgsDict'] network: The network configuration of the API token.
    """
    __args__ = dict()
    __args__['id'] = id
    __args__['network'] = network
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('okta:index/getApiToken:getApiToken', __args__, opts=opts, typ=GetApiTokenResult)
    return __ret__.apply(lambda __response__: GetApiTokenResult(
        client_name=pulumi.get(__response__, 'client_name'),
        created=pulumi.get(__response__, 'created'),
        id=pulumi.get(__response__, 'id'),
        name=pulumi.get(__response__, 'name'),
        network=pulumi.get(__response__, 'network'),
        user_id=pulumi.get(__response__, 'user_id')))
