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


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


class ComponentPlatform(AWSProperty):
    props = {
        'Attributes': (dict, False),
        'Name': (basestring, False),
    }


class LambdaEventSource(AWSProperty):
    props = {
        'Topic': (basestring, False),
        'Type': (basestring, False),
    }


class LambdaDeviceMount(AWSProperty):
    props = {
        'AddGroupOwner': (boolean, False),
        'Path': (basestring, False),
        'Permission': (basestring, False),
    }


class LambdaVolumeMount(AWSProperty):
    props = {
        'AddGroupOwner': (boolean, False),
        'DestinationPath': (basestring, False),
        'Permission': (basestring, False),
        'SourcePath': (basestring, False),
    }


class LambdaContainerParams(AWSProperty):
    props = {
        'Devices': ([LambdaDeviceMount], False),
        'MemorySizeInKB': (integer, False),
        'MountROSysfs': (boolean, False),
        'Volumes': ([LambdaVolumeMount], False),
    }


class LambdaLinuxProcessParams(AWSProperty):
    props = {
        'ContainerParams': (LambdaContainerParams, False),
        'IsolationMode': (basestring, False),
    }


class LambdaExecutionParameters(AWSProperty):
    props = {
        'EnvironmentVariables': (dict, False),
        'EventSources': ([LambdaEventSource], False),
        'ExecArgs': ([basestring], False),
        'InputPayloadEncodingType': (basestring, False),
        'LinuxProcessParams': (LambdaLinuxProcessParams, False),
        'MaxIdleTimeInSeconds': (integer, False),
        'MaxInstancesCount': (integer, False),
        'MaxQueueSize': (integer, False),
        'Pinned': (boolean, False),
        'StatusTimeoutInSeconds': (integer, False),
        'TimeoutInSeconds': (integer, False),
    }


class LambdaFunctionRecipeSource(AWSProperty):
    props = {
        'ComponentDependencies': (dict, False),
        'ComponentLambdaParameters': (LambdaExecutionParameters, False),
        'ComponentName': (basestring, False),
        'ComponentPlatforms': ([ComponentPlatform], False),
        'ComponentVersion': (basestring, False),
        'LambdaArn': (basestring, False),
    }


class ComponentVersion(AWSObject):
    resource_type = "AWS::GreengrassV2::ComponentVersion"

    props = {
        'InlineRecipe': (basestring, False),
        'LambdaFunction': (LambdaFunctionRecipeSource, False),
        'Tags': (Tags, False),
    }
