"""Raw representations of every data type in the AWS AutoScaling service.

See Also:
    `AWS developer guide for AutoScaling
    <http://docs.aws.amazon.com/autoscaling/latest/userguide/WhatIsAutoScaling.html>`_

This file is automatically generated, and should not be directly edited.
"""

from typing import Any
from typing import Dict

from attr import attrib
from attr import attrs

from ..core import ATTRSCONFIG
from ..core import Resource
from ..core import ResourceProperties
from ..core import create_object_converter

__all__ = [
    "AutoScalingGroup",
    "AutoScalingGroupProperties",
    "LaunchConfiguration",
    "LaunchConfigurationProperties",
    "LifecycleHook",
    "LifecycleHookProperties",
    "ScalingPolicy",
    "ScalingPolicyProperties",
    "ScheduledAction",
    "ScheduledActionProperties",
]


@attrs(**ATTRSCONFIG)
class AutoScalingGroupProperties(ResourceProperties):
    AutoScalingGroupName = attrib(default=None)
    AvailabilityZones = attrib(default=None)
    Cooldown = attrib(default=None)
    DesiredCapacity = attrib(default=None)
    HealthCheckGracePeriod = attrib(default=None)
    HealthCheckType = attrib(default=None)
    InstanceId = attrib(default=None)
    LaunchConfigurationName = attrib(default=None)
    LaunchTemplate = attrib(default=None)
    LifecycleHookSpecificationList = attrib(default=None)
    LoadBalancerNames = attrib(default=None)
    MaxSize = attrib(default=None)
    MetricsCollection = attrib(default=None)
    MinSize = attrib(default=None)
    MixedInstancesPolicy = attrib(default=None)
    NotificationConfigurations = attrib(default=None)
    PlacementGroup = attrib(default=None)
    ServiceLinkedRoleARN = attrib(default=None)
    Tags = attrib(default=None)
    TargetGroupARNs = attrib(default=None)
    TerminationPolicies = attrib(default=None)
    VPCZoneIdentifier = attrib(default=None)


@attrs(**ATTRSCONFIG)
class AutoScalingGroup(Resource):
    """A Auto Scaling Group for AutoScaling.

    See Also:
        `AWS Cloud Formation documentation for AutoScalingGroup
        <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html>`_
    """

    RESOURCE_TYPE = "AWS::AutoScaling::AutoScalingGroup"

    Properties: AutoScalingGroupProperties = attrib(
        factory=AutoScalingGroupProperties,
        converter=create_object_converter(AutoScalingGroupProperties),
    )

    # NB: CreationPolicy may be set for AutoScalingGroup
    # (unlike most Resource types)
    CreationPolicy: Dict[str, Any] = attrib(factory=dict)

    # NB: UpdatePolicy may be set for AutoScalingGroup
    # (unlike most Resource types)
    UpdatePolicy: Dict[str, Any] = attrib(factory=dict)


@attrs(**ATTRSCONFIG)
class LaunchConfigurationProperties(ResourceProperties):
    AssociatePublicIpAddress = attrib(default=None)
    BlockDeviceMappings = attrib(default=None)
    ClassicLinkVPCId = attrib(default=None)
    ClassicLinkVPCSecurityGroups = attrib(default=None)
    EbsOptimized = attrib(default=None)
    IamInstanceProfile = attrib(default=None)
    ImageId = attrib(default=None)
    InstanceId = attrib(default=None)
    InstanceMonitoring = attrib(default=None)
    InstanceType = attrib(default=None)
    KernelId = attrib(default=None)
    KeyName = attrib(default=None)
    LaunchConfigurationName = attrib(default=None)
    PlacementTenancy = attrib(default=None)
    RamDiskId = attrib(default=None)
    SecurityGroups = attrib(default=None)
    SpotPrice = attrib(default=None)
    UserData = attrib(default=None)


@attrs(**ATTRSCONFIG)
class LaunchConfiguration(Resource):
    """A Launch Configuration for AutoScaling.

    See Also:
        `AWS Cloud Formation documentation for LaunchConfiguration
        <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig.html>`_
    """

    RESOURCE_TYPE = "AWS::AutoScaling::LaunchConfiguration"

    Properties: LaunchConfigurationProperties = attrib(
        factory=LaunchConfigurationProperties,
        converter=create_object_converter(LaunchConfigurationProperties),
    )


@attrs(**ATTRSCONFIG)
class LifecycleHookProperties(ResourceProperties):
    AutoScalingGroupName = attrib(default=None)
    DefaultResult = attrib(default=None)
    HeartbeatTimeout = attrib(default=None)
    LifecycleHookName = attrib(default=None)
    LifecycleTransition = attrib(default=None)
    NotificationMetadata = attrib(default=None)
    NotificationTargetARN = attrib(default=None)
    RoleARN = attrib(default=None)


@attrs(**ATTRSCONFIG)
class LifecycleHook(Resource):
    """A Lifecycle Hook for AutoScaling.

    See Also:
        `AWS Cloud Formation documentation for LifecycleHook
        <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-as-lifecyclehook.html>`_
    """

    RESOURCE_TYPE = "AWS::AutoScaling::LifecycleHook"

    Properties: LifecycleHookProperties = attrib(
        factory=LifecycleHookProperties,
        converter=create_object_converter(LifecycleHookProperties),
    )


@attrs(**ATTRSCONFIG)
class ScalingPolicyProperties(ResourceProperties):
    AdjustmentType = attrib(default=None)
    AutoScalingGroupName = attrib(default=None)
    Cooldown = attrib(default=None)
    EstimatedInstanceWarmup = attrib(default=None)
    MetricAggregationType = attrib(default=None)
    MinAdjustmentMagnitude = attrib(default=None)
    PolicyType = attrib(default=None)
    ScalingAdjustment = attrib(default=None)
    StepAdjustments = attrib(default=None)
    TargetTrackingConfiguration = attrib(default=None)


@attrs(**ATTRSCONFIG)
class ScalingPolicy(Resource):
    """A Scaling Policy for AutoScaling.

    See Also:
        `AWS Cloud Formation documentation for ScalingPolicy
        <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-policy.html>`_
    """

    RESOURCE_TYPE = "AWS::AutoScaling::ScalingPolicy"

    Properties: ScalingPolicyProperties = attrib(
        factory=ScalingPolicyProperties,
        converter=create_object_converter(ScalingPolicyProperties),
    )


@attrs(**ATTRSCONFIG)
class ScheduledActionProperties(ResourceProperties):
    AutoScalingGroupName = attrib(default=None)
    DesiredCapacity = attrib(default=None)
    EndTime = attrib(default=None)
    MaxSize = attrib(default=None)
    MinSize = attrib(default=None)
    Recurrence = attrib(default=None)
    StartTime = attrib(default=None)


@attrs(**ATTRSCONFIG)
class ScheduledAction(Resource):
    """A Scheduled Action for AutoScaling.

    See Also:
        `AWS Cloud Formation documentation for ScheduledAction
        <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-as-scheduledaction.html>`_
    """

    RESOURCE_TYPE = "AWS::AutoScaling::ScheduledAction"

    Properties: ScheduledActionProperties = attrib(
        factory=ScheduledActionProperties,
        converter=create_object_converter(ScheduledActionProperties),
    )
