# 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: 25.0.0


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


class RoutingStrategy(AWSProperty):
    props = {
        'FleetId': (basestring, False),
        'Message': (basestring, False),
        'Type': (basestring, False),
    }


class Alias(AWSObject):
    resource_type = "AWS::GameLift::Alias"

    props = {
        'Description': (basestring, False),
        'Name': (basestring, True),
        'RoutingStrategy': (RoutingStrategy, True),
    }


class S3Location(AWSProperty):
    props = {
        'Bucket': (basestring, True),
        'Key': (basestring, True),
        'ObjectVersion': (basestring, False),
        'RoleArn': (basestring, True),
    }


class Build(AWSObject):
    resource_type = "AWS::GameLift::Build"

    props = {
        'Name': (basestring, False),
        'OperatingSystem': (basestring, False),
        'StorageLocation': (S3Location, False),
        'Version': (basestring, False),
    }


class CertificateConfiguration(AWSProperty):
    props = {
        'CertificateType': (basestring, True),
    }


class IpPermission(AWSProperty):
    props = {
        'FromPort': (integer, True),
        'IpRange': (basestring, True),
        'Protocol': (basestring, True),
        'ToPort': (integer, True),
    }


class ResourceCreationLimitPolicy(AWSProperty):
    props = {
        'NewGameSessionsPerCreator': (integer, False),
        'PolicyPeriodInMinutes': (integer, False),
    }


class ServerProcess(AWSProperty):
    props = {
        'ConcurrentExecutions': (integer, True),
        'LaunchPath': (basestring, True),
        'Parameters': (basestring, False),
    }


class RuntimeConfiguration(AWSProperty):
    props = {
        'GameSessionActivationTimeoutSeconds': (integer, False),
        'MaxConcurrentGameSessionActivations': (integer, False),
        'ServerProcesses': ([ServerProcess], False),
    }


class Fleet(AWSObject):
    resource_type = "AWS::GameLift::Fleet"

    props = {
        'BuildId': (basestring, False),
        'CertificateConfiguration': (CertificateConfiguration, False),
        'Description': (basestring, False),
        'DesiredEC2Instances': (integer, False),
        'EC2InboundPermissions': ([IpPermission], False),
        'EC2InstanceType': (basestring, True),
        'FleetType': (basestring, False),
        'InstanceRoleARN': (basestring, False),
        'LogPaths': ([basestring], False),
        'MaxSize': (integer, False),
        'MetricGroups': ([basestring], False),
        'MinSize': (integer, False),
        'Name': (basestring, True),
        'NewGameSessionProtectionPolicy': (basestring, False),
        'PeerVpcAwsAccountId': (basestring, False),
        'PeerVpcId': (basestring, False),
        'ResourceCreationLimitPolicy': (ResourceCreationLimitPolicy, False),
        'RuntimeConfiguration': (RuntimeConfiguration, False),
        'ScriptId': (basestring, False),
        'ServerLaunchParameters': (basestring, False),
        'ServerLaunchPath': (basestring, False),
    }


class TargetTrackingConfiguration(AWSProperty):
    props = {
        'TargetValue': (double, True),
    }


class AutoScalingPolicy(AWSProperty):
    props = {
        'EstimatedInstanceWarmup': (double, False),
        'TargetTrackingConfiguration': (TargetTrackingConfiguration, True),
    }


class InstanceDefinition(AWSProperty):
    props = {
        'InstanceType': (basestring, True),
        'WeightedCapacity': (basestring, False),
    }


class LaunchTemplate(AWSProperty):
    props = {
        'LaunchTemplateId': (basestring, False),
        'LaunchTemplateName': (basestring, False),
        'Version': (basestring, False),
    }


class GameServerGroup(AWSObject):
    resource_type = "AWS::GameLift::GameServerGroup"

    props = {
        'AutoScalingPolicy': (AutoScalingPolicy, False),
        'BalancingStrategy': (basestring, False),
        'DeleteOption': (basestring, False),
        'GameServerGroupName': (basestring, True),
        'GameServerProtectionPolicy': (basestring, False),
        'InstanceDefinitions': ([InstanceDefinition], True),
        'LaunchTemplate': (LaunchTemplate, True),
        'MaxSize': (double, False),
        'MinSize': (double, False),
        'RoleArn': (basestring, True),
        'Tags': (Tags, False),
        'VpcSubnets': ([basestring], False),
    }


class Destination(AWSProperty):
    props = {
        'DestinationArn': (basestring, False),
    }


class PlayerLatencyPolicy(AWSProperty):
    props = {
        'MaximumIndividualPlayerLatencyMilliseconds': (integer, False),
        'PolicyDurationSeconds': (integer, False),
    }


class GameSessionQueue(AWSObject):
    resource_type = "AWS::GameLift::GameSessionQueue"

    props = {
        'Destinations': ([Destination], False),
        'Name': (basestring, True),
        'PlayerLatencyPolicies': ([PlayerLatencyPolicy], False),
        'TimeoutInSeconds': (integer, False),
    }


class GameProperty(AWSProperty):
    props = {
        'Key': (basestring, True),
        'Value': (basestring, True),
    }


class MatchmakingConfiguration(AWSObject):
    resource_type = "AWS::GameLift::MatchmakingConfiguration"

    props = {
        'AcceptanceRequired': (boolean, True),
        'AcceptanceTimeoutSeconds': (integer, False),
        'AdditionalPlayerCount': (integer, False),
        'BackfillMode': (basestring, False),
        'CustomEventData': (basestring, False),
        'Description': (basestring, False),
        'FlexMatchMode': (basestring, False),
        'GameProperties': ([GameProperty], False),
        'GameSessionData': (basestring, False),
        'GameSessionQueueArns': ([basestring], False),
        'Name': (basestring, True),
        'NotificationTarget': (basestring, False),
        'RequestTimeoutSeconds': (integer, True),
        'RuleSetName': (basestring, True),
    }


class MatchmakingRuleSet(AWSObject):
    resource_type = "AWS::GameLift::MatchmakingRuleSet"

    props = {
        'Name': (basestring, True),
        'RuleSetBody': (basestring, True),
    }


class Script(AWSObject):
    resource_type = "AWS::GameLift::Script"

    props = {
        'Name': (basestring, False),
        'StorageLocation': (S3Location, True),
        'Version': (basestring, False),
    }
