# 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__ = ['ApiTokenArgs', 'ApiToken']

@pulumi.input_type
class ApiTokenArgs:
    def __init__(__self__, *,
                 id_property: pulumi.Input[_builtins.str],
                 client_name: Optional[pulumi.Input[_builtins.str]] = None,
                 created: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 network: Optional[pulumi.Input['ApiTokenNetworkArgs']] = None,
                 user_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a ApiToken resource.
        :param pulumi.Input[_builtins.str] id_property: The ID of the API token.
        :param pulumi.Input[_builtins.str] client_name: The name of the API token client.
        :param pulumi.Input[_builtins.str] created: The date and time the API token was created.
        :param pulumi.Input[_builtins.str] name: The name of the API token.
        :param pulumi.Input['ApiTokenNetworkArgs'] network: The Network Condition of the API Token.
        :param pulumi.Input[_builtins.str] user_id: The userId of the user who created the API Token.
        """
        pulumi.set(__self__, "id_property", id_property)
        if client_name is not None:
            pulumi.set(__self__, "client_name", client_name)
        if created is not None:
            pulumi.set(__self__, "created", created)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if network is not None:
            pulumi.set(__self__, "network", network)
        if user_id is not None:
            pulumi.set(__self__, "user_id", user_id)

    @_builtins.property
    @pulumi.getter(name="idProperty")
    def id_property(self) -> pulumi.Input[_builtins.str]:
        """
        The ID of the API 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)

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

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

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

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

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

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

    @_builtins.property
    @pulumi.getter
    def network(self) -> Optional[pulumi.Input['ApiTokenNetworkArgs']]:
        """
        The Network Condition of the API Token.
        """
        return pulumi.get(self, "network")

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

    @_builtins.property
    @pulumi.getter(name="userId")
    def user_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The userId of the user who created the API 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.input_type
