# 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

__all__ = [
    'TablePrimaryKey',
    'TunnelChannel',
    'GetInstanceAttachmentsAttachmentResult',
    'GetInstancesInstanceResult',
    'GetTablesTableResult',
    'GetTablesTablePrimaryKeyResult',
    'GetTunnelsTunnelResult',
    'GetTunnelsTunnelChannelResult',
]

@pulumi.output_type
class TablePrimaryKey(dict):
    def __init__(__self__, *,
                 name: str,
                 type: str):
        """
        :param str name: Name for primary key.
        :param str type: Type for primary key. Only `Integer`, `String` or `Binary` is allowed.
        """
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "type", type)

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        Name for primary key.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def type(self) -> str:
        """
        Type for primary key. Only `Integer`, `String` or `Binary` is allowed.
        """
        return pulumi.get(self, "type")


@pulumi.output_type
class TunnelChannel(dict):
    @staticmethod
    def __key_warning(key: str):
        suggest = None
        if key == "channelId":
            suggest = "channel_id"
        elif key == "channelRpo":
            suggest = "channel_rpo"
        elif key == "channelStatus":
            suggest = "channel_status"
        elif key == "channelType":
            suggest = "channel_type"
        elif key == "clientId":
            suggest = "client_id"

        if suggest:
            pulumi.log.warn(f"Key '{key}' not found in TunnelChannel. Access the value via the '{suggest}' property getter instead.")

    def __getitem__(self, key: str) -> Any:
        TunnelChannel.__key_warning(key)
        return super().__getitem__(key)

    def get(self, key: str, default = None) -> Any:
        TunnelChannel.__key_warning(key)
        return super().get(key, default)

    def __init__(__self__, *,
                 channel_id: Optional[str] = None,
                 channel_rpo: Optional[int] = None,
                 channel_status: Optional[str] = None,
                 channel_type: Optional[str] = None,
                 client_id: Optional[str] = None):
        """
        :param str channel_id: The id of the channel.
        :param int channel_rpo: The latest consumption time of the channel, unix time in nanosecond.
        :param str channel_status: The status of the channel, valid values: `WAIT`, `OPEN`, `CLOSING`, `CLOSE`, `TERMINATED`.
        :param str channel_type: The type of the channel, valid values: `BaseData`, `Stream`.
        :param str client_id: The client id of the channel.
        """
        if channel_id is not None:
            pulumi.set(__self__, "channel_id", channel_id)
        if channel_rpo is not None:
            pulumi.set(__self__, "channel_rpo", channel_rpo)
        if channel_status is not None:
            pulumi.set(__self__, "channel_status", channel_status)
        if channel_type is not None:
            pulumi.set(__self__, "channel_type", channel_type)
        if client_id is not None:
            pulumi.set(__self__, "client_id", client_id)

    @property
    @pulumi.getter(name="channelId")
    def channel_id(self) -> Optional[str]:
        """
        The id of the channel.
        """
        return pulumi.get(self, "channel_id")

    @property
    @pulumi.getter(name="channelRpo")
    def channel_rpo(self) -> Optional[int]:
        """
        The latest consumption time of the channel, unix time in nanosecond.
        """
        return pulumi.get(self, "channel_rpo")

    @property
    @pulumi.getter(name="channelStatus")
    def channel_status(self) -> Optional[str]:
        """
        The status of the channel, valid values: `WAIT`, `OPEN`, `CLOSING`, `CLOSE`, `TERMINATED`.
        """
        return pulumi.get(self, "channel_status")

    @property
    @pulumi.getter(name="channelType")
    def channel_type(self) -> Optional[str]:
        """
        The type of the channel, valid values: `BaseData`, `Stream`.
        """
        return pulumi.get(self, "channel_type")

    @property
    @pulumi.getter(name="clientId")
    def client_id(self) -> Optional[str]:
        """
        The client id of the channel.
        """
        return pulumi.get(self, "client_id")


