# 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.7.0


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


class ConfigurationId(AWSProperty):
    props = {
        'Id': (basestring, True),
        'Revision': (integer, True),
    }


class EncryptionOptions(AWSProperty):
    props = {
        'KmsKeyId': (basestring, False),
        'UseAwsOwnedKey': (boolean, True),
    }


class InterBrokerCred(AWSProperty):
    props = {
        'Password': (basestring, True),
        'Username': (basestring, True),
    }


class ServerMetadata(AWSProperty):
    props = {
        'Hosts': ([basestring], True),
        'RoleBase': (basestring, True),
        'RoleName': (basestring, False),
        'RoleSearchMatching': (basestring, True),
        'RoleSearchSubtree': (boolean, False),
        'ServiceAccountPassword': (basestring, True),
        'ServiceAccountUsername': (basestring, True),
        'UserBase': (basestring, True),
        'UserRoleName': (basestring, False),
        'UserSearchMatching': (basestring, True),
        'UserSearchSubtree': (boolean, False),
    }


class LdapMetadata(AWSProperty):
    props = {
        'InterBrokerCreds': ([InterBrokerCred], False),
        'ServerMetadata': (ServerMetadata, True),
    }


class LdapServerMetadata(AWSProperty):
    props = {
        'Hosts': ([basestring], True),
        'RoleBase': (basestring, True),
        'RoleName': (basestring, False),
        'RoleSearchMatching': (basestring, True),
        'RoleSearchSubtree': (boolean, False),
        'ServiceAccountPassword': (basestring, True),
        'ServiceAccountUsername': (basestring, True),
        'UserBase': (basestring, True),
        'UserRoleName': (basestring, False),
        'UserSearchMatching': (basestring, True),
        'UserSearchSubtree': (boolean, False),
    }


class LogsConfiguration(AWSProperty):
    props = {
        'Audit': (boolean, False),
        'General': (boolean, False),
    }


class MaintenanceWindow(AWSProperty):
    props = {
        'DayOfWeek': (basestring, True),
        'TimeOfDay': (basestring, True),
        'TimeZone': (basestring, True),
    }


class User(AWSProperty):
    props = {
        'ConsoleAccess': (boolean, False),
        'Groups': ([basestring], False),
        'Password': (basestring, True),
        'Username': (basestring, True),
    }


class Broker(AWSObject):
    resource_type = "AWS::AmazonMQ::Broker"

    props = {
        'AuthenticationStrategy': (basestring, False),
        'AutoMinorVersionUpgrade': (boolean, True),
        'BrokerName': (basestring, True),
        'Configuration': (ConfigurationId, False),
        'DeploymentMode': (basestring, True),
        'EncryptionOptions': (EncryptionOptions, False),
        'EngineType': (basestring, True),
        'EngineVersion': (basestring, True),
        'HostInstanceType': (basestring, True),
        'LdapMetadata': (LdapMetadata, False),
        'LdapServerMetadata': (LdapServerMetadata, False),
        'Logs': (LogsConfiguration, False),
        'MaintenanceWindowStartTime': (MaintenanceWindow, False),
        'PubliclyAccessible': (boolean, True),
        'SecurityGroups': ([basestring], False),
        'StorageType': (basestring, False),
        'SubnetIds': ([basestring], False),
        'Tags': ((Tags, list), False),
        'Users': ([User], True),
    }


class Configuration(AWSObject):
    resource_type = "AWS::AmazonMQ::Configuration"

    props = {
        'Data': (basestring, True),
        'Description': (basestring, False),
        'EngineType': (basestring, True),
        'EngineVersion': (basestring, True),
        'Name': (basestring, True),
        'Tags': (Tags, False),
    }


class ConfigurationAssociation(AWSObject):
    resource_type = "AWS::AmazonMQ::ConfigurationAssociation"

    props = {
        'Broker': (basestring, True),
        'Configuration': (ConfigurationId, True),
    }
