def make( cls, linear=None, non_linear=None, companion=None, id=None, sequence=None, ad_id=None, api_framework=None, ): instance = check_and_convert( cls, args_dict=dict( linear=linear, non_linear=non_linear, companion=companion, id=id, sequence=sequence, ad_id=ad_id, api_framework=api_framework, ), ) validators.validate(instance, cls.VALIDATORS) return instance
def make( cls, width, height, expanded_width=None, expanded_height=None, api_framework=None, id=None, static_resource=None, iframe_resource=None, html_resource=None, companion_click_through=None, ad_parameters=None, alt_text=None, tracking_events=None, ): instance = check_and_convert( cls, args_dict=dict( width=width, height=height, expanded_width=expanded_width, expanded_height=expanded_height, api_framework=api_framework, id=id, static_resource=static_resource, iframe_resource=iframe_resource, html_resource=html_resource, companion_click_through=companion_click_through, ad_parameters=ad_parameters, alt_text=alt_text, tracking_events=tracking_events, ), ) return instance
def make( cls, width, height, expanded_width=None, expanded_height=None, scalable=None, maintain_aspect_ratio=None, min_suggested_duration=None, api_framework=None, id=None, static_resource=None, iframe_resource=None, html_resource=None, non_linear_click_through=None, ad_parameters=None, ): instance = check_and_convert( cls, args_dict=dict( width=width, height=height, expanded_width=expanded_width, expanded_height=expanded_height, scalable=scalable, maintain_aspect_ratio=maintain_aspect_ratio, min_suggested_duration=min_suggested_duration, api_framework=api_framework, id=id, static_resource=static_resource, iframe_resource=iframe_resource, html_resource=html_resource, non_linear_click_through=non_linear_click_through, ad_parameters=ad_parameters, ), ) return instance
def make(cls, companion_ads=None): instance = check_and_convert( cls, args_dict=dict(companion_ads=companion_ads, ), ) return instance
def make(cls, tracking_event_uri, tracking_event_type): instance = check_and_convert( cls, args_dict=dict( tracking_event_uri=tracking_event_uri, tracking_event_type=tracking_event_type, ), ) return instance
def make(cls, resource, mime_type): instance = check_and_convert( cls, args_dict=dict( resource=resource, mime_type=mime_type, ), ) return instance
def make(cls, data, xml_encoded=None): instance = check_and_convert( cls, args_dict=dict( data=data, xml_encoded=xml_encoded, ), ) return instance
def make( cls, asset, delivery, type, width, height, codec=None, id=None, bitrate=None, min_bitrate=None, max_bitrate=None, scalable=None, maintain_aspect_ratio=None, api_framework=None, ): """ Entry point for making MediaFile instances. :param asset: the url to the asset :param delivery: either “progressive” for progressive download protocols (such as HTTP) or “streaming” for streaming protocols. :param type: MIME type for the file container. Popular MIME types include, but are not limited to “video/x- flv” for Flash Video and “video/mp4” for MP4 :param width: the native width of the video file, in pixels :param height: the native height of the video file, in pixels :param codec: the codec used to encode the file which can take values as specified by RFC 4281: http://tools.ietf.org/html/rfc4281 :param id: an identifier for the media file :param bitrate: for progressive load video, the bitrate value specifies the average bitrate for the media file; :param min_bitrate: used in conjunction with max_bitrate for streaming videos :param max_bitrate: used in conjunction with min_bitrate for streaming videos :param scalable: identifies whether the media file is meant to scale to larger dimensions :param maintain_aspect_ratio: identifies whether aspect ratio for media file is maintained :param api_framework: identifies the API needed to execute an interactive media file :return: """ instance = check_and_convert( cls, args_dict=dict( asset=asset, delivery=delivery, type=type, width=width, height=height, codec=codec, id=id, bitrate=bitrate, min_bitrate=min_bitrate, max_bitrate=max_bitrate, scalable=scalable, maintain_aspect_ratio=maintain_aspect_ratio, api_framework=api_framework, ), ) if instance.type in (MimeType.FLASH, MimeType.JS): vs = list(cls.VALIDATORS) elif instance.delivery == Delivery.PROGRESSIVE: vs = list(cls.VALIDATORS) + [cls._validate_bitrate] else: vs = list(cls.VALIDATORS) + [cls._validate_min_max_bitrate] validators.validate(instance, vs) return instance
def make(cls, id, wrapper=None, inline=None): instance = check_and_convert( cls, args_dict=dict( id=id, wrapper=wrapper, inline=inline, ), ) return instance
def make(cls, non_linear_ads, tracking_events=None): instance = check_and_convert( cls, args_dict=dict( non_linear_ads=non_linear_ads, tracking_events=tracking_events, ), ) return instance
def make(cls, resource, id=None): instance = check_and_convert( cls, args_dict=dict( resource=resource, id=id, ), ) return instance
def make(cls, version, ad): instance = check_and_convert( cls, args_dict=dict( version=version, ad=ad, ), ) validators.validate(instance, [cls._validate_version]) return instance
def make(cls, ad_system, ad_title, impression, creatives): instance = check_and_convert( cls, args_dict=dict( ad_system=ad_system, ad_title=ad_title, impression=impression, creatives=creatives, ), ) return instance
def make(cls, click_through=None, click_tracking=None, custom_click=None): instance = check_and_convert( cls, args_dict=dict( click_through=click_through, click_tracking=click_tracking, custom_click=custom_click, ), ) return instance
def make(cls, ad_system, vast_ad_tag_uri, ad_title=None, impression=None, error=None, creatives=None): instance = check_and_convert( cls, args_dict=dict( ad_system=ad_system, vast_ad_tag_uri=vast_ad_tag_uri, ad_title=ad_title, impression=impression, error=error, creatives=creatives, ), ) return instance
def make(cls, duration, media_files, video_clicks=None, ad_parameters=None, tracking_events=None): instance = check_and_convert( cls, args_dict=dict( duration=duration, media_files=media_files, video_clicks=video_clicks, ad_parameters=ad_parameters, tracking_events=tracking_events, ), ) validators.validate(instance) return instance