@pulumi.output_type
class GetInstanceAttachmentsAttachmentResult(dict):
    def __init__(__self__, *,
                 domain: str,
                 endpoint: str,
                 id: str,
                 instance_name: str,
                 region: str,
                 vpc_id: str,
                 vpc_name: str):
        """
        :param str domain: The domain of the instance attachment.
        :param str endpoint: The access endpoint of the instance attachment.
        :param str id: The resource ID, the value is same as "instance_name".
        :param str instance_name: The name of OTS instance.
        :param str region: The region of the instance attachment.
        :param str vpc_id: The ID of attaching VPC to instance.
        :param str vpc_name: The name of attaching VPC to instance.
        """
        pulumi.set(__self__, "domain", domain)
        pulumi.set(__self__, "endpoint", endpoint)
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "instance_name", instance_name)
        pulumi.set(__self__, "region", region)
        pulumi.set(__self__, "vpc_id", vpc_id)
        pulumi.set(__self__, "vpc_name", vpc_name)

    @property
    @pulumi.getter
    def domain(self) -> str:
        """
        The domain of the instance attachment.
        """
        return pulumi.get(self, "domain")

    @property
    @pulumi.getter
    def endpoint(self) -> str:
        """
        The access endpoint of the instance attachment.
        """
        return pulumi.get(self, "endpoint")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The resource ID, the value is same as "instance_name".
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="instanceName")
    def instance_name(self) -> str:
        """
        The name of OTS instance.
        """
        return pulumi.get(self, "instance_name")

    @property
    @pulumi.getter
    def region(self) -> str:
        """
        The region of the instance attachment.
        """
        return pulumi.get(self, "region")

    @property
    @pulumi.getter(name="vpcId")
    def vpc_id(self) -> str:
        """
        The ID of attaching VPC to instance.
        """
        return pulumi.get(self, "vpc_id")

    @property
    @pulumi.getter(name="vpcName")
    def vpc_name(self) -> str:
        """
        The name of attaching VPC to instance.
        """
        return pulumi.get(self, "vpc_name")


