# 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 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__ = [
    'GetServiceHybridDoubleWritesResult',
    'AwaitableGetServiceHybridDoubleWritesResult',
    'get_service_hybrid_double_writes',
    'get_service_hybrid_double_writes_output',
]

@pulumi.output_type
class GetServiceHybridDoubleWritesResult:
    """
    A collection of values returned by getServiceHybridDoubleWrites.
    """
    def __init__(__self__, hybrid_double_writes=None, id=None, ids=None, namespace=None, output_file=None, source_namespace=None, source_user_id=None, user_id=None):
        if hybrid_double_writes and not isinstance(hybrid_double_writes, list):
            raise TypeError("Expected argument 'hybrid_double_writes' to be a list")
        pulumi.set(__self__, "hybrid_double_writes", hybrid_double_writes)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if ids and not isinstance(ids, list):
            raise TypeError("Expected argument 'ids' to be a list")
        pulumi.set(__self__, "ids", ids)
        if namespace and not isinstance(namespace, str):
            raise TypeError("Expected argument 'namespace' to be a str")
        pulumi.set(__self__, "namespace", namespace)
        if output_file and not isinstance(output_file, str):
            raise TypeError("Expected argument 'output_file' to be a str")
        pulumi.set(__self__, "output_file", output_file)
        if source_namespace and not isinstance(source_namespace, str):
            raise TypeError("Expected argument 'source_namespace' to be a str")
        pulumi.set(__self__, "source_namespace", source_namespace)
        if source_user_id and not isinstance(source_user_id, str):
            raise TypeError("Expected argument 'source_user_id' to be a str")
        pulumi.set(__self__, "source_user_id", source_user_id)
        if user_id and not isinstance(user_id, str):
            raise TypeError("Expected argument 'user_id' to be a str")
        pulumi.set(__self__, "user_id", user_id)

    @property
    @pulumi.getter(name="hybridDoubleWrites")
    def hybrid_double_writes(self) -> Sequence['outputs.GetServiceHybridDoubleWritesHybridDoubleWriteResult']:
        """
        A list of Hybrid Double Writes. Each element contains the following attributes:
        """
        return pulumi.get(self, "hybrid_double_writes")

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

    @property
    @pulumi.getter
    def ids(self) -> Sequence[str]:
        return pulumi.get(self, "ids")

    @property
    @pulumi.getter
    def namespace(self) -> Optional[str]:
        """
        Target Namespace.
        """
        return pulumi.get(self, "namespace")

    @property
    @pulumi.getter(name="outputFile")
    def output_file(self) -> Optional[str]:
        return pulumi.get(self, "output_file")

    @property
    @pulumi.getter(name="sourceNamespace")
    def source_namespace(self) -> Optional[str]:
        """
        Source Namespace.
        """
        return pulumi.get(self, "source_namespace")

    @property
    @pulumi.getter(name="sourceUserId")
    def source_user_id(self) -> Optional[str]:
        """
        Source UserId.
        """
        return pulumi.get(self, "source_user_id")

    @property
    @pulumi.getter(name="userId")
    def user_id(self) -> Optional[str]:
        """
        Target UserId.
        """
        return pulumi.get(self, "user_id")


