Skip to content

Commit

Permalink
Merge pull request #45 from demisto/incidents-fix
Browse files Browse the repository at this point in the history
Fix for SearchIncidents incorrect model used
  • Loading branch information
amshamah419 authored Aug 5, 2020
2 parents 14f18f8 + 2e503e0 commit 95ed782
Show file tree
Hide file tree
Showing 27 changed files with 407 additions and 23 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

[1]: https://pypi.org/project/demisto-py/#history

## 2.0.14
Fixed an issue where the attribute mapping for the `search_incidents` model was incorrectly looking for `incidents` not `data`.

## 2.0.13
* Fixed the `filter` parameter in `search_incidents` method to be required as specified in the API.

Expand Down
7 changes: 3 additions & 4 deletions demisto_client/demisto_api/api/default_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3814,7 +3814,6 @@ def import_classifier(self, file, **kwargs): # noqa: E501
"""
with open(file, 'r') as classifier_json_file:
data = classifier_json_file.read()

classifier_data_json = json.loads(data)
classifier_id = classifier_data_json.get('id')
kwargs['_return_http_data_only'] = True
Expand Down Expand Up @@ -6105,7 +6104,7 @@ def search_incidents(self, filter, **kwargs): # noqa: E501
:param async_req bool
:param SearchIncidentsData filter: (required)
:return: Incident
:return: InlineResponse200
If the method is called asynchronously,
returns the request thread.
"""
Expand All @@ -6127,7 +6126,7 @@ def search_incidents_with_http_info(self, filter, **kwargs): # noqa: E501
:param async_req bool
:param SearchIncidentsData filter: (required)
:return: Incident
:return: InlineResponse200
If the method is called asynchronously,
returns the request thread.
"""
Expand Down Expand Up @@ -6185,7 +6184,7 @@ def search_incidents_with_http_info(self, filter, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Incident', # noqa: E501
response_type='InlineResponse200', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
30 changes: 15 additions & 15 deletions demisto_client/demisto_api/models/inline_response200.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,47 +33,47 @@ class InlineResponse200(object):
and the value is json key in definition.
"""
swagger_types = {
'incidents': 'list[Incident]',
'data': 'list[Incident]',
'total': 'int'
}

attribute_map = {
'incidents': 'incidents',
'data': 'data',
'total': 'total'
}

def __init__(self, incidents=None, total=None): # noqa: E501
def __init__(self, data=None, total=None): # noqa: E501
"""InlineResponse200 - a model defined in Swagger""" # noqa: E501

self._incidents = None
self._data = None
self._total = None
self.discriminator = None

if incidents is not None:
self.incidents = incidents
if data is not None:
self.data = data
if total is not None:
self.total = total

@property
def incidents(self):
"""Gets the incidents of this InlineResponse200. # noqa: E501
def data(self):
"""Gets the data of this InlineResponse200. # noqa: E501
:return: The incidents of this InlineResponse200. # noqa: E501
:return: The data of this InlineResponse200. # noqa: E501
:rtype: list[Incident]
"""
return self._incidents
return self._data

@incidents.setter
def incidents(self, incidents):
"""Sets the incidents of this InlineResponse200.
@data.setter
def data(self, data):
"""Sets the data of this InlineResponse200.
:param incidents: The incidents of this InlineResponse200. # noqa: E501
:param data: The data of this InlineResponse200. # noqa: E501
:type: list[Incident]
"""

self._incidents = incidents
self._data = data

@property
def total(self):
Expand Down
2 changes: 2 additions & 0 deletions docs/DefaultApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -2116,6 +2116,8 @@ from pprint import pprint

api_instance = demisto_client.configure(base_url="https://YOUR_DEMISTO_SERVER", api_key="YOUR_API_KEY")
file = '/path/to/file.txt' # file | file
type = 'type_example' # str | associated typeID for the layout
kind = 'kind_example' # str | layout kind details

try:
# Import a layout
Expand Down
9 changes: 9 additions & 0 deletions docs/ExpirationPolicy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ExpirationPolicy

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)


9 changes: 9 additions & 0 deletions docs/ExpirationSettingsSource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ExpirationSettingsSource

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)


17 changes: 17 additions & 0 deletions docs/ExpirationSource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ExpirationSource

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**brand** | **str** | | [optional]
**expiration_interval** | **int** | | [optional]
**expiration_policy** | [**ExpirationPolicy**](ExpirationPolicy.md) | | [optional]
**instance** | **str** | | [optional]
**module_id** | **str** | | [optional]
**set_time** | **datetime** | | [optional]
**source** | [**ExpirationSettingsSource**](ExpirationSettingsSource.md) | | [optional]
**user** | **str** | | [optional]

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)


28 changes: 28 additions & 0 deletions docs/FeedIndicator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# FeedIndicator

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**expiration_source** | [**ExpirationSource**](ExpirationSource.md) | | [optional]
**bypass_exclusion_list** | **bool** | | [optional]
**classifier_version** | **int** | | [optional]
**expiration_interval** | **int** | | [optional]
**expiration_policy** | [**ExpirationPolicy**](ExpirationPolicy.md) | | [optional]
**feed_config** | **dict(str, object)** | | [optional]
**fetch_time** | **datetime** | | [optional]
**fields** | [**CustomFields**](CustomFields.md) | | [optional]
**is_enrichment** | **bool** | | [optional]
**modified_time** | **datetime** | | [optional]
**module_id** | **str** | | [optional]
**raw_json** | **dict(str, object)** | | [optional]
**reliability** | [**Reliability**](Reliability.md) | | [optional]
**score** | **int** | | [optional]
**source_brand** | **str** | | [optional]
**source_instance** | **str** | | [optional]
**timestamp** | **datetime** | | [optional]
**type** | **str** | indicator fields | [optional]
**value** | **str** | | [optional]

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)


