# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class QosCar(pulumi.CustomResource):
    description: pulumi.Output[str]
    """
    The description of the QoS speed limiting rule.
    """
    limit_type: pulumi.Output[str]
    """
    The speed limiting method. Valid values: Absolute, Percent.
    """
    max_bandwidth_abs: pulumi.Output[float]
    """
    The maximum bandwidth allowed for the stream specified in the quintuple rule. This parameter is required when the value of the LimitType is Absolute.
    """
    max_bandwidth_percent: pulumi.Output[float]
    """
    The maximum bandwidth percentage allowed for the stream specified in the quintuple rule. It is based on the maximum upstream bandwidth you set for the associated Smart Access Gateway (SAG) instance.This parameter is required when the value of the LimitType parameter is Percent.
    """
    min_bandwidth_abs: pulumi.Output[float]
    """
    The minimum bandwidth allowed for the stream specified in the quintuple rule. This parameter is required when the value of the LimitType parameter is Absolute.
    """
    min_bandwidth_percent: pulumi.Output[float]
    """
    The minimum bandwidth percentage allowed for the stream specified in the quintuple rule. It is based on the maximum upstream bandwidth you set for the associated SAG instance.This parameter is required when the value of the LimitType parameter is Percent.
    """
    name: pulumi.Output[str]
    """
    The name of the QoS speed limiting rule..
    """
    percent_source_type: pulumi.Output[str]
    """
    The bandwidth type when the speed is limited based on percentage. Valid values: CcnBandwidth, InternetUpBandwidth.The default value is InternetUpBandwidth.
    """
    priority: pulumi.Output[float]
    """
    The priority of the specified stream.
    """
    qos_id: pulumi.Output[str]
    """
    The instance ID of the QoS.
    """
    def __init__(__self__, resource_name, opts=None, description=None, limit_type=None, max_bandwidth_abs=None, max_bandwidth_percent=None, min_bandwidth_abs=None, min_bandwidth_percent=None, name=None, percent_source_type=None, priority=None, qos_id=None, __props__=None, __name__=None, __opts__=None):
        """
        Provides a Sag qos car resource. 
        You need to create a QoS car to set priorities, rate limits, and quintuple rules for different messages.

        For information about Sag Qos Car and how to use it, see [What is Qos Car](https://www.alibabacloud.com/help/doc-detail/140065.htm).

        > **NOTE:** Available in 1.60.0+

        > **NOTE:** Only the following regions support. [`cn-shanghai`, `cn-shanghai-finance-1`, `cn-hongkong`, `ap-southeast-1`, `ap-southeast-2`, `ap-southeast-3`, `ap-southeast-5`, `ap-northeast-1`, `eu-central-1`]

        > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/r/sag_qos_car.html.markdown.

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] description: The description of the QoS speed limiting rule.
        :param pulumi.Input[str] limit_type: The speed limiting method. Valid values: Absolute, Percent.
        :param pulumi.Input[float] max_bandwidth_abs: The maximum bandwidth allowed for the stream specified in the quintuple rule. This parameter is required when the value of the LimitType is Absolute.
        :param pulumi.Input[float] max_bandwidth_percent: The maximum bandwidth percentage allowed for the stream specified in the quintuple rule. It is based on the maximum upstream bandwidth you set for the associated Smart Access Gateway (SAG) instance.This parameter is required when the value of the LimitType parameter is Percent.
        :param pulumi.Input[float] min_bandwidth_abs: The minimum bandwidth allowed for the stream specified in the quintuple rule. This parameter is required when the value of the LimitType parameter is Absolute.
        :param pulumi.Input[float] min_bandwidth_percent: The minimum bandwidth percentage allowed for the stream specified in the quintuple rule. It is based on the maximum upstream bandwidth you set for the associated SAG instance.This parameter is required when the value of the LimitType parameter is Percent.
        :param pulumi.Input[str] name: The name of the QoS speed limiting rule..
        :param pulumi.Input[str] percent_source_type: The bandwidth type when the speed is limited based on percentage. Valid values: CcnBandwidth, InternetUpBandwidth.The default value is InternetUpBandwidth.
        :param pulumi.Input[float] priority: The priority of the specified stream.
        :param pulumi.Input[str] qos_id: The instance ID of the QoS.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = utilities.get_version()
        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__ = dict()

            __props__['description'] = description
            if limit_type is None:
                raise TypeError("Missing required property 'limit_type'")
            __props__['limit_type'] = limit_type
            __props__['max_bandwidth_abs'] = max_bandwidth_abs
            __props__['max_bandwidth_percent'] = max_bandwidth_percent
            __props__['min_bandwidth_abs'] = min_bandwidth_abs
            __props__['min_bandwidth_percent'] = min_bandwidth_percent
            __props__['name'] = name
            __props__['percent_source_type'] = percent_source_type
            if priority is None:
                raise TypeError("Missing required property 'priority'")
            __props__['priority'] = priority
            if qos_id is None:
                raise TypeError("Missing required property 'qos_id'")
            __props__['qos_id'] = qos_id
        super(QosCar, __self__).__init__(
            'alicloud:rocketmq/qosCar:QosCar',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, description=None, limit_type=None, max_bandwidth_abs=None, max_bandwidth_percent=None, min_bandwidth_abs=None, min_bandwidth_percent=None, name=None, percent_source_type=None, priority=None, qos_id=None):
        """
        Get an existing QosCar 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 str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] description: The description of the QoS speed limiting rule.
        :param pulumi.Input[str] limit_type: The speed limiting method. Valid values: Absolute, Percent.
        :param pulumi.Input[float] max_bandwidth_abs: The maximum bandwidth allowed for the stream specified in the quintuple rule. This parameter is required when the value of the LimitType is Absolute.
        :param pulumi.Input[float] max_bandwidth_percent: The maximum bandwidth percentage allowed for the stream specified in the quintuple rule. It is based on the maximum upstream bandwidth you set for the associated Smart Access Gateway (SAG) instance.This parameter is required when the value of the LimitType parameter is Percent.
        :param pulumi.Input[float] min_bandwidth_abs: The minimum bandwidth allowed for the stream specified in the quintuple rule. This parameter is required when the value of the LimitType parameter is Absolute.
        :param pulumi.Input[float] min_bandwidth_percent: The minimum bandwidth percentage allowed for the stream specified in the quintuple rule. It is based on the maximum upstream bandwidth you set for the associated SAG instance.This parameter is required when the value of the LimitType parameter is Percent.
        :param pulumi.Input[str] name: The name of the QoS speed limiting rule..
        :param pulumi.Input[str] percent_source_type: The bandwidth type when the speed is limited based on percentage. Valid values: CcnBandwidth, InternetUpBandwidth.The default value is InternetUpBandwidth.
        :param pulumi.Input[float] priority: The priority of the specified stream.
        :param pulumi.Input[str] qos_id: The instance ID of the QoS.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["description"] = description
        __props__["limit_type"] = limit_type
        __props__["max_bandwidth_abs"] = max_bandwidth_abs
        __props__["max_bandwidth_percent"] = max_bandwidth_percent
        __props__["min_bandwidth_abs"] = min_bandwidth_abs
        __props__["min_bandwidth_percent"] = min_bandwidth_percent
        __props__["name"] = name
        __props__["percent_source_type"] = percent_source_type
        __props__["priority"] = priority
        __props__["qos_id"] = qos_id
        return QosCar(resource_name, opts=opts, __props__=__props__)
    def translate_output_property(self, prop):
        return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