class AwaitableGetServiceHybridDoubleWritesResult(GetServiceHybridDoubleWritesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetServiceHybridDoubleWritesResult(
            hybrid_double_writes=self.hybrid_double_writes,
            id=self.id,
            ids=self.ids,
            namespace=self.namespace,
            output_file=self.output_file,
            source_namespace=self.source_namespace,
            source_user_id=self.source_user_id,
            user_id=self.user_id)


def get_service_hybrid_double_writes(ids: Optional[Sequence[str]] = None,
                                     namespace: Optional[str] = None,
                                     output_file: Optional[str] = None,
                                     source_namespace: Optional[str] = None,
                                     source_user_id: Optional[str] = None,
                                     user_id: Optional[str] = None,
                                     opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetServiceHybridDoubleWritesResult:
    """
    This data source provides the Cloud Monitor Service Hybrid Double Writes of the current Alibaba Cloud user.

    > **NOTE:** Available since v1.220.0.

    ## Example Usage

    Basic Usage

    ```python
    import pulumi
    import pulumi_alicloud as alicloud

    default = alicloud.get_account()
    source = alicloud.cms.Namespace("source", namespace="your-source-namespace")
    default_namespace = alicloud.cms.Namespace("default", namespace="your-namespace")
    default_service_hybrid_double_write = alicloud.cloudmonitor.ServiceHybridDoubleWrite("default",
        source_namespace=source.id,
        source_user_id=default.id,
        namespace=default_namespace.id,
        user_id=default.id)
    ids = alicloud.cloudmonitor.get_service_hybrid_double_writes_output(ids=[default_service_hybrid_double_write.id])
    pulumi.export("cloudMonitorServiceHybridDoubleWritesId1", ids.hybrid_double_writes[0].id)
    ```


    :param Sequence[str] ids: A list of Hybrid Double Write IDs.
    :param str namespace: Target Namespace.
    :param str output_file: File name where to save data source results (after running `pulumi preview`).
    :param str source_namespace: Source Namespace.
    :param str source_user_id: Source UserId.
    :param str user_id: Target UserId.
    """
    __args__ = dict()
    __args__['ids'] = ids
    __args__['namespace'] = namespace
    __args__['outputFile'] = output_file
    __args__['sourceNamespace'] = source_namespace
    __args__['sourceUserId'] = source_user_id
    __args__['userId'] = user_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('alicloud:cloudmonitor/getServiceHybridDoubleWrites:getServiceHybridDoubleWrites', __args__, opts=opts, typ=GetServiceHybridDoubleWritesResult).value

    return AwaitableGetServiceHybridDoubleWritesResult(
        hybrid_double_writes=pulumi.get(__ret__, 'hybrid_double_writes'),
        id=pulumi.get(__ret__, 'id'),
        ids=pulumi.get(__ret__, 'ids'),
        namespace=pulumi.get(__ret__, 'namespace'),
        output_file=pulumi.get(__ret__, 'output_file'),
        source_namespace=pulumi.get(__ret__, 'source_namespace'),
        source_user_id=pulumi.get(__ret__, 'source_user_id'),
        user_id=pulumi.get(__ret__, 'user_id'))
def get_service_hybrid_double_writes_output(ids: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
                                            namespace: Optional[pulumi.Input[Optional[str]]] = None,
                                            output_file: Optional[pulumi.Input[Optional[str]]] = None,
                                            source_namespace: Optional[pulumi.Input[Optional[str]]] = None,
                                            source_user_id: Optional[pulumi.Input[Optional[str]]] = None,
                                            user_id: Optional[pulumi.Input[Optional[str]]] = None,
                                            opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetServiceHybridDoubleWritesResult]:
    """
    This data source provides the Cloud Monitor Service Hybrid Double Writes of the current Alibaba Cloud user.

    > **NOTE:** Available since v1.220.0.

    ## Example Usage

    Basic Usage

    ```python
    import pulumi
    import pulumi_alicloud as alicloud

    default = alicloud.get_account()
    source = alicloud.cms.Namespace("source", namespace="your-source-namespace")
    default_namespace = alicloud.cms.Namespace("default", namespace="your-namespace")
    default_service_hybrid_double_write = alicloud.cloudmonitor.ServiceHybridDoubleWrite("default",
        source_namespace=source.id,
        source_user_id=default.id,
        namespace=default_namespace.id,
        user_id=default.id)
    ids = alicloud.cloudmonitor.get_service_hybrid_double_writes_output(ids=[default_service_hybrid_double_write.id])
    pulumi.export("cloudMonitorServiceHybridDoubleWritesId1", ids.hybrid_double_writes[0].id)
    ```


    :param Sequence[str] ids: A list of Hybrid Double Write IDs.
    :param str namespace: Target Namespace.
    :param str output_file: File name where to save data source results (after running `pulumi preview`).
    :param str source_namespace: Source Namespace.
    :param str source_user_id: Source UserId.
    :param str user_id: Target UserId.
    """
    __args__ = dict()
    __args__['ids'] = ids
    __args__['namespace'] = namespace
    __args__['outputFile'] = output_file
    __args__['sourceNamespace'] = source_namespace
    __args__['sourceUserId'] = source_user_id
    __args__['userId'] = user_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('alicloud:cloudmonitor/getServiceHybridDoubleWrites:getServiceHybridDoubleWrites', __args__, opts=opts, typ=GetServiceHybridDoubleWritesResult)
    return __ret__.apply(lambda __response__: GetServiceHybridDoubleWritesResult(
        hybrid_double_writes=pulumi.get(__response__, 'hybrid_double_writes'),
        id=pulumi.get(__response__, 'id'),
        ids=pulumi.get(__response__, 'ids'),
        namespace=pulumi.get(__response__, 'namespace'),
        output_file=pulumi.get(__response__, 'output_file'),
        source_namespace=pulumi.get(__response__, 'source_namespace'),
        source_user_id=pulumi.get(__response__, 'source_user_id'),
        user_id=pulumi.get(__response__, 'user_id')))
