# 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 builtins
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__ = [
    'GetScalingPolicyResult',
    'AwaitableGetScalingPolicyResult',
    'get_scaling_policy',
    'get_scaling_policy_output',
]

@pulumi.output_type
class GetScalingPolicyResult:
    """
    A collection of values returned by getScalingPolicy.
    """
    def __init__(__self__, adjustment_type=None, adjustment_value=None, alarm_policy=None, cooldown=None, id=None, is_enabled_policy=None, scaling_group_id=None, scaling_policy_id=None, scaling_policy_name=None, scaling_policy_type=None, scheduled_policy=None, status=None):
        if adjustment_type and not isinstance(adjustment_type, str):
            raise TypeError("Expected argument 'adjustment_type' to be a str")
        pulumi.set(__self__, "adjustment_type", adjustment_type)
        if adjustment_value and not isinstance(adjustment_value, int):
            raise TypeError("Expected argument 'adjustment_value' to be a int")
        pulumi.set(__self__, "adjustment_value", adjustment_value)
        if alarm_policy and not isinstance(alarm_policy, dict):
            raise TypeError("Expected argument 'alarm_policy' to be a dict")
        pulumi.set(__self__, "alarm_policy", alarm_policy)
        if cooldown and not isinstance(cooldown, int):
            raise TypeError("Expected argument 'cooldown' to be a int")
        pulumi.set(__self__, "cooldown", cooldown)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if is_enabled_policy and not isinstance(is_enabled_policy, bool):
            raise TypeError("Expected argument 'is_enabled_policy' to be a bool")
        pulumi.set(__self__, "is_enabled_policy", is_enabled_policy)
        if scaling_group_id and not isinstance(scaling_group_id, str):
            raise TypeError("Expected argument 'scaling_group_id' to be a str")
        pulumi.set(__self__, "scaling_group_id", scaling_group_id)
        if scaling_policy_id and not isinstance(scaling_policy_id, str):
            raise TypeError("Expected argument 'scaling_policy_id' to be a str")
        pulumi.set(__self__, "scaling_policy_id", scaling_policy_id)
        if scaling_policy_name and not isinstance(scaling_policy_name, str):
            raise TypeError("Expected argument 'scaling_policy_name' to be a str")
        pulumi.set(__self__, "scaling_policy_name", scaling_policy_name)
        if scaling_policy_type and not isinstance(scaling_policy_type, str):
            raise TypeError("Expected argument 'scaling_policy_type' to be a str")
        pulumi.set(__self__, "scaling_policy_type", scaling_policy_type)
        if scheduled_policy and not isinstance(scheduled_policy, dict):
            raise TypeError("Expected argument 'scheduled_policy' to be a dict")
        pulumi.set(__self__, "scheduled_policy", scheduled_policy)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)

    @property
    @pulumi.getter(name="adjustmentType")
    def adjustment_type(self) -> builtins.str:
        """
        伸缩规则的伸缩行为，适用于简单规则和步进规则，QuantityChangeInCapacity：增加或减少指定数量的实例。PercentChangeInCapacity：增加或减少指定比例的实例。TotalCapacity： 将当前伸缩组的实例数量调整到指定数量。
        """
        return pulumi.get(self, "adjustment_type")

    @property
    @pulumi.getter(name="adjustmentValue")
    def adjustment_value(self) -> builtins.int:
        """
        伸缩行为的调整数值，适用于简单规则和步进规则，当AdjustmentType参数取值为QuantityChangeInCapacity时：-100   - 100，不允许为0，单位：个。当AdjustmentType参数取值为PercentChangeInCapacity时：-100   - 10000，不允许为0，单位：%。当AdjustmentType参数取值为TotalCapacity时：默认为0   - 100，单位：个。
        """
        return pulumi.get(self, "adjustment_value")

    @property
    @pulumi.getter(name="alarmPolicy")
    def alarm_policy(self) -> 'outputs.GetScalingPolicyAlarmPolicyResult':
        """
        报警任务的详细信息。
        """
        return pulumi.get(self, "alarm_policy")

    @property
    @pulumi.getter
    def cooldown(self) -> builtins.int:
        """
        伸缩规则的冷却时间。 取值：0-86400，单位：秒，不填则默认使用伸缩组的冷却时间。
        """
        return pulumi.get(self, "cooldown")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="isEnabledPolicy")
    def is_enabled_policy(self) -> builtins.bool:
        """
        伸缩规则的状态。取值：true：启用。false：停用。需保证伸缩组的状态为Active。
        """
        return pulumi.get(self, "is_enabled_policy")

    @property
    @pulumi.getter(name="scalingGroupId")
    def scaling_group_id(self) -> builtins.str:
        """
        伸缩组ID。
        """
        return pulumi.get(self, "scaling_group_id")

    @property
    @pulumi.getter(name="scalingPolicyId")
    def scaling_policy_id(self) -> builtins.str:
        """
        伸缩规则ID。
        """
        return pulumi.get(self, "scaling_policy_id")

    @property
    @pulumi.getter(name="scalingPolicyName")
    def scaling_policy_name(self) -> builtins.str:
        """
        伸缩规则名称。
        """
        return pulumi.get(self, "scaling_policy_name")

    @property
    @pulumi.getter(name="scalingPolicyType")
    def scaling_policy_type(self) -> builtins.str:
        """
        伸缩规则的类型，取值：Scheduled：定时任务。Recurrence：周期任务。Alarm：报警任务。
        """
        return pulumi.get(self, "scaling_policy_type")

    @property
    @pulumi.getter(name="scheduledPolicy")
    def scheduled_policy(self) -> 'outputs.GetScalingPolicyScheduledPolicyResult':
        """
        定时任务/周期任务的详细信息。
        """
        return pulumi.get(self, "scheduled_policy")

    @property
    @pulumi.getter
    def status(self) -> builtins.str:
        """
        伸缩规则的状态。取值：Active：已启用。InActive：已停用。需保证伸缩组的状态为Active。
        """
        return pulumi.get(self, "status")


