diff --git a/terminalone/models/__init__.py b/terminalone/models/__init__.py index d2d798c..5e59522 100644 --- a/terminalone/models/__init__.py +++ b/terminalone/models/__init__.py @@ -20,6 +20,7 @@ from .placementslot import PlacementSlot from .publisher import Publisher from .publishersite import PublisherSite +from .seat import Seat from .sitelist import SiteList from .siteplacement import SitePlacement from .strategy import Strategy @@ -58,6 +59,7 @@ 'PlacementSlot', 'Publisher', 'PublisherSite', + 'Seat', 'SiteList', 'SitePlacement', 'Strategy', diff --git a/terminalone/models/organization.py b/terminalone/models/organization.py index 08d3bef..e7bf4ab 100644 --- a/terminalone/models/organization.py +++ b/terminalone/models/organization.py @@ -11,6 +11,7 @@ class Organization(Entity): resource = 'organization' _relations = { 'currency', + 'seats', } _dmp_settings = Entity._enum({'disabled', 'enabled'}, 'disabled') _org_types = Entity._enum({'buyer', 'partner'}, 'buyer') diff --git a/terminalone/models/pixelbundle.py b/terminalone/models/pixelbundle.py index 5901a96..d6f5593 100644 --- a/terminalone/models/pixelbundle.py +++ b/terminalone/models/pixelbundle.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -"""Provides Pixel Bundles object for working with creatives.""" +"""Provides Pixel Bundle object for working with T1 pixels.""" from __future__ import absolute_import from ..entity import Entity diff --git a/terminalone/models/seat.py b/terminalone/models/seat.py new file mode 100644 index 0000000..9ad0bbf --- /dev/null +++ b/terminalone/models/seat.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +"""Provides seat object.""" + +from __future__ import absolute_import +from ..entity import Entity + + +class Seat(Entity): + """Seat entity.""" + collection = 'seats' + resource = 'seat' + _relations = { + 'advertiser', + } + _rmx_units = Entity._enum({'CPM', 'PCT_MEDIA'}, 'PCT_MEDIA') + _pull = { + 'bill_media_to_client': Entity._int_to_bool, + 'created_on': Entity._strpt, + 'id': int, + 'organization_id': int, + 'rmx_exchange_cost_cpm': float, + 'rmx_exchange_cost_pct': float, + 'rmx_exchange_cost_unit': None, + 'seat_identifier': None, + 'status': Entity._int_to_bool, + 'supply_source_id': int, + 'updated_on': Entity._strpt, + 'version': int, + } + _push = _pull.copy() + _push.update({ + 'bill_media_to_client': int, + 'rmx_exchange_cost_unit': _rmx_units, + 'status': int, + }) + + def __init__(self, session, properties=None, **kwargs): + super(Seat, self).__init__(session, properties, **kwargs) diff --git a/terminalone/service.py b/terminalone/service.py index fae9d31..714a174 100644 --- a/terminalone/service.py +++ b/terminalone/service.py @@ -29,6 +29,7 @@ 'placement_slots': PlacementSlot, 'publishers': Publisher, 'publisher_sites': PublisherSite, + 'seats': Seat, 'site_lists': SiteList, 'site_placements': SitePlacement, 'strategies': Strategy, @@ -67,6 +68,7 @@ PlacementSlot: 'placement_slots', Publisher: 'publishers', PublisherSite: 'publisher_sites', + Seat: 'seats', SiteList: 'site_lists', SitePlacement: 'site_placements', Strategy: 'strategies', @@ -105,6 +107,7 @@ 'placement_slot': PlacementSlot, 'publisher': Publisher, 'publisher_site': PublisherSite, + 'seat': Seat, 'site_list': SiteList, 'site_placement': SitePlacement, 'strategy': Strategy,