Skip to content

Commit

Permalink
Added support for custom owner on Case creation (#118)
Browse files Browse the repository at this point in the history
* Added support for custom owner on Case creation

* added support to create CaseTask objects with specific ID
  • Loading branch information
victorvillar authored and nadouani committed Jun 13, 2019
1 parent 2ee9ed5 commit 1565f29
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions thehive4py/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def __init__(self, **attributes):
'metrics': {},
'customFields': {},
'tasks': [],
'template': None
'template': None,
'owner' : None
}

if attributes.get('json', False):
Expand All @@ -98,6 +99,7 @@ def __init__(self, **attributes):
self.metrics = attributes.get('metrics', defaults['metrics'])
self.customFields = attributes.get('customFields', defaults['customFields'])
self.template = attributes.get('template', defaults['template'])
self.owner = attributes.get('owner', defaults['owner'])

tasks = attributes.get('tasks', defaults['tasks'])
self.tasks = []
Expand Down Expand Up @@ -204,7 +206,8 @@ class CaseTask(JSONSerializable):
def __init__(self, **attributes):
if attributes.get('json', False):
attributes = attributes['json']


self.id = attributes.get('id', None)
self.title = attributes.get('title', None)
self.status = attributes.get('status', 'Waiting')
self.flag = attributes.get('flag', False)
Expand Down

0 comments on commit 1565f29

Please sign in to comment.