Example #1
0
class Bid(OrtbObject):
    _required = {
        'id': str,
        'impid': str,
        'price': float,
    }

    _optional = {
        'nurl': str,
        'burl': str,
        'lurl': str,
        'adm': str,
        'adid': str,
        'adomain': OrtbArray(str),
        'bundle': str,
        'iurl': str,
        'cid': str,
        'crid': str,
        'tactic': str,
        'cat': OrtbArray(str),
        'attr': OrtbArray(int),
        'api': int,
        'protocol': int,
        'qagmediarating': int,
        'language': str,
        'dealid': str,
        'w': int,
        'h': int,
        'wratio': int,
        'hratio': int,
        'exp': int,
        'ext': str,
    }
Example #2
0
class Content(OrtbObject):
    _optional = {
        'id': str,
        'episode': int,
        'title': str,
        'series': str,
        'season': str,
        'artist': str,
        'genre': str,
        'album': str,
        'isrc': str,
        'producer': Producer,
        'url': str,
        'cat': OrtbArray(str),
        'prodq': int,
        'videoquality': int,
        'context': int,
        'contentrating': str,
        'userrating': str,
        'qagmediarating': int,
        'keywords': str,
        'livestream': int,
        'sourcerelationship': int,
        'len': int,
        'language': str,
        'embeddable': int,
        'data': OrtbArray(Data),
        'ext': str,
    }
Example #3
0
    def test_OrtbArray(self):
        field = OrtbArray(str)
        check = field([1, 2, '3'])
        self.assertEqual(check, ['1', '2', '3'])

        field = OrtbArray(int)
        check = field(['1', 2, '3'])
        self.assertEqual(check, [1, 2, 3])
Example #4
0
class Deal(OrtbObject):
    _optional = {
        'id': str,
        'bidfloor': float,
        'bidfloorcur': str,
        'at': int,
        'wseat': OrtbArray(str),
        'wadomain': OrtbArray(str),
        'ext': str,
    }
Example #5
0
File: request.py Project: vp7v/ortb
class Video(OrtbObject):

    _required = {
        'mimes': OrtbArray(str),
        'minduration': int,
        'maxduration': int,
        'protocols': OrtbArray(int),
    }

    _optional = {
        'ext': str,
    }
Example #6
0
class Video(OrtbObject):
    _required = {
        'mimes': OrtbArray(str),
    }

    _optional = {
        'minduration': int,
        'maxduration': int,
        'protocols': OrtbArray(int),
        'protocol': int,
        'w': int,
        'h': int,
        'startdelay': int,
        'placement': int,
        'linearity': int,
        'skip': int,
        'skipmin': int,
        'skipafter': int,
        'sequence': int,
        'battr': OrtbArray(int),
        'maxextended': int,
        'minbitrate': int,
        'maxbitrate': int,
        'boxingallowed': int,
        'playbackmethod': OrtbArray(int),
        'playbackend': int,
        'delivery': OrtbArray(int),
        'pos': int,
        'companionad': OrtbArray(Banner),
        'api': OrtbArray(int),
        'companiontype': OrtbArray(int),
        'ext': str,
    }
Example #7
0
class BidRequest(OrtbObject):
    _required = {
        'id': str,
        'imp': OrtbArray(Imp),
    }

    _optional = {
        'site': Site,
        'app': App,
        'device': Device,
        'user': User,
        'test': int,
        'at': int,
        'tmax': int,
        'wseat': OrtbArray(str),
        'bseat': OrtbArray(str),
        'allimps': int,
        'cur': OrtbArray(str),
        'wlang': OrtbArray(str),
        'bcat': OrtbArray(str),
        'badv': OrtbArray(str),
        'bapp': OrtbArray(str),
        'source': Source,
        'regs': Regs,
        'ext': str,
    }
Example #8
0
class Data(OrtbObject):
    _optional = {
        'id': str,
        'name': str,
        'segment': OrtbArray(Segment),
        'ext': str,
    }
Example #9
0
class NativeMarkup(OrtbObject):

    _required = {
        'link': Link,
    }

    _optional = {
        'ver': str,
        'assets': OrtbArray(Asset),
        'assetsurl': str,
        'dcourl': str,
        'imptrackers': OrtbArray(str),
        'jstracker': str,
        'eventtrackers': OrtbArray(str),
        'privacy': str,
        'ext': str,
    }
Example #10
0
File: request.py Project: vp7v/ortb
class NativeMarkup(OrtbObject):

    _required = {'assets': OrtbArray(Asset)}

    _optional = {
        'ver': str,
        'context': int,
        'contextsubtype': int,
        'plcmttype': int,
        'plcmtcnt': int,
        'seq': int,
        'aurlsupport': int,
        'durlsupport': int,
        'eventtrackers': OrtbArray(EventTrackers),
        'privacy': int,
        'ext': str,
    }
Example #11
0
class Producer(OrtbObject):
    _optional = {
        'id': str,
        'name': str,
        'cat': OrtbArray(str),
        'domain': str,
        'ext': str,
    }
