Skip to content

Commit

Permalink
Merge pull request #73 from pswaminathan/seats
Browse files Browse the repository at this point in the history
Add Seat object and fix docstring for pixelbundle.py
  • Loading branch information
pswaminathan committed Feb 25, 2016
2 parents 5cf896e + 1325c5d commit b7aff13
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
2 changes: 2 additions & 0 deletions terminalone/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -58,6 +59,7 @@
'PlacementSlot',
'Publisher',
'PublisherSite',
'Seat',
'SiteList',
'SitePlacement',
'Strategy',
Expand Down
1 change: 1 addition & 0 deletions terminalone/models/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion terminalone/models/pixelbundle.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
38 changes: 38 additions & 0 deletions terminalone/models/seat.py
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 3 additions & 0 deletions terminalone/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
'placement_slots': PlacementSlot,
'publishers': Publisher,
'publisher_sites': PublisherSite,
'seats': Seat,
'site_lists': SiteList,
'site_placements': SitePlacement,
'strategies': Strategy,
Expand Down Expand Up @@ -67,6 +68,7 @@
PlacementSlot: 'placement_slots',
Publisher: 'publishers',
PublisherSite: 'publisher_sites',
Seat: 'seats',
SiteList: 'site_lists',
SitePlacement: 'site_placements',
Strategy: 'strategies',
Expand Down Expand Up @@ -105,6 +107,7 @@
'placement_slot': PlacementSlot,
'publisher': Publisher,
'publisher_site': PublisherSite,
'seat': Seat,
'site_list': SiteList,
'site_placement': SitePlacement,
'strategy': Strategy,
Expand Down

0 comments on commit b7aff13

Please sign in to comment.