# 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

__all__ = ['ServiceQueueArgs', 'ServiceQueue']

@pulumi.input_type
class ServiceQueueArgs:
    def __init__(__self__, *,
                 queue_name: pulumi.Input[str],
                 delay_seconds: Optional[pulumi.Input[int]] = None,
                 logging_enabled: Optional[pulumi.Input[bool]] = None,
                 maximum_message_size: Optional[pulumi.Input[int]] = None,
                 message_retention_period: Optional[pulumi.Input[int]] = None,
                 polling_wait_seconds: Optional[pulumi.Input[int]] = None,
                 visibility_timeout: Optional[pulumi.Input[int]] = None):
        """
        The set of arguments for constructing a ServiceQueue resource.
        :param pulumi.Input[str] queue_name: Representative resources.
        :param pulumi.Input[int] delay_seconds: This means that messages sent to the queue can only be consumed after the delay time set by this parameter, in seconds.
        :param pulumi.Input[bool] logging_enabled: Represents whether the log management function is enabled.
        :param pulumi.Input[int] maximum_message_size: Represents the maximum length of the message body sent to the Queue, in Byte.
        :param pulumi.Input[int] message_retention_period: Represents the longest life time of the message in the Queue.
        :param pulumi.Input[int] polling_wait_seconds: The longest waiting time for a Queue request when the number of messages is empty, in seconds.
        :param pulumi.Input[int] visibility_timeout: Represents the duration after the message is removed from the Queue and changed from the Active state to the Inactive state.
        """
        pulumi.set(__self__, "queue_name", queue_name)
        if delay_seconds is not None:
            pulumi.set(__self__, "delay_seconds", delay_seconds)
        if logging_enabled is not None:
            pulumi.set(__self__, "logging_enabled", logging_enabled)
        if maximum_message_size is not None:
            pulumi.set(__self__, "maximum_message_size", maximum_message_size)
        if message_retention_period is not None:
            pulumi.set(__self__, "message_retention_period", message_retention_period)
        if polling_wait_seconds is not None:
            pulumi.set(__self__, "polling_wait_seconds", polling_wait_seconds)
        if visibility_timeout is not None:
            pulumi.set(__self__, "visibility_timeout", visibility_timeout)

    @property
    @pulumi.getter(name="queueName")
    def queue_name(self) -> pulumi.Input[str]:
        """
        Representative resources.
        """
        return pulumi.get(self, "queue_name")

    @queue_name.setter
    def queue_name(self, value: pulumi.Input[str]):
        pulumi.set(self, "queue_name", value)

    @property
    @pulumi.getter(name="delaySeconds")
    def delay_seconds(self) -> Optional[pulumi.Input[int]]:
        """
        This means that messages sent to the queue can only be consumed after the delay time set by this parameter, in seconds.
        """
        return pulumi.get(self, "delay_seconds")

    @delay_seconds.setter
    def delay_seconds(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "delay_seconds", value)

    @property
    @pulumi.getter(name="loggingEnabled")
    def logging_enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Represents whether the log management function is enabled.
        """
        return pulumi.get(self, "logging_enabled")

    @logging_enabled.setter
    def logging_enabled(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "logging_enabled", value)

    @property
    @pulumi.getter(name="maximumMessageSize")
    def maximum_message_size(self) -> Optional[pulumi.Input[int]]:
        """
        Represents the maximum length of the message body sent to the Queue, in Byte.
        """
        return pulumi.get(self, "maximum_message_size")

    @maximum_message_size.setter
    def maximum_message_size(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "maximum_message_size", value)

    @property
    @pulumi.getter(name="messageRetentionPeriod")
    def message_retention_period(self) -> Optional[pulumi.Input[int]]:
        """
        Represents the longest life time of the message in the Queue.
        """
        return pulumi.get(self, "message_retention_period")

    @message_retention_period.setter
    def message_retention_period(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "message_retention_period", value)

    @property
    @pulumi.getter(name="pollingWaitSeconds")
    def polling_wait_seconds(self) -> Optional[pulumi.Input[int]]:
        """
        The longest waiting time for a Queue request when the number of messages is empty, in seconds.
        """
        return pulumi.get(self, "polling_wait_seconds")

    @polling_wait_seconds.setter
    def polling_wait_seconds(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "polling_wait_seconds", value)

    @property
    @pulumi.getter(name="visibilityTimeout")
    def visibility_timeout(self) -> Optional[pulumi.Input[int]]:
        """
        Represents the duration after the message is removed from the Queue and changed from the Active state to the Inactive state.
        """
        return pulumi.get(self, "visibility_timeout")

    @visibility_timeout.setter
    def visibility_timeout(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "visibility_timeout", value)


@pulumi.input_type
class _ServiceQueueState:
    def __init__(__self__, *,
                 create_time: Optional[pulumi.Input[int]] = None,
                 delay_seconds: Optional[pulumi.Input[int]] = None,
                 logging_enabled: Optional[pulumi.Input[bool]] = None,
                 maximum_message_size: Optional[pulumi.Input[int]] = None,
                 message_retention_period: Optional[pulumi.Input[int]] = None,
                 polling_wait_seconds: Optional[pulumi.Input[int]] = None,
                 queue_name: Optional[pulumi.Input[str]] = None,
                 visibility_timeout: Optional[pulumi.Input[int]] = None):
        """
        Input properties used for looking up and filtering ServiceQueue resources.
        :param pulumi.Input[int] create_time: Represents the time when the Queue was created.
        :param pulumi.Input[int] delay_seconds: This means that messages sent to the queue can only be consumed after the delay time set by this parameter, in seconds.
        :param pulumi.Input[bool] logging_enabled: Represents whether the log management function is enabled.
        :param pulumi.Input[int] maximum_message_size: Represents the maximum length of the message body sent to the Queue, in Byte.
        :param pulumi.Input[int] message_retention_period: Represents the longest life time of the message in the Queue.
        :param pulumi.Input[int] polling_wait_seconds: The longest waiting time for a Queue request when the number of messages is empty, in seconds.
        :param pulumi.Input[str] queue_name: Representative resources.
        :param pulumi.Input[int] visibility_timeout: Represents the duration after the message is removed from the Queue and changed from the Active state to the Inactive state.
        """
        if create_time is not None:
            pulumi.set(__self__, "create_time", create_time)
        if delay_seconds is not None:
            pulumi.set(__self__, "delay_seconds", delay_seconds)
        if logging_enabled is not None:
            pulumi.set(__self__, "logging_enabled", logging_enabled)
        if maximum_message_size is not None:
            pulumi.set(__self__, "maximum_message_size", maximum_message_size)
        if message_retention_period is not None:
            pulumi.set(__self__, "message_retention_period", message_retention_period)
        if polling_wait_seconds is not None:
            pulumi.set(__self__, "polling_wait_seconds", polling_wait_seconds)
        if queue_name is not None:
            pulumi.set(__self__, "queue_name", queue_name)
        if visibility_timeout is not None:
            pulumi.set(__self__, "visibility_timeout", visibility_timeout)

    @property
    @pulumi.getter(name="createTime")
    def create_time(self) -> Optional[pulumi.Input[int]]:
        """
        Represents the time when the Queue was created.
        """
        return pulumi.get(self, "create_time")

    @create_time.setter
    def create_time(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "create_time", value)

    @property
    @pulumi.getter(name="delaySeconds")
    def delay_seconds(self) -> Optional[pulumi.Input[int]]:
        """
        This means that messages sent to the queue can only be consumed after the delay time set by this parameter, in seconds.
        """
        return pulumi.get(self, "delay_seconds")

    @delay_seconds.setter
    def delay_seconds(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "delay_seconds", value)

    @property
    @pulumi.getter(name="loggingEnabled")
    def logging_enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Represents whether the log management function is enabled.
        """
        return pulumi.get(self, "logging_enabled")

    @logging_enabled.setter
    def logging_enabled(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "logging_enabled", value)

    @property
    @pulumi.getter(name="maximumMessageSize")
    def maximum_message_size(self) -> Optional[pulumi.Input[int]]:
        """
        Represents the maximum length of the message body sent to the Queue, in Byte.
        """
        return pulumi.get(self, "maximum_message_size")

    @maximum_message_size.setter
    def maximum_message_size(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "maximum_message_size", value)

    @property
    @pulumi.getter(name="messageRetentionPeriod")
    def message_retention_period(self) -> Optional[pulumi.Input[int]]:
        """
        Represents the longest life time of the message in the Queue.
        """
        return pulumi.get(self, "message_retention_period")

    @message_retention_period.setter
    def message_retention_period(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "message_retention_period", value)

    @property
    @pulumi.getter(name="pollingWaitSeconds")
    def polling_wait_seconds(self) -> Optional[pulumi.Input[int]]:
        """
        The longest waiting time for a Queue request when the number of messages is empty, in seconds.
        """
        return pulumi.get(self, "polling_wait_seconds")

    @polling_wait_seconds.setter
    def polling_wait_seconds(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "polling_wait_seconds", value)

    @property
    @pulumi.getter(name="queueName")
    def queue_name(self) -> Optional[pulumi.Input[str]]:
        """
        Representative resources.
        """
        return pulumi.get(self, "queue_name")

    @queue_name.setter
    def queue_name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "queue_name", value)

    @property
    @pulumi.getter(name="visibilityTimeout")
    def visibility_timeout(self) -> Optional[pulumi.Input[int]]:
        """
        Represents the duration after the message is removed from the Queue and changed from the Active state to the Inactive state.
        """
        return pulumi.get(self, "visibility_timeout")

    @visibility_timeout.setter
    def visibility_timeout(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "visibility_timeout", value)


