# 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 EgressEndpoint(AWSProperty):
    props = {
        'PackagingConfigurationId': (basestring, True),
        'Url': (basestring, True),
    }


class Asset(AWSObject):
    resource_type = "AWS::MediaPackage::Asset"

    props = {
        'EgressEndpoints': ([EgressEndpoint], False),
        'Id': (basestring, True),
        'PackagingGroupId': (basestring, True),
        'ResourceId': (basestring, False),
        'SourceArn': (basestring, True),
        'SourceRoleArn': (basestring, True),
        'Tags': (Tags, False),
    }


class Channel(AWSObject):
    resource_type = "AWS::MediaPackage::Channel"

    props = {
        'Description': (basestring, False),
        'Id': (basestring, True),
        'Tags': (Tags, False),
    }


class Authorization(AWSProperty):
    props = {
        'CdnIdentifierSecret': (basestring, True),
        'SecretsRoleArn': (basestring, True),
    }


class SpekeKeyProvider(AWSProperty):
    props = {
        'RoleArn': (basestring, True),
        'SystemIds': ([basestring], True),
        'Url': (basestring, True),
    }


class CmafEncryption(AWSProperty):
    props = {
        'SpekeKeyProvider': (SpekeKeyProvider, True),
    }


class StreamSelection(AWSProperty):
    props = {
        'MaxVideoBitsPerSecond': (integer, False),
        'MinVideoBitsPerSecond': (integer, False),
        'StreamOrder': (basestring, False),
    }


class HlsManifest(AWSProperty):
    props = {
        'AdMarkers': (basestring, False),
        'IncludeIframeOnlyStream': (boolean, False),
        'ManifestName': (basestring, False),
        'ProgramDateTimeIntervalSeconds': (integer, False),
        'RepeatExtXKey': (boolean, False),
        'StreamSelection': (StreamSelection, False),
    }


class CmafPackage(AWSProperty):
    props = {
        'Encryption': (CmafEncryption, False),
        'HlsManifests': ([HlsManifest], True),
        'SegmentDurationSeconds': (integer, False),
    }


class DashEncryption(AWSProperty):
    props = {
        'SpekeKeyProvider': (SpekeKeyProvider, True),
    }


class DashManifest(AWSProperty):
    props = {
        'ManifestLayout': (basestring, False),
        'ManifestName': (basestring, False),
        'MinBufferTimeSeconds': (integer, False),
        'Profile': (basestring, False),
        'StreamSelection': (StreamSelection, False),
    }


class DashPackage(AWSProperty):
    props = {
        'DashManifests': ([DashManifest], True),
        'Encryption': (DashEncryption, False),
        'PeriodTriggers': ([basestring], False),
        'SegmentDurationSeconds': (integer, False),
        'SegmentTemplateFormat': (basestring, False),
    }


class HlsEncryption(AWSProperty):
    props = {
        'ConstantInitializationVector': (basestring, False),
        'EncryptionMethod': (basestring, False),
        'SpekeKeyProvider': (SpekeKeyProvider, True),
    }


class HlsPackage(AWSProperty):
    props = {
        'Encryption': (HlsEncryption, False),
        'HlsManifests': ([HlsManifest], True),
        'SegmentDurationSeconds': (integer, False),
        'UseAudioRenditionGroup': (boolean, False),
    }


class MssEncryption(AWSProperty):
    props = {
        'SpekeKeyProvider': (SpekeKeyProvider, True),
    }


class MssManifest(AWSProperty):
    props = {
        'ManifestName': (basestring, False),
        'StreamSelection': (StreamSelection, False),
    }


class MssPackage(AWSProperty):
    props = {
        'Encryption': (MssEncryption, False),
        'MssManifests': ([MssManifest], True),
        'SegmentDurationSeconds': (integer, False),
    }


class OriginEndpoint(AWSObject):
    resource_type = "AWS::MediaPackage::OriginEndpoint"

    props = {
        'Authorization': (Authorization, False),
        'ChannelId': (basestring, True),
        'CmafPackage': (CmafPackage, False),
        'DashPackage': (DashPackage, False),
        'Description': (basestring, False),
        'HlsPackage': (HlsPackage, False),
        'Id': (basestring, True),
        'ManifestName': (basestring, False),
        'MssPackage': (MssPackage, False),
        'Origination': (basestring, False),
        'StartoverWindowSeconds': (integer, False),
        'Tags': (Tags, False),
        'TimeDelaySeconds': (integer, False),
        'Whitelist': ([basestring], False),
    }


class PackagingConfiguration(AWSObject):
    resource_type = "AWS::MediaPackage::PackagingConfiguration"

    props = {
        'CmafPackage': (CmafPackage, False),
        'DashPackage': (DashPackage, False),
        'HlsPackage': (HlsPackage, False),
        'Id': (basestring, True),
        'MssPackage': (MssPackage, False),
        'PackagingGroupId': (basestring, True),
        'Tags': (Tags, False),
    }


class PackagingGroup(AWSObject):
    resource_type = "AWS::MediaPackage::PackagingGroup"

    props = {
        'Authorization': (Authorization, False),
        'Id': (basestring, True),
        'Tags': (Tags, False),
    }