Example #12
0
class Audio(OrtbObject):
    _required = {
        'mimes': OrtbArray(str),
    }

    _optional = {
        'minduration': int,
        'maxduration': int,
        'protocols': OrtbArray(int),
        'startdelay': int,
        'sequence': int,
        'battr': OrtbArray(int),
        'maxextended': int,
        'minbitrate': int,
        'bitrate': int,
        'delivery': OrtbArray(int),
        'companionad': OrtbArray(Banner),
        'api': OrtbArray(int),
        'companiontype': OrtbArray(int),
        'maxseq': int,
        'feed': int,
        'stitched': int,
        'nvol': int,
        'ext': str,
    }
Example #13
0
class Site(OrtbObject):
    _optional = {
        'id': str,
        'name': str,
        'domain': str,
        'cat': OrtbArray(str),
        'sectioncat': OrtbArray(str),
        'pagecat': OrtbArray(str),
        'page': str,
        'ref': str,
        'search': str,
        'mobile': int,
        'privacypolicy': int,
        'publisher': Publisher,
        'content': Content,
        'keywords': str,
        'ext': str,
    }
Example #14
0
class App(OrtbObject):
    _optional = {
        'id': str,
        'name': str,
        'bundle': str,
        'domain': str,
        'storeurl': str,
        'cat': OrtbArray(str),
        'sectioncat': OrtbArray(str),
        'pagecat': OrtbArray(str),
        'ver': str,
        'privacypolicy': int,
        'paid': int,
        'publisher': Publisher,
        'content': Content,
        'keywords': str,
        'ext': str,
    }
Example #15
0
class BidResponse(OrtbObject):
    _required = {'id': str, 'seatbid': OrtbArray(SeatBid)}

    _optional = {
        'bidid': str,
        'cur': str,
        'customdata': str,
        'nbr': int,
        'ext': str,
    }
Example #16
0
class SeatBid(OrtbObject):
    _required = {
        'bid': OrtbArray(Bid),
    }

    _optional = {
        'seat': str,
        'group': int,
        'ext': str,
    }
Example #17
0
File: request.py Project: vp7v/ortb
class EventTrackers(OrtbObject):

    _required = {
        'event': int,
        'methods': OrtbArray(int),
    }

    _optional = {
        'ext': str,
    }
Example #18
0
class Link(OrtbObject):

    _required = {
        'url': str,
    }

    _optional = {
        'clicktrackers': OrtbArray(str),
        'fallback': str,
        'ext': str,
    }
Example #19
0
class User(OrtbObject):

    _optional = {
        'id': str,
        'buyeruid': str,
        'yob': int,
        'gender': str,
        'keywords': str,
        'customdata': str,
        'geo': Geo,
        'data': OrtbArray(Data),
        'ext': str,
    }
Example #20
0
File: request.py Project: vp7v/ortb
class Image(OrtbObject):

    _required = {}

    _optional = {
        'type': int,
        'w': int,
        'wmin': int,
        'h': int,
        'hmin': int,
        'mimes': OrtbArray(str),
        'ext': str,
    }
Example #21
0
class Native(OrtbObject):
    _required = {
        'request': NativeMarkup,
    }

    _optional = {
        'ver': str,
        'api': OrtbArray(int),
        'battr': OrtbArray(int),
        'ext': str,
    }

    def __init__(self, fields):
        if isinstance(fields['request'], str):
            # native.request could be json string or ready object
            fields['request'] = json.loads(fields['request'])

        super().__init__(fields)

    def repr_json(self):
        fields = self.__dict__.copy()
        fields['request'] = json.dumps(fields['request'], cls=OrtbEncoder)
        return fields
Example #22
0
class Imp(OrtbObject):
    _required = {
        'id': str,
    }

    _optional = {
        'metric': OrtbArray(Metric),
        'banner': Banner,
        'video': Video,
        'audio': Audio,
        'native': Native,
        'pmp': Pmp,
        'displaymanager': str,
        'displaymanagerver': str,
        'instl': int,
        'tagid': str,
        'bidfloor': float,
        'bidfloorcur': str,
        'clickbrowser': int,
        'secure': int,
        'iframebuster': OrtbArray(str),
        'exp': int,
        'ext': str,
    }
Example #23
0
class Banner(OrtbObject):
    _optional = {
        'format': OrtbArray(Format),
        'w': int,
        'h': int,
        'wmax': int,
        'wmin': int,
        'hmax': int,
        'hmin': int,
        'btype': OrtbArray(int),
        'battr': OrtbArray(int),
        'pos': int,
        'mimes': OrtbArray(str),
        'topframe': int,
        'expdir': OrtbArray(int),
        'api': OrtbArray(int),
        'id': str,
        'vcm': int,
        'ext': str,
    }
Example #24
0
class Pmp(OrtbObject):
    _optional = {
        'private_auction': int,
        'deals': OrtbArray(Deal),
        'ext': str,
    }