def deserialize(cls, data):
        # type: (dict) -> TranscodeSpecification

        destination = Destination.deserialize(data['destination'])

        video_data = data.get('video')
        video = StreamSpecification.deserialize(
            video_data) if video_data else None

        audio_data = data.get('audio')
        audio = StreamSpecification.deserialize(
            audio_data) if audio_data else None

        quality_range_data = data.get('qualityRange')
        quality_range = VideoQualityRange.deserialize(
            quality_range_data) if quality_range_data else None

        quality = data.get('quality')

        clipping_data = data.get('clipping')
        clipping = Clipping.deserialize(
            clipping_data) if clipping_data else None

        return TranscodeSpecification(destination, video, audio, quality_range,
                                      quality, clipping)
    def deserialize(cls, data):
        # type: (dict) -> ExtractStoryboardSpecification
        destination = Destination.deserialize(data['destination'])

        return ExtractStoryboardSpecification(destination, data['columns'],
                                              data['rows'],
                                              data.get('tileWidth'),
                                              data.get('tileHeight'),
                                              data.get('format'),
                                              data.get('segmentDuration'))
Exemplo n.º 3
0
    def deserialize(cls, data):
        # type: (dict) -> CreateArchiveSpecification
        sources_data = data.get('sources')
        sources = [
            ArchiveSource.deserialize(source_info)
            for source_info in sources_data if source_info
        ]

        return CreateArchiveSpecification(
            sources, Destination.deserialize(data['destination']),
            data['archiveType'])
Exemplo n.º 4
0
    def test_deserialize(self):
        data = {
            'directory': None,
            'path': '/fish.jpg',
            'lifecycle': None,
            'acl': 'public',
            'bucket': None
        }

        destination = Destination.deserialize(data)

        assert_that(destination.serialize(), is_(data))
    def deserialize(cls, data):
        # type: (dict) -> ExtractArchiveSpecification

        extraction_report_data = data.get('extractedFilesReport')
        if extraction_report_data:
            extraction_report = ExtractionReport.deserialize(
                extraction_report_data)
        else:
            extraction_report = None

        source_data = data.get('source')
        source = Source.deserialize(source_data) if source_data else None
        return ExtractArchiveSpecification(
            source, Destination.deserialize(data['destination']),
            extraction_report)
    def deserialize(cls, data):
        # type: (dict) -> ConvertFontSpecification
        destination = Destination.deserialize(data['destination'])

        return ConvertFontSpecification(destination, data.get('fontType'),
                                        data.get('fontSet'))
Exemplo n.º 7
0
    def deserialize(cls, data):
        # type: (dict) -> ImageOperationSpecification
        destination = Destination.deserialize(data['destination'])

        return ImageOperationSpecification(data['command'], destination)
    def deserialize(cls, data):
        # type: (dict) -> ExtractionReport
        destination = Destination.deserialize(data['destination'])

        return ExtractionReport(destination, data['format'])
 def deserialize(cls, data):
     # type: (dict) -> ReplaceAudioExtraMetadataSpecification
     return cls(Destination.deserialize(data['destination']),
                AudioExtraMetadata.deserialize(data['audioExtraMetadata']))
    def deserialize(cls, data):
        # type: (dict) -> SubsetFontSpecification
        destination = Destination.deserialize(data['destination'])

        return SubsetFontSpecification(destination, data.get('languageCode'))
Exemplo n.º 11
0
 def deserialize(cls, data):
     # type: (dict) -> CopyFileSpecification
     return cls(Destination.deserialize(data['destination']))
Exemplo n.º 12
0
    def deserialize(cls, data):
        # type: (dict) -> ImportFileSpecification
        destination = Destination.deserialize(data['destination'])

        return ImportFileSpecification(data['sourceUrl'], destination)