Skip to content

Commit

Permalink
Merge pull request #51 from gadventures/checkins
Browse files Browse the repository at this point in the history
add checkins resource for GoodToGo
  • Loading branch information
bartek committed Sep 20, 2016
2 parents c65b31e + 7aa42e6 commit 0320185
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gapipy/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
Timezone,
)

from .checkin import (
Checkin,
)

from .language import Language # NOQA


Expand All @@ -75,6 +79,7 @@
'Itinerary',
'Promotion',
'SingleSupplement',
'Checkin',
'Tour',
'TourCategory',
'TourDossier',
Expand Down
2 changes: 2 additions & 0 deletions gapipy/resources/booking/booking.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .transaction import Payment, Refund
from .document import Invoice, Document
from .service import Service
from gapipy.resources.checkin import Checkin


class Booking(Resource):
Expand Down Expand Up @@ -33,4 +34,5 @@ def _resource_collection_fields(self):
('payments', Payment),
('refunds', Refund),
('documents', Document),
('checkins', Checkin),
]
1 change: 1 addition & 0 deletions gapipy/resources/checkin/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .checkin import Checkin
14 changes: 14 additions & 0 deletions gapipy/resources/checkin/checkin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from __future__ import unicode_literals

from ..base import Resource

class Checkin(Resource):
_resource_name = 'checkins'
_is_listable = True

_as_is_fields = ['id']
_date_fields = ['expires']
_resource_fields = [
('booking', 'Booking'),
('customer', 'Customer'),
]
2 changes: 2 additions & 0 deletions tests/test_live_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
Activity,
ActivityDossier,
Airport,
Checkin,
Continent,
Country,
CountryDossier,
Expand Down Expand Up @@ -90,6 +91,7 @@ class LiveAPITestCase(TestCase):
resources = [
(Accommodation, 54),
(Activity, 4486),
(Checkin, 'f17a0.11d22a09fd89750ca4157f4f866b8413c61c0c7b1ac88f'),
(Country, 'CA'),
(Departure, 419504),
(DepartureComponent, '55_3983802'),
Expand Down

0 comments on commit 0320185

Please sign in to comment.