Skip to content

Commit

Permalink
Merge pull request #83 from gadventures/agent-fields
Browse files Browse the repository at this point in the history
Update Agent resource representation
  • Loading branch information
marz619 committed Dec 1, 2017
2 parents 1a31f44 + dfdcbda commit 185e301
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions gapipy/resources/booking/agent.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
from __future__ import unicode_literals

from ..base import Resource
from ..base import BaseModel, Resource

from .agency import Agency


class AgentRole(BaseModel):
_as_is_fields = ['id', 'name']


class AgentPhoneNumber(BaseModel):
_as_is_fields = ['number', 'type']


class Agent(Resource):
_resource_name = 'agents'
_is_listable = False

_as_is_fields = [
'id', 'href', 'role', 'first_name', 'last_name', 'email',
'phone_numbers', 'username', 'active',
'id',
'href',
'first_name',
'last_name',
'email',
'username',
'active',
]
_model_fields = [
('role', AgentRole),
]
_model_collection_fields = [
('phone_numbers', AgentPhoneNumber),
]
_resource_fields = [('agency', Agency)]

0 comments on commit 185e301

Please sign in to comment.