Skip to content

Commit

Permalink
Merge pull request #9 from Moesif/add-direction-field-to-event
Browse files Browse the repository at this point in the history
Add: direction field to Event Model
  • Loading branch information
dgilling committed Dec 13, 2019
2 parents 41599a5 + 3fa861e commit f782611
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions moesifapi/models/event_model.py
Expand Up @@ -21,6 +21,9 @@ class EventModel(BaseModel):
session_token (string): End user's auth/session token
tags (string): comma separated list of tags, see documentation
user_id (string): End user's user_id string from your app
company_id (string): End user's company_id string from your app
metadata (object): Any custom data for the event.
direction (string): API direction, incoming or outgoing
"""

Expand All @@ -31,7 +34,8 @@ def __init__(self,
tags = None,
user_id = None,
company_id=None,
metadata = None):
metadata = None,
direction=None):
"""Constructor for the EventModel class"""

# Initialize members of the class
Expand All @@ -42,6 +46,7 @@ def __init__(self,
self.user_id = user_id
self.company_id = company_id
self.metadata = metadata
self.direction = direction

# Create a mapping from Model property names to API property names
self.names = {
Expand All @@ -51,7 +56,8 @@ def __init__(self,
"tags" : "tags",
"user_id" : "user_id",
"company_id" : "company_id",
"metadata" : "metadata"
"metadata" : "metadata",
"direction": "direction"
}


Expand Down Expand Up @@ -80,11 +86,13 @@ def from_dictionary(cls,
user_id = dictionary.get("user_id")
company_id = dictionary.get("company_id")
metadata = dictionary.get("metadata")
direction = dictionary.get("direction")
# Return an object of this model
return cls(request,
response,
session_token,
tags,
user_id,
company_id,
metadata)
metadata,
direction)
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -28,7 +28,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='1.3.0',
version='1.3.1',

description='Moesif API Lib for Python',
long_description=long_description,
Expand Down

0 comments on commit f782611

Please sign in to comment.