# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = [
    'KubeconfigResult',
    'AwaitableKubeconfigResult',
    'kubeconfig',
    'kubeconfig_output',
]

@pulumi.output_type
class KubeconfigResult:
    """
    A collection of values returned by Kubeconfig.
    """
    def __init__(__self__, client_configuration=None, endpoint=None, id=None, kubeconfig_raw=None, kubernetes_client_configuration=None, node=None, timeouts=None, wait=None):
        if client_configuration and not isinstance(client_configuration, dict):
            raise TypeError("Expected argument 'client_configuration' to be a dict")
        pulumi.set(__self__, "client_configuration", client_configuration)
        if endpoint and not isinstance(endpoint, str):
            raise TypeError("Expected argument 'endpoint' to be a str")
        pulumi.set(__self__, "endpoint", endpoint)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if kubeconfig_raw and not isinstance(kubeconfig_raw, str):
            raise TypeError("Expected argument 'kubeconfig_raw' to be a str")
        pulumi.set(__self__, "kubeconfig_raw", kubeconfig_raw)
        if kubernetes_client_configuration and not isinstance(kubernetes_client_configuration, dict):
            raise TypeError("Expected argument 'kubernetes_client_configuration' to be a dict")
        pulumi.set(__self__, "kubernetes_client_configuration", kubernetes_client_configuration)
        if node and not isinstance(node, str):
            raise TypeError("Expected argument 'node' to be a str")
        pulumi.set(__self__, "node", node)
        if timeouts and not isinstance(timeouts, dict):
            raise TypeError("Expected argument 'timeouts' to be a dict")
        pulumi.set(__self__, "timeouts", timeouts)
        if wait and not isinstance(wait, bool):
            raise TypeError("Expected argument 'wait' to be a bool")
        pulumi.set(__self__, "wait", wait)

    @property
    @pulumi.getter(name="clientConfiguration")
    def client_configuration(self) -> 'outputs.KubeconfigClientConfigurationResult':
        """
        The client configuration data
        """
        return pulumi.get(self, "client_configuration")

    @property
    @pulumi.getter
    def endpoint(self) -> str:
        """
        endpoint to use for the talosclient. If not set, the node value will be used
        """
        return pulumi.get(self, "endpoint")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The ID of this resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="kubeconfigRaw")
    def kubeconfig_raw(self) -> str:
        """
        The raw kubeconfig
        """
        return pulumi.get(self, "kubeconfig_raw")

    @property
    @pulumi.getter(name="kubernetesClientConfiguration")
    def kubernetes_client_configuration(self) -> 'outputs.KubeconfigKubernetesClientConfigurationResult':
        """
        The kubernetes client configuration
        """
        return pulumi.get(self, "kubernetes_client_configuration")

    @property
    @pulumi.getter
    def node(self) -> str:
        """
        controlplane node to retrieve the kubeconfig from
        """
        return pulumi.get(self, "node")

    @property
    @pulumi.getter
    def timeouts(self) -> Optional['outputs.KubeconfigTimeoutsResult']:
        return pulumi.get(self, "timeouts")

    @property
    @pulumi.getter
    def wait(self) -> Optional[bool]:
        """
        Wait for the kubernetes api to be available
        """
        warnings.warn("""This attribute is deprecated and no-op. Will be removed in a future version. Use talos_cluster_health instead.""", DeprecationWarning)
        pulumi.log.warn("""wait is deprecated: This attribute is deprecated and no-op. Will be removed in a future version. Use talos_cluster_health instead.""")

        return pulumi.get(self, "wait")


class AwaitableKubeconfigResult(KubeconfigResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return KubeconfigResult(
            client_configuration=self.client_configuration,
            endpoint=self.endpoint,
            id=self.id,
            kubeconfig_raw=self.kubeconfig_raw,
            kubernetes_client_configuration=self.kubernetes_client_configuration,
            node=self.node,
            timeouts=self.timeouts,
            wait=self.wait)


def kubeconfig(client_configuration: Optional[pulumi.InputType['KubeconfigClientConfigurationArgs']] = None,
               endpoint: Optional[str] = None,
               node: Optional[str] = None,
               timeouts: Optional[pulumi.InputType['KubeconfigTimeoutsArgs']] = None,
               wait: Optional[bool] = None,
               opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableKubeconfigResult:
    """
    Retrieves the kubeconfig for a Talos cluster


    :param pulumi.InputType['KubeconfigClientConfigurationArgs'] client_configuration: The client configuration data
    :param str endpoint: endpoint to use for the talosclient. If not set, the node value will be used
    :param str node: controlplane node to retrieve the kubeconfig from
    :param bool wait: Wait for the kubernetes api to be available
    """
    __args__ = dict()
    __args__['clientConfiguration'] = client_configuration
    __args__['endpoint'] = endpoint
    __args__['node'] = node
    __args__['timeouts'] = timeouts
    __args__['wait'] = wait
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('talos:cluster/kubeconfig:Kubeconfig', __args__, opts=opts, typ=KubeconfigResult).value

    return AwaitableKubeconfigResult(
        client_configuration=pulumi.get(__ret__, 'client_configuration'),
        endpoint=pulumi.get(__ret__, 'endpoint'),
        id=pulumi.get(__ret__, 'id'),
        kubeconfig_raw=pulumi.get(__ret__, 'kubeconfig_raw'),
        kubernetes_client_configuration=pulumi.get(__ret__, 'kubernetes_client_configuration'),
        node=pulumi.get(__ret__, 'node'),
        timeouts=pulumi.get(__ret__, 'timeouts'),
        wait=pulumi.get(__ret__, 'wait'))


@_utilities.lift_output_func(kubeconfig)
def kubeconfig_output(client_configuration: Optional[pulumi.Input[pulumi.InputType['KubeconfigClientConfigurationArgs']]] = None,
                      endpoint: Optional[pulumi.Input[Optional[str]]] = None,
                      node: Optional[pulumi.Input[str]] = None,
                      timeouts: Optional[pulumi.Input[Optional[pulumi.InputType['KubeconfigTimeoutsArgs']]]] = None,
                      wait: Optional[pulumi.Input[Optional[bool]]] = None,
                      opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[KubeconfigResult]:
    """
    Retrieves the kubeconfig for a Talos cluster


    :param pulumi.InputType['KubeconfigClientConfigurationArgs'] client_configuration: The client configuration data
    :param str endpoint: endpoint to use for the talosclient. If not set, the node value will be used
    :param str node: controlplane node to retrieve the kubeconfig from
    :param bool wait: Wait for the kubernetes api to be available
    """
    ...
