# Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 18.6.0


from . import AWSObject
from . import AWSProperty
from troposphere import Tags
from .validators import boolean
from .validators import integer


class Alarm(AWSProperty):
    props = {
        'AlarmName': (basestring, True),
        'Severity': (basestring, False),
    }


class AlarmMetric(AWSProperty):
    props = {
        'AlarmMetricName': (basestring, True),
    }


class Log(AWSProperty):
    props = {
        'Encoding': (basestring, False),
        'LogGroupName': (basestring, False),
        'LogPath': (basestring, False),
        'LogType': (basestring, True),
        'PatternSet': (basestring, False),
    }


class WindowsEvent(AWSProperty):
    props = {
        'EventLevels': ([basestring], True),
        'EventName': (basestring, True),
        'LogGroupName': (basestring, True),
        'PatternSet': (basestring, False),
    }


class ConfigurationDetails(AWSProperty):
    props = {
        'AlarmMetrics': ([AlarmMetric], False),
        'Alarms': ([Alarm], False),
        'Logs': ([Log], False),
        'WindowsEvents': ([WindowsEvent], False),
    }


class SubComponentConfigurationDetails(AWSProperty):
    props = {
        'AlarmMetrics': ([AlarmMetric], False),
        'Logs': ([Log], False),
        'WindowsEvents': ([WindowsEvent], False),
    }


class SubComponentTypeConfiguration(AWSProperty):
    props = {
        'SubComponentConfigurationDetails':
            (SubComponentConfigurationDetails, True),
        'SubComponentType': (basestring, True),
    }


class ComponentConfiguration(AWSProperty):
    props = {
        'ConfigurationDetails': (ConfigurationDetails, False),
        'SubComponentTypeConfigurations':
            ([SubComponentTypeConfiguration], False),
    }


class ComponentMonitoringSetting(AWSProperty):
    props = {
        'ComponentARN': (basestring, False),
        'ComponentConfigurationMode': (basestring, False),
        'ComponentName': (basestring, False),
        'CustomComponentConfiguration': (ComponentConfiguration, False),
        'DefaultOverwriteComponentConfiguration':
            (ComponentConfiguration, False),
        'Tier': (basestring, False),
    }


class CustomComponent(AWSProperty):
    props = {
        'ComponentName': (basestring, True),
        'ResourceList': ([basestring], True),
    }


class LogPattern(AWSProperty):
    props = {
        'Pattern': (basestring, True),
        'PatternName': (basestring, True),
        'Rank': (integer, True),
    }


class LogPatternSet(AWSProperty):
    props = {
        'LogPatterns': ([LogPattern], True),
        'PatternSetName': (basestring, True),
    }


class Application(AWSObject):
    resource_type = "AWS::ApplicationInsights::Application"

    props = {
        'AutoConfigurationEnabled': (boolean, False),
        'CWEMonitorEnabled': (boolean, False),
        'ComponentMonitoringSettings':
            ([ComponentMonitoringSetting], False),
        'CustomComponents': ([CustomComponent], False),
        'LogPatternSets': ([LogPatternSet], False),
        'OpsCenterEnabled': (boolean, False),
        'OpsItemSNSTopicArn': (basestring, False),
        'ResourceGroupName': (basestring, True),
        'Tags': (Tags, False),
    }
