# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
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__ = [
    'GetGrantRuleToCensResult',
    'AwaitableGetGrantRuleToCensResult',
    'get_grant_rule_to_cens',
    'get_grant_rule_to_cens_output',
]

@pulumi.output_type
class GetGrantRuleToCensResult:
    """
    A collection of values returned by getGrantRuleToCens.
    """
    def __init__(__self__, cens=None, id=None, ids=None, instance_id=None, output_file=None, page_number=None, page_size=None):
        if cens and not isinstance(cens, list):
            raise TypeError("Expected argument 'cens' to be a list")
        pulumi.set(__self__, "cens", cens)
        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 instance_id and not isinstance(instance_id, str):
            raise TypeError("Expected argument 'instance_id' to be a str")
        pulumi.set(__self__, "instance_id", instance_id)
        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 page_number and not isinstance(page_number, int):
            raise TypeError("Expected argument 'page_number' to be a int")
        pulumi.set(__self__, "page_number", page_number)
        if page_size and not isinstance(page_size, int):
            raise TypeError("Expected argument 'page_size' to be a int")
        pulumi.set(__self__, "page_size", page_size)

    @_builtins.property
    @pulumi.getter
    def cens(self) -> Sequence['outputs.GetGrantRuleToCensCenResult']:
        """
        A list of Express Connect Grant Rule To Cens. Each element contains the following attributes:
        """
        return pulumi.get(self, "cens")

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

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

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

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

    @_builtins.property
    @pulumi.getter(name="pageNumber")
    def page_number(self) -> Optional[_builtins.int]:
        return pulumi.get(self, "page_number")

    @_builtins.property
    @pulumi.getter(name="pageSize")
    def page_size(self) -> Optional[_builtins.int]:
        return pulumi.get(self, "page_size")


class AwaitableGetGrantRuleToCensResult(GetGrantRuleToCensResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetGrantRuleToCensResult(
            cens=self.cens,
            id=self.id,
            ids=self.ids,
            instance_id=self.instance_id,
            output_file=self.output_file,
            page_number=self.page_number,
            page_size=self.page_size)


def get_grant_rule_to_cens(ids: Optional[Sequence[_builtins.str]] = None,
                           instance_id: Optional[_builtins.str] = None,
                           output_file: Optional[_builtins.str] = None,
                           page_number: Optional[_builtins.int] = None,
                           page_size: Optional[_builtins.int] = None,
                           opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetGrantRuleToCensResult:
    """
    This data source provides the Express Connect Grant Rule To Cens of the current Alibaba Cloud user.

    > **NOTE:** Available in v1.196.0+.

    ## Example Usage

    Basic Usage

    ```python
    import pulumi
    import pulumi_alicloud as alicloud

    ids = alicloud.expressconnect.get_grant_rule_to_cens(ids=["example_id"],
        instance_id="your_vbr_instance_id")
    pulumi.export("expressConnectGrantRuleToCenId0", ids.cens[0].id)
    ```


    :param Sequence[_builtins.str] ids: A list of Grant Rule To Cen IDs.
    :param _builtins.str instance_id: The ID of the VBR.
    :param _builtins.str output_file: File name where to save data source results (after running `pulumi preview`).
    """
    __args__ = dict()
    __args__['ids'] = ids
    __args__['instanceId'] = instance_id
    __args__['outputFile'] = output_file
    __args__['pageNumber'] = page_number
    __args__['pageSize'] = page_size
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('alicloud:expressconnect/getGrantRuleToCens:getGrantRuleToCens', __args__, opts=opts, typ=GetGrantRuleToCensResult).value

    return AwaitableGetGrantRuleToCensResult(
        cens=pulumi.get(__ret__, 'cens'),
        id=pulumi.get(__ret__, 'id'),
        ids=pulumi.get(__ret__, 'ids'),
        instance_id=pulumi.get(__ret__, 'instance_id'),
        output_file=pulumi.get(__ret__, 'output_file'),
        page_number=pulumi.get(__ret__, 'page_number'),
        page_size=pulumi.get(__ret__, 'page_size'))
def get_grant_rule_to_cens_output(ids: Optional[pulumi.Input[Optional[Sequence[_builtins.str]]]] = None,
                                  instance_id: Optional[pulumi.Input[_builtins.str]] = None,
                                  output_file: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                                  page_number: Optional[pulumi.Input[Optional[_builtins.int]]] = None,
                                  page_size: Optional[pulumi.Input[Optional[_builtins.int]]] = None,
                                  opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetGrantRuleToCensResult]:
    """
    This data source provides the Express Connect Grant Rule To Cens of the current Alibaba Cloud user.

    > **NOTE:** Available in v1.196.0+.

    ## Example Usage

    Basic Usage

    ```python
    import pulumi
    import pulumi_alicloud as alicloud

    ids = alicloud.expressconnect.get_grant_rule_to_cens(ids=["example_id"],
        instance_id="your_vbr_instance_id")
    pulumi.export("expressConnectGrantRuleToCenId0", ids.cens[0].id)
    ```


    :param Sequence[_builtins.str] ids: A list of Grant Rule To Cen IDs.
    :param _builtins.str instance_id: The ID of the VBR.
    :param _builtins.str output_file: File name where to save data source results (after running `pulumi preview`).
    """
    __args__ = dict()
    __args__['ids'] = ids
    __args__['instanceId'] = instance_id
    __args__['outputFile'] = output_file
    __args__['pageNumber'] = page_number
    __args__['pageSize'] = page_size
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('alicloud:expressconnect/getGrantRuleToCens:getGrantRuleToCens', __args__, opts=opts, typ=GetGrantRuleToCensResult)
    return __ret__.apply(lambda __response__: GetGrantRuleToCensResult(
        cens=pulumi.get(__response__, 'cens'),
        id=pulumi.get(__response__, 'id'),
        ids=pulumi.get(__response__, 'ids'),
        instance_id=pulumi.get(__response__, 'instance_id'),
        output_file=pulumi.get(__response__, 'output_file'),
        page_number=pulumi.get(__response__, 'page_number'),
        page_size=pulumi.get(__response__, 'page_size')))