class ServiceQueue(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 delay_seconds: Optional[pulumi.Input[int]] = None,
                 logging_enabled: Optional[pulumi.Input[bool]] = None,
                 maximum_message_size: Optional[pulumi.Input[int]] = None,
                 message_retention_period: Optional[pulumi.Input[int]] = None,
                 polling_wait_seconds: Optional[pulumi.Input[int]] = None,
                 queue_name: Optional[pulumi.Input[str]] = None,
                 visibility_timeout: Optional[pulumi.Input[int]] = None,
                 __props__=None):
        """
        Provides a Message Service Queue resource.

        For information about Message Service Queue and how to use it, see [What is Queue](https://www.alibabacloud.com/help/en/message-service/latest/createqueue).

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

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        config = pulumi.Config()
        name = config.get("name")
        if name is None:
            name = "terraform-example"
        default = alicloud.message.ServiceQueue("default",
            delay_seconds=2,
            polling_wait_seconds=2,
            message_retention_period=566,
            maximum_message_size=1123,
            visibility_timeout=30,
            queue_name=name)
        ```

        ## Import

        Message Service Queue can be imported using the id, e.g.

        ```sh
        $ pulumi import alicloud:message/serviceQueue:ServiceQueue example <id>
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[int] delay_seconds: This means that messages sent to the queue can only be consumed after the delay time set by this parameter, in seconds.
        :param pulumi.Input[bool] logging_enabled: Represents whether the log management function is enabled.
        :param pulumi.Input[int] maximum_message_size: Represents the maximum length of the message body sent to the Queue, in Byte.
        :param pulumi.Input[int] message_retention_period: Represents the longest life time of the message in the Queue.
        :param pulumi.Input[int] polling_wait_seconds: The longest waiting time for a Queue request when the number of messages is empty, in seconds.
        :param pulumi.Input[str] queue_name: Representative resources.
        :param pulumi.Input[int] visibility_timeout: Represents the duration after the message is removed from the Queue and changed from the Active state to the Inactive state.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: ServiceQueueArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Provides a Message Service Queue resource.

        For information about Message Service Queue and how to use it, see [What is Queue](https://www.alibabacloud.com/help/en/message-service/latest/createqueue).

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

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        config = pulumi.Config()
        name = config.get("name")
        if name is None:
            name = "terraform-example"
        default = alicloud.message.ServiceQueue("default",
            delay_seconds=2,
            polling_wait_seconds=2,
            message_retention_period=566,
            maximum_message_size=1123,
            visibility_timeout=30,
            queue_name=name)
        ```

        ## Import

        Message Service Queue can be imported using the id, e.g.

        ```sh
        $ pulumi import alicloud:message/serviceQueue:ServiceQueue example <id>
        ```

        :param str resource_name: The name of the resource.
        :param ServiceQueueArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(ServiceQueueArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 delay_seconds: Optional[pulumi.Input[int]] = None,
                 logging_enabled: Optional[pulumi.Input[bool]] = None,
                 maximum_message_size: Optional[pulumi.Input[int]] = None,
                 message_retention_period: Optional[pulumi.Input[int]] = None,
                 polling_wait_seconds: Optional[pulumi.Input[int]] = None,
                 queue_name: Optional[pulumi.Input[str]] = None,
                 visibility_timeout: Optional[pulumi.Input[int]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = ServiceQueueArgs.__new__(ServiceQueueArgs)

            __props__.__dict__["delay_seconds"] = delay_seconds
            __props__.__dict__["logging_enabled"] = logging_enabled
            __props__.__dict__["maximum_message_size"] = maximum_message_size
            __props__.__dict__["message_retention_period"] = message_retention_period
            __props__.__dict__["polling_wait_seconds"] = polling_wait_seconds
            if queue_name is None and not opts.urn:
                raise TypeError("Missing required property 'queue_name'")
            __props__.__dict__["queue_name"] = queue_name
            __props__.__dict__["visibility_timeout"] = visibility_timeout
            __props__.__dict__["create_time"] = None
        super(ServiceQueue, __self__).__init__(
            'alicloud:message/serviceQueue:ServiceQueue',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            create_time: Optional[pulumi.Input[int]] = None,
            delay_seconds: Optional[pulumi.Input[int]] = None,
            logging_enabled: Optional[pulumi.Input[bool]] = None,
            maximum_message_size: Optional[pulumi.Input[int]] = None,
            message_retention_period: Optional[pulumi.Input[int]] = None,
            polling_wait_seconds: Optional[pulumi.Input[int]] = None,
            queue_name: Optional[pulumi.Input[str]] = None,
            visibility_timeout: Optional[pulumi.Input[int]] = None) -> 'ServiceQueue':
        """
        Get an existing ServiceQueue resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[int] create_time: Represents the time when the Queue was created.
        :param pulumi.Input[int] delay_seconds: This means that messages sent to the queue can only be consumed after the delay time set by this parameter, in seconds.
        :param pulumi.Input[bool] logging_enabled: Represents whether the log management function is enabled.
        :param pulumi.Input[int] maximum_message_size: Represents the maximum length of the message body sent to the Queue, in Byte.
        :param pulumi.Input[int] message_retention_period: Represents the longest life time of the message in the Queue.
        :param pulumi.Input[int] polling_wait_seconds: The longest waiting time for a Queue request when the number of messages is empty, in seconds.
        :param pulumi.Input[str] queue_name: Representative resources.
        :param pulumi.Input[int] visibility_timeout: Represents the duration after the message is removed from the Queue and changed from the Active state to the Inactive state.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ServiceQueueState.__new__(_ServiceQueueState)

        __props__.__dict__["create_time"] = create_time
        __props__.__dict__["delay_seconds"] = delay_seconds
        __props__.__dict__["logging_enabled"] = logging_enabled
        __props__.__dict__["maximum_message_size"] = maximum_message_size
        __props__.__dict__["message_retention_period"] = message_retention_period
        __props__.__dict__["polling_wait_seconds"] = polling_wait_seconds
        __props__.__dict__["queue_name"] = queue_name
        __props__.__dict__["visibility_timeout"] = visibility_timeout
        return ServiceQueue(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="createTime")
    def create_time(self) -> pulumi.Output[int]:
        """
        Represents the time when the Queue was created.
        """
        return pulumi.get(self, "create_time")

    @property
    @pulumi.getter(name="delaySeconds")
    def delay_seconds(self) -> pulumi.Output[int]:
        """
        This means that messages sent to the queue can only be consumed after the delay time set by this parameter, in seconds.
        """
        return pulumi.get(self, "delay_seconds")

    @property
    @pulumi.getter(name="loggingEnabled")
    def logging_enabled(self) -> pulumi.Output[Optional[bool]]:
        """
        Represents whether the log management function is enabled.
        """
        return pulumi.get(self, "logging_enabled")

    @property
    @pulumi.getter(name="maximumMessageSize")
    def maximum_message_size(self) -> pulumi.Output[int]:
        """
        Represents the maximum length of the message body sent to the Queue, in Byte.
        """
        return pulumi.get(self, "maximum_message_size")

    @property
    @pulumi.getter(name="messageRetentionPeriod")
    def message_retention_period(self) -> pulumi.Output[int]:
        """
        Represents the longest life time of the message in the Queue.
        """
        return pulumi.get(self, "message_retention_period")

    @property
    @pulumi.getter(name="pollingWaitSeconds")
    def polling_wait_seconds(self) -> pulumi.Output[int]:
        """
        The longest waiting time for a Queue request when the number of messages is empty, in seconds.
        """
        return pulumi.get(self, "polling_wait_seconds")

    @property
    @pulumi.getter(name="queueName")
    def queue_name(self) -> pulumi.Output[str]:
        """
        Representative resources.
        """
        return pulumi.get(self, "queue_name")

    @property
    @pulumi.getter(name="visibilityTimeout")
    def visibility_timeout(self) -> pulumi.Output[int]:
        """
        Represents the duration after the message is removed from the Queue and changed from the Active state to the Inactive state.
        """
        return pulumi.get(self, "visibility_timeout")

