Skip to content

Commit 51a40e5

Browse files
authored
Add reputation routes (#99)
* Add reputation routes
1 parent 3bf9ce1 commit 51a40e5

File tree

10 files changed

+1929
-0
lines changed

10 files changed

+1929
-0
lines changed

demisto_client/demisto_api/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,10 @@
156156
from demisto_client.demisto_api.models.report_automation import ReportAutomation
157157
from demisto_client.demisto_api.models.report_fields_decoder import ReportFieldsDecoder
158158
from demisto_client.demisto_api.models.report_query import ReportQuery
159+
from demisto_client.demisto_api.models.reputation import Reputation
159160
from demisto_client.demisto_api.models.reputation_calc_alg import ReputationCalcAlg
160161
from demisto_client.demisto_api.models.reputation_data import ReputationData
162+
from demisto_client.demisto_api.models.reputations_with_errors import ReputationsWithErrors
161163
from demisto_client.demisto_api.models.run_status import RunStatus
162164
from demisto_client.demisto_api.models.sla import SLA
163165
from demisto_client.demisto_api.models.sla_state import SLAState

demisto_client/demisto_api/api/default_api.py

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4514,6 +4514,105 @@ def import_playbook_with_http_info(self, file, **kwargs): # noqa: E501
45144514
_request_timeout=params.get('_request_timeout'),
45154515
collection_formats=collection_formats)
45164516

4517+
def import_reputation_handler(self, file, **kwargs): # noqa: E501
4518+
"""Import a reputation type # noqa: E501
4519+
4520+
Import a reputation type to XSOAR # noqa: E501
4521+
This method makes a synchronous HTTP request by default. To make an
4522+
asynchronous HTTP request, please pass async_req=True
4523+
>>> thread = api.import_reputation_handler(file, async_req=True)
4524+
>>> result = thread.get()
4525+
4526+
:param async_req bool
4527+
:param file file: file (required)
4528+
:return: ReputationsWithErrors
4529+
If the method is called asynchronously,
4530+
returns the request thread.
4531+
"""
4532+
kwargs['_return_http_data_only'] = True
4533+
if kwargs.get('async_req'):
4534+
return self.import_reputation_handler_with_http_info(file, **kwargs) # noqa: E501
4535+
else:
4536+
(data) = self.import_reputation_handler_with_http_info(file, **kwargs) # noqa: E501
4537+
return data
4538+
4539+
def import_reputation_handler_with_http_info(self, file, **kwargs): # noqa: E501
4540+
"""Import a reputation type # noqa: E501
4541+
4542+
Import a reputation type to XSOAR # noqa: E501
4543+
This method makes a synchronous HTTP request by default. To make an
4544+
asynchronous HTTP request, please pass async_req=True
4545+
>>> thread = api.import_reputation_handler_with_http_info(file, async_req=True)
4546+
>>> result = thread.get()
4547+
4548+
:param async_req bool
4549+
:param file file: file (required)
4550+
:return: ReputationsWithErrors
4551+
If the method is called asynchronously,
4552+
returns the request thread.
4553+
"""
4554+
4555+
all_params = ['file'] # noqa: E501
4556+
all_params.append('async_req')
4557+
all_params.append('_return_http_data_only')
4558+
all_params.append('_preload_content')
4559+
all_params.append('_request_timeout')
4560+
4561+
params = locals()
4562+
for key, val in six.iteritems(params['kwargs']):
4563+
if key not in all_params:
4564+
raise TypeError(
4565+
"Got an unexpected keyword argument '%s'"
4566+
" to method import_reputation_handler" % key
4567+
)
4568+
params[key] = val
4569+
del params['kwargs']
4570+
# verify the required parameter 'file' is set
4571+
if ('file' not in params or
4572+
params['file'] is None):
4573+
raise ValueError("Missing the required parameter `file` when calling `import_reputation_handler`") # noqa: E501
4574+
4575+
collection_formats = {}
4576+
4577+
path_params = {}
4578+
4579+
query_params = []
4580+
4581+
header_params = {}
4582+
4583+
form_params = []
4584+
local_var_files = {}
4585+
if 'file' in params:
4586+
local_var_files['file'] = params['file'] # noqa: E501
4587+
4588+
body_params = None
4589+
# HTTP header `Accept`
4590+
header_params['Accept'] = self.api_client.select_header_accept(
4591+
['application/json']) # noqa: E501
4592+
4593+
# HTTP header `Content-Type`
4594+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
4595+
['multipart/form-data']) # noqa: E501
4596+
4597+
# Authentication setting
4598+
auth_settings = ['api_key', 'csrf_token', 'x-xdr-auth-id'] # noqa: E501
4599+
4600+
return self.api_client.call_api(
4601+
'/reputation/import', 'POST',
4602+
path_params,
4603+
query_params,
4604+
header_params,
4605+
body=body_params,
4606+
post_params=form_params,
4607+
files=local_var_files,
4608+
response_type='ReputationsWithErrors', # noqa: E501
4609+
auth_settings=auth_settings,
4610+
async_req=params.get('async_req'),
4611+
_return_http_data_only=params.get('_return_http_data_only'),
4612+
_preload_content=params.get('_preload_content', True),
4613+
_request_timeout=params.get('_request_timeout'),
4614+
collection_formats=collection_formats)
4615+
45174616
def import_script(self, file, **kwargs): # noqa: E501
45184617
"""Upload an automation # noqa: E501
45194618

demisto_client/demisto_api/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,10 @@
149149
from demisto_client.demisto_api.models.report_automation import ReportAutomation
150150
from demisto_client.demisto_api.models.report_fields_decoder import ReportFieldsDecoder
151151
from demisto_client.demisto_api.models.report_query import ReportQuery
152+
from demisto_client.demisto_api.models.reputation import Reputation
152153
from demisto_client.demisto_api.models.reputation_calc_alg import ReputationCalcAlg
153154
from demisto_client.demisto_api.models.reputation_data import ReputationData
155+
from demisto_client.demisto_api.models.reputations_with_errors import ReputationsWithErrors
154156
from demisto_client.demisto_api.models.run_status import RunStatus
155157
from demisto_client.demisto_api.models.sla import SLA
156158
from demisto_client.demisto_api.models.sla_state import SLAState

0 commit comments

Comments
 (0)