# 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__ = [
    'GetServerResult',
    'AwaitableGetServerResult',
    'get_server',
    'get_server_output',
]

@pulumi.output_type
class GetServerResult:
    """
    A collection of values returned by getServer.
    """
    def __init__(__self__, audiences=None, credentials_last_rotated=None, credentials_next_rotation=None, credentials_rotation_mode=None, description=None, id=None, issuer=None, issuer_mode=None, kid=None, name=None, status=None):
        if audiences and not isinstance(audiences, list):
            raise TypeError("Expected argument 'audiences' to be a list")
        pulumi.set(__self__, "audiences", audiences)
        if credentials_last_rotated and not isinstance(credentials_last_rotated, str):
            raise TypeError("Expected argument 'credentials_last_rotated' to be a str")
        pulumi.set(__self__, "credentials_last_rotated", credentials_last_rotated)
        if credentials_next_rotation and not isinstance(credentials_next_rotation, str):
            raise TypeError("Expected argument 'credentials_next_rotation' to be a str")
        pulumi.set(__self__, "credentials_next_rotation", credentials_next_rotation)
        if credentials_rotation_mode and not isinstance(credentials_rotation_mode, str):
            raise TypeError("Expected argument 'credentials_rotation_mode' to be a str")
        pulumi.set(__self__, "credentials_rotation_mode", credentials_rotation_mode)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if issuer and not isinstance(issuer, str):
            raise TypeError("Expected argument 'issuer' to be a str")
        pulumi.set(__self__, "issuer", issuer)
        if issuer_mode and not isinstance(issuer_mode, str):
            raise TypeError("Expected argument 'issuer_mode' to be a str")
        pulumi.set(__self__, "issuer_mode", issuer_mode)
        if kid and not isinstance(kid, str):
            raise TypeError("Expected argument 'kid' to be a str")
        pulumi.set(__self__, "kid", kid)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)

    @_builtins.property
    @pulumi.getter
    def audiences(self) -> Sequence[_builtins.str]:
        """
        Description of Authorization server.
        """
        return pulumi.get(self, "audiences")

    @_builtins.property
    @pulumi.getter(name="credentialsLastRotated")
    def credentials_last_rotated(self) -> _builtins.str:
        """
        Last time credentials were rotated.
        """
        return pulumi.get(self, "credentials_last_rotated")

    @_builtins.property
    @pulumi.getter(name="credentialsNextRotation")
    def credentials_next_rotation(self) -> _builtins.str:
        """
        Next time credentials will be rotated
        """
        return pulumi.get(self, "credentials_next_rotation")

    @_builtins.property
    @pulumi.getter(name="credentialsRotationMode")
    def credentials_rotation_mode(self) -> _builtins.str:
        """
        Mode of credential rotation, auto or manual.
        """
        return pulumi.get(self, "credentials_rotation_mode")

    @_builtins.property
    @pulumi.getter
    def description(self) -> _builtins.str:
        """
        Description of Authorization server.
        """
        return pulumi.get(self, "description")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter
    def issuer(self) -> _builtins.str:
        """
        The complete URL of the authorization server. This becomes the `iss` claim in an access token.
        """
        return pulumi.get(self, "issuer")

    @_builtins.property
    @pulumi.getter(name="issuerMode")
    def issuer_mode(self) -> _builtins.str:
        """
        Can be set to `CUSTOM_URL` or `ORG_URL`
        """
        return pulumi.get(self, "issuer_mode")

    @_builtins.property
    @pulumi.getter
    def kid(self) -> _builtins.str:
        """
        Auth server key id.
        """
        return pulumi.get(self, "kid")

    @_builtins.property
    @pulumi.getter
    def name(self) -> _builtins.str:
        """
        The name of the auth server to retrieve.
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter
    def status(self) -> _builtins.str:
        """
        The activation status of the authorization server.
        """
        return pulumi.get(self, "status")


class AwaitableGetServerResult(GetServerResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetServerResult(
            audiences=self.audiences,
            credentials_last_rotated=self.credentials_last_rotated,
            credentials_next_rotation=self.credentials_next_rotation,
            credentials_rotation_mode=self.credentials_rotation_mode,
            description=self.description,
            id=self.id,
            issuer=self.issuer,
            issuer_mode=self.issuer_mode,
            kid=self.kid,
            name=self.name,
            status=self.status)


def get_server(name: Optional[_builtins.str] = None,
               opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetServerResult:
    """
    Get an auth server from Okta.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_okta as okta

    example = okta.auth.get_server(name="Example Auth")
    ```


    :param _builtins.str name: The name of the auth server to retrieve.
    """
    __args__ = dict()
    __args__['name'] = name
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('okta:auth/getServer:getServer', __args__, opts=opts, typ=GetServerResult).value

    return AwaitableGetServerResult(
        audiences=pulumi.get(__ret__, 'audiences'),
        credentials_last_rotated=pulumi.get(__ret__, 'credentials_last_rotated'),
        credentials_next_rotation=pulumi.get(__ret__, 'credentials_next_rotation'),
        credentials_rotation_mode=pulumi.get(__ret__, 'credentials_rotation_mode'),
        description=pulumi.get(__ret__, 'description'),
        id=pulumi.get(__ret__, 'id'),
        issuer=pulumi.get(__ret__, 'issuer'),
        issuer_mode=pulumi.get(__ret__, 'issuer_mode'),
        kid=pulumi.get(__ret__, 'kid'),
        name=pulumi.get(__ret__, 'name'),
        status=pulumi.get(__ret__, 'status'))
def get_server_output(name: Optional[pulumi.Input[_builtins.str]] = None,
                      opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetServerResult]:
    """
    Get an auth server from Okta.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_okta as okta

    example = okta.auth.get_server(name="Example Auth")
    ```


    :param _builtins.str name: The name of the auth server to retrieve.
    """
    __args__ = dict()
    __args__['name'] = name
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('okta:auth/getServer:getServer', __args__, opts=opts, typ=GetServerResult)
    return __ret__.apply(lambda __response__: GetServerResult(
        audiences=pulumi.get(__response__, 'audiences'),
        credentials_last_rotated=pulumi.get(__response__, 'credentials_last_rotated'),
        credentials_next_rotation=pulumi.get(__response__, 'credentials_next_rotation'),
        credentials_rotation_mode=pulumi.get(__response__, 'credentials_rotation_mode'),
        description=pulumi.get(__response__, 'description'),
        id=pulumi.get(__response__, 'id'),
        issuer=pulumi.get(__response__, 'issuer'),
        issuer_mode=pulumi.get(__response__, 'issuer_mode'),
        kid=pulumi.get(__response__, 'kid'),
        name=pulumi.get(__response__, 'name'),
        status=pulumi.get(__response__, 'status')))