@pulumi.output_type
class GetInstancesInstanceResult(dict):
    def __init__(__self__, *,
                 cluster_type: str,
                 create_time: str,
                 description: str,
                 entity_quota: int,
                 id: str,
                 name: str,
                 network: str,
                 read_capacity: int,
                 status: str,
                 tags: Mapping[str, Any],
                 user_id: str,
                 write_capacity: int):
        """
        :param str cluster_type: The cluster type of the instance. Possible values: `SSD`, `HYBRID`.
        :param str create_time: The create time of the instance.
        :param str description: The description of the instance.
        :param int entity_quota: The instance quota which indicating the maximum number of tables.
        :param str id: ID of the instance.
        :param str name: Instance name.
        :param str network: The network type of the instance. Possible values: `NORMAL`, `VPC`, `VPC_CONSOLE`.
        :param int read_capacity: The maximum adjustable read capacity unit of the instance.
        :param str status: Instance status. Possible values: `Running`, `Disabled`, `Deleting`.
        :param Mapping[str, Any] tags: A map of tags assigned to the instance. It must be in the format:
               ```python
               import pulumi
               import pulumi_alicloud as alicloud
               
               instances_ds = alicloud.ots.get_instances(tags={
                   "tagKey1": "tagValue1",
                   "tagKey2": "tagValue2",
               })
               ```
        :param str user_id: The user id of the instance.
        :param int write_capacity: The maximum adjustable write capacity unit of the instance.
        """
        pulumi.set(__self__, "cluster_type", cluster_type)
        pulumi.set(__self__, "create_time", create_time)
        pulumi.set(__self__, "description", description)
        pulumi.set(__self__, "entity_quota", entity_quota)
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "network", network)
        pulumi.set(__self__, "read_capacity", read_capacity)
        pulumi.set(__self__, "status", status)
        pulumi.set(__self__, "tags", tags)
        pulumi.set(__self__, "user_id", user_id)
        pulumi.set(__self__, "write_capacity", write_capacity)

    @property
    @pulumi.getter(name="clusterType")
    def cluster_type(self) -> str:
        """
        The cluster type of the instance. Possible values: `SSD`, `HYBRID`.
        """
        return pulumi.get(self, "cluster_type")

    @property
    @pulumi.getter(name="createTime")
    def create_time(self) -> str:
        """
        The create time of the instance.
        """
        return pulumi.get(self, "create_time")

    @property
    @pulumi.getter
    def description(self) -> str:
        """
        The description of the instance.
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="entityQuota")
    def entity_quota(self) -> int:
        """
        The instance quota which indicating the maximum number of tables.
        """
        return pulumi.get(self, "entity_quota")

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

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

    @property
    @pulumi.getter
    def network(self) -> str:
        """
        The network type of the instance. Possible values: `NORMAL`, `VPC`, `VPC_CONSOLE`.
        """
        return pulumi.get(self, "network")

    @property
    @pulumi.getter(name="readCapacity")
    def read_capacity(self) -> int:
        """
        The maximum adjustable read capacity unit of the instance.
        """
        return pulumi.get(self, "read_capacity")

    @property
    @pulumi.getter
    def status(self) -> str:
        """
        Instance status. Possible values: `Running`, `Disabled`, `Deleting`.
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter
    def tags(self) -> Mapping[str, Any]:
        """
        A map of tags assigned to the instance. It must be in the format:
        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        instances_ds = alicloud.ots.get_instances(tags={
            "tagKey1": "tagValue1",
            "tagKey2": "tagValue2",
        })
        ```
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter(name="userId")
    def user_id(self) -> str:
        """
        The user id of the instance.
        """
        return pulumi.get(self, "user_id")

    @property
    @pulumi.getter(name="writeCapacity")
    def write_capacity(self) -> int:
        """
        The maximum adjustable write capacity unit of the instance.
        """
        return pulumi.get(self, "write_capacity")


@pulumi.output_type
class GetTablesTableResult(dict):
    def __init__(__self__, *,
                 id: str,
                 instance_name: str,
                 max_version: int,
                 primary_keys: Sequence['outputs.GetTablesTablePrimaryKeyResult'],
                 table_name: str,
                 time_to_live: int):
        """
        :param str id: ID of the table. The value is `<instance_name>:<table_name>`.
        :param str instance_name: The name of OTS instance.
        :param int max_version: The maximum number of versions stored in this table.
        :param Sequence['GetTablesTablePrimaryKeyArgs'] primary_keys: The property of `TableMeta` which indicates the structure information of a table.
        :param str table_name: The table name of the OTS which could not be changed.
        :param int time_to_live: The retention time of data stored in this table.
        """
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "instance_name", instance_name)
        pulumi.set(__self__, "max_version", max_version)
        pulumi.set(__self__, "primary_keys", primary_keys)
        pulumi.set(__self__, "table_name", table_name)
        pulumi.set(__self__, "time_to_live", time_to_live)

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        ID of the table. The value is `<instance_name>:<table_name>`.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="instanceName")
    def instance_name(self) -> str:
        """
        The name of OTS instance.
        """
        return pulumi.get(self, "instance_name")

    @property
    @pulumi.getter(name="maxVersion")
    def max_version(self) -> int:
        """
        The maximum number of versions stored in this table.
        """
        return pulumi.get(self, "max_version")

    @property
    @pulumi.getter(name="primaryKeys")
    def primary_keys(self) -> Sequence['outputs.GetTablesTablePrimaryKeyResult']:
        """
        The property of `TableMeta` which indicates the structure information of a table.
        """
        return pulumi.get(self, "primary_keys")

    @property
    @pulumi.getter(name="tableName")
    def table_name(self) -> str:
        """
        The table name of the OTS which could not be changed.
        """
        return pulumi.get(self, "table_name")

    @property
    @pulumi.getter(name="timeToLive")
    def time_to_live(self) -> int:
        """
        The retention time of data stored in this table.
        """
        return pulumi.get(self, "time_to_live")


@pulumi.output_type
class GetTablesTablePrimaryKeyResult(dict):
    def __init__(__self__, *,
                 name: str,
                 type: str):
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "type", type)

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

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


@pulumi.output_type
class GetTunnelsTunnelResult(dict):
    def __init__(__self__, *,
                 channels: Sequence['outputs.GetTunnelsTunnelChannelResult'],
                 create_time: int,
                 expired: bool,
                 id: str,
                 instance_name: str,
                 table_name: str,
                 tunnel_id: str,
                 tunnel_name: str,
                 tunnel_rpo: int,
                 tunnel_stage: str,
                 tunnel_type: str):
        """
        :param Sequence['GetTunnelsTunnelChannelArgs'] channels: The channels of OTS tunnel. Each element contains the following attributes:
        :param int create_time: The creation time of the Tunnel.
        :param bool expired: Whether the tunnel has expired.
        :param str id: The resource ID. The value is `<instance_name>:<table_name>:<tunnel_name>`.
        :param str instance_name: The name of OTS instance.
        :param str table_name: The name of OTS table.
        :param str tunnel_id: The tunnel id of the OTS which could not be changed.
        :param str tunnel_name: The tunnel name of the OTS which could not be changed.
        :param int tunnel_rpo: The latest consumption time of the tunnel, unix time in nanosecond.
        :param str tunnel_stage: The stage of OTS tunnel, valid values: `InitBaseDataAndStreamShard`, `ProcessBaseData`, `ProcessStream`.
        :param str tunnel_type: The type of the OTS tunnel, valid values: `BaseAndStream`, `BaseData`, `Stream`.
        """
        pulumi.set(__self__, "channels", channels)
        pulumi.set(__self__, "create_time", create_time)
        pulumi.set(__self__, "expired", expired)
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "instance_name", instance_name)
        pulumi.set(__self__, "table_name", table_name)
        pulumi.set(__self__, "tunnel_id", tunnel_id)
        pulumi.set(__self__, "tunnel_name", tunnel_name)
        pulumi.set(__self__, "tunnel_rpo", tunnel_rpo)
        pulumi.set(__self__, "tunnel_stage", tunnel_stage)
        pulumi.set(__self__, "tunnel_type", tunnel_type)

    @property
    @pulumi.getter
    def channels(self) -> Sequence['outputs.GetTunnelsTunnelChannelResult']:
        """
        The channels of OTS tunnel. Each element contains the following attributes:
        """
        return pulumi.get(self, "channels")

    @property
    @pulumi.getter(name="createTime")
    def create_time(self) -> int:
        """
        The creation time of the Tunnel.
        """
        return pulumi.get(self, "create_time")

    @property
    @pulumi.getter
    def expired(self) -> bool:
        """
        Whether the tunnel has expired.
        """
        return pulumi.get(self, "expired")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The resource ID. The value is `<instance_name>:<table_name>:<tunnel_name>`.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="instanceName")
    def instance_name(self) -> str:
        """
        The name of OTS instance.
        """
        return pulumi.get(self, "instance_name")

    @property
    @pulumi.getter(name="tableName")
    def table_name(self) -> str:
        """
        The name of OTS table.
        """
        return pulumi.get(self, "table_name")

    @property
    @pulumi.getter(name="tunnelId")
    def tunnel_id(self) -> str:
        """
        The tunnel id of the OTS which could not be changed.
        """
        return pulumi.get(self, "tunnel_id")

    @property
    @pulumi.getter(name="tunnelName")
    def tunnel_name(self) -> str:
        """
        The tunnel name of the OTS which could not be changed.
        """
        return pulumi.get(self, "tunnel_name")

    @property
    @pulumi.getter(name="tunnelRpo")
    def tunnel_rpo(self) -> int:
        """
        The latest consumption time of the tunnel, unix time in nanosecond.
        """
        return pulumi.get(self, "tunnel_rpo")

    @property
    @pulumi.getter(name="tunnelStage")
    def tunnel_stage(self) -> str:
        """
        The stage of OTS tunnel, valid values: `InitBaseDataAndStreamShard`, `ProcessBaseData`, `ProcessStream`.
        """
        return pulumi.get(self, "tunnel_stage")

    @property
    @pulumi.getter(name="tunnelType")
    def tunnel_type(self) -> str:
        """
        The type of the OTS tunnel, valid values: `BaseAndStream`, `BaseData`, `Stream`.
        """
        return pulumi.get(self, "tunnel_type")


@pulumi.output_type
class GetTunnelsTunnelChannelResult(dict):
    def __init__(__self__, *,
                 channel_id: str,
                 channel_rpo: int,
                 channel_status: str,
                 channel_type: str,
                 client_id: str):
        """
        :param str channel_id: The id of the channel.
        :param int channel_rpo: The latest consumption time of the channel, unix time in nanosecond
        :param str channel_status: The status of the channel, valid values: `WAIT`, `OPEN`, `CLOSING`, `CLOSE`, `TERMINATED`.
        :param str channel_type: The type of the channel, valid values: `BaseData`, `Stream`.
        :param str client_id: The client id of the channel.
        """
        pulumi.set(__self__, "channel_id", channel_id)
        pulumi.set(__self__, "channel_rpo", channel_rpo)
        pulumi.set(__self__, "channel_status", channel_status)
        pulumi.set(__self__, "channel_type", channel_type)
        pulumi.set(__self__, "client_id", client_id)

    @property
    @pulumi.getter(name="channelId")
    def channel_id(self) -> str:
        """
        The id of the channel.
        """
        return pulumi.get(self, "channel_id")

    @property
    @pulumi.getter(name="channelRpo")
    def channel_rpo(self) -> int:
        """
        The latest consumption time of the channel, unix time in nanosecond
        """
        return pulumi.get(self, "channel_rpo")

    @property
    @pulumi.getter(name="channelStatus")
    def channel_status(self) -> str:
        """
        The status of the channel, valid values: `WAIT`, `OPEN`, `CLOSING`, `CLOSE`, `TERMINATED`.
        """
        return pulumi.get(self, "channel_status")

    @property
    @pulumi.getter(name="channelType")
    def channel_type(self) -> str:
        """
        The type of the channel, valid values: `BaseData`, `Stream`.
        """
        return pulumi.get(self, "channel_type")

    @property
    @pulumi.getter(name="clientId")
    def client_id(self) -> str:
        """
        The client id of the channel.
        """
        return pulumi.get(self, "client_id")