class _ApiTokenState:
    def __init__(__self__, *,
                 client_name: Optional[pulumi.Input[_builtins.str]] = None,
                 created: Optional[pulumi.Input[_builtins.str]] = None,
                 id_property: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 network: Optional[pulumi.Input['ApiTokenNetworkArgs']] = None,
                 user_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering ApiToken resources.
        :param pulumi.Input[_builtins.str] client_name: The name of the API token client.
        :param pulumi.Input[_builtins.str] created: The date and time the API token was created.
        :param pulumi.Input[_builtins.str] id_property: The ID of the API token.
        :param pulumi.Input[_builtins.str] name: The name of the API token.
        :param pulumi.Input['ApiTokenNetworkArgs'] network: The Network Condition of the API Token.
        :param pulumi.Input[_builtins.str] user_id: The userId of the user who created the API Token.
        """
        if client_name is not None:
            pulumi.set(__self__, "client_name", client_name)
        if created is not None:
            pulumi.set(__self__, "created", created)
        if id_property is not None:
            pulumi.set(__self__, "id_property", id_property)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if network is not None:
            pulumi.set(__self__, "network", network)
        if user_id is not None:
            pulumi.set(__self__, "user_id", user_id)

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

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

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

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

    @_builtins.property
    @pulumi.getter(name="idProperty")
    def id_property(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the API 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 name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the API token.
        """
        return pulumi.get(self, "name")

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

    @_builtins.property
    @pulumi.getter
    def network(self) -> Optional[pulumi.Input['ApiTokenNetworkArgs']]:
        """
        The Network Condition of the API Token.
        """
        return pulumi.get(self, "network")

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

    @_builtins.property
    @pulumi.getter(name="userId")
    def user_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The userId of the user who created the API 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:index/apiToken:ApiToken")
class ApiToken(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 client_name: Optional[pulumi.Input[_builtins.str]] = None,
                 created: Optional[pulumi.Input[_builtins.str]] = None,
                 id_property: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 network: Optional[pulumi.Input[Union['ApiTokenNetworkArgs', 'ApiTokenNetworkArgsDict']]] = None,
                 user_id: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        ## Example Usage

        ```python
        import pulumi
        import pulumi_okta as okta

        example = okta.ApiToken("example",
            id_property="00T1fxzubpqiepH11d38",
            name="token-api-token-test",
            user_id="00unkw1sfbTw08c0g1d7",
            network={
                "connection": "ZONE",
                "excludes": ["nzonkw1sfwwi79Hat2d7"],
            },
            client_name="Okta API")
        ```

        ## Nested Schema for network

        ### Optional:
        - `connection` (String) The connection type of the Network Condition.

        ### Blocks:
        - `exclude` (List of String) List of excluded network zones.
        - `include` (List of String) List of included network zones.

        ### Import
        API tokens can be imported using their ID:

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] client_name: The name of the API token client.
        :param pulumi.Input[_builtins.str] created: The date and time the API token was created.
        :param pulumi.Input[_builtins.str] id_property: The ID of the API token.
        :param pulumi.Input[_builtins.str] name: The name of the API token.
        :param pulumi.Input[Union['ApiTokenNetworkArgs', 'ApiTokenNetworkArgsDict']] network: The Network Condition of the API Token.
        :param pulumi.Input[_builtins.str] user_id: The userId of the user who created the API Token.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: ApiTokenArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        ## Example Usage

        ```python
        import pulumi
        import pulumi_okta as okta

        example = okta.ApiToken("example",
            id_property="00T1fxzubpqiepH11d38",
            name="token-api-token-test",
            user_id="00unkw1sfbTw08c0g1d7",
            network={
                "connection": "ZONE",
                "excludes": ["nzonkw1sfwwi79Hat2d7"],
            },
            client_name="Okta API")
        ```

        ## Nested Schema for network

        ### Optional:
        - `connection` (String) The connection type of the Network Condition.

        ### Blocks:
        - `exclude` (List of String) List of excluded network zones.
        - `include` (List of String) List of included network zones.

        ### Import
        API tokens can be imported using their ID:

        :param str resource_name: The name of the resource.
        :param ApiTokenArgs 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(ApiTokenArgs, 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_name: Optional[pulumi.Input[_builtins.str]] = None,
                 created: Optional[pulumi.Input[_builtins.str]] = None,
                 id_property: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 network: Optional[pulumi.Input[Union['ApiTokenNetworkArgs', 'ApiTokenNetworkArgsDict']]] = None,
                 user_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__ = ApiTokenArgs.__new__(ApiTokenArgs)

            __props__.__dict__["client_name"] = client_name
            __props__.__dict__["created"] = created
            if id_property is None and not opts.urn:
                raise TypeError("Missing required property 'id_property'")
            __props__.__dict__["id_property"] = id_property
            __props__.__dict__["name"] = name
            __props__.__dict__["network"] = network
            __props__.__dict__["user_id"] = user_id
        super(ApiToken, __self__).__init__(
            'okta:index/apiToken:ApiToken',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            client_name: Optional[pulumi.Input[_builtins.str]] = None,
            created: Optional[pulumi.Input[_builtins.str]] = None,
            id_property: Optional[pulumi.Input[_builtins.str]] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None,
            network: Optional[pulumi.Input[Union['ApiTokenNetworkArgs', 'ApiTokenNetworkArgsDict']]] = None,
            user_id: Optional[pulumi.Input[_builtins.str]] = None) -> 'ApiToken':
        """
        Get an existing ApiToken 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_name: The name of the API token client.
        :param pulumi.Input[_builtins.str] created: The date and time the API token was created.
        :param pulumi.Input[_builtins.str] id_property: The ID of the API token.
        :param pulumi.Input[_builtins.str] name: The name of the API token.
        :param pulumi.Input[Union['ApiTokenNetworkArgs', 'ApiTokenNetworkArgsDict']] network: The Network Condition of the API Token.
        :param pulumi.Input[_builtins.str] user_id: The userId of the user who created the API Token.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ApiTokenState.__new__(_ApiTokenState)

        __props__.__dict__["client_name"] = client_name
        __props__.__dict__["created"] = created
        __props__.__dict__["id_property"] = id_property
        __props__.__dict__["name"] = name
        __props__.__dict__["network"] = network
        __props__.__dict__["user_id"] = user_id
        return ApiToken(resource_name, opts=opts, __props__=__props__)

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

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

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

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

    @_builtins.property
    @pulumi.getter
    def network(self) -> pulumi.Output[Optional['outputs.ApiTokenNetwork']]:
        """
        The Network Condition of the API Token.
        """
        return pulumi.get(self, "network")

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

