# 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

__all__ = [
    'GetCertResult',
    'AwaitableGetCertResult',
    'get_cert',
    'get_cert_output',
]

@pulumi.output_type
class GetCertResult:
    """
    A collection of values returned by getCert.
    """
    def __init__(__self__, app=None, check=None, dnsvalidationhostname=None, dnsvalidationinstructions=None, dnsvalidationtarget=None, hostname=None, id=None):
        if app and not isinstance(app, str):
            raise TypeError("Expected argument 'app' to be a str")
        pulumi.set(__self__, "app", app)
        if check and not isinstance(check, bool):
            raise TypeError("Expected argument 'check' to be a bool")
        pulumi.set(__self__, "check", check)
        if dnsvalidationhostname and not isinstance(dnsvalidationhostname, str):
            raise TypeError("Expected argument 'dnsvalidationhostname' to be a str")
        pulumi.set(__self__, "dnsvalidationhostname", dnsvalidationhostname)
        if dnsvalidationinstructions and not isinstance(dnsvalidationinstructions, str):
            raise TypeError("Expected argument 'dnsvalidationinstructions' to be a str")
        pulumi.set(__self__, "dnsvalidationinstructions", dnsvalidationinstructions)
        if dnsvalidationtarget and not isinstance(dnsvalidationtarget, str):
            raise TypeError("Expected argument 'dnsvalidationtarget' to be a str")
        pulumi.set(__self__, "dnsvalidationtarget", dnsvalidationtarget)
        if hostname and not isinstance(hostname, str):
            raise TypeError("Expected argument 'hostname' to be a str")
        pulumi.set(__self__, "hostname", hostname)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)

    @property
    @pulumi.getter
    def app(self) -> str:
        """
        Name of app attached to
        """
        return pulumi.get(self, "app")

    @property
    @pulumi.getter
    def check(self) -> bool:
        """
        check
        """
        return pulumi.get(self, "check")

    @property
    @pulumi.getter
    def dnsvalidationhostname(self) -> str:
        """
        DnsValidationHostname
        """
        return pulumi.get(self, "dnsvalidationhostname")

    @property
    @pulumi.getter
    def dnsvalidationinstructions(self) -> str:
        """
        DnsValidationHostname
        """
        return pulumi.get(self, "dnsvalidationinstructions")

    @property
    @pulumi.getter
    def dnsvalidationtarget(self) -> str:
        """
        DnsValidationTarget
        """
        return pulumi.get(self, "dnsvalidationtarget")

    @property
    @pulumi.getter
    def hostname(self) -> str:
        """
        hostname
        """
        return pulumi.get(self, "hostname")

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


class AwaitableGetCertResult(GetCertResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetCertResult(
            app=self.app,
            check=self.check,
            dnsvalidationhostname=self.dnsvalidationhostname,
            dnsvalidationinstructions=self.dnsvalidationinstructions,
            dnsvalidationtarget=self.dnsvalidationtarget,
            hostname=self.hostname,
            id=self.id)


def get_cert(app: Optional[str] = None,
             hostname: Optional[str] = None,
             opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCertResult:
    """
    Fly certificate data source


    :param str app: Name of app attached to
    :param str hostname: hostname
    """
    __args__ = dict()
    __args__['app'] = app
    __args__['hostname'] = hostname
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('fly:index/getCert:getCert', __args__, opts=opts, typ=GetCertResult).value

    return AwaitableGetCertResult(
        app=__ret__.app,
        check=__ret__.check,
        dnsvalidationhostname=__ret__.dnsvalidationhostname,
        dnsvalidationinstructions=__ret__.dnsvalidationinstructions,
        dnsvalidationtarget=__ret__.dnsvalidationtarget,
        hostname=__ret__.hostname,
        id=__ret__.id)


@_utilities.lift_output_func(get_cert)
def get_cert_output(app: Optional[pulumi.Input[str]] = None,
                    hostname: Optional[pulumi.Input[str]] = None,
                    opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetCertResult]:
    """
    Fly certificate data source


    :param str app: Name of app attached to
    :param str hostname: hostname
    """
    ...
