# 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 builtins
import copy
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

__all__ = [
    'GetUpstreamSourceResult',
    'AwaitableGetUpstreamSourceResult',
    'get_upstream_source',
    'get_upstream_source_output',
]

@pulumi.output_type
class GetUpstreamSourceResult:
    """
    A collection of values returned by getUpstreamSource.
    """
    def __init__(__self__, comments=None, created_time=None, gateway_id=None, id=None, ingress_settings=None, source_spec=None, source_type=None, status=None, status_message=None, updated_time=None, upstream_source_id=None, watch_namespaces=None):
        if comments and not isinstance(comments, str):
            raise TypeError("Expected argument 'comments' to be a str")
        pulumi.set(__self__, "comments", comments)
        if created_time and not isinstance(created_time, str):
            raise TypeError("Expected argument 'created_time' to be a str")
        pulumi.set(__self__, "created_time", created_time)
        if gateway_id and not isinstance(gateway_id, str):
            raise TypeError("Expected argument 'gateway_id' to be a str")
        pulumi.set(__self__, "gateway_id", gateway_id)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if ingress_settings and not isinstance(ingress_settings, dict):
            raise TypeError("Expected argument 'ingress_settings' to be a dict")
        pulumi.set(__self__, "ingress_settings", ingress_settings)
        if source_spec and not isinstance(source_spec, dict):
            raise TypeError("Expected argument 'source_spec' to be a dict")
        pulumi.set(__self__, "source_spec", source_spec)
        if source_type and not isinstance(source_type, str):
            raise TypeError("Expected argument 'source_type' to be a str")
        pulumi.set(__self__, "source_type", source_type)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if status_message and not isinstance(status_message, str):
            raise TypeError("Expected argument 'status_message' to be a str")
        pulumi.set(__self__, "status_message", status_message)
        if updated_time and not isinstance(updated_time, str):
            raise TypeError("Expected argument 'updated_time' to be a str")
        pulumi.set(__self__, "updated_time", updated_time)
        if upstream_source_id and not isinstance(upstream_source_id, str):
            raise TypeError("Expected argument 'upstream_source_id' to be a str")
        pulumi.set(__self__, "upstream_source_id", upstream_source_id)
        if watch_namespaces and not isinstance(watch_namespaces, list):
            raise TypeError("Expected argument 'watch_namespaces' to be a list")
        pulumi.set(__self__, "watch_namespaces", watch_namespaces)

    @property
    @pulumi.getter
    def comments(self) -> builtins.str:
        """
        备注，长度限制为0~253个字符。
        """
        return pulumi.get(self, "comments")

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> builtins.str:
        """
        创建时间。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter(name="gatewayId")
    def gateway_id(self) -> builtins.str:
        """
        网关实例ID。
        """
        return pulumi.get(self, "gateway_id")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="ingressSettings")
    def ingress_settings(self) -> 'outputs.GetUpstreamSourceIngressSettingsResult':
        """
        路由同步。开启后，API网关会自动监听Ingress资源的变化，并将Ingress资源转义为服务，域名，Upstream等资源合并至当前网关。由Ingress转义的资源不支持在控制台操作。仅支持容器集群来源类型。
        """
        return pulumi.get(self, "ingress_settings")

    @property
    @pulumi.getter(name="sourceSpec")
    def source_spec(self) -> 'outputs.GetUpstreamSourceSourceSpecResult':
        """
        Upstream来源配置。
        """
        return pulumi.get(self, "source_spec")

    @property
    @pulumi.getter(name="sourceType")
    def source_type(self) -> builtins.str:
        """
        Upstream来源类型，取值：K8S：容器集群。Nacos：注册中心。
        """
        return pulumi.get(self, "source_type")

    @property
    @pulumi.getter
    def status(self) -> builtins.str:
        """
        导入状态，取值：Syncing：导入中。SyncedSucceed：导入成功。SyncedFailed：导入失败。
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter(name="statusMessage")
    def status_message(self) -> builtins.str:
        """
        导入状态信息，取值：ConnectionFailed：Nacos集群无法连接。AuthenticationFailed：认证失败。PermissionFailed：Nacos集群无法连接。
        """
        return pulumi.get(self, "status_message")

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> builtins.str:
        """
        更新时间。
        """
        return pulumi.get(self, "updated_time")

    @property
    @pulumi.getter(name="upstreamSourceId")
    def upstream_source_id(self) -> builtins.str:
        """
        Upstream来源ID。
        """
        return pulumi.get(self, "upstream_source_id")

    @property
    @pulumi.getter(name="watchNamespaces")
    def watch_namespaces(self) -> Sequence[builtins.str]:
        """
        指定命名空间。
        """
        return pulumi.get(self, "watch_namespaces")


class AwaitableGetUpstreamSourceResult(GetUpstreamSourceResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetUpstreamSourceResult(
            comments=self.comments,
            created_time=self.created_time,
            gateway_id=self.gateway_id,
            id=self.id,
            ingress_settings=self.ingress_settings,
            source_spec=self.source_spec,
            source_type=self.source_type,
            status=self.status,
            status_message=self.status_message,
            updated_time=self.updated_time,
            upstream_source_id=self.upstream_source_id,
            watch_namespaces=self.watch_namespaces)


def get_upstream_source(id: Optional[builtins.str] = None,
                        opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetUpstreamSourceResult:
    """
    Data Source schema for Byteplus::APIG::UpstreamSource


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:apig/getUpstreamSource:getUpstreamSource', __args__, opts=opts, typ=GetUpstreamSourceResult).value

    return AwaitableGetUpstreamSourceResult(
        comments=pulumi.get(__ret__, 'comments'),
        created_time=pulumi.get(__ret__, 'created_time'),
        gateway_id=pulumi.get(__ret__, 'gateway_id'),
        id=pulumi.get(__ret__, 'id'),
        ingress_settings=pulumi.get(__ret__, 'ingress_settings'),
        source_spec=pulumi.get(__ret__, 'source_spec'),
        source_type=pulumi.get(__ret__, 'source_type'),
        status=pulumi.get(__ret__, 'status'),
        status_message=pulumi.get(__ret__, 'status_message'),
        updated_time=pulumi.get(__ret__, 'updated_time'),
        upstream_source_id=pulumi.get(__ret__, 'upstream_source_id'),
        watch_namespaces=pulumi.get(__ret__, 'watch_namespaces'))
def get_upstream_source_output(id: Optional[pulumi.Input[builtins.str]] = None,
                               opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetUpstreamSourceResult]:
    """
    Data Source schema for Byteplus::APIG::UpstreamSource


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:apig/getUpstreamSource:getUpstreamSource', __args__, opts=opts, typ=GetUpstreamSourceResult)
    return __ret__.apply(lambda __response__: GetUpstreamSourceResult(
        comments=pulumi.get(__response__, 'comments'),
        created_time=pulumi.get(__response__, 'created_time'),
        gateway_id=pulumi.get(__response__, 'gateway_id'),
        id=pulumi.get(__response__, 'id'),
        ingress_settings=pulumi.get(__response__, 'ingress_settings'),
        source_spec=pulumi.get(__response__, 'source_spec'),
        source_type=pulumi.get(__response__, 'source_type'),
        status=pulumi.get(__response__, 'status'),
        status_message=pulumi.get(__response__, 'status_message'),
        updated_time=pulumi.get(__response__, 'updated_time'),
        upstream_source_id=pulumi.get(__response__, 'upstream_source_id'),
        watch_namespaces=pulumi.get(__response__, 'watch_namespaces')))
