# 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__ = ['HookKeyArgs', 'HookKey']

@pulumi.input_type
class HookKeyArgs:
    def __init__(__self__, *,
                 name: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a HookKey resource.
        :param pulumi.Input[_builtins.str] name: Display name for the key. Must be between 1 and 255 characters.
        """
        if name is not None:
            pulumi.set(__self__, "name", name)

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Display name for the key. Must be between 1 and 255 characters.
        """
        return pulumi.get(self, "name")

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


@pulumi.input_type
class _HookKeyState:
    def __init__(__self__, *,
                 created: Optional[pulumi.Input[_builtins.str]] = None,
                 is_used: Optional[pulumi.Input[_builtins.bool]] = None,
                 key_id: Optional[pulumi.Input[_builtins.str]] = None,
                 last_updated: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering HookKey resources.
        :param pulumi.Input[_builtins.str] created: Timestamp when the key was created.
        :param pulumi.Input[_builtins.bool] is_used: Whether this key is currently in use by other applications.
        :param pulumi.Input[_builtins.str] key_id: The alias of the public key.
        :param pulumi.Input[_builtins.str] last_updated: Timestamp when the key was updated.
        :param pulumi.Input[_builtins.str] name: Display name for the key. Must be between 1 and 255 characters.
        """
        if created is not None:
            pulumi.set(__self__, "created", created)
        if is_used is not None:
            pulumi.set(__self__, "is_used", is_used)
        if key_id is not None:
            pulumi.set(__self__, "key_id", key_id)
        if last_updated is not None:
            pulumi.set(__self__, "last_updated", last_updated)
        if name is not None:
            pulumi.set(__self__, "name", name)

    @_builtins.property
    @pulumi.getter
    def created(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Timestamp when the key 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="isUsed")
    def is_used(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Whether this key is currently in use by other applications.
        """
        return pulumi.get(self, "is_used")

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

    @_builtins.property
    @pulumi.getter(name="keyId")
    def key_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The alias of the public key.
        """
        return pulumi.get(self, "key_id")

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

    @_builtins.property
    @pulumi.getter(name="lastUpdated")
    def last_updated(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Timestamp when the key was updated.
        """
        return pulumi.get(self, "last_updated")

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

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Display name for the key. Must be between 1 and 255 characters.
        """
        return pulumi.get(self, "name")

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


@pulumi.type_token("okta:index/hookKey:HookKey")
class HookKey(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        Creates and manages a Hook Key. This resource allows you to create and configure an Okta [Hook Key](https://developer.okta.com/docs/reference/api/hook-keys/).

        Use Key Management to create and manage JSON Web Keys (JWKS) that support OAuth 2.0 client authentication. The key is composed of a public and private key pair. The private key signs the JSON Web Token (JWT) and the public key validates it on the client side.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_okta as okta

        example = okta.HookKey("example", name="My Hook Key")
        ```

        ## Import

        Hook Keys can be imported using the `id`.

        ```sh
        $ pulumi import okta:index/hookKey:HookKey example &#60;hook_key_id&#62;
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] name: Display name for the key. Must be between 1 and 255 characters.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: Optional[HookKeyArgs] = None,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Creates and manages a Hook Key. This resource allows you to create and configure an Okta [Hook Key](https://developer.okta.com/docs/reference/api/hook-keys/).

        Use Key Management to create and manage JSON Web Keys (JWKS) that support OAuth 2.0 client authentication. The key is composed of a public and private key pair. The private key signs the JSON Web Token (JWT) and the public key validates it on the client side.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_okta as okta

        example = okta.HookKey("example", name="My Hook Key")
        ```

        ## Import

        Hook Keys can be imported using the `id`.

        ```sh
        $ pulumi import okta:index/hookKey:HookKey example &#60;hook_key_id&#62;
        ```

        :param str resource_name: The name of the resource.
        :param HookKeyArgs 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(HookKeyArgs, 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,
                 name: 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__ = HookKeyArgs.__new__(HookKeyArgs)

            __props__.__dict__["name"] = name
            __props__.__dict__["created"] = None
            __props__.__dict__["is_used"] = None
            __props__.__dict__["key_id"] = None
            __props__.__dict__["last_updated"] = None
        super(HookKey, __self__).__init__(
            'okta:index/hookKey:HookKey',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            created: Optional[pulumi.Input[_builtins.str]] = None,
            is_used: Optional[pulumi.Input[_builtins.bool]] = None,
            key_id: Optional[pulumi.Input[_builtins.str]] = None,
            last_updated: Optional[pulumi.Input[_builtins.str]] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None) -> 'HookKey':
        """
        Get an existing HookKey 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] created: Timestamp when the key was created.
        :param pulumi.Input[_builtins.bool] is_used: Whether this key is currently in use by other applications.
        :param pulumi.Input[_builtins.str] key_id: The alias of the public key.
        :param pulumi.Input[_builtins.str] last_updated: Timestamp when the key was updated.
        :param pulumi.Input[_builtins.str] name: Display name for the key. Must be between 1 and 255 characters.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _HookKeyState.__new__(_HookKeyState)

        __props__.__dict__["created"] = created
        __props__.__dict__["is_used"] = is_used
        __props__.__dict__["key_id"] = key_id
        __props__.__dict__["last_updated"] = last_updated
        __props__.__dict__["name"] = name
        return HookKey(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter
    def created(self) -> pulumi.Output[_builtins.str]:
        """
        Timestamp when the key was created.
        """
        return pulumi.get(self, "created")

    @_builtins.property
    @pulumi.getter(name="isUsed")
    def is_used(self) -> pulumi.Output[_builtins.bool]:
        """
        Whether this key is currently in use by other applications.
        """
        return pulumi.get(self, "is_used")

    @_builtins.property
    @pulumi.getter(name="keyId")
    def key_id(self) -> pulumi.Output[_builtins.str]:
        """
        The alias of the public key.
        """
        return pulumi.get(self, "key_id")

    @_builtins.property
    @pulumi.getter(name="lastUpdated")
    def last_updated(self) -> pulumi.Output[_builtins.str]:
        """
        Timestamp when the key was updated.
        """
        return pulumi.get(self, "last_updated")

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[_builtins.str]:
        """
        Display name for the key. Must be between 1 and 255 characters.
        """
        return pulumi.get(self, "name")

