Skip to content

Commit

Permalink
Add reputation routes (#99)
Browse files Browse the repository at this point in the history
* Add reputation routes
  • Loading branch information
amshamah419 authored Aug 15, 2022
1 parent 3bf9ce1 commit 51a40e5
Show file tree
Hide file tree
Showing 10 changed files with 1,929 additions and 0 deletions.
2 changes: 2 additions & 0 deletions demisto_client/demisto_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@
from demisto_client.demisto_api.models.report_automation import ReportAutomation
from demisto_client.demisto_api.models.report_fields_decoder import ReportFieldsDecoder
from demisto_client.demisto_api.models.report_query import ReportQuery
from demisto_client.demisto_api.models.reputation import Reputation
from demisto_client.demisto_api.models.reputation_calc_alg import ReputationCalcAlg
from demisto_client.demisto_api.models.reputation_data import ReputationData
from demisto_client.demisto_api.models.reputations_with_errors import ReputationsWithErrors
from demisto_client.demisto_api.models.run_status import RunStatus
from demisto_client.demisto_api.models.sla import SLA
from demisto_client.demisto_api.models.sla_state import SLAState
Expand Down
99 changes: 99 additions & 0 deletions demisto_client/demisto_api/api/default_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4514,6 +4514,105 @@ def import_playbook_with_http_info(self, file, **kwargs): # noqa: E501
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def import_reputation_handler(self, file, **kwargs): # noqa: E501
"""Import a reputation type # noqa: E501
Import a reputation type to XSOAR # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.import_reputation_handler(file, async_req=True)
>>> result = thread.get()
:param async_req bool
:param file file: file (required)
:return: ReputationsWithErrors
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.import_reputation_handler_with_http_info(file, **kwargs) # noqa: E501
else:
(data) = self.import_reputation_handler_with_http_info(file, **kwargs) # noqa: E501
return data

def import_reputation_handler_with_http_info(self, file, **kwargs): # noqa: E501
"""Import a reputation type # noqa: E501
Import a reputation type to XSOAR # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.import_reputation_handler_with_http_info(file, async_req=True)
>>> result = thread.get()
:param async_req bool
:param file file: file (required)
:return: ReputationsWithErrors
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['file'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')

params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method import_reputation_handler" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'file' is set
if ('file' not in params or
params['file'] is None):
raise ValueError("Missing the required parameter `file` when calling `import_reputation_handler`") # noqa: E501

collection_formats = {}

path_params = {}

query_params = []

header_params = {}

form_params = []
local_var_files = {}
if 'file' in params:
local_var_files['file'] = params['file'] # noqa: E501

body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501

# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['multipart/form-data']) # noqa: E501

# Authentication setting
auth_settings = ['api_key', 'csrf_token', 'x-xdr-auth-id'] # noqa: E501

return self.api_client.call_api(
'/reputation/import', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='ReputationsWithErrors', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def import_script(self, file, **kwargs): # noqa: E501
"""Upload an automation # noqa: E501
Expand Down
2 changes: 2 additions & 0 deletions demisto_client/demisto_api/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@
from demisto_client.demisto_api.models.report_automation import ReportAutomation
from demisto_client.demisto_api.models.report_fields_decoder import ReportFieldsDecoder
from demisto_client.demisto_api.models.report_query import ReportQuery
from demisto_client.demisto_api.models.reputation import Reputation
from demisto_client.demisto_api.models.reputation_calc_alg import ReputationCalcAlg
from demisto_client.demisto_api.models.reputation_data import ReputationData
from demisto_client.demisto_api.models.reputations_with_errors import ReputationsWithErrors
from demisto_client.demisto_api.models.run_status import RunStatus
from demisto_client.demisto_api.models.sla import SLA
from demisto_client.demisto_api.models.sla_state import SLAState
Expand Down
Loading

0 comments on commit 51a40e5

Please sign in to comment.