9 changes: 9 additions & 0 deletions docs/FeedIndicators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# FeedIndicators

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)


17 changes: 17 additions & 0 deletions docs/FormDisplay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# FormDisplay

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**body_background_color** | **str** | | [optional]
**body_font_color** | **str** | | [optional]
**header_background_color** | **str** | | [optional]
**header_font_color** | **str** | | [optional]
**sender** | **str** | | [optional]
**submit_button_background_color** | **str** | | [optional]
**submit_button_font_color** | **str** | | [optional]
**submit_text** | **str** | | [optional]

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)


9 changes: 9 additions & 0 deletions docs/Incidents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Incidents

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)


11 changes: 11 additions & 0 deletions docs/IndicatorEditBulkResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# IndicatorEditBulkResponse

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**total** | **int** | | [optional]
**updated** | **int** | | [optional]

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)


2 changes: 1 addition & 1 deletion docs/InlineResponse200.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**incidents** | [**list[Incident]**](Incident.md) | | [optional]
**data** | [**list[Incident]**](Incident.md) | | [optional]
**total** | **int** | | [optional]

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)
Expand Down
32 changes: 32 additions & 0 deletions docs/InstanceClassifier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# InstanceClassifier

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**brand_name** | **str** | | [optional]
**commit_message** | **str** | | [optional]
**custom** | **bool** | | [optional]
**default_incident_type** | **str** | | [optional]
**feed** | **bool** | | [optional]
**from_server_version** | [**Version**](Version.md) | | [optional]
**id** | **str** | | [optional]
**incident_samples** | [**Incidents**](Incidents.md) | | [optional]
**indicator_samples** | [**FeedIndicators**](FeedIndicators.md) | | [optional]
**instance_id** | **str** | | [optional]
**instance_name** | **str** | | [optional]
**is_default** | **bool** | | [optional]
**item_version** | [**Version**](Version.md) | | [optional]
**key_type_map** | **dict(str, str)** | | [optional]
**mapping** | [**dict(str, Mapper)**](Mapper.md) | | [optional]
**modified** | **datetime** | | [optional]
**pack_id** | **str** | | [optional]
**primary_term** | **int** | | [optional]
**propagation_labels** | **list[str]** | | [optional]
**sequence_number** | **int** | | [optional]
**should_commit** | **bool** | | [optional]
**sort_values** | **list[str]** | | [optional]
**version** | **int** | | [optional]

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)


30 changes: 30 additions & 0 deletions docs/Layout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Layout

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**commit_message** | **str** | | [optional]
**from_server_version** | [**Version**](Version.md) | | [optional]
**id** | **str** | | [optional]
**item_version** | [**Version**](Version.md) | | [optional]
**kind** | **str** | | [optional]
**modified** | **datetime** | | [optional]
**name** | **str** | | [optional]
**pack_id** | **str** | | [optional]
**prev_kind** | **str** | | [optional]
**prev_type_id** | **str** | | [optional]
**primary_term** | **int** | | [optional]
**propagation_labels** | **list[str]** | | [optional]
**sections** | [**list[LayoutSection]**](LayoutSection.md) | | [optional]
**sequence_number** | **int** | | [optional]
**should_commit** | **bool** | | [optional]
**sort_values** | **list[str]** | | [optional]
**system** | **bool** | | [optional]
**to_server_version** | [**Version**](Version.md) | | [optional]
**type_id** | **str** | | [optional]
**vc_should_ignore** | **bool** | | [optional]
**version** | **int** | | [optional]

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)


12 changes: 12 additions & 0 deletions docs/LayoutAPI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# LayoutAPI

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**kind** | **str** | | [optional]
**layout** | [**Layout**](Layout.md) | | [optional]
**type_id** | **str** | | [optional]

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)


17 changes: 17 additions & 0 deletions docs/LayoutField.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# LayoutField

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**field_id** | **str** | | [optional]
**id** | **str** | | [optional]
**is_visible** | **bool** | | [optional]
**modified** | **datetime** | | [optional]
**primary_term** | **int** | | [optional]
**sequence_number** | **int** | | [optional]
**sort_values** | **list[str]** | | [optional]
**version** | **int** | | [optional]

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)


23 changes: 23 additions & 0 deletions docs/LayoutSection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# LayoutSection

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**description** | **str** | | [optional]
**fields** | [**list[LayoutField]**](LayoutField.md) | | [optional]
**id** | **str** | | [optional]
**is_visible** | **bool** | | [optional]
**modified** | **datetime** | | [optional]
**name** | **str** | | [optional]
**primary_term** | **int** | | [optional]
**query** | **object** | | [optional]
**query_type** | **str** | | [optional]
**read_only** | **bool** | | [optional]
**sequence_number** | **int** | | [optional]
**sort_values** | **list[str]** | | [optional]
**type** | **str** | | [optional]
**version** | **int** | | [optional]

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)


11 changes: 11 additions & 0 deletions docs/Mapper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Mapper

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**dont_map_event_to_labels** | **bool** | DontMapEventToLabels by default we will map all the fields of the event to incident labels | [optional]
**internal_mapping** | [**dict(str, AdvanceArg)**](AdvanceArg.md) | | [optional]

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)


Loading

0 comments on commit 95ed782

Please sign in to comment.