class AwaitableGetScalingPolicyResult(GetScalingPolicyResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetScalingPolicyResult(
            adjustment_type=self.adjustment_type,
            adjustment_value=self.adjustment_value,
            alarm_policy=self.alarm_policy,
            cooldown=self.cooldown,
            id=self.id,
            is_enabled_policy=self.is_enabled_policy,
            scaling_group_id=self.scaling_group_id,
            scaling_policy_id=self.scaling_policy_id,
            scaling_policy_name=self.scaling_policy_name,
            scaling_policy_type=self.scaling_policy_type,
            scheduled_policy=self.scheduled_policy,
            status=self.status)


def get_scaling_policy(id: Optional[builtins.str] = None,
                       opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetScalingPolicyResult:
    """
    Data Source schema for Byteplus::AutoScaling::ScalingPolicy


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:autoscaling/getScalingPolicy:getScalingPolicy', __args__, opts=opts, typ=GetScalingPolicyResult).value

    return AwaitableGetScalingPolicyResult(
        adjustment_type=pulumi.get(__ret__, 'adjustment_type'),
        adjustment_value=pulumi.get(__ret__, 'adjustment_value'),
        alarm_policy=pulumi.get(__ret__, 'alarm_policy'),
        cooldown=pulumi.get(__ret__, 'cooldown'),
        id=pulumi.get(__ret__, 'id'),
        is_enabled_policy=pulumi.get(__ret__, 'is_enabled_policy'),
        scaling_group_id=pulumi.get(__ret__, 'scaling_group_id'),
        scaling_policy_id=pulumi.get(__ret__, 'scaling_policy_id'),
        scaling_policy_name=pulumi.get(__ret__, 'scaling_policy_name'),
        scaling_policy_type=pulumi.get(__ret__, 'scaling_policy_type'),
        scheduled_policy=pulumi.get(__ret__, 'scheduled_policy'),
        status=pulumi.get(__ret__, 'status'))
def get_scaling_policy_output(id: Optional[pulumi.Input[builtins.str]] = None,
                              opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetScalingPolicyResult]:
    """
    Data Source schema for Byteplus::AutoScaling::ScalingPolicy


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:autoscaling/getScalingPolicy:getScalingPolicy', __args__, opts=opts, typ=GetScalingPolicyResult)
    return __ret__.apply(lambda __response__: GetScalingPolicyResult(
        adjustment_type=pulumi.get(__response__, 'adjustment_type'),
        adjustment_value=pulumi.get(__response__, 'adjustment_value'),
        alarm_policy=pulumi.get(__response__, 'alarm_policy'),
        cooldown=pulumi.get(__response__, 'cooldown'),
        id=pulumi.get(__response__, 'id'),
        is_enabled_policy=pulumi.get(__response__, 'is_enabled_policy'),
        scaling_group_id=pulumi.get(__response__, 'scaling_group_id'),
        scaling_policy_id=pulumi.get(__response__, 'scaling_policy_id'),
        scaling_policy_name=pulumi.get(__response__, 'scaling_policy_name'),
        scaling_policy_type=pulumi.get(__response__, 'scaling_policy_type'),
        scheduled_policy=pulumi.get(__response__, 'scheduled_policy'),
        status=pulumi.get(__response__, 'status')))
