From c6f68c12cdf1e51dd72f65ca694711953c939888 Mon Sep 17 00:00:00 2001 From: ShahafBenYakir Date: Mon, 20 Apr 2020 10:04:28 +0300 Subject: [PATCH 1/5] Added new api functions --- demisto_client/demisto_api/api/default_api.py | 737 +++++++++++++++++- docs/DefaultApi.md | 357 ++++++++- docs/README.md | 7 + server_api_swagger.json | 249 +++++- 4 files changed, 1327 insertions(+), 23 deletions(-) diff --git a/demisto_client/demisto_api/api/default_api.py b/demisto_client/demisto_api/api/default_api.py index 7fb6d1d..d0790be 100644 --- a/demisto_client/demisto_api/api/default_api.py +++ b/demisto_client/demisto_api/api/default_api.py @@ -3796,45 +3796,655 @@ def get_widget_with_http_info(self, id, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def import_widget(self, **kwargs): # noqa: E501 + def import_classifier(self, file, **kwargs): # noqa: E501 + """Import a classifier # noqa: E501 + + Import a classifier to Cortex 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_classifier(file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :return: InstanceClassifier + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.import_classifier_with_http_info(file, **kwargs) # noqa: E501 + else: + (data) = self.import_classifier_with_http_info(file, **kwargs) # noqa: E501 + return data + + def import_classifier_with_http_info(self, file, **kwargs): # noqa: E501 + """Import a classifier # noqa: E501 + + Import a classifier to Cortex 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_classifier_with_http_info(file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :return: InstanceClassifier + 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_classifier" % 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_classifier`") # 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'] # noqa: E501 + + return self.api_client.call_api( + '/classifier/import', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InstanceClassifier', # 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_dashboard(self, file, **kwargs): # noqa: E501 + """Import a dashboard # noqa: E501 + + Import a dashboard to Cortex 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_dashboard(file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :return: Dashboard + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.import_dashboard_with_http_info(file, **kwargs) # noqa: E501 + else: + (data) = self.import_dashboard_with_http_info(file, **kwargs) # noqa: E501 + return data + + def import_dashboard_with_http_info(self, file, **kwargs): # noqa: E501 + """Import a dashboard # noqa: E501 + + Import a dashboard to Cortex 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_dashboard_with_http_info(file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :return: Dashboard + 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_dashboard" % 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_dashboard`") # 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'] # noqa: E501 + + return self.api_client.call_api( + '/dashboards/import', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Dashboard', # 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_incident_fields(self, file, **kwargs): # noqa: E501 + """Import an incidents field # noqa: E501 + + Import an incidents field to Cortex 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_incident_fields(file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :return: IncidentField + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.import_incident_fields_with_http_info(file, **kwargs) # noqa: E501 + else: + (data) = self.import_incident_fields_with_http_info(file, **kwargs) # noqa: E501 + return data + + def import_incident_fields_with_http_info(self, file, **kwargs): # noqa: E501 + """Import an incidents field # noqa: E501 + + Import an incidents field to Cortex 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_incident_fields_with_http_info(file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :return: IncidentField + 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_incident_fields" % 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_incident_fields`") # 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'] # noqa: E501 + + return self.api_client.call_api( + '/incidentfields/import', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IncidentField', # 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_incident_types_handler(self, file, **kwargs): # noqa: E501 + """Import an incident type # noqa: E501 + + Import an incident type to Cortex 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_incident_types_handler(file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :return: IncidentType + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.import_incident_types_handler_with_http_info(file, **kwargs) # noqa: E501 + else: + (data) = self.import_incident_types_handler_with_http_info(file, **kwargs) # noqa: E501 + return data + + def import_incident_types_handler_with_http_info(self, file, **kwargs): # noqa: E501 + """Import an incident type # noqa: E501 + + Import an incident type to Cortex 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_incident_types_handler_with_http_info(file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :return: IncidentType + 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_incident_types_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_incident_types_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'] # noqa: E501 + + return self.api_client.call_api( + '/incidenttypes/import', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IncidentType', # 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_layout(self, file, type, kind, **kwargs): # noqa: E501 + """Import a layout # noqa: E501 + + Import a layout to Cortex 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_layout(file, type, kind, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :param str type: associated typeID for the layout (required) + :param str kind: layout kind details (required) + :return: LayoutAPI + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.import_layout_with_http_info(file, type, kind, **kwargs) # noqa: E501 + else: + (data) = self.import_layout_with_http_info(file, type, kind, **kwargs) # noqa: E501 + return data + + def import_layout_with_http_info(self, file, type, kind, **kwargs): # noqa: E501 + """Import a layout # noqa: E501 + + Import a layout to Cortex 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_layout_with_http_info(file, type, kind, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :param str type: associated typeID for the layout (required) + :param str kind: layout kind details (required) + :return: LayoutAPI + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['file', 'type', 'kind'] # 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_layout" % 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_layout`") # noqa: E501 + # verify the required parameter 'type' is set + if ('type' not in params or + params['type'] is None): + raise ValueError("Missing the required parameter `type` when calling `import_layout`") # noqa: E501 + # verify the required parameter 'kind' is set + if ('kind' not in params or + params['kind'] is None): + raise ValueError("Missing the required parameter `kind` when calling `import_layout`") # 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 + if 'type' in params: + form_params.append(('type', params['type'])) # noqa: E501 + if 'kind' in params: + form_params.append(('kind', params['kind'])) # 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'] # noqa: E501 + + return self.api_client.call_api( + '/layouts/import', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='LayoutAPI', # 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 + + Upload an automation to Cortex 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_script(file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :return: AutomationScript + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.import_script_with_http_info(file, **kwargs) # noqa: E501 + else: + (data) = self.import_script_with_http_info(file, **kwargs) # noqa: E501 + return data + + def import_script_with_http_info(self, file, **kwargs): # noqa: E501 + """Upload an automation # noqa: E501 + + Upload an automation to Cortex 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_script_with_http_info(file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :return: AutomationScript + 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_script" % 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_script`") # 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'] # noqa: E501 + + return self.api_client.call_api( + '/automation/import', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutomationScript', # 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_widget(self, file, **kwargs): # noqa: E501 """Import a widget # noqa: E501 Import a widget to the system, ignoring ID or version, used to import new widgets. # 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_widget(async_req=True) + >>> thread = api.import_widget(file, async_req=True) >>> result = thread.get() :param async_req bool - :param Widget widget: + :param file file: file (required) :return: Widget If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.import_widget_with_http_info(**kwargs) # noqa: E501 + return self.import_widget_with_http_info(file, **kwargs) # noqa: E501 else: - (data) = self.import_widget_with_http_info(**kwargs) # noqa: E501 + (data) = self.import_widget_with_http_info(file, **kwargs) # noqa: E501 return data - def import_widget_with_http_info(self, **kwargs): # noqa: E501 + def import_widget_with_http_info(self, file, **kwargs): # noqa: E501 """Import a widget # noqa: E501 Import a widget to the system, ignoring ID or version, used to import new widgets. # 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_widget_with_http_info(async_req=True) + >>> thread = api.import_widget_with_http_info(file, async_req=True) >>> result = thread.get() :param async_req bool - :param Widget widget: + :param file file: file (required) :return: Widget If the method is called asynchronously, returns the request thread. """ - all_params = ['widget'] # noqa: E501 + all_params = ['file'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3849,6 +4459,10 @@ def import_widget_with_http_info(self, **kwargs): # noqa: E501 ) 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_widget`") # noqa: E501 collection_formats = {} @@ -3860,17 +4474,17 @@ def import_widget_with_http_info(self, **kwargs): # noqa: E501 form_params = [] local_var_files = {} + if 'file' in params: + local_var_files['file'] = params['file'] # noqa: E501 body_params = None - if 'widget' in params: - body_params = params['widget'] # 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 - ['application/json', 'application/xml']) # noqa: E501 + ['multipart/form-data']) # noqa: E501 # Authentication setting auth_settings = ['api_key', 'csrf_token'] # noqa: E501 @@ -4885,6 +5499,105 @@ def investigation_add_formatted_entry_handler_with_http_info(self, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def import_playbook(self, file, **kwargs): # noqa: E501 + """Import and override playbook # noqa: E501 + + Import and override playbook in Cortex 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_playbook(file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :return: Playbook + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.override_playbook_yaml_with_http_info(file, **kwargs) # noqa: E501 + else: + (data) = self.override_playbook_yaml_with_http_info(file, **kwargs) # noqa: E501 + return data + + def override_playbook_yaml_with_http_info(self, file, **kwargs): # noqa: E501 + """Import and override playbook # noqa: E501 + + Import and override playbook in Cortex 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.override_playbook_yaml_with_http_info(file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :return: Playbook + 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 override_playbook_yaml" % 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 `override_playbook_yaml`") # 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'] # noqa: E501 + + return self.api_client.call_api( + '/playbook/save/yaml', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Playbook', # 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 revoke_user_api_key(self, username, **kwargs): # noqa: E501 """revoke_user_api_key # noqa: E501 diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 40e8f02..a1dea6e 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -42,6 +42,12 @@ Method | HTTP request | Description [**get_stats_for_dashboard**](DefaultApi.md#get_stats_for_dashboard) | **POST** /statistics/dashboards/query | Get Dashboard Statistics [**get_stats_for_widget**](DefaultApi.md#get_stats_for_widget) | **POST** /statistics/widgets/query | Get Widget Statistics [**get_widget**](DefaultApi.md#get_widget) | **GET** /widgets/{id} | Get widget by ID +[**import_classifier**](DefaultApi.md#import_classifier) | **POST** /classifier/import | Import a classifier +[**import_dashboard**](DefaultApi.md#import_dashboard) | **POST** /dashboards/import | Import a dashboard +[**import_incident_fields**](DefaultApi.md#import_incident_fields) | **POST** /incidentfields/import | Import an incidents field +[**import_incident_types_handler**](DefaultApi.md#import_incident_types_handler) | **POST** /incidenttypes/import | Import an incident type +[**import_layout**](DefaultApi.md#import_layout) | **POST** /layouts/import | Import a layout +[**import_script**](DefaultApi.md#import_script) | **POST** /automation/import | Upload an automation [**import_widget**](DefaultApi.md#import_widget) | **POST** /widgets/import | Import a widget [**incident_file_upload**](DefaultApi.md#incident_file_upload) | **POST** /incident/upload/{id} | [**indicator_whitelist**](DefaultApi.md#indicator_whitelist) | **POST** /indicator/whitelist | Whitelists or deletes Indicator @@ -53,6 +59,7 @@ Method | HTTP request | Description [**investigation_add_entries_sync**](DefaultApi.md#investigation_add_entries_sync) | **POST** /entry/execute/sync | Create new entry in existing investigation [**investigation_add_entry_handler**](DefaultApi.md#investigation_add_entry_handler) | **POST** /entry | Create new entry in existing investigation [**investigation_add_formatted_entry_handler**](DefaultApi.md#investigation_add_formatted_entry_handler) | **POST** /entry/formatted | Create new formatted entry in existing investigation +[**override_playbook_yaml**](DefaultApi.md#override_playbook_yaml) | **POST** /playbook/save/yaml | Import and override playbook [**revoke_user_api_key**](DefaultApi.md#revoke_user_api_key) | **POST** /apikeys/revoke/user/{username} | [**save_evidence**](DefaultApi.md#save_evidence) | **POST** /evidence | Save evidence [**save_or_update_script**](DefaultApi.md#save_or_update_script) | **POST** /automation | Create or update automation @@ -1899,8 +1906,300 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) +# **import_classifier** +> InstanceClassifier import_classifier(file) + +Import a classifier + +Import a classifier to Cortex XSOAR + +### Example +```python +from __future__ import print_function +import time +import demisto_client +import demisto_client.demisto_api +from demisto_client.demisto_api.rest import ApiException +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 + +try: + # Import a classifier + api_response = api_instance.import_classifier(file) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->import_classifier: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **file**| file | + +### Return type + +[**InstanceClassifier**](InstanceClassifier.md) + +### Authorization + +[api_key](README.md#api_key), [csrf_token](README.md#csrf_token) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **import_dashboard** +> Dashboard import_dashboard(file) + +Import a dashboard + +Import a dashboard to Cortex XSOAR + +### Example +```python +from __future__ import print_function +import time +import demisto_client +import demisto_client.demisto_api +from demisto_client.demisto_api.rest import ApiException +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 + +try: + # Import a dashboard + api_response = api_instance.import_dashboard(file) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->import_dashboard: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **file**| file | + +### Return type + +[**Dashboard**](Dashboard.md) + +### Authorization + +[api_key](README.md#api_key), [csrf_token](README.md#csrf_token) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **import_incident_fields** +> IncidentField import_incident_fields(file) + +Import an incidents field + +Import an incidents field to Cortex XSOAR + +### Example +```python +from __future__ import print_function +import time +import demisto_client +import demisto_client.demisto_api +from demisto_client.demisto_api.rest import ApiException +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 + +try: + # Import an incidents field + api_response = api_instance.import_incident_fields(file) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->import_incident_fields: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **file**| file | + +### Return type + +[**IncidentField**](IncidentField.md) + +### Authorization + +[api_key](README.md#api_key), [csrf_token](README.md#csrf_token) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **import_incident_types_handler** +> IncidentType import_incident_types_handler(file) + +Import an incident type + +Import an incident type to Cortex XSOAR + +### Example +```python +from __future__ import print_function +import time +import demisto_client +import demisto_client.demisto_api +from demisto_client.demisto_api.rest import ApiException +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 + +try: + # Import an incident type + api_response = api_instance.import_incident_types_handler(file) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->import_incident_types_handler: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **file**| file | + +### Return type + +[**IncidentType**](IncidentType.md) + +### Authorization + +[api_key](README.md#api_key), [csrf_token](README.md#csrf_token) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **import_layout** +> LayoutAPI import_layout(file, type, kind) + +Import a layout + +Import a layout to Cortex XSOAR + +### Example +```python +from __future__ import print_function +import time +import demisto_client +import demisto_client.demisto_api +from demisto_client.demisto_api.rest import ApiException +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 + api_response = api_instance.import_layout(file, type, kind) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->import_layout: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **file**| file | + **type** | **str**| associated typeID for the layout | + **kind** | **str**| layout kind details | + +### Return type + +[**LayoutAPI**](LayoutAPI.md) + +### Authorization + +[api_key](README.md#api_key), [csrf_token](README.md#csrf_token) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **import_script** +> AutomationScript import_script(file) + +Upload an automation + +Upload an automation to Cortex XSOAR + +### Example +```python +from __future__ import print_function +import time +import demisto_client +import demisto_client.demisto_api +from demisto_client.demisto_api.rest import ApiException +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 + +try: + # Upload an automation + api_response = api_instance.import_script(file) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->import_script: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **file**| file | + +### Return type + +[**AutomationScript**](AutomationScript.md) + +### Authorization + +[api_key](README.md#api_key), [csrf_token](README.md#csrf_token) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + # **import_widget** -> Widget import_widget(widget=widget) +> Widget import_widget(file) Import a widget @@ -1916,11 +2215,11 @@ from demisto_client.demisto_api.rest import ApiException from pprint import pprint api_instance = demisto_client.configure(base_url="https://YOUR_DEMISTO_SERVER", api_key="YOUR_API_KEY") -widget = demisto_client.demisto_api.Widget() # Widget | (optional) +file = '/path/to/file.txt' # file | file try: # Import a widget - api_response = api_instance.import_widget(widget=widget) + api_response = api_instance.import_widget(file) pprint(api_response) except ApiException as e: print("Exception when calling DefaultApi->import_widget: %s\n" % e) @@ -1930,7 +2229,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **widget** | [**Widget**](Widget.md)| | [optional] + **file** | **file**| file | ### Return type @@ -1942,7 +2241,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: multipart/form-data - **Accept**: application/json [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) @@ -2440,6 +2739,54 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) +# **override_playbook_yaml** +> Playbook override_playbook_yaml(file) + +Import and override playbook + +Import and override playbook in Cortex XSOAR + +### Example +```python +from __future__ import print_function +import time +import demisto_client +import demisto_client.demisto_api +from demisto_client.demisto_api.rest import ApiException +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 + +try: + # Import and override playbook + api_response = api_instance.import_playbook(file) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->override_playbook_yaml: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **file**| file | + +### Return type + +[**Playbook**](Playbook.md) + +### Authorization + +[api_key](README.md#api_key), [csrf_token](README.md#csrf_token) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + # **revoke_user_api_key** > revoke_user_api_key(username) diff --git a/docs/README.md b/docs/README.md index 49880b7..266d01a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -42,6 +42,12 @@ Method | HTTP request | Description [**get_stats_for_dashboard**](DefaultApi.md#get_stats_for_dashboard) | **POST** /statistics/dashboards/query | Get Dashboard Statistics [**get_stats_for_widget**](DefaultApi.md#get_stats_for_widget) | **POST** /statistics/widgets/query | Get Widget Statistics [**get_widget**](DefaultApi.md#get_widget) | **GET** /widgets/{id} | Get widget by ID +[**import_classifier**](DefaultApi.md#import_classifier) | **POST** /classifier/import | Import a classifier +[**import_dashboard**](DefaultApi.md#import_dashboard) | **POST** /dashboards/import | Import a dashboard +[**import_incident_fields**](DefaultApi.md#import_incident_fields) | **POST** /incidentfields/import | Import an incidents field +[**import_incident_types_handler**](DefaultApi.md#import_incident_types_handler) | **POST** /incidenttypes/import | Import an incident type +[**import_layout**](DefaultApi.md#import_layout) | **POST** /layouts/import | Import a layout +[**import_script**](DefaultApi.md#import_script) | **POST** /automation/import | Upload an automation [**import_widget**](DefaultApi.md#import_widget) | **POST** /widgets/import | Import a widget [**incident_file_upload**](DefaultApi.md#incident_file_upload) | **POST** /incident/upload/{id} | [**indicator_whitelist**](DefaultApi.md#indicator_whitelist) | **POST** /indicator/whitelist | Whitelists or deletes Indicator @@ -53,6 +59,7 @@ Method | HTTP request | Description [**investigation_add_entries_sync**](DefaultApi.md#investigation_add_entries_sync) | **POST** /entry/execute/sync | Create new entry in existing investigation [**investigation_add_entry_handler**](DefaultApi.md#investigation_add_entry_handler) | **POST** /entry | Create new entry in existing investigation [**investigation_add_formatted_entry_handler**](DefaultApi.md#investigation_add_formatted_entry_handler) | **POST** /entry/formatted | Create new formatted entry in existing investigation +[**override_playbook_yaml**](DefaultApi.md#override_playbook_yaml) | **POST** /playbook/save/yaml | Import and override playbook [**revoke_user_api_key**](DefaultApi.md#revoke_user_api_key) | **POST** /apikeys/revoke/user/{username} | [**save_evidence**](DefaultApi.md#save_evidence) | **POST** /evidence | Save evidence [**save_or_update_script**](DefaultApi.md#save_or_update_script) | **POST** /automation | Create or update automation diff --git a/server_api_swagger.json b/server_api_swagger.json index ac962a7..7bf1c0d 100644 --- a/server_api_swagger.json +++ b/server_api_swagger.json @@ -109,6 +109,36 @@ } } }, + "/automation/import": { + "post": { + "description": "Upload an automation to Cortex XSOAR", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "summary": "Upload an automation", + "operationId": "importScript", + "parameters": [ + { + "type": "file", + "description": "file", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "The saved automation", + "schema": { + "$ref": "#/definitions/AutomationScript" + } + } + } + } + }, "/automation/search": { "post": { "description": "Search Automation by filter", @@ -133,6 +163,73 @@ } } }, + "/classifier/import": { + "post": { + "description": "Import a classifier to Cortex XSOAR", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "summary": "Import a classifier", + "operationId": "importClassifier", + "parameters": [ + { + "type": "file", + "description": "file", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "associated typeID for the layout", + "name": "classifierId", + "in": "string", + "required": true + } + ], + "responses": { + "200": { + "description": "The saved classifier", + "schema": { + "$ref": "#/definitions/InstanceClassifier" + } + } + } + } + }, + "/dashboards/import": { + "post": { + "description": "Import a dashboard to Cortex XSOAR", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "summary": "Import a dashboard", + "operationId": "importDashboard", + "parameters": [ + { + "type": "file", + "description": "file", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "The saved dashboard", + "schema": { + "$ref": "#/definitions/Dashboard" + } + } + } + } + }, "/entry": { "post": { "description": "API to create an entry (markdown format) in existing investigation\nBody example: {\"investigationId\":\"1234\",\"data\":\"entry content…\"}", @@ -660,6 +757,36 @@ } } }, + "/incidentfields/import": { + "post": { + "description": "Import an incidents field to Cortex XSOAR", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "summary": "Import an incidents field", + "operationId": "importIncidentFields", + "parameters": [ + { + "type": "file", + "description": "file", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "The saved incident field", + "schema": { + "$ref": "#/definitions/IncidentField" + } + } + } + } + }, "/incidents/search": { "post": { "description": "This will search incidents across all indices\nYou can filter by multiple options", @@ -719,6 +846,36 @@ } } }, + "/incidenttypes/import": { + "post": { + "description": "Import an incident type to Cortex XSOAR", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "summary": "Import an incident type", + "operationId": "importIncidentTypesHandler", + "parameters": [ + { + "type": "file", + "description": "file", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "The saved incident type", + "schema": { + "$ref": "#/definitions/IncidentType" + } + } + } + } + }, "/indicator/create": { "post": { "description": "Create an indicator entity\nTo update indicator custom fields you should lowercase them and remove all spaces. For example: Scan IP -\u003e scanip", @@ -1280,6 +1437,80 @@ } } }, + "/layouts/import": { + "post": { + "description": "Import a layout to Cortex XSOAR", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "summary": "Import a layout", + "operationId": "importLayout", + "parameters": [ + { + "type": "file", + "description": "file", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "associated typeID for the layout", + "name": "type", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "layout kind details", + "name": "kind", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "The saved layout", + "schema": { + "$ref": "#/definitions/LayoutAPI" + } + } + } + } + }, + "/playbook/save/yaml": { + "post": { + "description": "Import and override playbook in Cortex XSOAR", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "summary": "Import and override playbook", + "operationId": "overridePlaybookYaml", + "parameters": [ + { + "type": "file", + "description": "file", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "The saved playbook", + "schema": { + "$ref": "#/definitions/Playbook" + } + } + } + } + }, "/report/{id}/{requestId}/execute": { "post": { "description": "Execute a new report", @@ -1685,20 +1916,26 @@ "/widgets/import": { "post": { "description": "Import a widget to the system, ignoring ID or version, used to import new widgets.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], "summary": "Import a widget", "operationId": "importWidget", "parameters": [ { - "name": "widget", - "in": "body", - "schema": { - "$ref": "#/definitions/Widget" - } + "type": "file", + "description": "file", + "name": "file", + "in": "formData", + "required": true } ], "responses": { "200": { - "description": "The imported saved widget.", + "description": "The saved widget", "schema": { "$ref": "#/definitions/Widget" } From e29c756cb7b39a672275ca110e1a47fe34794434 Mon Sep 17 00:00:00 2001 From: ShahafBenYakir Date: Mon, 20 Apr 2020 15:09:43 +0300 Subject: [PATCH 2/5] Added new api functions --- demisto_client/demisto_api/__init__.py | 20 + demisto_client/demisto_api/api/default_api.py | 229 +-- demisto_client/demisto_api/models/__init__.py | 20 + .../demisto_api/models/insight_cache.py | 28 +- .../models/investigation_playbook_task.py | 29 +- docs/DefaultApi.md | 110 +- docs/InsightCache.md | 1 + docs/InvestigationPlaybookTask.md | 1 + docs/README.md | 24 +- server_api_swagger.json | 1253 +++++++++++++++-- 10 files changed, 1458 insertions(+), 257 deletions(-) diff --git a/demisto_client/demisto_api/__init__.py b/demisto_client/demisto_api/__init__.py index a9198cc..9d09800 100644 --- a/demisto_client/demisto_api/__init__.py +++ b/demisto_client/demisto_api/__init__.py @@ -65,12 +65,18 @@ from demisto_client.demisto_api.models.evidences import Evidences from demisto_client.demisto_api.models.evidences_filter_wrapper import EvidencesFilterWrapper from demisto_client.demisto_api.models.evidences_search_response import EvidencesSearchResponse +from demisto_client.demisto_api.models.expiration_policy import ExpirationPolicy +from demisto_client.demisto_api.models.expiration_settings_source import ExpirationSettingsSource +from demisto_client.demisto_api.models.expiration_source import ExpirationSource +from demisto_client.demisto_api.models.feed_indicator import FeedIndicator +from demisto_client.demisto_api.models.feed_indicators import FeedIndicators from demisto_client.demisto_api.models.field_group import FieldGroup from demisto_client.demisto_api.models.field_mapping import FieldMapping from demisto_client.demisto_api.models.field_term_location_map import FieldTermLocationMap from demisto_client.demisto_api.models.file_metadata import FileMetadata from demisto_client.demisto_api.models.filter_cache import FilterCache from demisto_client.demisto_api.models.filter_operator_id import FilterOperatorID +from demisto_client.demisto_api.models.form_display import FormDisplay from demisto_client.demisto_api.models.generic_indicator_update_batch import GenericIndicatorUpdateBatch from demisto_client.demisto_api.models.generic_string_date_filter import GenericStringDateFilter from demisto_client.demisto_api.models.generic_string_filter import GenericStringFilter @@ -86,11 +92,14 @@ from demisto_client.demisto_api.models.incident_status import IncidentStatus from demisto_client.demisto_api.models.incident_type import IncidentType from demisto_client.demisto_api.models.incident_wrapper import IncidentWrapper +from demisto_client.demisto_api.models.incidents import Incidents from demisto_client.demisto_api.models.indicator_context import IndicatorContext +from demisto_client.demisto_api.models.indicator_edit_bulk_response import IndicatorEditBulkResponse from demisto_client.demisto_api.models.indicator_filter import IndicatorFilter from demisto_client.demisto_api.models.indicator_result import IndicatorResult from demisto_client.demisto_api.models.inline_response200 import InlineResponse200 from demisto_client.demisto_api.models.insight_cache import InsightCache +from demisto_client.demisto_api.models.instance_classifier import InstanceClassifier from demisto_client.demisto_api.models.integration_script import IntegrationScript from demisto_client.demisto_api.models.inv_playbook_assignee import InvPlaybookAssignee from demisto_client.demisto_api.models.inv_playbook_due import InvPlaybookDue @@ -111,8 +120,13 @@ from demisto_client.demisto_api.models.ioc_object import IocObject from demisto_client.demisto_api.models.ioc_objects import IocObjects from demisto_client.demisto_api.models.label import Label +from demisto_client.demisto_api.models.layout import Layout +from demisto_client.demisto_api.models.layout_api import LayoutAPI +from demisto_client.demisto_api.models.layout_field import LayoutField +from demisto_client.demisto_api.models.layout_section import LayoutSection from demisto_client.demisto_api.models.location import Location from demisto_client.demisto_api.models.locations import Locations +from demisto_client.demisto_api.models.mapper import Mapper from demisto_client.demisto_api.models.module_args import ModuleArgs from demisto_client.demisto_api.models.module_configuration import ModuleConfiguration from demisto_client.demisto_api.models.new_docker_image import NewDockerImage @@ -124,13 +138,17 @@ from demisto_client.demisto_api.models.output import Output from demisto_client.demisto_api.models.output_type import OutputType from demisto_client.demisto_api.models.period import Period +from demisto_client.demisto_api.models.playbook import Playbook from demisto_client.demisto_api.models.playbook_input import PlaybookInput from demisto_client.demisto_api.models.playbook_inputs import PlaybookInputs from demisto_client.demisto_api.models.playbook_output import PlaybookOutput from demisto_client.demisto_api.models.playbook_outputs import PlaybookOutputs +from demisto_client.demisto_api.models.playbook_task import PlaybookTask from demisto_client.demisto_api.models.playbook_view import PlaybookView from demisto_client.demisto_api.models.question import Question +from demisto_client.demisto_api.models.quiet_mode import QuietMode from demisto_client.demisto_api.models.raw_message import RawMessage +from demisto_client.demisto_api.models.reliability import Reliability from demisto_client.demisto_api.models.remote_repos import RemoteRepos from demisto_client.demisto_api.models.report import Report from demisto_client.demisto_api.models.report_automation import ReportAutomation @@ -141,6 +159,7 @@ 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 +from demisto_client.demisto_api.models.script_api import ScriptAPI from demisto_client.demisto_api.models.script_sub_type import ScriptSubType from demisto_client.demisto_api.models.script_target import ScriptTarget from demisto_client.demisto_api.models.script_type import ScriptType @@ -170,6 +189,7 @@ from demisto_client.demisto_api.models.update_indicator_reputation_data import UpdateIndicatorReputationData from demisto_client.demisto_api.models.update_response import UpdateResponse from demisto_client.demisto_api.models.uploaded_entry import UploadedEntry +from demisto_client.demisto_api.models.version import Version from demisto_client.demisto_api.models.widget import Widget from demisto_client.demisto_api.models.widget_cell import WidgetCell from demisto_client.demisto_api.models.widget_cells import WidgetCells diff --git a/demisto_client/demisto_api/api/default_api.py b/demisto_client/demisto_api/api/default_api.py index d0790be..80e35a0 100644 --- a/demisto_client/demisto_api/api/default_api.py +++ b/demisto_client/demisto_api/api/default_api.py @@ -13,6 +13,7 @@ from __future__ import absolute_import +import json import re # noqa: F401 # python 2 and python 3 compatibility library @@ -3811,30 +3812,36 @@ def import_classifier(self, file, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ + 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 if kwargs.get('async_req'): - return self.import_classifier_with_http_info(file, **kwargs) # noqa: E501 + return self.import_classifier_with_http_info(file, classifier_id, **kwargs) # noqa: E501 else: - (data) = self.import_classifier_with_http_info(file, **kwargs) # noqa: E501 + (data) = self.import_classifier_with_http_info(file, classifier_id, **kwargs) # noqa: E501 return data - def import_classifier_with_http_info(self, file, **kwargs): # noqa: E501 + def import_classifier_with_http_info(self, file, classifier_id, **kwargs): # noqa: E501 """Import a classifier # noqa: E501 Import a classifier to Cortex 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_classifier_with_http_info(file, async_req=True) + >>> thread = api.import_classifier_with_http_info(file, classifier_id, async_req=True) >>> result = thread.get() :param async_req bool :param file file: file (required) + :param str classifier_id: associated typeID for the layout (required) :return: InstanceClassifier If the method is called asynchronously, returns the request thread. """ - all_params = ['file'] # noqa: E501 + all_params = ['file', 'classifier_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3853,6 +3860,10 @@ def import_classifier_with_http_info(self, file, **kwargs): # noqa: E501 if ('file' not in params or params['file'] is None): raise ValueError("Missing the required parameter `file` when calling `import_classifier`") # noqa: E501 + # verify the required parameter 'classifier_id' is set + if ('classifier_id' not in params or + params['classifier_id'] is None): + raise ValueError("Missing the required parameter `classifier_id` when calling `import_classifier`") # noqa: E501 collection_formats = {} @@ -3866,6 +3877,8 @@ def import_classifier_with_http_info(self, file, **kwargs): # noqa: E501 local_var_files = {} if 'file' in params: local_var_files['file'] = params['file'] # noqa: E501 + if 'classifier_id' in params: + form_params.append(('classifierId', params['classifier_id'])) # noqa: E501 body_params = None # HTTP header `Accept` @@ -4209,6 +4222,12 @@ def import_layout(self, file, type, kind, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ + with open(file, 'r') as layout_json_file: + data = layout_json_file.read() + + layout_data_json = json.loads(data) + type = layout_data_json.get('typeId') + kind = layout_data_json.get('kind') kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.import_layout_with_http_info(file, type, kind, **kwargs) # noqa: E501 @@ -4292,7 +4311,7 @@ def import_layout_with_http_info(self, file, type, kind, **kwargs): # noqa: E50 auth_settings = ['api_key', 'csrf_token'] # noqa: E501 return self.api_client.call_api( - '/layouts/import', 'POST', + '/v2/layouts/import', 'POST', path_params, query_params, header_params, @@ -4307,6 +4326,105 @@ def import_layout_with_http_info(self, file, type, kind, **kwargs): # noqa: E50 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def import_playbook(self, file, **kwargs): # noqa: E501 + """Import and override playbook # noqa: E501 + + Import and override playbook in Cortex 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_playbook(file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :return: Playbook + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.import_playbook_with_http_info(file, **kwargs) # noqa: E501 + else: + (data) = self.import_playbook_with_http_info(file, **kwargs) # noqa: E501 + return data + + def import_playbook_with_http_info(self, file, **kwargs): # noqa: E501 + """Import and override playbook # noqa: E501 + + Import and override playbook in Cortex 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_playbook_with_http_info(file, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param file file: file (required) + :return: Playbook + 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_playbook" % 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_playbook`") # 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'] # noqa: E501 + + return self.api_client.call_api( + '/playbook/save/yaml', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Playbook', # 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 @@ -5499,105 +5617,6 @@ def investigation_add_formatted_entry_handler_with_http_info(self, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def import_playbook(self, file, **kwargs): # noqa: E501 - """Import and override playbook # noqa: E501 - - Import and override playbook in Cortex 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_playbook(file, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param file file: file (required) - :return: Playbook - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.override_playbook_yaml_with_http_info(file, **kwargs) # noqa: E501 - else: - (data) = self.override_playbook_yaml_with_http_info(file, **kwargs) # noqa: E501 - return data - - def override_playbook_yaml_with_http_info(self, file, **kwargs): # noqa: E501 - """Import and override playbook # noqa: E501 - - Import and override playbook in Cortex 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.override_playbook_yaml_with_http_info(file, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param file file: file (required) - :return: Playbook - 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 override_playbook_yaml" % 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 `override_playbook_yaml`") # 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'] # noqa: E501 - - return self.api_client.call_api( - '/playbook/save/yaml', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Playbook', # 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 revoke_user_api_key(self, username, **kwargs): # noqa: E501 """revoke_user_api_key # noqa: E501 diff --git a/demisto_client/demisto_api/models/__init__.py b/demisto_client/demisto_api/models/__init__.py index a7a6a4f..06387a4 100644 --- a/demisto_client/demisto_api/models/__init__.py +++ b/demisto_client/demisto_api/models/__init__.py @@ -58,12 +58,18 @@ from demisto_client.demisto_api.models.evidences import Evidences from demisto_client.demisto_api.models.evidences_filter_wrapper import EvidencesFilterWrapper from demisto_client.demisto_api.models.evidences_search_response import EvidencesSearchResponse +from demisto_client.demisto_api.models.expiration_policy import ExpirationPolicy +from demisto_client.demisto_api.models.expiration_settings_source import ExpirationSettingsSource +from demisto_client.demisto_api.models.expiration_source import ExpirationSource +from demisto_client.demisto_api.models.feed_indicator import FeedIndicator +from demisto_client.demisto_api.models.feed_indicators import FeedIndicators from demisto_client.demisto_api.models.field_group import FieldGroup from demisto_client.demisto_api.models.field_mapping import FieldMapping from demisto_client.demisto_api.models.field_term_location_map import FieldTermLocationMap from demisto_client.demisto_api.models.file_metadata import FileMetadata from demisto_client.demisto_api.models.filter_cache import FilterCache from demisto_client.demisto_api.models.filter_operator_id import FilterOperatorID +from demisto_client.demisto_api.models.form_display import FormDisplay from demisto_client.demisto_api.models.generic_indicator_update_batch import GenericIndicatorUpdateBatch from demisto_client.demisto_api.models.generic_string_date_filter import GenericStringDateFilter from demisto_client.demisto_api.models.generic_string_filter import GenericStringFilter @@ -79,11 +85,14 @@ from demisto_client.demisto_api.models.incident_status import IncidentStatus from demisto_client.demisto_api.models.incident_type import IncidentType from demisto_client.demisto_api.models.incident_wrapper import IncidentWrapper +from demisto_client.demisto_api.models.incidents import Incidents from demisto_client.demisto_api.models.indicator_context import IndicatorContext +from demisto_client.demisto_api.models.indicator_edit_bulk_response import IndicatorEditBulkResponse from demisto_client.demisto_api.models.indicator_filter import IndicatorFilter from demisto_client.demisto_api.models.indicator_result import IndicatorResult from demisto_client.demisto_api.models.inline_response200 import InlineResponse200 from demisto_client.demisto_api.models.insight_cache import InsightCache +from demisto_client.demisto_api.models.instance_classifier import InstanceClassifier from demisto_client.demisto_api.models.integration_script import IntegrationScript from demisto_client.demisto_api.models.inv_playbook_assignee import InvPlaybookAssignee from demisto_client.demisto_api.models.inv_playbook_due import InvPlaybookDue @@ -104,8 +113,13 @@ from demisto_client.demisto_api.models.ioc_object import IocObject from demisto_client.demisto_api.models.ioc_objects import IocObjects from demisto_client.demisto_api.models.label import Label +from demisto_client.demisto_api.models.layout import Layout +from demisto_client.demisto_api.models.layout_api import LayoutAPI +from demisto_client.demisto_api.models.layout_field import LayoutField +from demisto_client.demisto_api.models.layout_section import LayoutSection from demisto_client.demisto_api.models.location import Location from demisto_client.demisto_api.models.locations import Locations +from demisto_client.demisto_api.models.mapper import Mapper from demisto_client.demisto_api.models.module_args import ModuleArgs from demisto_client.demisto_api.models.module_configuration import ModuleConfiguration from demisto_client.demisto_api.models.new_docker_image import NewDockerImage @@ -117,13 +131,17 @@ from demisto_client.demisto_api.models.output import Output from demisto_client.demisto_api.models.output_type import OutputType from demisto_client.demisto_api.models.period import Period +from demisto_client.demisto_api.models.playbook import Playbook from demisto_client.demisto_api.models.playbook_input import PlaybookInput from demisto_client.demisto_api.models.playbook_inputs import PlaybookInputs from demisto_client.demisto_api.models.playbook_output import PlaybookOutput from demisto_client.demisto_api.models.playbook_outputs import PlaybookOutputs +from demisto_client.demisto_api.models.playbook_task import PlaybookTask from demisto_client.demisto_api.models.playbook_view import PlaybookView from demisto_client.demisto_api.models.question import Question +from demisto_client.demisto_api.models.quiet_mode import QuietMode from demisto_client.demisto_api.models.raw_message import RawMessage +from demisto_client.demisto_api.models.reliability import Reliability from demisto_client.demisto_api.models.remote_repos import RemoteRepos from demisto_client.demisto_api.models.report import Report from demisto_client.demisto_api.models.report_automation import ReportAutomation @@ -134,6 +152,7 @@ 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 +from demisto_client.demisto_api.models.script_api import ScriptAPI from demisto_client.demisto_api.models.script_sub_type import ScriptSubType from demisto_client.demisto_api.models.script_target import ScriptTarget from demisto_client.demisto_api.models.script_type import ScriptType @@ -163,6 +182,7 @@ from demisto_client.demisto_api.models.update_indicator_reputation_data import UpdateIndicatorReputationData from demisto_client.demisto_api.models.update_response import UpdateResponse from demisto_client.demisto_api.models.uploaded_entry import UploadedEntry +from demisto_client.demisto_api.models.version import Version from demisto_client.demisto_api.models.widget import Widget from demisto_client.demisto_api.models.widget_cell import WidgetCell from demisto_client.demisto_api.models.widget_cells import WidgetCells diff --git a/demisto_client/demisto_api/models/insight_cache.py b/demisto_client/demisto_api/models/insight_cache.py index 541e2a9..1814ab1 100644 --- a/demisto_client/demisto_api/models/insight_cache.py +++ b/demisto_client/demisto_api/models/insight_cache.py @@ -36,6 +36,7 @@ class InsightCache(object): 'id': 'str', 'modified': 'datetime', 'scores': 'dict(str, DBotScore)', + 'sequence_number': 'int', 'sort_values': 'list[str]', 'version': 'int' } @@ -44,16 +45,18 @@ class InsightCache(object): 'id': 'id', 'modified': 'modified', 'scores': 'scores', + 'sequence_number': 'sequenceNumber', 'sort_values': 'sortValues', 'version': 'version' } - def __init__(self, id=None, modified=None, scores=None, sort_values=None, version=None): # noqa: E501 + def __init__(self, id=None, modified=None, scores=None, sequence_number=None, sort_values=None, version=None): # noqa: E501 """InsightCache - a model defined in Swagger""" # noqa: E501 self._id = None self._modified = None self._scores = None + self._sequence_number = None self._sort_values = None self._version = None self.discriminator = None @@ -64,6 +67,8 @@ def __init__(self, id=None, modified=None, scores=None, sort_values=None, versio self.modified = modified if scores is not None: self.scores = scores + if sequence_number is not None: + self.sequence_number = sequence_number if sort_values is not None: self.sort_values = sort_values if version is not None: @@ -132,6 +137,27 @@ def scores(self, scores): self._scores = scores + @property + def sequence_number(self): + """Gets the sequence_number of this InsightCache. # noqa: E501 + + + :return: The sequence_number of this InsightCache. # noqa: E501 + :rtype: int + """ + return self._sequence_number + + @sequence_number.setter + def sequence_number(self, sequence_number): + """Sets the sequence_number of this InsightCache. + + + :param sequence_number: The sequence_number of this InsightCache. # noqa: E501 + :type: int + """ + + self._sequence_number = sequence_number + @property def sort_values(self): """Gets the sort_values of this InsightCache. # noqa: E501 diff --git a/demisto_client/demisto_api/models/investigation_playbook_task.py b/demisto_client/demisto_api/models/investigation_playbook_task.py index bee082f..7781e5d 100644 --- a/demisto_client/demisto_api/models/investigation_playbook_task.py +++ b/demisto_client/demisto_api/models/investigation_playbook_task.py @@ -23,6 +23,7 @@ from demisto_client.demisto_api.models.inv_playbook_task_complete_data import InvPlaybookTaskCompleteData # noqa: F401,E501 # from demisto_client.demisto_api.models.investigation_playbook import InvestigationPlaybook # noqa: F401,E501 from demisto_client.demisto_api.models.notifiable_item import NotifiableItem # noqa: F401,E501 +from demisto_client.demisto_api.models.quiet_mode import QuietMode # noqa: F401,E501 from demisto_client.demisto_api.models.reputation_calc_alg import ReputationCalcAlg # noqa: F401,E501 from demisto_client.demisto_api.models.sla import SLA # noqa: F401,E501 from demisto_client.demisto_api.models.task import Task # noqa: F401,E501 @@ -84,6 +85,7 @@ class InvestigationPlaybookTask(object): 'patched': 'bool', 'playbook_inputs': 'dict(str, object)', 'previous_tasks': 'dict(str, list[str])', + 'quiet_mode': 'QuietMode', 'reminder': 'int', 'reputation_calc': 'ReputationCalcAlg', 'restricted_completion': 'bool', @@ -140,6 +142,7 @@ class InvestigationPlaybookTask(object): 'patched': 'patched', 'playbook_inputs': 'playbookInputs', 'previous_tasks': 'previousTasks', + 'quiet_mode': 'quietMode', 'reminder': 'reminder', 'reputation_calc': 'reputationCalc', 'restricted_completion': 'restrictedCompletion', @@ -159,7 +162,7 @@ class InvestigationPlaybookTask(object): 'will_not_execute_count': 'willNotExecuteCount' } - def __init__(self, arguments=None, assignee=None, assignee_set=None, blocking_tasks=None, comments=None, completed_by=None, completed_count=None, completed_date=None, conditions=None, continue_on_error=None, default_assignee=None, default_assignee_complex=None, default_reminder=None, due_date=None, due_date_set=None, entries=None, evidence_data=None, execution_count=None, field_mapping=None, for_each_index=None, for_each_inputs=None, form=None, id=None, ignore_worker=None, indent=None, input=None, loop=None, message=None, next_tasks=None, note=None, outputs=None, parent_block_count=None, parent_playbook_id=None, patched=None, playbook_inputs=None, previous_tasks=None, reminder=None, reputation_calc=None, restricted_completion=None, script_arguments=None, separate_context=None, sla=None, sla_reminder=None, start_date=None, state=None, sub_playbook=None, task=None, task_complete_data=None, task_id=None, timer_triggers=None, type=None, view=None, will_not_execute_count=None): # noqa: E501 + def __init__(self, arguments=None, assignee=None, assignee_set=None, blocking_tasks=None, comments=None, completed_by=None, completed_count=None, completed_date=None, conditions=None, continue_on_error=None, default_assignee=None, default_assignee_complex=None, default_reminder=None, due_date=None, due_date_set=None, entries=None, evidence_data=None, execution_count=None, field_mapping=None, for_each_index=None, for_each_inputs=None, form=None, id=None, ignore_worker=None, indent=None, input=None, loop=None, message=None, next_tasks=None, note=None, outputs=None, parent_block_count=None, parent_playbook_id=None, patched=None, playbook_inputs=None, previous_tasks=None, quiet_mode=None, reminder=None, reputation_calc=None, restricted_completion=None, script_arguments=None, separate_context=None, sla=None, sla_reminder=None, start_date=None, state=None, sub_playbook=None, task=None, task_complete_data=None, task_id=None, timer_triggers=None, type=None, view=None, will_not_execute_count=None): # noqa: E501 """InvestigationPlaybookTask - a model defined in Swagger""" # noqa: E501 self._arguments = None @@ -198,6 +201,7 @@ def __init__(self, arguments=None, assignee=None, assignee_set=None, blocking_ta self._patched = None self._playbook_inputs = None self._previous_tasks = None + self._quiet_mode = None self._reminder = None self._reputation_calc = None self._restricted_completion = None @@ -289,6 +293,8 @@ def __init__(self, arguments=None, assignee=None, assignee_set=None, blocking_ta self.playbook_inputs = playbook_inputs if previous_tasks is not None: self.previous_tasks = previous_tasks + if quiet_mode is not None: + self.quiet_mode = quiet_mode if reminder is not None: self.reminder = reminder if reputation_calc is not None: @@ -1092,6 +1098,27 @@ def previous_tasks(self, previous_tasks): self._previous_tasks = previous_tasks + @property + def quiet_mode(self): + """Gets the quiet_mode of this InvestigationPlaybookTask. # noqa: E501 + + + :return: The quiet_mode of this InvestigationPlaybookTask. # noqa: E501 + :rtype: QuietMode + """ + return self._quiet_mode + + @quiet_mode.setter + def quiet_mode(self, quiet_mode): + """Sets the quiet_mode of this InvestigationPlaybookTask. + + + :param quiet_mode: The quiet_mode of this InvestigationPlaybookTask. # noqa: E501 + :type: QuietMode + """ + + self._quiet_mode = quiet_mode + @property def reminder(self): """Gets the reminder of this InvestigationPlaybookTask. # noqa: E501 diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index a1dea6e..94ff0ac 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -46,7 +46,8 @@ Method | HTTP request | Description [**import_dashboard**](DefaultApi.md#import_dashboard) | **POST** /dashboards/import | Import a dashboard [**import_incident_fields**](DefaultApi.md#import_incident_fields) | **POST** /incidentfields/import | Import an incidents field [**import_incident_types_handler**](DefaultApi.md#import_incident_types_handler) | **POST** /incidenttypes/import | Import an incident type -[**import_layout**](DefaultApi.md#import_layout) | **POST** /layouts/import | Import a layout +[**import_layout**](DefaultApi.md#import_layout) | **POST** /v2/layouts/import | Import a layout +[**import_playbook**](DefaultApi.md#import_playbook) | **POST** /playbook/save/yaml | Import and override playbook [**import_script**](DefaultApi.md#import_script) | **POST** /automation/import | Upload an automation [**import_widget**](DefaultApi.md#import_widget) | **POST** /widgets/import | Import a widget [**incident_file_upload**](DefaultApi.md#incident_file_upload) | **POST** /incident/upload/{id} | @@ -59,7 +60,6 @@ Method | HTTP request | Description [**investigation_add_entries_sync**](DefaultApi.md#investigation_add_entries_sync) | **POST** /entry/execute/sync | Create new entry in existing investigation [**investigation_add_entry_handler**](DefaultApi.md#investigation_add_entry_handler) | **POST** /entry | Create new entry in existing investigation [**investigation_add_formatted_entry_handler**](DefaultApi.md#investigation_add_formatted_entry_handler) | **POST** /entry/formatted | Create new formatted entry in existing investigation -[**override_playbook_yaml**](DefaultApi.md#override_playbook_yaml) | **POST** /playbook/save/yaml | Import and override playbook [**revoke_user_api_key**](DefaultApi.md#revoke_user_api_key) | **POST** /apikeys/revoke/user/{username} | [**save_evidence**](DefaultApi.md#save_evidence) | **POST** /evidence | Save evidence [**save_or_update_script**](DefaultApi.md#save_or_update_script) | **POST** /automation | Create or update automation @@ -2099,7 +2099,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) # **import_layout** -> LayoutAPI import_layout(file, type, kind) +> LayoutAPI import_layout(file) Import a layout @@ -2116,12 +2116,10 @@ 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 - api_response = api_instance.import_layout(file, type, kind) + api_response = api_instance.import_layout(file) pprint(api_response) except ApiException as e: print("Exception when calling DefaultApi->import_layout: %s\n" % e) @@ -2131,9 +2129,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **file** | **file**| file | - **type** | **str**| associated typeID for the layout | - **kind** | **str**| layout kind details | + **file** | **file**| file | ### Return type @@ -2150,6 +2146,54 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) +# **import_playbook** +> Playbook import_playbook(file) + +Import and override playbook + +Import and override playbook in Cortex XSOAR + +### Example +```python +from __future__ import print_function +import time +import demisto_client +import demisto_client.demisto_api +from demisto_client.demisto_api.rest import ApiException +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 + +try: + # Import and override playbook + api_response = api_instance.import_playbook(file) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->import_playbook: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **file**| file | + +### Return type + +[**Playbook**](Playbook.md) + +### Authorization + +[api_key](README.md#api_key), [csrf_token](README.md#csrf_token) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + # **import_script** > AutomationScript import_script(file) @@ -2739,54 +2783,6 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) -# **override_playbook_yaml** -> Playbook override_playbook_yaml(file) - -Import and override playbook - -Import and override playbook in Cortex XSOAR - -### Example -```python -from __future__ import print_function -import time -import demisto_client -import demisto_client.demisto_api -from demisto_client.demisto_api.rest import ApiException -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 - -try: - # Import and override playbook - api_response = api_instance.import_playbook(file) - pprint(api_response) -except ApiException as e: - print("Exception when calling DefaultApi->override_playbook_yaml: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file** | **file**| file | - -### Return type - -[**Playbook**](Playbook.md) - -### Authorization - -[api_key](README.md#api_key), [csrf_token](README.md#csrf_token) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) - # **revoke_user_api_key** > revoke_user_api_key(username) diff --git a/docs/InsightCache.md b/docs/InsightCache.md index be20eb6..b3d40f2 100644 --- a/docs/InsightCache.md +++ b/docs/InsightCache.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes **id** | **str** | | [optional] **modified** | **datetime** | | [optional] **scores** | [**dict(str, DBotScore)**](DBotScore.md) | | [optional] +**sequence_number** | **int** | | [optional] **sort_values** | **list[str]** | | [optional] **version** | **int** | | [optional] diff --git a/docs/InvestigationPlaybookTask.md b/docs/InvestigationPlaybookTask.md index 3d822c5..2c83bd5 100644 --- a/docs/InvestigationPlaybookTask.md +++ b/docs/InvestigationPlaybookTask.md @@ -39,6 +39,7 @@ Name | Type | Description | Notes **patched** | **bool** | Indicates whether this task was patched to InvPB and did not originally belong to the playbook | [optional] **playbook_inputs** | **dict(str, object)** | | [optional] **previous_tasks** | **dict(str, list[str])** | | [optional] +**quiet_mode** | [**QuietMode**](QuietMode.md) | | [optional] **reminder** | **int** | Duration in minutes, this field is not persisted here | [optional] **reputation_calc** | [**ReputationCalcAlg**](ReputationCalcAlg.md) | | [optional] **restricted_completion** | **bool** | | [optional] diff --git a/docs/README.md b/docs/README.md index 266d01a..946def8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -46,7 +46,8 @@ Method | HTTP request | Description [**import_dashboard**](DefaultApi.md#import_dashboard) | **POST** /dashboards/import | Import a dashboard [**import_incident_fields**](DefaultApi.md#import_incident_fields) | **POST** /incidentfields/import | Import an incidents field [**import_incident_types_handler**](DefaultApi.md#import_incident_types_handler) | **POST** /incidenttypes/import | Import an incident type -[**import_layout**](DefaultApi.md#import_layout) | **POST** /layouts/import | Import a layout +[**import_layout**](DefaultApi.md#import_layout) | **POST** /v2/layouts/import | Import a layout +[**import_playbook**](DefaultApi.md#import_playbook) | **POST** /playbook/save/yaml | Import and override playbook [**import_script**](DefaultApi.md#import_script) | **POST** /automation/import | Upload an automation [**import_widget**](DefaultApi.md#import_widget) | **POST** /widgets/import | Import a widget [**incident_file_upload**](DefaultApi.md#incident_file_upload) | **POST** /incident/upload/{id} | @@ -59,7 +60,6 @@ Method | HTTP request | Description [**investigation_add_entries_sync**](DefaultApi.md#investigation_add_entries_sync) | **POST** /entry/execute/sync | Create new entry in existing investigation [**investigation_add_entry_handler**](DefaultApi.md#investigation_add_entry_handler) | **POST** /entry | Create new entry in existing investigation [**investigation_add_formatted_entry_handler**](DefaultApi.md#investigation_add_formatted_entry_handler) | **POST** /entry/formatted | Create new formatted entry in existing investigation -[**override_playbook_yaml**](DefaultApi.md#override_playbook_yaml) | **POST** /playbook/save/yaml | Import and override playbook [**revoke_user_api_key**](DefaultApi.md#revoke_user_api_key) | **POST** /apikeys/revoke/user/{username} | [**save_evidence**](DefaultApi.md#save_evidence) | **POST** /evidence | Save evidence [**save_or_update_script**](DefaultApi.md#save_or_update_script) | **POST** /automation | Create or update automation @@ -122,12 +122,18 @@ Method | HTTP request | Description - [Evidences](Evidences.md) - [EvidencesFilterWrapper](EvidencesFilterWrapper.md) - [EvidencesSearchResponse](EvidencesSearchResponse.md) + - [ExpirationPolicy](ExpirationPolicy.md) + - [ExpirationSettingsSource](ExpirationSettingsSource.md) + - [ExpirationSource](ExpirationSource.md) + - [FeedIndicator](FeedIndicator.md) + - [FeedIndicators](FeedIndicators.md) - [FieldGroup](FieldGroup.md) - [FieldMapping](FieldMapping.md) - [FieldTermLocationMap](FieldTermLocationMap.md) - [FileMetadata](FileMetadata.md) - [FilterCache](FilterCache.md) - [FilterOperatorID](FilterOperatorID.md) + - [FormDisplay](FormDisplay.md) - [GenericIndicatorUpdateBatch](GenericIndicatorUpdateBatch.md) - [GenericStringDateFilter](GenericStringDateFilter.md) - [GenericStringFilter](GenericStringFilter.md) @@ -143,11 +149,14 @@ Method | HTTP request | Description - [IncidentStatus](IncidentStatus.md) - [IncidentType](IncidentType.md) - [IncidentWrapper](IncidentWrapper.md) + - [Incidents](Incidents.md) - [IndicatorContext](IndicatorContext.md) + - [IndicatorEditBulkResponse](IndicatorEditBulkResponse.md) - [IndicatorFilter](IndicatorFilter.md) - [IndicatorResult](IndicatorResult.md) - [InlineResponse200](InlineResponse200.md) - [InsightCache](InsightCache.md) + - [InstanceClassifier](InstanceClassifier.md) - [IntegrationScript](IntegrationScript.md) - [InvPlaybookAssignee](InvPlaybookAssignee.md) - [InvPlaybookDue](InvPlaybookDue.md) @@ -168,8 +177,13 @@ Method | HTTP request | Description - [IocObject](IocObject.md) - [IocObjects](IocObjects.md) - [Label](Label.md) + - [Layout](Layout.md) + - [LayoutAPI](LayoutAPI.md) + - [LayoutField](LayoutField.md) + - [LayoutSection](LayoutSection.md) - [Location](Location.md) - [Locations](Locations.md) + - [Mapper](Mapper.md) - [ModuleArgs](ModuleArgs.md) - [ModuleConfiguration](ModuleConfiguration.md) - [NewDockerImage](NewDockerImage.md) @@ -181,13 +195,17 @@ Method | HTTP request | Description - [Output](Output.md) - [OutputType](OutputType.md) - [Period](Period.md) + - [Playbook](Playbook.md) - [PlaybookInput](PlaybookInput.md) - [PlaybookInputs](PlaybookInputs.md) - [PlaybookOutput](PlaybookOutput.md) - [PlaybookOutputs](PlaybookOutputs.md) + - [PlaybookTask](PlaybookTask.md) - [PlaybookView](PlaybookView.md) - [Question](Question.md) + - [QuietMode](QuietMode.md) - [RawMessage](RawMessage.md) + - [Reliability](Reliability.md) - [RemoteRepos](RemoteRepos.md) - [Report](Report.md) - [ReportAutomation](ReportAutomation.md) @@ -198,6 +216,7 @@ Method | HTTP request | Description - [RunStatus](RunStatus.md) - [SLA](SLA.md) - [SLAState](SLAState.md) + - [ScriptAPI](ScriptAPI.md) - [ScriptSubType](ScriptSubType.md) - [ScriptTarget](ScriptTarget.md) - [ScriptType](ScriptType.md) @@ -227,6 +246,7 @@ Method | HTTP request | Description - [UpdateIndicatorReputationData](UpdateIndicatorReputationData.md) - [UpdateResponse](UpdateResponse.md) - [UploadedEntry](UploadedEntry.md) + - [Version](Version.md) - [Widget](Widget.md) - [WidgetCell](WidgetCell.md) - [WidgetCells](WidgetCells.md) diff --git a/server_api_swagger.json b/server_api_swagger.json index 7bf1c0d..8673eca 100644 --- a/server_api_swagger.json +++ b/server_api_swagger.json @@ -186,7 +186,7 @@ "type": "string", "description": "associated typeID for the layout", "name": "classifierId", - "in": "string", + "in": "formData", "required": true } ], @@ -1437,7 +1437,7 @@ } } }, - "/layouts/import": { + "/v2/layouts/import": { "post": { "description": "Import a layout to Cortex XSOAR", "consumes": [ @@ -1491,7 +1491,7 @@ "application/json" ], "summary": "Import and override playbook", - "operationId": "overridePlaybookYaml", + "operationId": "importPlaybook", "parameters": [ { "type": "file", @@ -3695,6 +3695,155 @@ }, "x-go-package": "github.com/demisto/server/repo/entities" }, + "ExpirationPolicy": { + "type": "string", + "title": "ExpirationPolicy ...", + "x-go-package": "github.com/demisto/server/domain" + }, + "ExpirationSettingsSource": { + "type": "string", + "title": "ExpirationSettingsSource ...", + "x-go-package": "github.com/demisto/server/domain" + }, + "ExpirationSource": { + "type": "object", + "title": "ExpirationSource ..\t.", + "properties": { + "brand": { + "type": "string", + "x-go-name": "Brand" + }, + "expirationInterval": { + "type": "integer", + "format": "int64", + "x-go-name": "ExpirationInterval" + }, + "expirationPolicy": { + "$ref": "#/definitions/ExpirationPolicy" + }, + "instance": { + "type": "string", + "x-go-name": "Instance" + }, + "moduleId": { + "type": "string", + "x-go-name": "ModuleID" + }, + "setTime": { + "type": "string", + "format": "date-time", + "x-go-name": "SetTime" + }, + "source": { + "$ref": "#/definitions/ExpirationSettingsSource" + }, + "user": { + "type": "string", + "x-go-name": "User" + } + }, + "x-go-package": "github.com/demisto/server/domain" + }, + "FeedIndicator": { + "type": "object", + "title": "FeedIndicator ...", + "properties": { + "ExpirationSource": { + "$ref": "#/definitions/ExpirationSource" + }, + "bypassExclusionList": { + "type": "boolean", + "x-go-name": "ShouldBypassExclusionList" + }, + "classifierVersion": { + "type": "integer", + "format": "int64", + "x-go-name": "ClassifierVersion" + }, + "expirationInterval": { + "type": "integer", + "format": "int64", + "x-go-name": "ExpirationInterval" + }, + "expirationPolicy": { + "$ref": "#/definitions/ExpirationPolicy" + }, + "feedConfig": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "x-go-name": "FeedConfig" + }, + "fetchTime": { + "type": "string", + "format": "date-time", + "x-go-name": "FetchTime" + }, + "fields": { + "$ref": "#/definitions/CustomFields" + }, + "isEnrichment": { + "type": "boolean", + "x-go-name": "IsEnrichment" + }, + "modifiedTime": { + "type": "string", + "format": "date-time", + "x-go-name": "ModifiedTime" + }, + "moduleId": { + "type": "string", + "x-go-name": "ModuleID" + }, + "rawJSON": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "x-go-name": "RawJSON" + }, + "reliability": { + "$ref": "#/definitions/Reliability" + }, + "score": { + "type": "integer", + "format": "int64", + "x-go-name": "Score" + }, + "sourceBrand": { + "type": "string", + "x-go-name": "Brand" + }, + "sourceInstance": { + "type": "string", + "x-go-name": "Instance" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "x-go-name": "TimeStamp" + }, + "type": { + "description": "indicator fields", + "type": "string", + "x-go-name": "Type" + }, + "value": { + "type": "string", + "x-go-name": "Value" + } + }, + "x-go-package": "github.com/demisto/server/domain" + }, + "FeedIndicators": { + "type": "array", + "title": "FeedIndicators ...", + "items": { + "$ref": "#/definitions/FeedIndicator" + }, + "x-go-package": "github.com/demisto/server/domain" + }, "FieldGroup": { "description": "FieldGroup is the field group", "type": "number", @@ -3776,6 +3925,45 @@ "title": "FilterOperatorID ...", "x-go-package": "github.com/demisto/server/domain" }, + "FormDisplay": { + "type": "object", + "title": "FormDisplay - display options for communication/ask task (for both email and web forms).", + "properties": { + "bodyBackgroundColor": { + "type": "string", + "x-go-name": "BodyBackgroundColor" + }, + "bodyFontColor": { + "type": "string", + "x-go-name": "BodyFontColor" + }, + "headerBackgroundColor": { + "type": "string", + "x-go-name": "HeaderBackgroundColor" + }, + "headerFontColor": { + "type": "string", + "x-go-name": "HeaderFontColor" + }, + "sender": { + "type": "string", + "x-go-name": "Sender" + }, + "submitButtonBackgroundColor": { + "type": "string", + "x-go-name": "SubmitButtonBackgroundColor" + }, + "submitButtonFontColor": { + "type": "string", + "x-go-name": "SubmitButtonFontColor" + }, + "submitText": { + "type": "string", + "x-go-name": "SubmitText" + } + }, + "x-go-package": "github.com/demisto/server/domain" + }, "GenericStringDateFilter": { "description": "GenericStringDateFilter is a general filter that will fetch entities using the Query value and a date filter", "type": "object", @@ -5260,6 +5448,26 @@ }, "x-go-package": "github.com/demisto/server/domain" }, + "Incidents": { + "description": "Incidents is a list of incident entities" + }, + "IndicatorEditBulkResponse": { + "type": "object", + "title": "IndicatorEditBulkResponse ...", + "properties": { + "total": { + "type": "integer", + "format": "uint64", + "x-go-name": "Total" + }, + "updated": { + "type": "integer", + "format": "uint64", + "x-go-name": "Updated" + } + }, + "x-go-package": "github.com/demisto/server/web" + }, "IndicatorFilter": { "description": "IndicatorFilter is a general filter that fetches entities using a query string query using the Query value", "type": "object", @@ -5394,6 +5602,122 @@ }, "x-go-name": "Scores" }, + "sequenceNumber": { + "type": "integer", + "format": "int64", + "x-go-name": "SeqNum" + }, + "sortValues": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "SortValues" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Versn" + } + }, + "x-go-package": "github.com/demisto/server/domain" + }, + "InstanceClassifier": { + "description": "InstanceClassifier - classifies an incident from a specific brand", + "type": "object", + "properties": { + "brandName": { + "type": "string", + "x-go-name": "Brand" + }, + "commitMessage": { + "type": "string", + "x-go-name": "CommitMessage" + }, + "custom": { + "type": "boolean", + "x-go-name": "Custom" + }, + "defaultIncidentType": { + "type": "string", + "x-go-name": "DefaultIncidentType" + }, + "feed": { + "type": "boolean", + "x-go-name": "Feed" + }, + "fromServerVersion": { + "$ref": "#/definitions/Version" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "incidentSamples": { + "$ref": "#/definitions/Incidents" + }, + "indicatorSamples": { + "$ref": "#/definitions/FeedIndicators" + }, + "instanceId": { + "type": "string", + "x-go-name": "InstanceID" + }, + "instanceName": { + "type": "string", + "x-go-name": "InstanceName" + }, + "isDefault": { + "type": "boolean", + "x-go-name": "IsDefault" + }, + "itemVersion": { + "$ref": "#/definitions/Version" + }, + "keyTypeMap": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "KeyTypeMap" + }, + "mapping": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Mapper" + }, + "x-go-name": "Mapping" + }, + "modified": { + "type": "string", + "format": "date-time", + "x-go-name": "Modified" + }, + "packID": { + "type": "string", + "x-go-name": "PackID" + }, + "primaryTerm": { + "type": "integer", + "format": "int64", + "x-go-name": "PrimaryTerm" + }, + "propagationLabels": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "PropagationLabels" + }, + "sequenceNumber": { + "type": "integer", + "format": "int64", + "x-go-name": "SeqNum" + }, + "shouldCommit": { + "type": "boolean", + "x-go-name": "ShouldCommit" + }, "sortValues": { "type": "array", "items": { @@ -6371,6 +6695,9 @@ }, "x-go-name": "PreviousTasks" }, + "quietMode": { + "$ref": "#/definitions/QuietMode" + }, "reminder": { "description": "Duration in minutes, this field is not persisted here", "type": "integer", @@ -6660,39 +6987,296 @@ }, "x-go-package": "github.com/demisto/server/domain" }, - "Location": { + "Layout": { "type": "object", + "title": "Layout ...", "properties": { - "array_positions": { - "$ref": "#/definitions/ArrayPositions" + "commitMessage": { + "type": "string", + "x-go-name": "CommitMessage" }, - "end": { - "type": "integer", - "format": "uint64", - "x-go-name": "End" + "fromServerVersion": { + "$ref": "#/definitions/Version" }, - "pos": { - "description": "Pos is the position of the term within the field, starting at 1", - "type": "integer", - "format": "uint64", - "x-go-name": "Pos" + "id": { + "type": "string", + "x-go-name": "ID" }, - "start": { - "description": "Start and End are the byte offsets of the term in the field", - "type": "integer", - "format": "uint64", - "x-go-name": "Start" - } - }, - "x-go-package": "github.com/demisto/server/vendor/github.com/blevesearch/bleve/search" - }, - "Locations": { - "type": "array", + "itemVersion": { + "$ref": "#/definitions/Version" + }, + "kind": { + "type": "string", + "x-go-name": "Kind" + }, + "modified": { + "type": "string", + "format": "date-time", + "x-go-name": "Modified" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "packID": { + "type": "string", + "x-go-name": "PackID" + }, + "prevKind": { + "type": "string", + "x-go-name": "PrevKind" + }, + "prevTypeId": { + "type": "string", + "x-go-name": "PrevTypeID" + }, + "primaryTerm": { + "type": "integer", + "format": "int64", + "x-go-name": "PrimaryTerm" + }, + "propagationLabels": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "PropagationLabels" + }, + "sections": { + "type": "array", + "items": { + "$ref": "#/definitions/LayoutSection" + }, + "x-go-name": "Sections" + }, + "sequenceNumber": { + "type": "integer", + "format": "int64", + "x-go-name": "SeqNum" + }, + "shouldCommit": { + "type": "boolean", + "x-go-name": "ShouldCommit" + }, + "sortValues": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "SortValues" + }, + "system": { + "type": "boolean", + "x-go-name": "System" + }, + "toServerVersion": { + "$ref": "#/definitions/Version" + }, + "typeId": { + "type": "string", + "x-go-name": "TypeID" + }, + "vcShouldIgnore": { + "type": "boolean", + "x-go-name": "VCShouldIgnore" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Versn" + } + }, + "x-go-package": "github.com/demisto/server/domain" + }, + "LayoutAPI": { + "description": "LayoutAPI - request sent from the client contains some or all\nof the fields.", + "type": "object", + "properties": { + "kind": { + "type": "string", + "x-go-name": "Kind" + }, + "layout": { + "$ref": "#/definitions/Layout" + }, + "typeId": { + "type": "string", + "x-go-name": "TypeID" + } + }, + "x-go-package": "github.com/demisto/server/domain" + }, + "LayoutField": { + "type": "object", + "title": "LayoutField ...", + "properties": { + "fieldId": { + "type": "string", + "x-go-name": "FieldID" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "isVisible": { + "type": "boolean", + "x-go-name": "IsVisible" + }, + "modified": { + "type": "string", + "format": "date-time", + "x-go-name": "Modified" + }, + "primaryTerm": { + "type": "integer", + "format": "int64", + "x-go-name": "PrimaryTerm" + }, + "sequenceNumber": { + "type": "integer", + "format": "int64", + "x-go-name": "SeqNum" + }, + "sortValues": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "SortValues" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Versn" + } + }, + "x-go-package": "github.com/demisto/server/domain" + }, + "LayoutSection": { + "type": "object", + "title": "LayoutSection ...", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/LayoutField" + }, + "x-go-name": "Fields" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "isVisible": { + "type": "boolean", + "x-go-name": "IsVisible" + }, + "modified": { + "type": "string", + "format": "date-time", + "x-go-name": "Modified" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "primaryTerm": { + "type": "integer", + "format": "int64", + "x-go-name": "PrimaryTerm" + }, + "query": { + "type": "object", + "x-go-name": "Query" + }, + "queryType": { + "type": "string", + "x-go-name": "QueryType" + }, + "readOnly": { + "type": "boolean", + "x-go-name": "IsReadOnly" + }, + "sequenceNumber": { + "type": "integer", + "format": "int64", + "x-go-name": "SeqNum" + }, + "sortValues": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "SortValues" + }, + "type": { + "type": "string", + "x-go-name": "Type" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Versn" + } + }, + "x-go-package": "github.com/demisto/server/domain" + }, + "Location": { + "type": "object", + "properties": { + "array_positions": { + "$ref": "#/definitions/ArrayPositions" + }, + "end": { + "type": "integer", + "format": "uint64", + "x-go-name": "End" + }, + "pos": { + "description": "Pos is the position of the term within the field, starting at 1", + "type": "integer", + "format": "uint64", + "x-go-name": "Pos" + }, + "start": { + "description": "Start and End are the byte offsets of the term in the field", + "type": "integer", + "format": "uint64", + "x-go-name": "Start" + } + }, + "x-go-package": "github.com/demisto/server/vendor/github.com/blevesearch/bleve/search" + }, + "Locations": { + "type": "array", "items": { "$ref": "#/definitions/Location" }, "x-go-package": "github.com/demisto/server/vendor/github.com/blevesearch/bleve/search" }, + "Mapper": { + "description": "Mapper - mapper for new incidents", + "type": "object", + "properties": { + "dontMapEventToLabels": { + "description": "DontMapEventToLabels by default we will map all the fields of the event to incident labels", + "type": "boolean", + "x-go-name": "DontMapEventToLabels" + }, + "internalMapping": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/AdvanceArg" + }, + "x-go-name": "InternalMapping" + } + }, + "x-go-package": "github.com/demisto/server/domain" + }, "ModuleArgs": { "description": "ModuleArgs represents module args", "type": "object", @@ -6989,87 +7573,419 @@ "type": "string", "x-go-name": "By" }, - "byFrom": { - "type": "string", - "x-go-name": "ByFrom" + "byFrom": { + "type": "string", + "x-go-name": "ByFrom" + }, + "byTo": { + "type": "string", + "x-go-name": "ByTo" + }, + "field": { + "type": "string", + "x-go-name": "Field" + }, + "fromValue": { + "type": "string", + "format": "duration", + "x-go-name": "FromValue" + }, + "toValue": { + "type": "string", + "format": "duration", + "x-go-name": "ToValue" + } + }, + "x-go-package": "github.com/demisto/server/domain" + }, + "Playbook": { + "description": "Playbook is a collection of tasks", + "type": "object", + "properties": { + "brands": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Brands" + }, + "commands": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Commands" + }, + "comment": { + "type": "string", + "x-go-name": "Description" + }, + "commitMessage": { + "type": "string", + "x-go-name": "CommitMessage" + }, + "dbotCreatedBy": { + "description": "Who has created this event - relevant only for manual incidents", + "type": "string", + "x-go-name": "CreatedBy" + }, + "detached": { + "type": "boolean", + "x-go-name": "Detached" + }, + "fromServerVersion": { + "$ref": "#/definitions/Version" + }, + "hasRole": { + "description": "Internal field to make queries on role faster", + "type": "boolean", + "x-go-name": "HasRole" + }, + "hidden": { + "type": "boolean", + "x-go-name": "Hidden" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "inputs": { + "$ref": "#/definitions/PlaybookInputs" + }, + "itemVersion": { + "$ref": "#/definitions/Version" + }, + "locked": { + "type": "boolean", + "x-go-name": "Locked" + }, + "missingScriptsIds": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "MissingScriptsIDs" + }, + "modified": { + "type": "string", + "format": "date-time", + "x-go-name": "Modified" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "nameRaw": { + "type": "string", + "x-go-name": "NameRaw" + }, + "outputs": { + "$ref": "#/definitions/PlaybookOutputs" + }, + "packID": { + "type": "string", + "x-go-name": "PackID" + }, + "prevName": { + "type": "string", + "x-go-name": "PrevName" + }, + "previousRoles": { + "description": "PreviousRoleName - do not change this field manually", + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "PreviousRoleName" + }, + "primaryTerm": { + "type": "integer", + "format": "int64", + "x-go-name": "PrimaryTerm" + }, + "private": { + "type": "boolean", + "x-go-name": "Private" + }, + "propagationLabels": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "PropagationLabels" + }, + "quiet": { + "type": "boolean", + "x-go-name": "Quiet" + }, + "roles": { + "description": "The role assigned to this investigation", + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "RoleName" + }, + "scriptIds": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "ScriptIDs" + }, + "sequenceNumber": { + "type": "integer", + "format": "int64", + "x-go-name": "SeqNum" + }, + "shouldCommit": { + "type": "boolean", + "x-go-name": "ShouldCommit" + }, + "sortValues": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "SortValues" + }, + "sourcePlaybookID": { + "type": "string", + "x-go-name": "SourcePlaybookID" + }, + "startTaskId": { + "type": "string", + "x-go-name": "StartTaskID" + }, + "system": { + "type": "boolean", + "x-go-name": "System" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Tags" + }, + "taskIds": { + "description": "auto generated field that will contain all task ids in this playbook\nNeeded for searching with bleve", + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "TaskIDs" + }, + "tasks": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/PlaybookTask" + }, + "x-go-name": "Tasks" + }, + "toServerVersion": { + "$ref": "#/definitions/Version" + }, + "vcShouldIgnore": { + "type": "boolean", + "x-go-name": "VCShouldIgnore" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Versn" + }, + "view": { + "$ref": "#/definitions/PlaybookView" + } + }, + "x-go-package": "github.com/demisto/server/domain" + }, + "PlaybookInput": { + "description": "PlaybookInput represents the playbook input", + "type": "object", + "properties": { + "description": { + "type": "string", + "x-go-name": "Description" + }, + "key": { + "type": "string", + "x-go-name": "Key" + }, + "required": { + "type": "boolean", + "x-go-name": "Required" + }, + "value": { + "$ref": "#/definitions/AdvanceArg" + } + }, + "x-go-package": "github.com/demisto/server/domain" + }, + "PlaybookInputs": { + "description": "PlaybookInputs - array of PlaybookInput", + "type": "array", + "items": { + "$ref": "#/definitions/PlaybookInput" + }, + "x-go-package": "github.com/demisto/server/domain" + }, + "PlaybookOutput": { + "description": "PlaybookOutput represents the playbook output", + "type": "object", + "properties": { + "contextPath": { + "type": "string", + "x-go-name": "ContextPath" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "type": { + "$ref": "#/definitions/OutputType" + } + }, + "x-go-package": "github.com/demisto/server/domain" + }, + "PlaybookOutputs": { + "description": "PlaybookOutputs - array of PlaybookOutput", + "type": "array", + "items": { + "$ref": "#/definitions/PlaybookOutput" + }, + "x-go-package": "github.com/demisto/server/domain" + }, + "PlaybookTask": { + "type": "object", + "title": "PlaybookTask ...", + "properties": { + "conditions": { + "description": "Conditions - optional list of conditions to run when task is conditional. we check conditions by their order (e.i. - considering the first one that satisfied)", + "type": "array", + "items": { + "$ref": "#/definitions/TaskCondition" + }, + "x-go-name": "Conditions" + }, + "continueOnError": { + "type": "boolean", + "x-go-name": "ContinueOnError" + }, + "defaultAssignee": { + "type": "string", + "x-go-name": "DefaultAssignee" + }, + "defaultAssigneeComplex": { + "$ref": "#/definitions/AdvanceArg" + }, + "defaultReminder": { + "type": "integer", + "format": "int64", + "x-go-name": "DefaultReminder" + }, + "evidenceData": { + "$ref": "#/definitions/EvidenceData" + }, + "fieldMapping": { + "type": "array", + "items": { + "$ref": "#/definitions/FieldMapping" + }, + "x-go-name": "FieldMappingArray" + }, + "form": { + "$ref": "#/definitions/DataCollectionForm" + }, + "formDisplay": { + "$ref": "#/definitions/FormDisplay" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "ignoreWorker": { + "description": "Do not run this task in a worker", + "type": "boolean", + "x-go-name": "IgnoreWorker" + }, + "loop": { + "$ref": "#/definitions/TaskLoop" + }, + "message": { + "$ref": "#/definitions/NotifiableItem" + }, + "nextTasks": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "x-go-name": "NextTasks" }, - "byTo": { - "type": "string", - "x-go-name": "ByTo" + "note": { + "type": "boolean", + "x-go-name": "Note" }, - "field": { - "type": "string", - "x-go-name": "Field" + "quietMode": { + "$ref": "#/definitions/QuietMode" }, - "fromValue": { - "type": "string", - "format": "duration", - "x-go-name": "FromValue" + "reputationCalc": { + "$ref": "#/definitions/ReputationCalcAlg" }, - "toValue": { - "type": "string", - "format": "duration", - "x-go-name": "ToValue" - } - }, - "x-go-package": "github.com/demisto/server/domain" - }, - "PlaybookInput": { - "description": "PlaybookInput represents the playbook input", - "type": "object", - "properties": { - "description": { - "type": "string", - "x-go-name": "Description" + "restrictedCompletion": { + "type": "boolean", + "x-go-name": "RestrictedCompletion" }, - "key": { - "type": "string", - "x-go-name": "Key" + "scriptArguments": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/AdvanceArg" + }, + "x-go-name": "ScriptArguments" }, - "required": { + "separateContext": { "type": "boolean", - "x-go-name": "Required" + "x-go-name": "SeparateContext" }, - "value": { - "$ref": "#/definitions/AdvanceArg" - } - }, - "x-go-package": "github.com/demisto/server/domain" - }, - "PlaybookInputs": { - "description": "PlaybookInputs - array of PlaybookInput", - "type": "array", - "items": { - "$ref": "#/definitions/PlaybookInput" - }, - "x-go-package": "github.com/demisto/server/domain" - }, - "PlaybookOutput": { - "description": "PlaybookOutput represents the playbook output", - "type": "object", - "properties": { - "contextPath": { - "type": "string", - "x-go-name": "ContextPath" + "skipUnavailable": { + "description": "SkipUnavailable if true then will check if automation exists, integration of that command is installed and\nactive or sub playbook exists in Demisto", + "type": "boolean", + "x-go-name": "SkipUnavailable" }, - "description": { + "sla": { + "$ref": "#/definitions/SLA" + }, + "slaReminder": { + "$ref": "#/definitions/SLA" + }, + "task": { + "$ref": "#/definitions/Task" + }, + "taskId": { "type": "string", - "x-go-name": "Description" + "x-go-name": "TaskID" + }, + "timerTriggers": { + "description": "SLA fields", + "type": "array", + "items": { + "$ref": "#/definitions/TimerTrigger" + }, + "x-go-name": "TimerTriggers" }, "type": { - "$ref": "#/definitions/OutputType" + "$ref": "#/definitions/TaskType" + }, + "view": { + "$ref": "#/definitions/TaskView" } }, "x-go-package": "github.com/demisto/server/domain" }, - "PlaybookOutputs": { - "description": "PlaybookOutputs - array of PlaybookOutput", - "type": "array", - "items": { - "$ref": "#/definitions/PlaybookOutput" - }, - "x-go-package": "github.com/demisto/server/domain" - }, "PlaybookView": { "description": "PlaybookView represents the view in client of playbook graph", "type": "object", @@ -7137,6 +8053,12 @@ }, "x-go-package": "github.com/demisto/server/domain" }, + "QuietMode": { + "description": "QuietMode quiet mode for playbook task", + "type": "integer", + "format": "int64", + "x-go-package": "github.com/demisto/server/domain" + }, "RawMessage": { "description": "It implements Marshaler and Unmarshaler and can\nbe used to delay JSON decoding or precompute a JSON encoding.", "type": "array", @@ -7147,6 +8069,11 @@ }, "x-go-package": "encoding/json" }, + "Reliability": { + "type": "string", + "title": "Reliability ...", + "x-go-package": "github.com/demisto/server/domain" + }, "Report": { "description": "Report - represents report", "type": "object", @@ -7480,6 +8407,133 @@ "format": "double", "x-go-package": "github.com/demisto/server/domain" }, + "ScriptAPI": { + "type": "object", + "title": "ScriptAPI ...", + "properties": { + "arguments": { + "type": "array", + "items": { + "$ref": "#/definitions/Argument" + }, + "x-go-name": "Args" + }, + "comment": { + "type": "string", + "x-go-name": "Comment" + }, + "contextKeys": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "ContextKeys" + }, + "dependsOn": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "x-go-name": "DependsOn" + }, + "deprecated": { + "type": "boolean", + "x-go-name": "Deprecated" + }, + "detached": { + "type": "boolean", + "x-go-name": "Detached" + }, + "dockerImage": { + "type": "string", + "x-go-name": "DockerImage" + }, + "enabled": { + "type": "boolean", + "x-go-name": "Enabled" + }, + "hidden": { + "type": "boolean", + "x-go-name": "Hidden" + }, + "id": { + "type": "string", + "x-go-name": "ID" + }, + "locked": { + "type": "boolean", + "x-go-name": "Locked" + }, + "modified": { + "type": "string", + "format": "date-time", + "x-go-name": "Modified" + }, + "name": { + "type": "string", + "x-go-name": "Name" + }, + "outputs": { + "type": "array", + "items": { + "$ref": "#/definitions/Output" + }, + "x-go-name": "Outputs" + }, + "permitted": { + "type": "boolean", + "x-go-name": "Permitted" + }, + "propagationLabels": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "PropagationLabels" + }, + "roles": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Roles" + }, + "runAs": { + "type": "string", + "x-go-name": "RunAs" + }, + "scriptTarget": { + "$ref": "#/definitions/ScriptTarget" + }, + "system": { + "type": "boolean", + "x-go-name": "System" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Tags" + }, + "type": { + "$ref": "#/definitions/ScriptType" + }, + "user": { + "type": "string", + "x-go-name": "User" + }, + "version": { + "type": "integer", + "format": "int64", + "x-go-name": "Version" + } + }, + "x-go-package": "github.com/demisto/server/services/automation" + }, "ScriptSubType": { "description": "ScriptSubType holds the script type version", "type": "string", @@ -8061,6 +9115,23 @@ }, "x-go-package": "github.com/demisto/server/web" }, + "Version": { + "type": "object", + "title": "Version represents a version.", + "properties": { + "Digits": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + "Label": { + "type": "string" + } + }, + "x-go-package": "github.com/demisto/server/domain" + }, "UpdateResponse": { "type": "object", "title": "UpdateResponse ...", From 81cbe86aef5b206eb159fe3ff7b8c08e16acff9d Mon Sep 17 00:00:00 2001 From: ShahafBenYakir Date: Mon, 20 Apr 2020 15:15:51 +0300 Subject: [PATCH 3/5] Removed type and kind --- demisto_client/demisto_api/api/default_api.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/demisto_client/demisto_api/api/default_api.py b/demisto_client/demisto_api/api/default_api.py index 80e35a0..de4b15e 100644 --- a/demisto_client/demisto_api/api/default_api.py +++ b/demisto_client/demisto_api/api/default_api.py @@ -4205,7 +4205,7 @@ def import_incident_types_handler_with_http_info(self, file, **kwargs): # noqa: _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def import_layout(self, file, type, kind, **kwargs): # noqa: E501 + def import_layout(self, file, **kwargs): # noqa: E501 """Import a layout # noqa: E501 Import a layout to Cortex XSOAR # noqa: E501 @@ -4216,8 +4216,6 @@ def import_layout(self, file, type, kind, **kwargs): # noqa: E501 :param async_req bool :param file file: file (required) - :param str type: associated typeID for the layout (required) - :param str kind: layout kind details (required) :return: LayoutAPI If the method is called asynchronously, returns the request thread. From b695001b4b00b98f2b009c149c794805c2dfad1c Mon Sep 17 00:00:00 2001 From: ShahafBenYakir Date: Mon, 20 Apr 2020 15:30:32 +0300 Subject: [PATCH 4/5] Added missing dependencies --- .../demisto_api/models/expiration_policy.py | 87 ++ .../models/expiration_settings_source.py | 87 ++ .../demisto_api/models/expiration_source.py | 300 +++++ .../demisto_api/models/feed_indicator.py | 590 +++++++++ .../demisto_api/models/feed_indicators.py | 89 ++ .../demisto_api/models/form_display.py | 297 +++++ .../demisto_api/models/incidents.py | 87 ++ .../models/indicator_edit_bulk_response.py | 141 ++ .../demisto_api/models/instance_classifier.py | 692 ++++++++++ demisto_client/demisto_api/models/layout.py | 638 +++++++++ .../demisto_api/models/layout_api.py | 169 +++ .../demisto_api/models/layout_field.py | 297 +++++ .../demisto_api/models/layout_section.py | 455 +++++++ demisto_client/demisto_api/models/mapper.py | 145 +++ demisto_client/demisto_api/models/playbook.py | 1145 +++++++++++++++++ .../demisto_api/models/playbook_task.py | 841 ++++++++++++ .../demisto_api/models/quiet_mode.py | 87 ++ .../demisto_api/models/reliability.py | 87 ++ .../demisto_api/models/script_api.py | 718 +++++++++++ demisto_client/demisto_api/models/version.py | 141 ++ 20 files changed, 7093 insertions(+) create mode 100644 demisto_client/demisto_api/models/expiration_policy.py create mode 100644 demisto_client/demisto_api/models/expiration_settings_source.py create mode 100644 demisto_client/demisto_api/models/expiration_source.py create mode 100644 demisto_client/demisto_api/models/feed_indicator.py create mode 100644 demisto_client/demisto_api/models/feed_indicators.py create mode 100644 demisto_client/demisto_api/models/form_display.py create mode 100644 demisto_client/demisto_api/models/incidents.py create mode 100644 demisto_client/demisto_api/models/indicator_edit_bulk_response.py create mode 100644 demisto_client/demisto_api/models/instance_classifier.py create mode 100644 demisto_client/demisto_api/models/layout.py create mode 100644 demisto_client/demisto_api/models/layout_api.py create mode 100644 demisto_client/demisto_api/models/layout_field.py create mode 100644 demisto_client/demisto_api/models/layout_section.py create mode 100644 demisto_client/demisto_api/models/mapper.py create mode 100644 demisto_client/demisto_api/models/playbook.py create mode 100644 demisto_client/demisto_api/models/playbook_task.py create mode 100644 demisto_client/demisto_api/models/quiet_mode.py create mode 100644 demisto_client/demisto_api/models/reliability.py create mode 100644 demisto_client/demisto_api/models/script_api.py create mode 100644 demisto_client/demisto_api/models/version.py diff --git a/demisto_client/demisto_api/models/expiration_policy.py b/demisto_client/demisto_api/models/expiration_policy.py new file mode 100644 index 0000000..8eac54d --- /dev/null +++ b/demisto_client/demisto_api/models/expiration_policy.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ExpirationPolicy(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ExpirationPolicy - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ExpirationPolicy, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExpirationPolicy): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/expiration_settings_source.py b/demisto_client/demisto_api/models/expiration_settings_source.py new file mode 100644 index 0000000..2632c23 --- /dev/null +++ b/demisto_client/demisto_api/models/expiration_settings_source.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ExpirationSettingsSource(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ExpirationSettingsSource - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ExpirationSettingsSource, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExpirationSettingsSource): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/expiration_source.py b/demisto_client/demisto_api/models/expiration_source.py new file mode 100644 index 0000000..35b0055 --- /dev/null +++ b/demisto_client/demisto_api/models/expiration_source.py @@ -0,0 +1,300 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from demisto_client.demisto_api.models.expiration_policy import ExpirationPolicy # noqa: F401,E501 +from demisto_client.demisto_api.models.expiration_settings_source import ExpirationSettingsSource # noqa: F401,E501 + + +class ExpirationSource(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'brand': 'str', + 'expiration_interval': 'int', + 'expiration_policy': 'ExpirationPolicy', + 'instance': 'str', + 'module_id': 'str', + 'set_time': 'datetime', + 'source': 'ExpirationSettingsSource', + 'user': 'str' + } + + attribute_map = { + 'brand': 'brand', + 'expiration_interval': 'expirationInterval', + 'expiration_policy': 'expirationPolicy', + 'instance': 'instance', + 'module_id': 'moduleId', + 'set_time': 'setTime', + 'source': 'source', + 'user': 'user' + } + + def __init__(self, brand=None, expiration_interval=None, expiration_policy=None, instance=None, module_id=None, set_time=None, source=None, user=None): # noqa: E501 + """ExpirationSource - a model defined in Swagger""" # noqa: E501 + + self._brand = None + self._expiration_interval = None + self._expiration_policy = None + self._instance = None + self._module_id = None + self._set_time = None + self._source = None + self._user = None + self.discriminator = None + + if brand is not None: + self.brand = brand + if expiration_interval is not None: + self.expiration_interval = expiration_interval + if expiration_policy is not None: + self.expiration_policy = expiration_policy + if instance is not None: + self.instance = instance + if module_id is not None: + self.module_id = module_id + if set_time is not None: + self.set_time = set_time + if source is not None: + self.source = source + if user is not None: + self.user = user + + @property + def brand(self): + """Gets the brand of this ExpirationSource. # noqa: E501 + + + :return: The brand of this ExpirationSource. # noqa: E501 + :rtype: str + """ + return self._brand + + @brand.setter + def brand(self, brand): + """Sets the brand of this ExpirationSource. + + + :param brand: The brand of this ExpirationSource. # noqa: E501 + :type: str + """ + + self._brand = brand + + @property + def expiration_interval(self): + """Gets the expiration_interval of this ExpirationSource. # noqa: E501 + + + :return: The expiration_interval of this ExpirationSource. # noqa: E501 + :rtype: int + """ + return self._expiration_interval + + @expiration_interval.setter + def expiration_interval(self, expiration_interval): + """Sets the expiration_interval of this ExpirationSource. + + + :param expiration_interval: The expiration_interval of this ExpirationSource. # noqa: E501 + :type: int + """ + + self._expiration_interval = expiration_interval + + @property + def expiration_policy(self): + """Gets the expiration_policy of this ExpirationSource. # noqa: E501 + + + :return: The expiration_policy of this ExpirationSource. # noqa: E501 + :rtype: ExpirationPolicy + """ + return self._expiration_policy + + @expiration_policy.setter + def expiration_policy(self, expiration_policy): + """Sets the expiration_policy of this ExpirationSource. + + + :param expiration_policy: The expiration_policy of this ExpirationSource. # noqa: E501 + :type: ExpirationPolicy + """ + + self._expiration_policy = expiration_policy + + @property + def instance(self): + """Gets the instance of this ExpirationSource. # noqa: E501 + + + :return: The instance of this ExpirationSource. # noqa: E501 + :rtype: str + """ + return self._instance + + @instance.setter + def instance(self, instance): + """Sets the instance of this ExpirationSource. + + + :param instance: The instance of this ExpirationSource. # noqa: E501 + :type: str + """ + + self._instance = instance + + @property + def module_id(self): + """Gets the module_id of this ExpirationSource. # noqa: E501 + + + :return: The module_id of this ExpirationSource. # noqa: E501 + :rtype: str + """ + return self._module_id + + @module_id.setter + def module_id(self, module_id): + """Sets the module_id of this ExpirationSource. + + + :param module_id: The module_id of this ExpirationSource. # noqa: E501 + :type: str + """ + + self._module_id = module_id + + @property + def set_time(self): + """Gets the set_time of this ExpirationSource. # noqa: E501 + + + :return: The set_time of this ExpirationSource. # noqa: E501 + :rtype: datetime + """ + return self._set_time + + @set_time.setter + def set_time(self, set_time): + """Sets the set_time of this ExpirationSource. + + + :param set_time: The set_time of this ExpirationSource. # noqa: E501 + :type: datetime + """ + + self._set_time = set_time + + @property + def source(self): + """Gets the source of this ExpirationSource. # noqa: E501 + + + :return: The source of this ExpirationSource. # noqa: E501 + :rtype: ExpirationSettingsSource + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this ExpirationSource. + + + :param source: The source of this ExpirationSource. # noqa: E501 + :type: ExpirationSettingsSource + """ + + self._source = source + + @property + def user(self): + """Gets the user of this ExpirationSource. # noqa: E501 + + + :return: The user of this ExpirationSource. # noqa: E501 + :rtype: str + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this ExpirationSource. + + + :param user: The user of this ExpirationSource. # noqa: E501 + :type: str + """ + + self._user = user + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ExpirationSource, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExpirationSource): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/feed_indicator.py b/demisto_client/demisto_api/models/feed_indicator.py new file mode 100644 index 0000000..0147ec6 --- /dev/null +++ b/demisto_client/demisto_api/models/feed_indicator.py @@ -0,0 +1,590 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from demisto_client.demisto_api.models.custom_fields import CustomFields # noqa: F401,E501 +from demisto_client.demisto_api.models.expiration_policy import ExpirationPolicy # noqa: F401,E501 +from demisto_client.demisto_api.models.expiration_source import ExpirationSource # noqa: F401,E501 +from demisto_client.demisto_api.models.reliability import Reliability # noqa: F401,E501 + + +class FeedIndicator(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'expiration_source': 'ExpirationSource', + 'bypass_exclusion_list': 'bool', + 'classifier_version': 'int', + 'expiration_interval': 'int', + 'expiration_policy': 'ExpirationPolicy', + 'feed_config': 'dict(str, object)', + 'fetch_time': 'datetime', + 'fields': 'CustomFields', + 'is_enrichment': 'bool', + 'modified_time': 'datetime', + 'module_id': 'str', + 'raw_json': 'dict(str, object)', + 'reliability': 'Reliability', + 'score': 'int', + 'source_brand': 'str', + 'source_instance': 'str', + 'timestamp': 'datetime', + 'type': 'str', + 'value': 'str' + } + + attribute_map = { + 'expiration_source': 'ExpirationSource', + 'bypass_exclusion_list': 'bypassExclusionList', + 'classifier_version': 'classifierVersion', + 'expiration_interval': 'expirationInterval', + 'expiration_policy': 'expirationPolicy', + 'feed_config': 'feedConfig', + 'fetch_time': 'fetchTime', + 'fields': 'fields', + 'is_enrichment': 'isEnrichment', + 'modified_time': 'modifiedTime', + 'module_id': 'moduleId', + 'raw_json': 'rawJSON', + 'reliability': 'reliability', + 'score': 'score', + 'source_brand': 'sourceBrand', + 'source_instance': 'sourceInstance', + 'timestamp': 'timestamp', + 'type': 'type', + 'value': 'value' + } + + def __init__(self, expiration_source=None, bypass_exclusion_list=None, classifier_version=None, expiration_interval=None, expiration_policy=None, feed_config=None, fetch_time=None, fields=None, is_enrichment=None, modified_time=None, module_id=None, raw_json=None, reliability=None, score=None, source_brand=None, source_instance=None, timestamp=None, type=None, value=None): # noqa: E501 + """FeedIndicator - a model defined in Swagger""" # noqa: E501 + + self._expiration_source = None + self._bypass_exclusion_list = None + self._classifier_version = None + self._expiration_interval = None + self._expiration_policy = None + self._feed_config = None + self._fetch_time = None + self._fields = None + self._is_enrichment = None + self._modified_time = None + self._module_id = None + self._raw_json = None + self._reliability = None + self._score = None + self._source_brand = None + self._source_instance = None + self._timestamp = None + self._type = None + self._value = None + self.discriminator = None + + if expiration_source is not None: + self.expiration_source = expiration_source + if bypass_exclusion_list is not None: + self.bypass_exclusion_list = bypass_exclusion_list + if classifier_version is not None: + self.classifier_version = classifier_version + if expiration_interval is not None: + self.expiration_interval = expiration_interval + if expiration_policy is not None: + self.expiration_policy = expiration_policy + if feed_config is not None: + self.feed_config = feed_config + if fetch_time is not None: + self.fetch_time = fetch_time + if fields is not None: + self.fields = fields + if is_enrichment is not None: + self.is_enrichment = is_enrichment + if modified_time is not None: + self.modified_time = modified_time + if module_id is not None: + self.module_id = module_id + if raw_json is not None: + self.raw_json = raw_json + if reliability is not None: + self.reliability = reliability + if score is not None: + self.score = score + if source_brand is not None: + self.source_brand = source_brand + if source_instance is not None: + self.source_instance = source_instance + if timestamp is not None: + self.timestamp = timestamp + if type is not None: + self.type = type + if value is not None: + self.value = value + + @property + def expiration_source(self): + """Gets the expiration_source of this FeedIndicator. # noqa: E501 + + + :return: The expiration_source of this FeedIndicator. # noqa: E501 + :rtype: ExpirationSource + """ + return self._expiration_source + + @expiration_source.setter + def expiration_source(self, expiration_source): + """Sets the expiration_source of this FeedIndicator. + + + :param expiration_source: The expiration_source of this FeedIndicator. # noqa: E501 + :type: ExpirationSource + """ + + self._expiration_source = expiration_source + + @property + def bypass_exclusion_list(self): + """Gets the bypass_exclusion_list of this FeedIndicator. # noqa: E501 + + + :return: The bypass_exclusion_list of this FeedIndicator. # noqa: E501 + :rtype: bool + """ + return self._bypass_exclusion_list + + @bypass_exclusion_list.setter + def bypass_exclusion_list(self, bypass_exclusion_list): + """Sets the bypass_exclusion_list of this FeedIndicator. + + + :param bypass_exclusion_list: The bypass_exclusion_list of this FeedIndicator. # noqa: E501 + :type: bool + """ + + self._bypass_exclusion_list = bypass_exclusion_list + + @property + def classifier_version(self): + """Gets the classifier_version of this FeedIndicator. # noqa: E501 + + + :return: The classifier_version of this FeedIndicator. # noqa: E501 + :rtype: int + """ + return self._classifier_version + + @classifier_version.setter + def classifier_version(self, classifier_version): + """Sets the classifier_version of this FeedIndicator. + + + :param classifier_version: The classifier_version of this FeedIndicator. # noqa: E501 + :type: int + """ + + self._classifier_version = classifier_version + + @property + def expiration_interval(self): + """Gets the expiration_interval of this FeedIndicator. # noqa: E501 + + + :return: The expiration_interval of this FeedIndicator. # noqa: E501 + :rtype: int + """ + return self._expiration_interval + + @expiration_interval.setter + def expiration_interval(self, expiration_interval): + """Sets the expiration_interval of this FeedIndicator. + + + :param expiration_interval: The expiration_interval of this FeedIndicator. # noqa: E501 + :type: int + """ + + self._expiration_interval = expiration_interval + + @property + def expiration_policy(self): + """Gets the expiration_policy of this FeedIndicator. # noqa: E501 + + + :return: The expiration_policy of this FeedIndicator. # noqa: E501 + :rtype: ExpirationPolicy + """ + return self._expiration_policy + + @expiration_policy.setter + def expiration_policy(self, expiration_policy): + """Sets the expiration_policy of this FeedIndicator. + + + :param expiration_policy: The expiration_policy of this FeedIndicator. # noqa: E501 + :type: ExpirationPolicy + """ + + self._expiration_policy = expiration_policy + + @property + def feed_config(self): + """Gets the feed_config of this FeedIndicator. # noqa: E501 + + + :return: The feed_config of this FeedIndicator. # noqa: E501 + :rtype: dict(str, object) + """ + return self._feed_config + + @feed_config.setter + def feed_config(self, feed_config): + """Sets the feed_config of this FeedIndicator. + + + :param feed_config: The feed_config of this FeedIndicator. # noqa: E501 + :type: dict(str, object) + """ + + self._feed_config = feed_config + + @property + def fetch_time(self): + """Gets the fetch_time of this FeedIndicator. # noqa: E501 + + + :return: The fetch_time of this FeedIndicator. # noqa: E501 + :rtype: datetime + """ + return self._fetch_time + + @fetch_time.setter + def fetch_time(self, fetch_time): + """Sets the fetch_time of this FeedIndicator. + + + :param fetch_time: The fetch_time of this FeedIndicator. # noqa: E501 + :type: datetime + """ + + self._fetch_time = fetch_time + + @property + def fields(self): + """Gets the fields of this FeedIndicator. # noqa: E501 + + + :return: The fields of this FeedIndicator. # noqa: E501 + :rtype: CustomFields + """ + return self._fields + + @fields.setter + def fields(self, fields): + """Sets the fields of this FeedIndicator. + + + :param fields: The fields of this FeedIndicator. # noqa: E501 + :type: CustomFields + """ + + self._fields = fields + + @property + def is_enrichment(self): + """Gets the is_enrichment of this FeedIndicator. # noqa: E501 + + + :return: The is_enrichment of this FeedIndicator. # noqa: E501 + :rtype: bool + """ + return self._is_enrichment + + @is_enrichment.setter + def is_enrichment(self, is_enrichment): + """Sets the is_enrichment of this FeedIndicator. + + + :param is_enrichment: The is_enrichment of this FeedIndicator. # noqa: E501 + :type: bool + """ + + self._is_enrichment = is_enrichment + + @property + def modified_time(self): + """Gets the modified_time of this FeedIndicator. # noqa: E501 + + + :return: The modified_time of this FeedIndicator. # noqa: E501 + :rtype: datetime + """ + return self._modified_time + + @modified_time.setter + def modified_time(self, modified_time): + """Sets the modified_time of this FeedIndicator. + + + :param modified_time: The modified_time of this FeedIndicator. # noqa: E501 + :type: datetime + """ + + self._modified_time = modified_time + + @property + def module_id(self): + """Gets the module_id of this FeedIndicator. # noqa: E501 + + + :return: The module_id of this FeedIndicator. # noqa: E501 + :rtype: str + """ + return self._module_id + + @module_id.setter + def module_id(self, module_id): + """Sets the module_id of this FeedIndicator. + + + :param module_id: The module_id of this FeedIndicator. # noqa: E501 + :type: str + """ + + self._module_id = module_id + + @property + def raw_json(self): + """Gets the raw_json of this FeedIndicator. # noqa: E501 + + + :return: The raw_json of this FeedIndicator. # noqa: E501 + :rtype: dict(str, object) + """ + return self._raw_json + + @raw_json.setter + def raw_json(self, raw_json): + """Sets the raw_json of this FeedIndicator. + + + :param raw_json: The raw_json of this FeedIndicator. # noqa: E501 + :type: dict(str, object) + """ + + self._raw_json = raw_json + + @property + def reliability(self): + """Gets the reliability of this FeedIndicator. # noqa: E501 + + + :return: The reliability of this FeedIndicator. # noqa: E501 + :rtype: Reliability + """ + return self._reliability + + @reliability.setter + def reliability(self, reliability): + """Sets the reliability of this FeedIndicator. + + + :param reliability: The reliability of this FeedIndicator. # noqa: E501 + :type: Reliability + """ + + self._reliability = reliability + + @property + def score(self): + """Gets the score of this FeedIndicator. # noqa: E501 + + + :return: The score of this FeedIndicator. # noqa: E501 + :rtype: int + """ + return self._score + + @score.setter + def score(self, score): + """Sets the score of this FeedIndicator. + + + :param score: The score of this FeedIndicator. # noqa: E501 + :type: int + """ + + self._score = score + + @property + def source_brand(self): + """Gets the source_brand of this FeedIndicator. # noqa: E501 + + + :return: The source_brand of this FeedIndicator. # noqa: E501 + :rtype: str + """ + return self._source_brand + + @source_brand.setter + def source_brand(self, source_brand): + """Sets the source_brand of this FeedIndicator. + + + :param source_brand: The source_brand of this FeedIndicator. # noqa: E501 + :type: str + """ + + self._source_brand = source_brand + + @property + def source_instance(self): + """Gets the source_instance of this FeedIndicator. # noqa: E501 + + + :return: The source_instance of this FeedIndicator. # noqa: E501 + :rtype: str + """ + return self._source_instance + + @source_instance.setter + def source_instance(self, source_instance): + """Sets the source_instance of this FeedIndicator. + + + :param source_instance: The source_instance of this FeedIndicator. # noqa: E501 + :type: str + """ + + self._source_instance = source_instance + + @property + def timestamp(self): + """Gets the timestamp of this FeedIndicator. # noqa: E501 + + + :return: The timestamp of this FeedIndicator. # noqa: E501 + :rtype: datetime + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this FeedIndicator. + + + :param timestamp: The timestamp of this FeedIndicator. # noqa: E501 + :type: datetime + """ + + self._timestamp = timestamp + + @property + def type(self): + """Gets the type of this FeedIndicator. # noqa: E501 + + indicator fields # noqa: E501 + + :return: The type of this FeedIndicator. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this FeedIndicator. + + indicator fields # noqa: E501 + + :param type: The type of this FeedIndicator. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def value(self): + """Gets the value of this FeedIndicator. # noqa: E501 + + + :return: The value of this FeedIndicator. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this FeedIndicator. + + + :param value: The value of this FeedIndicator. # noqa: E501 + :type: str + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FeedIndicator, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FeedIndicator): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/feed_indicators.py b/demisto_client/demisto_api/models/feed_indicators.py new file mode 100644 index 0000000..f55ca7e --- /dev/null +++ b/demisto_client/demisto_api/models/feed_indicators.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from demisto_client.demisto_api.models.feed_indicator import FeedIndicator # noqa: F401,E501 + + +class FeedIndicators(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """FeedIndicators - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FeedIndicators, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FeedIndicators): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/form_display.py b/demisto_client/demisto_api/models/form_display.py new file mode 100644 index 0000000..f8bfa9c --- /dev/null +++ b/demisto_client/demisto_api/models/form_display.py @@ -0,0 +1,297 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class FormDisplay(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'body_background_color': 'str', + 'body_font_color': 'str', + 'header_background_color': 'str', + 'header_font_color': 'str', + 'sender': 'str', + 'submit_button_background_color': 'str', + 'submit_button_font_color': 'str', + 'submit_text': 'str' + } + + attribute_map = { + 'body_background_color': 'bodyBackgroundColor', + 'body_font_color': 'bodyFontColor', + 'header_background_color': 'headerBackgroundColor', + 'header_font_color': 'headerFontColor', + 'sender': 'sender', + 'submit_button_background_color': 'submitButtonBackgroundColor', + 'submit_button_font_color': 'submitButtonFontColor', + 'submit_text': 'submitText' + } + + def __init__(self, body_background_color=None, body_font_color=None, header_background_color=None, header_font_color=None, sender=None, submit_button_background_color=None, submit_button_font_color=None, submit_text=None): # noqa: E501 + """FormDisplay - a model defined in Swagger""" # noqa: E501 + + self._body_background_color = None + self._body_font_color = None + self._header_background_color = None + self._header_font_color = None + self._sender = None + self._submit_button_background_color = None + self._submit_button_font_color = None + self._submit_text = None + self.discriminator = None + + if body_background_color is not None: + self.body_background_color = body_background_color + if body_font_color is not None: + self.body_font_color = body_font_color + if header_background_color is not None: + self.header_background_color = header_background_color + if header_font_color is not None: + self.header_font_color = header_font_color + if sender is not None: + self.sender = sender + if submit_button_background_color is not None: + self.submit_button_background_color = submit_button_background_color + if submit_button_font_color is not None: + self.submit_button_font_color = submit_button_font_color + if submit_text is not None: + self.submit_text = submit_text + + @property + def body_background_color(self): + """Gets the body_background_color of this FormDisplay. # noqa: E501 + + + :return: The body_background_color of this FormDisplay. # noqa: E501 + :rtype: str + """ + return self._body_background_color + + @body_background_color.setter + def body_background_color(self, body_background_color): + """Sets the body_background_color of this FormDisplay. + + + :param body_background_color: The body_background_color of this FormDisplay. # noqa: E501 + :type: str + """ + + self._body_background_color = body_background_color + + @property + def body_font_color(self): + """Gets the body_font_color of this FormDisplay. # noqa: E501 + + + :return: The body_font_color of this FormDisplay. # noqa: E501 + :rtype: str + """ + return self._body_font_color + + @body_font_color.setter + def body_font_color(self, body_font_color): + """Sets the body_font_color of this FormDisplay. + + + :param body_font_color: The body_font_color of this FormDisplay. # noqa: E501 + :type: str + """ + + self._body_font_color = body_font_color + + @property + def header_background_color(self): + """Gets the header_background_color of this FormDisplay. # noqa: E501 + + + :return: The header_background_color of this FormDisplay. # noqa: E501 + :rtype: str + """ + return self._header_background_color + + @header_background_color.setter + def header_background_color(self, header_background_color): + """Sets the header_background_color of this FormDisplay. + + + :param header_background_color: The header_background_color of this FormDisplay. # noqa: E501 + :type: str + """ + + self._header_background_color = header_background_color + + @property + def header_font_color(self): + """Gets the header_font_color of this FormDisplay. # noqa: E501 + + + :return: The header_font_color of this FormDisplay. # noqa: E501 + :rtype: str + """ + return self._header_font_color + + @header_font_color.setter + def header_font_color(self, header_font_color): + """Sets the header_font_color of this FormDisplay. + + + :param header_font_color: The header_font_color of this FormDisplay. # noqa: E501 + :type: str + """ + + self._header_font_color = header_font_color + + @property + def sender(self): + """Gets the sender of this FormDisplay. # noqa: E501 + + + :return: The sender of this FormDisplay. # noqa: E501 + :rtype: str + """ + return self._sender + + @sender.setter + def sender(self, sender): + """Sets the sender of this FormDisplay. + + + :param sender: The sender of this FormDisplay. # noqa: E501 + :type: str + """ + + self._sender = sender + + @property + def submit_button_background_color(self): + """Gets the submit_button_background_color of this FormDisplay. # noqa: E501 + + + :return: The submit_button_background_color of this FormDisplay. # noqa: E501 + :rtype: str + """ + return self._submit_button_background_color + + @submit_button_background_color.setter + def submit_button_background_color(self, submit_button_background_color): + """Sets the submit_button_background_color of this FormDisplay. + + + :param submit_button_background_color: The submit_button_background_color of this FormDisplay. # noqa: E501 + :type: str + """ + + self._submit_button_background_color = submit_button_background_color + + @property + def submit_button_font_color(self): + """Gets the submit_button_font_color of this FormDisplay. # noqa: E501 + + + :return: The submit_button_font_color of this FormDisplay. # noqa: E501 + :rtype: str + """ + return self._submit_button_font_color + + @submit_button_font_color.setter + def submit_button_font_color(self, submit_button_font_color): + """Sets the submit_button_font_color of this FormDisplay. + + + :param submit_button_font_color: The submit_button_font_color of this FormDisplay. # noqa: E501 + :type: str + """ + + self._submit_button_font_color = submit_button_font_color + + @property + def submit_text(self): + """Gets the submit_text of this FormDisplay. # noqa: E501 + + + :return: The submit_text of this FormDisplay. # noqa: E501 + :rtype: str + """ + return self._submit_text + + @submit_text.setter + def submit_text(self, submit_text): + """Sets the submit_text of this FormDisplay. + + + :param submit_text: The submit_text of this FormDisplay. # noqa: E501 + :type: str + """ + + self._submit_text = submit_text + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FormDisplay, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FormDisplay): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/incidents.py b/demisto_client/demisto_api/models/incidents.py new file mode 100644 index 0000000..16d8c88 --- /dev/null +++ b/demisto_client/demisto_api/models/incidents.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Incidents(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """Incidents - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Incidents, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Incidents): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/indicator_edit_bulk_response.py b/demisto_client/demisto_api/models/indicator_edit_bulk_response.py new file mode 100644 index 0000000..1a6b1aa --- /dev/null +++ b/demisto_client/demisto_api/models/indicator_edit_bulk_response.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class IndicatorEditBulkResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'total': 'int', + 'updated': 'int' + } + + attribute_map = { + 'total': 'total', + 'updated': 'updated' + } + + def __init__(self, total=None, updated=None): # noqa: E501 + """IndicatorEditBulkResponse - a model defined in Swagger""" # noqa: E501 + + self._total = None + self._updated = None + self.discriminator = None + + if total is not None: + self.total = total + if updated is not None: + self.updated = updated + + @property + def total(self): + """Gets the total of this IndicatorEditBulkResponse. # noqa: E501 + + + :return: The total of this IndicatorEditBulkResponse. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this IndicatorEditBulkResponse. + + + :param total: The total of this IndicatorEditBulkResponse. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def updated(self): + """Gets the updated of this IndicatorEditBulkResponse. # noqa: E501 + + + :return: The updated of this IndicatorEditBulkResponse. # noqa: E501 + :rtype: int + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this IndicatorEditBulkResponse. + + + :param updated: The updated of this IndicatorEditBulkResponse. # noqa: E501 + :type: int + """ + + self._updated = updated + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IndicatorEditBulkResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IndicatorEditBulkResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/instance_classifier.py b/demisto_client/demisto_api/models/instance_classifier.py new file mode 100644 index 0000000..156d83d --- /dev/null +++ b/demisto_client/demisto_api/models/instance_classifier.py @@ -0,0 +1,692 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from demisto_client.demisto_api.models.feed_indicators import FeedIndicators # noqa: F401,E501 +from demisto_client.demisto_api.models.incidents import Incidents # noqa: F401,E501 +from demisto_client.demisto_api.models.mapper import Mapper # noqa: F401,E501 +from demisto_client.demisto_api.models.version import Version # noqa: F401,E501 + + +class InstanceClassifier(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'brand_name': 'str', + 'commit_message': 'str', + 'custom': 'bool', + 'default_incident_type': 'str', + 'feed': 'bool', + 'from_server_version': 'Version', + 'id': 'str', + 'incident_samples': 'Incidents', + 'indicator_samples': 'FeedIndicators', + 'instance_id': 'str', + 'instance_name': 'str', + 'is_default': 'bool', + 'item_version': 'Version', + 'key_type_map': 'dict(str, str)', + 'mapping': 'dict(str, Mapper)', + 'modified': 'datetime', + 'pack_id': 'str', + 'primary_term': 'int', + 'propagation_labels': 'list[str]', + 'sequence_number': 'int', + 'should_commit': 'bool', + 'sort_values': 'list[str]', + 'version': 'int' + } + + attribute_map = { + 'brand_name': 'brandName', + 'commit_message': 'commitMessage', + 'custom': 'custom', + 'default_incident_type': 'defaultIncidentType', + 'feed': 'feed', + 'from_server_version': 'fromServerVersion', + 'id': 'id', + 'incident_samples': 'incidentSamples', + 'indicator_samples': 'indicatorSamples', + 'instance_id': 'instanceId', + 'instance_name': 'instanceName', + 'is_default': 'isDefault', + 'item_version': 'itemVersion', + 'key_type_map': 'keyTypeMap', + 'mapping': 'mapping', + 'modified': 'modified', + 'pack_id': 'packID', + 'primary_term': 'primaryTerm', + 'propagation_labels': 'propagationLabels', + 'sequence_number': 'sequenceNumber', + 'should_commit': 'shouldCommit', + 'sort_values': 'sortValues', + 'version': 'version' + } + + def __init__(self, brand_name=None, commit_message=None, custom=None, default_incident_type=None, feed=None, from_server_version=None, id=None, incident_samples=None, indicator_samples=None, instance_id=None, instance_name=None, is_default=None, item_version=None, key_type_map=None, mapping=None, modified=None, pack_id=None, primary_term=None, propagation_labels=None, sequence_number=None, should_commit=None, sort_values=None, version=None): # noqa: E501 + """InstanceClassifier - a model defined in Swagger""" # noqa: E501 + + self._brand_name = None + self._commit_message = None + self._custom = None + self._default_incident_type = None + self._feed = None + self._from_server_version = None + self._id = None + self._incident_samples = None + self._indicator_samples = None + self._instance_id = None + self._instance_name = None + self._is_default = None + self._item_version = None + self._key_type_map = None + self._mapping = None + self._modified = None + self._pack_id = None + self._primary_term = None + self._propagation_labels = None + self._sequence_number = None + self._should_commit = None + self._sort_values = None + self._version = None + self.discriminator = None + + if brand_name is not None: + self.brand_name = brand_name + if commit_message is not None: + self.commit_message = commit_message + if custom is not None: + self.custom = custom + if default_incident_type is not None: + self.default_incident_type = default_incident_type + if feed is not None: + self.feed = feed + if from_server_version is not None: + self.from_server_version = from_server_version + if id is not None: + self.id = id + if incident_samples is not None: + self.incident_samples = incident_samples + if indicator_samples is not None: + self.indicator_samples = indicator_samples + if instance_id is not None: + self.instance_id = instance_id + if instance_name is not None: + self.instance_name = instance_name + if is_default is not None: + self.is_default = is_default + if item_version is not None: + self.item_version = item_version + if key_type_map is not None: + self.key_type_map = key_type_map + if mapping is not None: + self.mapping = mapping + if modified is not None: + self.modified = modified + if pack_id is not None: + self.pack_id = pack_id + if primary_term is not None: + self.primary_term = primary_term + if propagation_labels is not None: + self.propagation_labels = propagation_labels + if sequence_number is not None: + self.sequence_number = sequence_number + if should_commit is not None: + self.should_commit = should_commit + if sort_values is not None: + self.sort_values = sort_values + if version is not None: + self.version = version + + @property + def brand_name(self): + """Gets the brand_name of this InstanceClassifier. # noqa: E501 + + + :return: The brand_name of this InstanceClassifier. # noqa: E501 + :rtype: str + """ + return self._brand_name + + @brand_name.setter + def brand_name(self, brand_name): + """Sets the brand_name of this InstanceClassifier. + + + :param brand_name: The brand_name of this InstanceClassifier. # noqa: E501 + :type: str + """ + + self._brand_name = brand_name + + @property + def commit_message(self): + """Gets the commit_message of this InstanceClassifier. # noqa: E501 + + + :return: The commit_message of this InstanceClassifier. # noqa: E501 + :rtype: str + """ + return self._commit_message + + @commit_message.setter + def commit_message(self, commit_message): + """Sets the commit_message of this InstanceClassifier. + + + :param commit_message: The commit_message of this InstanceClassifier. # noqa: E501 + :type: str + """ + + self._commit_message = commit_message + + @property + def custom(self): + """Gets the custom of this InstanceClassifier. # noqa: E501 + + + :return: The custom of this InstanceClassifier. # noqa: E501 + :rtype: bool + """ + return self._custom + + @custom.setter + def custom(self, custom): + """Sets the custom of this InstanceClassifier. + + + :param custom: The custom of this InstanceClassifier. # noqa: E501 + :type: bool + """ + + self._custom = custom + + @property + def default_incident_type(self): + """Gets the default_incident_type of this InstanceClassifier. # noqa: E501 + + + :return: The default_incident_type of this InstanceClassifier. # noqa: E501 + :rtype: str + """ + return self._default_incident_type + + @default_incident_type.setter + def default_incident_type(self, default_incident_type): + """Sets the default_incident_type of this InstanceClassifier. + + + :param default_incident_type: The default_incident_type of this InstanceClassifier. # noqa: E501 + :type: str + """ + + self._default_incident_type = default_incident_type + + @property + def feed(self): + """Gets the feed of this InstanceClassifier. # noqa: E501 + + + :return: The feed of this InstanceClassifier. # noqa: E501 + :rtype: bool + """ + return self._feed + + @feed.setter + def feed(self, feed): + """Sets the feed of this InstanceClassifier. + + + :param feed: The feed of this InstanceClassifier. # noqa: E501 + :type: bool + """ + + self._feed = feed + + @property + def from_server_version(self): + """Gets the from_server_version of this InstanceClassifier. # noqa: E501 + + + :return: The from_server_version of this InstanceClassifier. # noqa: E501 + :rtype: Version + """ + return self._from_server_version + + @from_server_version.setter + def from_server_version(self, from_server_version): + """Sets the from_server_version of this InstanceClassifier. + + + :param from_server_version: The from_server_version of this InstanceClassifier. # noqa: E501 + :type: Version + """ + + self._from_server_version = from_server_version + + @property + def id(self): + """Gets the id of this InstanceClassifier. # noqa: E501 + + + :return: The id of this InstanceClassifier. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this InstanceClassifier. + + + :param id: The id of this InstanceClassifier. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def incident_samples(self): + """Gets the incident_samples of this InstanceClassifier. # noqa: E501 + + + :return: The incident_samples of this InstanceClassifier. # noqa: E501 + :rtype: Incidents + """ + return self._incident_samples + + @incident_samples.setter + def incident_samples(self, incident_samples): + """Sets the incident_samples of this InstanceClassifier. + + + :param incident_samples: The incident_samples of this InstanceClassifier. # noqa: E501 + :type: Incidents + """ + + self._incident_samples = incident_samples + + @property + def indicator_samples(self): + """Gets the indicator_samples of this InstanceClassifier. # noqa: E501 + + + :return: The indicator_samples of this InstanceClassifier. # noqa: E501 + :rtype: FeedIndicators + """ + return self._indicator_samples + + @indicator_samples.setter + def indicator_samples(self, indicator_samples): + """Sets the indicator_samples of this InstanceClassifier. + + + :param indicator_samples: The indicator_samples of this InstanceClassifier. # noqa: E501 + :type: FeedIndicators + """ + + self._indicator_samples = indicator_samples + + @property + def instance_id(self): + """Gets the instance_id of this InstanceClassifier. # noqa: E501 + + + :return: The instance_id of this InstanceClassifier. # noqa: E501 + :rtype: str + """ + return self._instance_id + + @instance_id.setter + def instance_id(self, instance_id): + """Sets the instance_id of this InstanceClassifier. + + + :param instance_id: The instance_id of this InstanceClassifier. # noqa: E501 + :type: str + """ + + self._instance_id = instance_id + + @property + def instance_name(self): + """Gets the instance_name of this InstanceClassifier. # noqa: E501 + + + :return: The instance_name of this InstanceClassifier. # noqa: E501 + :rtype: str + """ + return self._instance_name + + @instance_name.setter + def instance_name(self, instance_name): + """Sets the instance_name of this InstanceClassifier. + + + :param instance_name: The instance_name of this InstanceClassifier. # noqa: E501 + :type: str + """ + + self._instance_name = instance_name + + @property + def is_default(self): + """Gets the is_default of this InstanceClassifier. # noqa: E501 + + + :return: The is_default of this InstanceClassifier. # noqa: E501 + :rtype: bool + """ + return self._is_default + + @is_default.setter + def is_default(self, is_default): + """Sets the is_default of this InstanceClassifier. + + + :param is_default: The is_default of this InstanceClassifier. # noqa: E501 + :type: bool + """ + + self._is_default = is_default + + @property + def item_version(self): + """Gets the item_version of this InstanceClassifier. # noqa: E501 + + + :return: The item_version of this InstanceClassifier. # noqa: E501 + :rtype: Version + """ + return self._item_version + + @item_version.setter + def item_version(self, item_version): + """Sets the item_version of this InstanceClassifier. + + + :param item_version: The item_version of this InstanceClassifier. # noqa: E501 + :type: Version + """ + + self._item_version = item_version + + @property + def key_type_map(self): + """Gets the key_type_map of this InstanceClassifier. # noqa: E501 + + + :return: The key_type_map of this InstanceClassifier. # noqa: E501 + :rtype: dict(str, str) + """ + return self._key_type_map + + @key_type_map.setter + def key_type_map(self, key_type_map): + """Sets the key_type_map of this InstanceClassifier. + + + :param key_type_map: The key_type_map of this InstanceClassifier. # noqa: E501 + :type: dict(str, str) + """ + + self._key_type_map = key_type_map + + @property + def mapping(self): + """Gets the mapping of this InstanceClassifier. # noqa: E501 + + + :return: The mapping of this InstanceClassifier. # noqa: E501 + :rtype: dict(str, Mapper) + """ + return self._mapping + + @mapping.setter + def mapping(self, mapping): + """Sets the mapping of this InstanceClassifier. + + + :param mapping: The mapping of this InstanceClassifier. # noqa: E501 + :type: dict(str, Mapper) + """ + + self._mapping = mapping + + @property + def modified(self): + """Gets the modified of this InstanceClassifier. # noqa: E501 + + + :return: The modified of this InstanceClassifier. # noqa: E501 + :rtype: datetime + """ + return self._modified + + @modified.setter + def modified(self, modified): + """Sets the modified of this InstanceClassifier. + + + :param modified: The modified of this InstanceClassifier. # noqa: E501 + :type: datetime + """ + + self._modified = modified + + @property + def pack_id(self): + """Gets the pack_id of this InstanceClassifier. # noqa: E501 + + + :return: The pack_id of this InstanceClassifier. # noqa: E501 + :rtype: str + """ + return self._pack_id + + @pack_id.setter + def pack_id(self, pack_id): + """Sets the pack_id of this InstanceClassifier. + + + :param pack_id: The pack_id of this InstanceClassifier. # noqa: E501 + :type: str + """ + + self._pack_id = pack_id + + @property + def primary_term(self): + """Gets the primary_term of this InstanceClassifier. # noqa: E501 + + + :return: The primary_term of this InstanceClassifier. # noqa: E501 + :rtype: int + """ + return self._primary_term + + @primary_term.setter + def primary_term(self, primary_term): + """Sets the primary_term of this InstanceClassifier. + + + :param primary_term: The primary_term of this InstanceClassifier. # noqa: E501 + :type: int + """ + + self._primary_term = primary_term + + @property + def propagation_labels(self): + """Gets the propagation_labels of this InstanceClassifier. # noqa: E501 + + + :return: The propagation_labels of this InstanceClassifier. # noqa: E501 + :rtype: list[str] + """ + return self._propagation_labels + + @propagation_labels.setter + def propagation_labels(self, propagation_labels): + """Sets the propagation_labels of this InstanceClassifier. + + + :param propagation_labels: The propagation_labels of this InstanceClassifier. # noqa: E501 + :type: list[str] + """ + + self._propagation_labels = propagation_labels + + @property + def sequence_number(self): + """Gets the sequence_number of this InstanceClassifier. # noqa: E501 + + + :return: The sequence_number of this InstanceClassifier. # noqa: E501 + :rtype: int + """ + return self._sequence_number + + @sequence_number.setter + def sequence_number(self, sequence_number): + """Sets the sequence_number of this InstanceClassifier. + + + :param sequence_number: The sequence_number of this InstanceClassifier. # noqa: E501 + :type: int + """ + + self._sequence_number = sequence_number + + @property + def should_commit(self): + """Gets the should_commit of this InstanceClassifier. # noqa: E501 + + + :return: The should_commit of this InstanceClassifier. # noqa: E501 + :rtype: bool + """ + return self._should_commit + + @should_commit.setter + def should_commit(self, should_commit): + """Sets the should_commit of this InstanceClassifier. + + + :param should_commit: The should_commit of this InstanceClassifier. # noqa: E501 + :type: bool + """ + + self._should_commit = should_commit + + @property + def sort_values(self): + """Gets the sort_values of this InstanceClassifier. # noqa: E501 + + + :return: The sort_values of this InstanceClassifier. # noqa: E501 + :rtype: list[str] + """ + return self._sort_values + + @sort_values.setter + def sort_values(self, sort_values): + """Sets the sort_values of this InstanceClassifier. + + + :param sort_values: The sort_values of this InstanceClassifier. # noqa: E501 + :type: list[str] + """ + + self._sort_values = sort_values + + @property + def version(self): + """Gets the version of this InstanceClassifier. # noqa: E501 + + + :return: The version of this InstanceClassifier. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this InstanceClassifier. + + + :param version: The version of this InstanceClassifier. # noqa: E501 + :type: int + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InstanceClassifier, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InstanceClassifier): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/layout.py b/demisto_client/demisto_api/models/layout.py new file mode 100644 index 0000000..20556dc --- /dev/null +++ b/demisto_client/demisto_api/models/layout.py @@ -0,0 +1,638 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from demisto_client.demisto_api.models.layout_section import LayoutSection # noqa: F401,E501 +from demisto_client.demisto_api.models.version import Version # noqa: F401,E501 + + +class Layout(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'commit_message': 'str', + 'from_server_version': 'Version', + 'id': 'str', + 'item_version': 'Version', + 'kind': 'str', + 'modified': 'datetime', + 'name': 'str', + 'pack_id': 'str', + 'prev_kind': 'str', + 'prev_type_id': 'str', + 'primary_term': 'int', + 'propagation_labels': 'list[str]', + 'sections': 'list[LayoutSection]', + 'sequence_number': 'int', + 'should_commit': 'bool', + 'sort_values': 'list[str]', + 'system': 'bool', + 'to_server_version': 'Version', + 'type_id': 'str', + 'vc_should_ignore': 'bool', + 'version': 'int' + } + + attribute_map = { + 'commit_message': 'commitMessage', + 'from_server_version': 'fromServerVersion', + 'id': 'id', + 'item_version': 'itemVersion', + 'kind': 'kind', + 'modified': 'modified', + 'name': 'name', + 'pack_id': 'packID', + 'prev_kind': 'prevKind', + 'prev_type_id': 'prevTypeId', + 'primary_term': 'primaryTerm', + 'propagation_labels': 'propagationLabels', + 'sections': 'sections', + 'sequence_number': 'sequenceNumber', + 'should_commit': 'shouldCommit', + 'sort_values': 'sortValues', + 'system': 'system', + 'to_server_version': 'toServerVersion', + 'type_id': 'typeId', + 'vc_should_ignore': 'vcShouldIgnore', + 'version': 'version' + } + + def __init__(self, commit_message=None, from_server_version=None, id=None, item_version=None, kind=None, modified=None, name=None, pack_id=None, prev_kind=None, prev_type_id=None, primary_term=None, propagation_labels=None, sections=None, sequence_number=None, should_commit=None, sort_values=None, system=None, to_server_version=None, type_id=None, vc_should_ignore=None, version=None): # noqa: E501 + """Layout - a model defined in Swagger""" # noqa: E501 + + self._commit_message = None + self._from_server_version = None + self._id = None + self._item_version = None + self._kind = None + self._modified = None + self._name = None + self._pack_id = None + self._prev_kind = None + self._prev_type_id = None + self._primary_term = None + self._propagation_labels = None + self._sections = None + self._sequence_number = None + self._should_commit = None + self._sort_values = None + self._system = None + self._to_server_version = None + self._type_id = None + self._vc_should_ignore = None + self._version = None + self.discriminator = None + + if commit_message is not None: + self.commit_message = commit_message + if from_server_version is not None: + self.from_server_version = from_server_version + if id is not None: + self.id = id + if item_version is not None: + self.item_version = item_version + if kind is not None: + self.kind = kind + if modified is not None: + self.modified = modified + if name is not None: + self.name = name + if pack_id is not None: + self.pack_id = pack_id + if prev_kind is not None: + self.prev_kind = prev_kind + if prev_type_id is not None: + self.prev_type_id = prev_type_id + if primary_term is not None: + self.primary_term = primary_term + if propagation_labels is not None: + self.propagation_labels = propagation_labels + if sections is not None: + self.sections = sections + if sequence_number is not None: + self.sequence_number = sequence_number + if should_commit is not None: + self.should_commit = should_commit + if sort_values is not None: + self.sort_values = sort_values + if system is not None: + self.system = system + if to_server_version is not None: + self.to_server_version = to_server_version + if type_id is not None: + self.type_id = type_id + if vc_should_ignore is not None: + self.vc_should_ignore = vc_should_ignore + if version is not None: + self.version = version + + @property + def commit_message(self): + """Gets the commit_message of this Layout. # noqa: E501 + + + :return: The commit_message of this Layout. # noqa: E501 + :rtype: str + """ + return self._commit_message + + @commit_message.setter + def commit_message(self, commit_message): + """Sets the commit_message of this Layout. + + + :param commit_message: The commit_message of this Layout. # noqa: E501 + :type: str + """ + + self._commit_message = commit_message + + @property + def from_server_version(self): + """Gets the from_server_version of this Layout. # noqa: E501 + + + :return: The from_server_version of this Layout. # noqa: E501 + :rtype: Version + """ + return self._from_server_version + + @from_server_version.setter + def from_server_version(self, from_server_version): + """Sets the from_server_version of this Layout. + + + :param from_server_version: The from_server_version of this Layout. # noqa: E501 + :type: Version + """ + + self._from_server_version = from_server_version + + @property + def id(self): + """Gets the id of this Layout. # noqa: E501 + + + :return: The id of this Layout. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Layout. + + + :param id: The id of this Layout. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def item_version(self): + """Gets the item_version of this Layout. # noqa: E501 + + + :return: The item_version of this Layout. # noqa: E501 + :rtype: Version + """ + return self._item_version + + @item_version.setter + def item_version(self, item_version): + """Sets the item_version of this Layout. + + + :param item_version: The item_version of this Layout. # noqa: E501 + :type: Version + """ + + self._item_version = item_version + + @property + def kind(self): + """Gets the kind of this Layout. # noqa: E501 + + + :return: The kind of this Layout. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this Layout. + + + :param kind: The kind of this Layout. # noqa: E501 + :type: str + """ + + self._kind = kind + + @property + def modified(self): + """Gets the modified of this Layout. # noqa: E501 + + + :return: The modified of this Layout. # noqa: E501 + :rtype: datetime + """ + return self._modified + + @modified.setter + def modified(self, modified): + """Sets the modified of this Layout. + + + :param modified: The modified of this Layout. # noqa: E501 + :type: datetime + """ + + self._modified = modified + + @property + def name(self): + """Gets the name of this Layout. # noqa: E501 + + + :return: The name of this Layout. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Layout. + + + :param name: The name of this Layout. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def pack_id(self): + """Gets the pack_id of this Layout. # noqa: E501 + + + :return: The pack_id of this Layout. # noqa: E501 + :rtype: str + """ + return self._pack_id + + @pack_id.setter + def pack_id(self, pack_id): + """Sets the pack_id of this Layout. + + + :param pack_id: The pack_id of this Layout. # noqa: E501 + :type: str + """ + + self._pack_id = pack_id + + @property + def prev_kind(self): + """Gets the prev_kind of this Layout. # noqa: E501 + + + :return: The prev_kind of this Layout. # noqa: E501 + :rtype: str + """ + return self._prev_kind + + @prev_kind.setter + def prev_kind(self, prev_kind): + """Sets the prev_kind of this Layout. + + + :param prev_kind: The prev_kind of this Layout. # noqa: E501 + :type: str + """ + + self._prev_kind = prev_kind + + @property + def prev_type_id(self): + """Gets the prev_type_id of this Layout. # noqa: E501 + + + :return: The prev_type_id of this Layout. # noqa: E501 + :rtype: str + """ + return self._prev_type_id + + @prev_type_id.setter + def prev_type_id(self, prev_type_id): + """Sets the prev_type_id of this Layout. + + + :param prev_type_id: The prev_type_id of this Layout. # noqa: E501 + :type: str + """ + + self._prev_type_id = prev_type_id + + @property + def primary_term(self): + """Gets the primary_term of this Layout. # noqa: E501 + + + :return: The primary_term of this Layout. # noqa: E501 + :rtype: int + """ + return self._primary_term + + @primary_term.setter + def primary_term(self, primary_term): + """Sets the primary_term of this Layout. + + + :param primary_term: The primary_term of this Layout. # noqa: E501 + :type: int + """ + + self._primary_term = primary_term + + @property + def propagation_labels(self): + """Gets the propagation_labels of this Layout. # noqa: E501 + + + :return: The propagation_labels of this Layout. # noqa: E501 + :rtype: list[str] + """ + return self._propagation_labels + + @propagation_labels.setter + def propagation_labels(self, propagation_labels): + """Sets the propagation_labels of this Layout. + + + :param propagation_labels: The propagation_labels of this Layout. # noqa: E501 + :type: list[str] + """ + + self._propagation_labels = propagation_labels + + @property + def sections(self): + """Gets the sections of this Layout. # noqa: E501 + + + :return: The sections of this Layout. # noqa: E501 + :rtype: list[LayoutSection] + """ + return self._sections + + @sections.setter + def sections(self, sections): + """Sets the sections of this Layout. + + + :param sections: The sections of this Layout. # noqa: E501 + :type: list[LayoutSection] + """ + + self._sections = sections + + @property + def sequence_number(self): + """Gets the sequence_number of this Layout. # noqa: E501 + + + :return: The sequence_number of this Layout. # noqa: E501 + :rtype: int + """ + return self._sequence_number + + @sequence_number.setter + def sequence_number(self, sequence_number): + """Sets the sequence_number of this Layout. + + + :param sequence_number: The sequence_number of this Layout. # noqa: E501 + :type: int + """ + + self._sequence_number = sequence_number + + @property + def should_commit(self): + """Gets the should_commit of this Layout. # noqa: E501 + + + :return: The should_commit of this Layout. # noqa: E501 + :rtype: bool + """ + return self._should_commit + + @should_commit.setter + def should_commit(self, should_commit): + """Sets the should_commit of this Layout. + + + :param should_commit: The should_commit of this Layout. # noqa: E501 + :type: bool + """ + + self._should_commit = should_commit + + @property + def sort_values(self): + """Gets the sort_values of this Layout. # noqa: E501 + + + :return: The sort_values of this Layout. # noqa: E501 + :rtype: list[str] + """ + return self._sort_values + + @sort_values.setter + def sort_values(self, sort_values): + """Sets the sort_values of this Layout. + + + :param sort_values: The sort_values of this Layout. # noqa: E501 + :type: list[str] + """ + + self._sort_values = sort_values + + @property + def system(self): + """Gets the system of this Layout. # noqa: E501 + + + :return: The system of this Layout. # noqa: E501 + :rtype: bool + """ + return self._system + + @system.setter + def system(self, system): + """Sets the system of this Layout. + + + :param system: The system of this Layout. # noqa: E501 + :type: bool + """ + + self._system = system + + @property + def to_server_version(self): + """Gets the to_server_version of this Layout. # noqa: E501 + + + :return: The to_server_version of this Layout. # noqa: E501 + :rtype: Version + """ + return self._to_server_version + + @to_server_version.setter + def to_server_version(self, to_server_version): + """Sets the to_server_version of this Layout. + + + :param to_server_version: The to_server_version of this Layout. # noqa: E501 + :type: Version + """ + + self._to_server_version = to_server_version + + @property + def type_id(self): + """Gets the type_id of this Layout. # noqa: E501 + + + :return: The type_id of this Layout. # noqa: E501 + :rtype: str + """ + return self._type_id + + @type_id.setter + def type_id(self, type_id): + """Sets the type_id of this Layout. + + + :param type_id: The type_id of this Layout. # noqa: E501 + :type: str + """ + + self._type_id = type_id + + @property + def vc_should_ignore(self): + """Gets the vc_should_ignore of this Layout. # noqa: E501 + + + :return: The vc_should_ignore of this Layout. # noqa: E501 + :rtype: bool + """ + return self._vc_should_ignore + + @vc_should_ignore.setter + def vc_should_ignore(self, vc_should_ignore): + """Sets the vc_should_ignore of this Layout. + + + :param vc_should_ignore: The vc_should_ignore of this Layout. # noqa: E501 + :type: bool + """ + + self._vc_should_ignore = vc_should_ignore + + @property + def version(self): + """Gets the version of this Layout. # noqa: E501 + + + :return: The version of this Layout. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this Layout. + + + :param version: The version of this Layout. # noqa: E501 + :type: int + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Layout, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Layout): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/layout_api.py b/demisto_client/demisto_api/models/layout_api.py new file mode 100644 index 0000000..f41ea41 --- /dev/null +++ b/demisto_client/demisto_api/models/layout_api.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from demisto_client.demisto_api.models.layout import Layout # noqa: F401,E501 + + +class LayoutAPI(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'kind': 'str', + 'layout': 'Layout', + 'type_id': 'str' + } + + attribute_map = { + 'kind': 'kind', + 'layout': 'layout', + 'type_id': 'typeId' + } + + def __init__(self, kind=None, layout=None, type_id=None): # noqa: E501 + """LayoutAPI - a model defined in Swagger""" # noqa: E501 + + self._kind = None + self._layout = None + self._type_id = None + self.discriminator = None + + if kind is not None: + self.kind = kind + if layout is not None: + self.layout = layout + if type_id is not None: + self.type_id = type_id + + @property + def kind(self): + """Gets the kind of this LayoutAPI. # noqa: E501 + + + :return: The kind of this LayoutAPI. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this LayoutAPI. + + + :param kind: The kind of this LayoutAPI. # noqa: E501 + :type: str + """ + + self._kind = kind + + @property + def layout(self): + """Gets the layout of this LayoutAPI. # noqa: E501 + + + :return: The layout of this LayoutAPI. # noqa: E501 + :rtype: Layout + """ + return self._layout + + @layout.setter + def layout(self, layout): + """Sets the layout of this LayoutAPI. + + + :param layout: The layout of this LayoutAPI. # noqa: E501 + :type: Layout + """ + + self._layout = layout + + @property + def type_id(self): + """Gets the type_id of this LayoutAPI. # noqa: E501 + + + :return: The type_id of this LayoutAPI. # noqa: E501 + :rtype: str + """ + return self._type_id + + @type_id.setter + def type_id(self, type_id): + """Sets the type_id of this LayoutAPI. + + + :param type_id: The type_id of this LayoutAPI. # noqa: E501 + :type: str + """ + + self._type_id = type_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(LayoutAPI, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LayoutAPI): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/layout_field.py b/demisto_client/demisto_api/models/layout_field.py new file mode 100644 index 0000000..56ef936 --- /dev/null +++ b/demisto_client/demisto_api/models/layout_field.py @@ -0,0 +1,297 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class LayoutField(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'field_id': 'str', + 'id': 'str', + 'is_visible': 'bool', + 'modified': 'datetime', + 'primary_term': 'int', + 'sequence_number': 'int', + 'sort_values': 'list[str]', + 'version': 'int' + } + + attribute_map = { + 'field_id': 'fieldId', + 'id': 'id', + 'is_visible': 'isVisible', + 'modified': 'modified', + 'primary_term': 'primaryTerm', + 'sequence_number': 'sequenceNumber', + 'sort_values': 'sortValues', + 'version': 'version' + } + + def __init__(self, field_id=None, id=None, is_visible=None, modified=None, primary_term=None, sequence_number=None, sort_values=None, version=None): # noqa: E501 + """LayoutField - a model defined in Swagger""" # noqa: E501 + + self._field_id = None + self._id = None + self._is_visible = None + self._modified = None + self._primary_term = None + self._sequence_number = None + self._sort_values = None + self._version = None + self.discriminator = None + + if field_id is not None: + self.field_id = field_id + if id is not None: + self.id = id + if is_visible is not None: + self.is_visible = is_visible + if modified is not None: + self.modified = modified + if primary_term is not None: + self.primary_term = primary_term + if sequence_number is not None: + self.sequence_number = sequence_number + if sort_values is not None: + self.sort_values = sort_values + if version is not None: + self.version = version + + @property + def field_id(self): + """Gets the field_id of this LayoutField. # noqa: E501 + + + :return: The field_id of this LayoutField. # noqa: E501 + :rtype: str + """ + return self._field_id + + @field_id.setter + def field_id(self, field_id): + """Sets the field_id of this LayoutField. + + + :param field_id: The field_id of this LayoutField. # noqa: E501 + :type: str + """ + + self._field_id = field_id + + @property + def id(self): + """Gets the id of this LayoutField. # noqa: E501 + + + :return: The id of this LayoutField. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this LayoutField. + + + :param id: The id of this LayoutField. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def is_visible(self): + """Gets the is_visible of this LayoutField. # noqa: E501 + + + :return: The is_visible of this LayoutField. # noqa: E501 + :rtype: bool + """ + return self._is_visible + + @is_visible.setter + def is_visible(self, is_visible): + """Sets the is_visible of this LayoutField. + + + :param is_visible: The is_visible of this LayoutField. # noqa: E501 + :type: bool + """ + + self._is_visible = is_visible + + @property + def modified(self): + """Gets the modified of this LayoutField. # noqa: E501 + + + :return: The modified of this LayoutField. # noqa: E501 + :rtype: datetime + """ + return self._modified + + @modified.setter + def modified(self, modified): + """Sets the modified of this LayoutField. + + + :param modified: The modified of this LayoutField. # noqa: E501 + :type: datetime + """ + + self._modified = modified + + @property + def primary_term(self): + """Gets the primary_term of this LayoutField. # noqa: E501 + + + :return: The primary_term of this LayoutField. # noqa: E501 + :rtype: int + """ + return self._primary_term + + @primary_term.setter + def primary_term(self, primary_term): + """Sets the primary_term of this LayoutField. + + + :param primary_term: The primary_term of this LayoutField. # noqa: E501 + :type: int + """ + + self._primary_term = primary_term + + @property + def sequence_number(self): + """Gets the sequence_number of this LayoutField. # noqa: E501 + + + :return: The sequence_number of this LayoutField. # noqa: E501 + :rtype: int + """ + return self._sequence_number + + @sequence_number.setter + def sequence_number(self, sequence_number): + """Sets the sequence_number of this LayoutField. + + + :param sequence_number: The sequence_number of this LayoutField. # noqa: E501 + :type: int + """ + + self._sequence_number = sequence_number + + @property + def sort_values(self): + """Gets the sort_values of this LayoutField. # noqa: E501 + + + :return: The sort_values of this LayoutField. # noqa: E501 + :rtype: list[str] + """ + return self._sort_values + + @sort_values.setter + def sort_values(self, sort_values): + """Sets the sort_values of this LayoutField. + + + :param sort_values: The sort_values of this LayoutField. # noqa: E501 + :type: list[str] + """ + + self._sort_values = sort_values + + @property + def version(self): + """Gets the version of this LayoutField. # noqa: E501 + + + :return: The version of this LayoutField. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this LayoutField. + + + :param version: The version of this LayoutField. # noqa: E501 + :type: int + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(LayoutField, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LayoutField): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/layout_section.py b/demisto_client/demisto_api/models/layout_section.py new file mode 100644 index 0000000..6d75e6a --- /dev/null +++ b/demisto_client/demisto_api/models/layout_section.py @@ -0,0 +1,455 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from demisto_client.demisto_api.models.layout_field import LayoutField # noqa: F401,E501 + + +class LayoutSection(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'description': 'str', + 'fields': 'list[LayoutField]', + 'id': 'str', + 'is_visible': 'bool', + 'modified': 'datetime', + 'name': 'str', + 'primary_term': 'int', + 'query': 'object', + 'query_type': 'str', + 'read_only': 'bool', + 'sequence_number': 'int', + 'sort_values': 'list[str]', + 'type': 'str', + 'version': 'int' + } + + attribute_map = { + 'description': 'description', + 'fields': 'fields', + 'id': 'id', + 'is_visible': 'isVisible', + 'modified': 'modified', + 'name': 'name', + 'primary_term': 'primaryTerm', + 'query': 'query', + 'query_type': 'queryType', + 'read_only': 'readOnly', + 'sequence_number': 'sequenceNumber', + 'sort_values': 'sortValues', + 'type': 'type', + 'version': 'version' + } + + def __init__(self, description=None, fields=None, id=None, is_visible=None, modified=None, name=None, primary_term=None, query=None, query_type=None, read_only=None, sequence_number=None, sort_values=None, type=None, version=None): # noqa: E501 + """LayoutSection - a model defined in Swagger""" # noqa: E501 + + self._description = None + self._fields = None + self._id = None + self._is_visible = None + self._modified = None + self._name = None + self._primary_term = None + self._query = None + self._query_type = None + self._read_only = None + self._sequence_number = None + self._sort_values = None + self._type = None + self._version = None + self.discriminator = None + + if description is not None: + self.description = description + if fields is not None: + self.fields = fields + if id is not None: + self.id = id + if is_visible is not None: + self.is_visible = is_visible + if modified is not None: + self.modified = modified + if name is not None: + self.name = name + if primary_term is not None: + self.primary_term = primary_term + if query is not None: + self.query = query + if query_type is not None: + self.query_type = query_type + if read_only is not None: + self.read_only = read_only + if sequence_number is not None: + self.sequence_number = sequence_number + if sort_values is not None: + self.sort_values = sort_values + if type is not None: + self.type = type + if version is not None: + self.version = version + + @property + def description(self): + """Gets the description of this LayoutSection. # noqa: E501 + + + :return: The description of this LayoutSection. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this LayoutSection. + + + :param description: The description of this LayoutSection. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def fields(self): + """Gets the fields of this LayoutSection. # noqa: E501 + + + :return: The fields of this LayoutSection. # noqa: E501 + :rtype: list[LayoutField] + """ + return self._fields + + @fields.setter + def fields(self, fields): + """Sets the fields of this LayoutSection. + + + :param fields: The fields of this LayoutSection. # noqa: E501 + :type: list[LayoutField] + """ + + self._fields = fields + + @property + def id(self): + """Gets the id of this LayoutSection. # noqa: E501 + + + :return: The id of this LayoutSection. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this LayoutSection. + + + :param id: The id of this LayoutSection. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def is_visible(self): + """Gets the is_visible of this LayoutSection. # noqa: E501 + + + :return: The is_visible of this LayoutSection. # noqa: E501 + :rtype: bool + """ + return self._is_visible + + @is_visible.setter + def is_visible(self, is_visible): + """Sets the is_visible of this LayoutSection. + + + :param is_visible: The is_visible of this LayoutSection. # noqa: E501 + :type: bool + """ + + self._is_visible = is_visible + + @property + def modified(self): + """Gets the modified of this LayoutSection. # noqa: E501 + + + :return: The modified of this LayoutSection. # noqa: E501 + :rtype: datetime + """ + return self._modified + + @modified.setter + def modified(self, modified): + """Sets the modified of this LayoutSection. + + + :param modified: The modified of this LayoutSection. # noqa: E501 + :type: datetime + """ + + self._modified = modified + + @property + def name(self): + """Gets the name of this LayoutSection. # noqa: E501 + + + :return: The name of this LayoutSection. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this LayoutSection. + + + :param name: The name of this LayoutSection. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def primary_term(self): + """Gets the primary_term of this LayoutSection. # noqa: E501 + + + :return: The primary_term of this LayoutSection. # noqa: E501 + :rtype: int + """ + return self._primary_term + + @primary_term.setter + def primary_term(self, primary_term): + """Sets the primary_term of this LayoutSection. + + + :param primary_term: The primary_term of this LayoutSection. # noqa: E501 + :type: int + """ + + self._primary_term = primary_term + + @property + def query(self): + """Gets the query of this LayoutSection. # noqa: E501 + + + :return: The query of this LayoutSection. # noqa: E501 + :rtype: object + """ + return self._query + + @query.setter + def query(self, query): + """Sets the query of this LayoutSection. + + + :param query: The query of this LayoutSection. # noqa: E501 + :type: object + """ + + self._query = query + + @property + def query_type(self): + """Gets the query_type of this LayoutSection. # noqa: E501 + + + :return: The query_type of this LayoutSection. # noqa: E501 + :rtype: str + """ + return self._query_type + + @query_type.setter + def query_type(self, query_type): + """Sets the query_type of this LayoutSection. + + + :param query_type: The query_type of this LayoutSection. # noqa: E501 + :type: str + """ + + self._query_type = query_type + + @property + def read_only(self): + """Gets the read_only of this LayoutSection. # noqa: E501 + + + :return: The read_only of this LayoutSection. # noqa: E501 + :rtype: bool + """ + return self._read_only + + @read_only.setter + def read_only(self, read_only): + """Sets the read_only of this LayoutSection. + + + :param read_only: The read_only of this LayoutSection. # noqa: E501 + :type: bool + """ + + self._read_only = read_only + + @property + def sequence_number(self): + """Gets the sequence_number of this LayoutSection. # noqa: E501 + + + :return: The sequence_number of this LayoutSection. # noqa: E501 + :rtype: int + """ + return self._sequence_number + + @sequence_number.setter + def sequence_number(self, sequence_number): + """Sets the sequence_number of this LayoutSection. + + + :param sequence_number: The sequence_number of this LayoutSection. # noqa: E501 + :type: int + """ + + self._sequence_number = sequence_number + + @property + def sort_values(self): + """Gets the sort_values of this LayoutSection. # noqa: E501 + + + :return: The sort_values of this LayoutSection. # noqa: E501 + :rtype: list[str] + """ + return self._sort_values + + @sort_values.setter + def sort_values(self, sort_values): + """Sets the sort_values of this LayoutSection. + + + :param sort_values: The sort_values of this LayoutSection. # noqa: E501 + :type: list[str] + """ + + self._sort_values = sort_values + + @property + def type(self): + """Gets the type of this LayoutSection. # noqa: E501 + + + :return: The type of this LayoutSection. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this LayoutSection. + + + :param type: The type of this LayoutSection. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def version(self): + """Gets the version of this LayoutSection. # noqa: E501 + + + :return: The version of this LayoutSection. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this LayoutSection. + + + :param version: The version of this LayoutSection. # noqa: E501 + :type: int + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(LayoutSection, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LayoutSection): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/mapper.py b/demisto_client/demisto_api/models/mapper.py new file mode 100644 index 0000000..ad4c44f --- /dev/null +++ b/demisto_client/demisto_api/models/mapper.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from demisto_client.demisto_api.models.advance_arg import AdvanceArg # noqa: F401,E501 + + +class Mapper(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'dont_map_event_to_labels': 'bool', + 'internal_mapping': 'dict(str, AdvanceArg)' + } + + attribute_map = { + 'dont_map_event_to_labels': 'dontMapEventToLabels', + 'internal_mapping': 'internalMapping' + } + + def __init__(self, dont_map_event_to_labels=None, internal_mapping=None): # noqa: E501 + """Mapper - a model defined in Swagger""" # noqa: E501 + + self._dont_map_event_to_labels = None + self._internal_mapping = None + self.discriminator = None + + if dont_map_event_to_labels is not None: + self.dont_map_event_to_labels = dont_map_event_to_labels + if internal_mapping is not None: + self.internal_mapping = internal_mapping + + @property + def dont_map_event_to_labels(self): + """Gets the dont_map_event_to_labels of this Mapper. # noqa: E501 + + DontMapEventToLabels by default we will map all the fields of the event to incident labels # noqa: E501 + + :return: The dont_map_event_to_labels of this Mapper. # noqa: E501 + :rtype: bool + """ + return self._dont_map_event_to_labels + + @dont_map_event_to_labels.setter + def dont_map_event_to_labels(self, dont_map_event_to_labels): + """Sets the dont_map_event_to_labels of this Mapper. + + DontMapEventToLabels by default we will map all the fields of the event to incident labels # noqa: E501 + + :param dont_map_event_to_labels: The dont_map_event_to_labels of this Mapper. # noqa: E501 + :type: bool + """ + + self._dont_map_event_to_labels = dont_map_event_to_labels + + @property + def internal_mapping(self): + """Gets the internal_mapping of this Mapper. # noqa: E501 + + + :return: The internal_mapping of this Mapper. # noqa: E501 + :rtype: dict(str, AdvanceArg) + """ + return self._internal_mapping + + @internal_mapping.setter + def internal_mapping(self, internal_mapping): + """Sets the internal_mapping of this Mapper. + + + :param internal_mapping: The internal_mapping of this Mapper. # noqa: E501 + :type: dict(str, AdvanceArg) + """ + + self._internal_mapping = internal_mapping + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Mapper, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Mapper): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/playbook.py b/demisto_client/demisto_api/models/playbook.py new file mode 100644 index 0000000..7089657 --- /dev/null +++ b/demisto_client/demisto_api/models/playbook.py @@ -0,0 +1,1145 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from demisto_client.demisto_api.models.playbook_inputs import PlaybookInputs # noqa: F401,E501 +from demisto_client.demisto_api.models.playbook_outputs import PlaybookOutputs # noqa: F401,E501 +from demisto_client.demisto_api.models.playbook_task import PlaybookTask # noqa: F401,E501 +from demisto_client.demisto_api.models.playbook_view import PlaybookView # noqa: F401,E501 +from demisto_client.demisto_api.models.version import Version # noqa: F401,E501 + + +class Playbook(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'brands': 'list[str]', + 'commands': 'list[str]', + 'comment': 'str', + 'commit_message': 'str', + 'dbot_created_by': 'str', + 'detached': 'bool', + 'from_server_version': 'Version', + 'has_role': 'bool', + 'hidden': 'bool', + 'id': 'str', + 'inputs': 'PlaybookInputs', + 'item_version': 'Version', + 'locked': 'bool', + 'missing_scripts_ids': 'list[str]', + 'modified': 'datetime', + 'name': 'str', + 'name_raw': 'str', + 'outputs': 'PlaybookOutputs', + 'pack_id': 'str', + 'prev_name': 'str', + 'previous_roles': 'list[str]', + 'primary_term': 'int', + 'private': 'bool', + 'propagation_labels': 'list[str]', + 'quiet': 'bool', + 'roles': 'list[str]', + 'script_ids': 'list[str]', + 'sequence_number': 'int', + 'should_commit': 'bool', + 'sort_values': 'list[str]', + 'source_playbook_id': 'str', + 'start_task_id': 'str', + 'system': 'bool', + 'tags': 'list[str]', + 'task_ids': 'list[str]', + 'tasks': 'dict(str, PlaybookTask)', + 'to_server_version': 'Version', + 'vc_should_ignore': 'bool', + 'version': 'int', + 'view': 'PlaybookView' + } + + attribute_map = { + 'brands': 'brands', + 'commands': 'commands', + 'comment': 'comment', + 'commit_message': 'commitMessage', + 'dbot_created_by': 'dbotCreatedBy', + 'detached': 'detached', + 'from_server_version': 'fromServerVersion', + 'has_role': 'hasRole', + 'hidden': 'hidden', + 'id': 'id', + 'inputs': 'inputs', + 'item_version': 'itemVersion', + 'locked': 'locked', + 'missing_scripts_ids': 'missingScriptsIds', + 'modified': 'modified', + 'name': 'name', + 'name_raw': 'nameRaw', + 'outputs': 'outputs', + 'pack_id': 'packID', + 'prev_name': 'prevName', + 'previous_roles': 'previousRoles', + 'primary_term': 'primaryTerm', + 'private': 'private', + 'propagation_labels': 'propagationLabels', + 'quiet': 'quiet', + 'roles': 'roles', + 'script_ids': 'scriptIds', + 'sequence_number': 'sequenceNumber', + 'should_commit': 'shouldCommit', + 'sort_values': 'sortValues', + 'source_playbook_id': 'sourcePlaybookID', + 'start_task_id': 'startTaskId', + 'system': 'system', + 'tags': 'tags', + 'task_ids': 'taskIds', + 'tasks': 'tasks', + 'to_server_version': 'toServerVersion', + 'vc_should_ignore': 'vcShouldIgnore', + 'version': 'version', + 'view': 'view' + } + + def __init__(self, brands=None, commands=None, comment=None, commit_message=None, dbot_created_by=None, detached=None, from_server_version=None, has_role=None, hidden=None, id=None, inputs=None, item_version=None, locked=None, missing_scripts_ids=None, modified=None, name=None, name_raw=None, outputs=None, pack_id=None, prev_name=None, previous_roles=None, primary_term=None, private=None, propagation_labels=None, quiet=None, roles=None, script_ids=None, sequence_number=None, should_commit=None, sort_values=None, source_playbook_id=None, start_task_id=None, system=None, tags=None, task_ids=None, tasks=None, to_server_version=None, vc_should_ignore=None, version=None, view=None): # noqa: E501 + """Playbook - a model defined in Swagger""" # noqa: E501 + + self._brands = None + self._commands = None + self._comment = None + self._commit_message = None + self._dbot_created_by = None + self._detached = None + self._from_server_version = None + self._has_role = None + self._hidden = None + self._id = None + self._inputs = None + self._item_version = None + self._locked = None + self._missing_scripts_ids = None + self._modified = None + self._name = None + self._name_raw = None + self._outputs = None + self._pack_id = None + self._prev_name = None + self._previous_roles = None + self._primary_term = None + self._private = None + self._propagation_labels = None + self._quiet = None + self._roles = None + self._script_ids = None + self._sequence_number = None + self._should_commit = None + self._sort_values = None + self._source_playbook_id = None + self._start_task_id = None + self._system = None + self._tags = None + self._task_ids = None + self._tasks = None + self._to_server_version = None + self._vc_should_ignore = None + self._version = None + self._view = None + self.discriminator = None + + if brands is not None: + self.brands = brands + if commands is not None: + self.commands = commands + if comment is not None: + self.comment = comment + if commit_message is not None: + self.commit_message = commit_message + if dbot_created_by is not None: + self.dbot_created_by = dbot_created_by + if detached is not None: + self.detached = detached + if from_server_version is not None: + self.from_server_version = from_server_version + if has_role is not None: + self.has_role = has_role + if hidden is not None: + self.hidden = hidden + if id is not None: + self.id = id + if inputs is not None: + self.inputs = inputs + if item_version is not None: + self.item_version = item_version + if locked is not None: + self.locked = locked + if missing_scripts_ids is not None: + self.missing_scripts_ids = missing_scripts_ids + if modified is not None: + self.modified = modified + if name is not None: + self.name = name + if name_raw is not None: + self.name_raw = name_raw + if outputs is not None: + self.outputs = outputs + if pack_id is not None: + self.pack_id = pack_id + if prev_name is not None: + self.prev_name = prev_name + if previous_roles is not None: + self.previous_roles = previous_roles + if primary_term is not None: + self.primary_term = primary_term + if private is not None: + self.private = private + if propagation_labels is not None: + self.propagation_labels = propagation_labels + if quiet is not None: + self.quiet = quiet + if roles is not None: + self.roles = roles + if script_ids is not None: + self.script_ids = script_ids + if sequence_number is not None: + self.sequence_number = sequence_number + if should_commit is not None: + self.should_commit = should_commit + if sort_values is not None: + self.sort_values = sort_values + if source_playbook_id is not None: + self.source_playbook_id = source_playbook_id + if start_task_id is not None: + self.start_task_id = start_task_id + if system is not None: + self.system = system + if tags is not None: + self.tags = tags + if task_ids is not None: + self.task_ids = task_ids + if tasks is not None: + self.tasks = tasks + if to_server_version is not None: + self.to_server_version = to_server_version + if vc_should_ignore is not None: + self.vc_should_ignore = vc_should_ignore + if version is not None: + self.version = version + if view is not None: + self.view = view + + @property + def brands(self): + """Gets the brands of this Playbook. # noqa: E501 + + + :return: The brands of this Playbook. # noqa: E501 + :rtype: list[str] + """ + return self._brands + + @brands.setter + def brands(self, brands): + """Sets the brands of this Playbook. + + + :param brands: The brands of this Playbook. # noqa: E501 + :type: list[str] + """ + + self._brands = brands + + @property + def commands(self): + """Gets the commands of this Playbook. # noqa: E501 + + + :return: The commands of this Playbook. # noqa: E501 + :rtype: list[str] + """ + return self._commands + + @commands.setter + def commands(self, commands): + """Sets the commands of this Playbook. + + + :param commands: The commands of this Playbook. # noqa: E501 + :type: list[str] + """ + + self._commands = commands + + @property + def comment(self): + """Gets the comment of this Playbook. # noqa: E501 + + + :return: The comment of this Playbook. # noqa: E501 + :rtype: str + """ + return self._comment + + @comment.setter + def comment(self, comment): + """Sets the comment of this Playbook. + + + :param comment: The comment of this Playbook. # noqa: E501 + :type: str + """ + + self._comment = comment + + @property + def commit_message(self): + """Gets the commit_message of this Playbook. # noqa: E501 + + + :return: The commit_message of this Playbook. # noqa: E501 + :rtype: str + """ + return self._commit_message + + @commit_message.setter + def commit_message(self, commit_message): + """Sets the commit_message of this Playbook. + + + :param commit_message: The commit_message of this Playbook. # noqa: E501 + :type: str + """ + + self._commit_message = commit_message + + @property + def dbot_created_by(self): + """Gets the dbot_created_by of this Playbook. # noqa: E501 + + Who has created this event - relevant only for manual incidents # noqa: E501 + + :return: The dbot_created_by of this Playbook. # noqa: E501 + :rtype: str + """ + return self._dbot_created_by + + @dbot_created_by.setter + def dbot_created_by(self, dbot_created_by): + """Sets the dbot_created_by of this Playbook. + + Who has created this event - relevant only for manual incidents # noqa: E501 + + :param dbot_created_by: The dbot_created_by of this Playbook. # noqa: E501 + :type: str + """ + + self._dbot_created_by = dbot_created_by + + @property + def detached(self): + """Gets the detached of this Playbook. # noqa: E501 + + + :return: The detached of this Playbook. # noqa: E501 + :rtype: bool + """ + return self._detached + + @detached.setter + def detached(self, detached): + """Sets the detached of this Playbook. + + + :param detached: The detached of this Playbook. # noqa: E501 + :type: bool + """ + + self._detached = detached + + @property + def from_server_version(self): + """Gets the from_server_version of this Playbook. # noqa: E501 + + + :return: The from_server_version of this Playbook. # noqa: E501 + :rtype: Version + """ + return self._from_server_version + + @from_server_version.setter + def from_server_version(self, from_server_version): + """Sets the from_server_version of this Playbook. + + + :param from_server_version: The from_server_version of this Playbook. # noqa: E501 + :type: Version + """ + + self._from_server_version = from_server_version + + @property + def has_role(self): + """Gets the has_role of this Playbook. # noqa: E501 + + Internal field to make queries on role faster # noqa: E501 + + :return: The has_role of this Playbook. # noqa: E501 + :rtype: bool + """ + return self._has_role + + @has_role.setter + def has_role(self, has_role): + """Sets the has_role of this Playbook. + + Internal field to make queries on role faster # noqa: E501 + + :param has_role: The has_role of this Playbook. # noqa: E501 + :type: bool + """ + + self._has_role = has_role + + @property + def hidden(self): + """Gets the hidden of this Playbook. # noqa: E501 + + + :return: The hidden of this Playbook. # noqa: E501 + :rtype: bool + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this Playbook. + + + :param hidden: The hidden of this Playbook. # noqa: E501 + :type: bool + """ + + self._hidden = hidden + + @property + def id(self): + """Gets the id of this Playbook. # noqa: E501 + + + :return: The id of this Playbook. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Playbook. + + + :param id: The id of this Playbook. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def inputs(self): + """Gets the inputs of this Playbook. # noqa: E501 + + + :return: The inputs of this Playbook. # noqa: E501 + :rtype: PlaybookInputs + """ + return self._inputs + + @inputs.setter + def inputs(self, inputs): + """Sets the inputs of this Playbook. + + + :param inputs: The inputs of this Playbook. # noqa: E501 + :type: PlaybookInputs + """ + + self._inputs = inputs + + @property + def item_version(self): + """Gets the item_version of this Playbook. # noqa: E501 + + + :return: The item_version of this Playbook. # noqa: E501 + :rtype: Version + """ + return self._item_version + + @item_version.setter + def item_version(self, item_version): + """Sets the item_version of this Playbook. + + + :param item_version: The item_version of this Playbook. # noqa: E501 + :type: Version + """ + + self._item_version = item_version + + @property + def locked(self): + """Gets the locked of this Playbook. # noqa: E501 + + + :return: The locked of this Playbook. # noqa: E501 + :rtype: bool + """ + return self._locked + + @locked.setter + def locked(self, locked): + """Sets the locked of this Playbook. + + + :param locked: The locked of this Playbook. # noqa: E501 + :type: bool + """ + + self._locked = locked + + @property + def missing_scripts_ids(self): + """Gets the missing_scripts_ids of this Playbook. # noqa: E501 + + + :return: The missing_scripts_ids of this Playbook. # noqa: E501 + :rtype: list[str] + """ + return self._missing_scripts_ids + + @missing_scripts_ids.setter + def missing_scripts_ids(self, missing_scripts_ids): + """Sets the missing_scripts_ids of this Playbook. + + + :param missing_scripts_ids: The missing_scripts_ids of this Playbook. # noqa: E501 + :type: list[str] + """ + + self._missing_scripts_ids = missing_scripts_ids + + @property + def modified(self): + """Gets the modified of this Playbook. # noqa: E501 + + + :return: The modified of this Playbook. # noqa: E501 + :rtype: datetime + """ + return self._modified + + @modified.setter + def modified(self, modified): + """Sets the modified of this Playbook. + + + :param modified: The modified of this Playbook. # noqa: E501 + :type: datetime + """ + + self._modified = modified + + @property + def name(self): + """Gets the name of this Playbook. # noqa: E501 + + + :return: The name of this Playbook. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Playbook. + + + :param name: The name of this Playbook. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def name_raw(self): + """Gets the name_raw of this Playbook. # noqa: E501 + + + :return: The name_raw of this Playbook. # noqa: E501 + :rtype: str + """ + return self._name_raw + + @name_raw.setter + def name_raw(self, name_raw): + """Sets the name_raw of this Playbook. + + + :param name_raw: The name_raw of this Playbook. # noqa: E501 + :type: str + """ + + self._name_raw = name_raw + + @property + def outputs(self): + """Gets the outputs of this Playbook. # noqa: E501 + + + :return: The outputs of this Playbook. # noqa: E501 + :rtype: PlaybookOutputs + """ + return self._outputs + + @outputs.setter + def outputs(self, outputs): + """Sets the outputs of this Playbook. + + + :param outputs: The outputs of this Playbook. # noqa: E501 + :type: PlaybookOutputs + """ + + self._outputs = outputs + + @property + def pack_id(self): + """Gets the pack_id of this Playbook. # noqa: E501 + + + :return: The pack_id of this Playbook. # noqa: E501 + :rtype: str + """ + return self._pack_id + + @pack_id.setter + def pack_id(self, pack_id): + """Sets the pack_id of this Playbook. + + + :param pack_id: The pack_id of this Playbook. # noqa: E501 + :type: str + """ + + self._pack_id = pack_id + + @property + def prev_name(self): + """Gets the prev_name of this Playbook. # noqa: E501 + + + :return: The prev_name of this Playbook. # noqa: E501 + :rtype: str + """ + return self._prev_name + + @prev_name.setter + def prev_name(self, prev_name): + """Sets the prev_name of this Playbook. + + + :param prev_name: The prev_name of this Playbook. # noqa: E501 + :type: str + """ + + self._prev_name = prev_name + + @property + def previous_roles(self): + """Gets the previous_roles of this Playbook. # noqa: E501 + + PreviousRoleName - do not change this field manually # noqa: E501 + + :return: The previous_roles of this Playbook. # noqa: E501 + :rtype: list[str] + """ + return self._previous_roles + + @previous_roles.setter + def previous_roles(self, previous_roles): + """Sets the previous_roles of this Playbook. + + PreviousRoleName - do not change this field manually # noqa: E501 + + :param previous_roles: The previous_roles of this Playbook. # noqa: E501 + :type: list[str] + """ + + self._previous_roles = previous_roles + + @property + def primary_term(self): + """Gets the primary_term of this Playbook. # noqa: E501 + + + :return: The primary_term of this Playbook. # noqa: E501 + :rtype: int + """ + return self._primary_term + + @primary_term.setter + def primary_term(self, primary_term): + """Sets the primary_term of this Playbook. + + + :param primary_term: The primary_term of this Playbook. # noqa: E501 + :type: int + """ + + self._primary_term = primary_term + + @property + def private(self): + """Gets the private of this Playbook. # noqa: E501 + + + :return: The private of this Playbook. # noqa: E501 + :rtype: bool + """ + return self._private + + @private.setter + def private(self, private): + """Sets the private of this Playbook. + + + :param private: The private of this Playbook. # noqa: E501 + :type: bool + """ + + self._private = private + + @property + def propagation_labels(self): + """Gets the propagation_labels of this Playbook. # noqa: E501 + + + :return: The propagation_labels of this Playbook. # noqa: E501 + :rtype: list[str] + """ + return self._propagation_labels + + @propagation_labels.setter + def propagation_labels(self, propagation_labels): + """Sets the propagation_labels of this Playbook. + + + :param propagation_labels: The propagation_labels of this Playbook. # noqa: E501 + :type: list[str] + """ + + self._propagation_labels = propagation_labels + + @property + def quiet(self): + """Gets the quiet of this Playbook. # noqa: E501 + + + :return: The quiet of this Playbook. # noqa: E501 + :rtype: bool + """ + return self._quiet + + @quiet.setter + def quiet(self, quiet): + """Sets the quiet of this Playbook. + + + :param quiet: The quiet of this Playbook. # noqa: E501 + :type: bool + """ + + self._quiet = quiet + + @property + def roles(self): + """Gets the roles of this Playbook. # noqa: E501 + + The role assigned to this investigation # noqa: E501 + + :return: The roles of this Playbook. # noqa: E501 + :rtype: list[str] + """ + return self._roles + + @roles.setter + def roles(self, roles): + """Sets the roles of this Playbook. + + The role assigned to this investigation # noqa: E501 + + :param roles: The roles of this Playbook. # noqa: E501 + :type: list[str] + """ + + self._roles = roles + + @property + def script_ids(self): + """Gets the script_ids of this Playbook. # noqa: E501 + + + :return: The script_ids of this Playbook. # noqa: E501 + :rtype: list[str] + """ + return self._script_ids + + @script_ids.setter + def script_ids(self, script_ids): + """Sets the script_ids of this Playbook. + + + :param script_ids: The script_ids of this Playbook. # noqa: E501 + :type: list[str] + """ + + self._script_ids = script_ids + + @property + def sequence_number(self): + """Gets the sequence_number of this Playbook. # noqa: E501 + + + :return: The sequence_number of this Playbook. # noqa: E501 + :rtype: int + """ + return self._sequence_number + + @sequence_number.setter + def sequence_number(self, sequence_number): + """Sets the sequence_number of this Playbook. + + + :param sequence_number: The sequence_number of this Playbook. # noqa: E501 + :type: int + """ + + self._sequence_number = sequence_number + + @property + def should_commit(self): + """Gets the should_commit of this Playbook. # noqa: E501 + + + :return: The should_commit of this Playbook. # noqa: E501 + :rtype: bool + """ + return self._should_commit + + @should_commit.setter + def should_commit(self, should_commit): + """Sets the should_commit of this Playbook. + + + :param should_commit: The should_commit of this Playbook. # noqa: E501 + :type: bool + """ + + self._should_commit = should_commit + + @property + def sort_values(self): + """Gets the sort_values of this Playbook. # noqa: E501 + + + :return: The sort_values of this Playbook. # noqa: E501 + :rtype: list[str] + """ + return self._sort_values + + @sort_values.setter + def sort_values(self, sort_values): + """Sets the sort_values of this Playbook. + + + :param sort_values: The sort_values of this Playbook. # noqa: E501 + :type: list[str] + """ + + self._sort_values = sort_values + + @property + def source_playbook_id(self): + """Gets the source_playbook_id of this Playbook. # noqa: E501 + + + :return: The source_playbook_id of this Playbook. # noqa: E501 + :rtype: str + """ + return self._source_playbook_id + + @source_playbook_id.setter + def source_playbook_id(self, source_playbook_id): + """Sets the source_playbook_id of this Playbook. + + + :param source_playbook_id: The source_playbook_id of this Playbook. # noqa: E501 + :type: str + """ + + self._source_playbook_id = source_playbook_id + + @property + def start_task_id(self): + """Gets the start_task_id of this Playbook. # noqa: E501 + + + :return: The start_task_id of this Playbook. # noqa: E501 + :rtype: str + """ + return self._start_task_id + + @start_task_id.setter + def start_task_id(self, start_task_id): + """Sets the start_task_id of this Playbook. + + + :param start_task_id: The start_task_id of this Playbook. # noqa: E501 + :type: str + """ + + self._start_task_id = start_task_id + + @property + def system(self): + """Gets the system of this Playbook. # noqa: E501 + + + :return: The system of this Playbook. # noqa: E501 + :rtype: bool + """ + return self._system + + @system.setter + def system(self, system): + """Sets the system of this Playbook. + + + :param system: The system of this Playbook. # noqa: E501 + :type: bool + """ + + self._system = system + + @property + def tags(self): + """Gets the tags of this Playbook. # noqa: E501 + + + :return: The tags of this Playbook. # noqa: E501 + :rtype: list[str] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this Playbook. + + + :param tags: The tags of this Playbook. # noqa: E501 + :type: list[str] + """ + + self._tags = tags + + @property + def task_ids(self): + """Gets the task_ids of this Playbook. # noqa: E501 + + auto generated field that will contain all task ids in this playbook Needed for searching with bleve # noqa: E501 + + :return: The task_ids of this Playbook. # noqa: E501 + :rtype: list[str] + """ + return self._task_ids + + @task_ids.setter + def task_ids(self, task_ids): + """Sets the task_ids of this Playbook. + + auto generated field that will contain all task ids in this playbook Needed for searching with bleve # noqa: E501 + + :param task_ids: The task_ids of this Playbook. # noqa: E501 + :type: list[str] + """ + + self._task_ids = task_ids + + @property + def tasks(self): + """Gets the tasks of this Playbook. # noqa: E501 + + + :return: The tasks of this Playbook. # noqa: E501 + :rtype: dict(str, PlaybookTask) + """ + return self._tasks + + @tasks.setter + def tasks(self, tasks): + """Sets the tasks of this Playbook. + + + :param tasks: The tasks of this Playbook. # noqa: E501 + :type: dict(str, PlaybookTask) + """ + + self._tasks = tasks + + @property + def to_server_version(self): + """Gets the to_server_version of this Playbook. # noqa: E501 + + + :return: The to_server_version of this Playbook. # noqa: E501 + :rtype: Version + """ + return self._to_server_version + + @to_server_version.setter + def to_server_version(self, to_server_version): + """Sets the to_server_version of this Playbook. + + + :param to_server_version: The to_server_version of this Playbook. # noqa: E501 + :type: Version + """ + + self._to_server_version = to_server_version + + @property + def vc_should_ignore(self): + """Gets the vc_should_ignore of this Playbook. # noqa: E501 + + + :return: The vc_should_ignore of this Playbook. # noqa: E501 + :rtype: bool + """ + return self._vc_should_ignore + + @vc_should_ignore.setter + def vc_should_ignore(self, vc_should_ignore): + """Sets the vc_should_ignore of this Playbook. + + + :param vc_should_ignore: The vc_should_ignore of this Playbook. # noqa: E501 + :type: bool + """ + + self._vc_should_ignore = vc_should_ignore + + @property + def version(self): + """Gets the version of this Playbook. # noqa: E501 + + + :return: The version of this Playbook. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this Playbook. + + + :param version: The version of this Playbook. # noqa: E501 + :type: int + """ + + self._version = version + + @property + def view(self): + """Gets the view of this Playbook. # noqa: E501 + + + :return: The view of this Playbook. # noqa: E501 + :rtype: PlaybookView + """ + return self._view + + @view.setter + def view(self, view): + """Sets the view of this Playbook. + + + :param view: The view of this Playbook. # noqa: E501 + :type: PlaybookView + """ + + self._view = view + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Playbook, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Playbook): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/playbook_task.py b/demisto_client/demisto_api/models/playbook_task.py new file mode 100644 index 0000000..fbd2908 --- /dev/null +++ b/demisto_client/demisto_api/models/playbook_task.py @@ -0,0 +1,841 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from demisto_client.demisto_api.models.advance_arg import AdvanceArg # noqa: F401,E501 +from demisto_client.demisto_api.models.data_collection_form import DataCollectionForm # noqa: F401,E501 +from demisto_client.demisto_api.models.evidence_data import EvidenceData # noqa: F401,E501 +from demisto_client.demisto_api.models.field_mapping import FieldMapping # noqa: F401,E501 +from demisto_client.demisto_api.models.form_display import FormDisplay # noqa: F401,E501 +from demisto_client.demisto_api.models.notifiable_item import NotifiableItem # noqa: F401,E501 +from demisto_client.demisto_api.models.quiet_mode import QuietMode # noqa: F401,E501 +from demisto_client.demisto_api.models.reputation_calc_alg import ReputationCalcAlg # noqa: F401,E501 +from demisto_client.demisto_api.models.sla import SLA # noqa: F401,E501 +from demisto_client.demisto_api.models.task import Task # noqa: F401,E501 +from demisto_client.demisto_api.models.task_condition import TaskCondition # noqa: F401,E501 +from demisto_client.demisto_api.models.task_loop import TaskLoop # noqa: F401,E501 +from demisto_client.demisto_api.models.task_type import TaskType # noqa: F401,E501 +from demisto_client.demisto_api.models.task_view import TaskView # noqa: F401,E501 +from demisto_client.demisto_api.models.timer_trigger import TimerTrigger # noqa: F401,E501 + + +class PlaybookTask(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'conditions': 'list[TaskCondition]', + 'continue_on_error': 'bool', + 'default_assignee': 'str', + 'default_assignee_complex': 'AdvanceArg', + 'default_reminder': 'int', + 'evidence_data': 'EvidenceData', + 'field_mapping': 'list[FieldMapping]', + 'form': 'DataCollectionForm', + 'form_display': 'FormDisplay', + 'id': 'str', + 'ignore_worker': 'bool', + 'loop': 'TaskLoop', + 'message': 'NotifiableItem', + 'next_tasks': 'dict(str, list[str])', + 'note': 'bool', + 'quiet_mode': 'QuietMode', + 'reputation_calc': 'ReputationCalcAlg', + 'restricted_completion': 'bool', + 'script_arguments': 'dict(str, AdvanceArg)', + 'separate_context': 'bool', + 'skip_unavailable': 'bool', + 'sla': 'SLA', + 'sla_reminder': 'SLA', + 'task': 'Task', + 'task_id': 'str', + 'timer_triggers': 'list[TimerTrigger]', + 'type': 'TaskType', + 'view': 'TaskView' + } + + attribute_map = { + 'conditions': 'conditions', + 'continue_on_error': 'continueOnError', + 'default_assignee': 'defaultAssignee', + 'default_assignee_complex': 'defaultAssigneeComplex', + 'default_reminder': 'defaultReminder', + 'evidence_data': 'evidenceData', + 'field_mapping': 'fieldMapping', + 'form': 'form', + 'form_display': 'formDisplay', + 'id': 'id', + 'ignore_worker': 'ignoreWorker', + 'loop': 'loop', + 'message': 'message', + 'next_tasks': 'nextTasks', + 'note': 'note', + 'quiet_mode': 'quietMode', + 'reputation_calc': 'reputationCalc', + 'restricted_completion': 'restrictedCompletion', + 'script_arguments': 'scriptArguments', + 'separate_context': 'separateContext', + 'skip_unavailable': 'skipUnavailable', + 'sla': 'sla', + 'sla_reminder': 'slaReminder', + 'task': 'task', + 'task_id': 'taskId', + 'timer_triggers': 'timerTriggers', + 'type': 'type', + 'view': 'view' + } + + def __init__(self, conditions=None, continue_on_error=None, default_assignee=None, default_assignee_complex=None, default_reminder=None, evidence_data=None, field_mapping=None, form=None, form_display=None, id=None, ignore_worker=None, loop=None, message=None, next_tasks=None, note=None, quiet_mode=None, reputation_calc=None, restricted_completion=None, script_arguments=None, separate_context=None, skip_unavailable=None, sla=None, sla_reminder=None, task=None, task_id=None, timer_triggers=None, type=None, view=None): # noqa: E501 + """PlaybookTask - a model defined in Swagger""" # noqa: E501 + + self._conditions = None + self._continue_on_error = None + self._default_assignee = None + self._default_assignee_complex = None + self._default_reminder = None + self._evidence_data = None + self._field_mapping = None + self._form = None + self._form_display = None + self._id = None + self._ignore_worker = None + self._loop = None + self._message = None + self._next_tasks = None + self._note = None + self._quiet_mode = None + self._reputation_calc = None + self._restricted_completion = None + self._script_arguments = None + self._separate_context = None + self._skip_unavailable = None + self._sla = None + self._sla_reminder = None + self._task = None + self._task_id = None + self._timer_triggers = None + self._type = None + self._view = None + self.discriminator = None + + if conditions is not None: + self.conditions = conditions + if continue_on_error is not None: + self.continue_on_error = continue_on_error + if default_assignee is not None: + self.default_assignee = default_assignee + if default_assignee_complex is not None: + self.default_assignee_complex = default_assignee_complex + if default_reminder is not None: + self.default_reminder = default_reminder + if evidence_data is not None: + self.evidence_data = evidence_data + if field_mapping is not None: + self.field_mapping = field_mapping + if form is not None: + self.form = form + if form_display is not None: + self.form_display = form_display + if id is not None: + self.id = id + if ignore_worker is not None: + self.ignore_worker = ignore_worker + if loop is not None: + self.loop = loop + if message is not None: + self.message = message + if next_tasks is not None: + self.next_tasks = next_tasks + if note is not None: + self.note = note + if quiet_mode is not None: + self.quiet_mode = quiet_mode + if reputation_calc is not None: + self.reputation_calc = reputation_calc + if restricted_completion is not None: + self.restricted_completion = restricted_completion + if script_arguments is not None: + self.script_arguments = script_arguments + if separate_context is not None: + self.separate_context = separate_context + if skip_unavailable is not None: + self.skip_unavailable = skip_unavailable + if sla is not None: + self.sla = sla + if sla_reminder is not None: + self.sla_reminder = sla_reminder + if task is not None: + self.task = task + if task_id is not None: + self.task_id = task_id + if timer_triggers is not None: + self.timer_triggers = timer_triggers + if type is not None: + self.type = type + if view is not None: + self.view = view + + @property + def conditions(self): + """Gets the conditions of this PlaybookTask. # noqa: E501 + + Conditions - optional list of conditions to run when task is conditional. we check conditions by their order (e.i. - considering the first one that satisfied) # noqa: E501 + + :return: The conditions of this PlaybookTask. # noqa: E501 + :rtype: list[TaskCondition] + """ + return self._conditions + + @conditions.setter + def conditions(self, conditions): + """Sets the conditions of this PlaybookTask. + + Conditions - optional list of conditions to run when task is conditional. we check conditions by their order (e.i. - considering the first one that satisfied) # noqa: E501 + + :param conditions: The conditions of this PlaybookTask. # noqa: E501 + :type: list[TaskCondition] + """ + + self._conditions = conditions + + @property + def continue_on_error(self): + """Gets the continue_on_error of this PlaybookTask. # noqa: E501 + + + :return: The continue_on_error of this PlaybookTask. # noqa: E501 + :rtype: bool + """ + return self._continue_on_error + + @continue_on_error.setter + def continue_on_error(self, continue_on_error): + """Sets the continue_on_error of this PlaybookTask. + + + :param continue_on_error: The continue_on_error of this PlaybookTask. # noqa: E501 + :type: bool + """ + + self._continue_on_error = continue_on_error + + @property + def default_assignee(self): + """Gets the default_assignee of this PlaybookTask. # noqa: E501 + + + :return: The default_assignee of this PlaybookTask. # noqa: E501 + :rtype: str + """ + return self._default_assignee + + @default_assignee.setter + def default_assignee(self, default_assignee): + """Sets the default_assignee of this PlaybookTask. + + + :param default_assignee: The default_assignee of this PlaybookTask. # noqa: E501 + :type: str + """ + + self._default_assignee = default_assignee + + @property + def default_assignee_complex(self): + """Gets the default_assignee_complex of this PlaybookTask. # noqa: E501 + + + :return: The default_assignee_complex of this PlaybookTask. # noqa: E501 + :rtype: AdvanceArg + """ + return self._default_assignee_complex + + @default_assignee_complex.setter + def default_assignee_complex(self, default_assignee_complex): + """Sets the default_assignee_complex of this PlaybookTask. + + + :param default_assignee_complex: The default_assignee_complex of this PlaybookTask. # noqa: E501 + :type: AdvanceArg + """ + + self._default_assignee_complex = default_assignee_complex + + @property + def default_reminder(self): + """Gets the default_reminder of this PlaybookTask. # noqa: E501 + + + :return: The default_reminder of this PlaybookTask. # noqa: E501 + :rtype: int + """ + return self._default_reminder + + @default_reminder.setter + def default_reminder(self, default_reminder): + """Sets the default_reminder of this PlaybookTask. + + + :param default_reminder: The default_reminder of this PlaybookTask. # noqa: E501 + :type: int + """ + + self._default_reminder = default_reminder + + @property + def evidence_data(self): + """Gets the evidence_data of this PlaybookTask. # noqa: E501 + + + :return: The evidence_data of this PlaybookTask. # noqa: E501 + :rtype: EvidenceData + """ + return self._evidence_data + + @evidence_data.setter + def evidence_data(self, evidence_data): + """Sets the evidence_data of this PlaybookTask. + + + :param evidence_data: The evidence_data of this PlaybookTask. # noqa: E501 + :type: EvidenceData + """ + + self._evidence_data = evidence_data + + @property + def field_mapping(self): + """Gets the field_mapping of this PlaybookTask. # noqa: E501 + + + :return: The field_mapping of this PlaybookTask. # noqa: E501 + :rtype: list[FieldMapping] + """ + return self._field_mapping + + @field_mapping.setter + def field_mapping(self, field_mapping): + """Sets the field_mapping of this PlaybookTask. + + + :param field_mapping: The field_mapping of this PlaybookTask. # noqa: E501 + :type: list[FieldMapping] + """ + + self._field_mapping = field_mapping + + @property + def form(self): + """Gets the form of this PlaybookTask. # noqa: E501 + + + :return: The form of this PlaybookTask. # noqa: E501 + :rtype: DataCollectionForm + """ + return self._form + + @form.setter + def form(self, form): + """Sets the form of this PlaybookTask. + + + :param form: The form of this PlaybookTask. # noqa: E501 + :type: DataCollectionForm + """ + + self._form = form + + @property + def form_display(self): + """Gets the form_display of this PlaybookTask. # noqa: E501 + + + :return: The form_display of this PlaybookTask. # noqa: E501 + :rtype: FormDisplay + """ + return self._form_display + + @form_display.setter + def form_display(self, form_display): + """Sets the form_display of this PlaybookTask. + + + :param form_display: The form_display of this PlaybookTask. # noqa: E501 + :type: FormDisplay + """ + + self._form_display = form_display + + @property + def id(self): + """Gets the id of this PlaybookTask. # noqa: E501 + + + :return: The id of this PlaybookTask. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this PlaybookTask. + + + :param id: The id of this PlaybookTask. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def ignore_worker(self): + """Gets the ignore_worker of this PlaybookTask. # noqa: E501 + + Do not run this task in a worker # noqa: E501 + + :return: The ignore_worker of this PlaybookTask. # noqa: E501 + :rtype: bool + """ + return self._ignore_worker + + @ignore_worker.setter + def ignore_worker(self, ignore_worker): + """Sets the ignore_worker of this PlaybookTask. + + Do not run this task in a worker # noqa: E501 + + :param ignore_worker: The ignore_worker of this PlaybookTask. # noqa: E501 + :type: bool + """ + + self._ignore_worker = ignore_worker + + @property + def loop(self): + """Gets the loop of this PlaybookTask. # noqa: E501 + + + :return: The loop of this PlaybookTask. # noqa: E501 + :rtype: TaskLoop + """ + return self._loop + + @loop.setter + def loop(self, loop): + """Sets the loop of this PlaybookTask. + + + :param loop: The loop of this PlaybookTask. # noqa: E501 + :type: TaskLoop + """ + + self._loop = loop + + @property + def message(self): + """Gets the message of this PlaybookTask. # noqa: E501 + + + :return: The message of this PlaybookTask. # noqa: E501 + :rtype: NotifiableItem + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this PlaybookTask. + + + :param message: The message of this PlaybookTask. # noqa: E501 + :type: NotifiableItem + """ + + self._message = message + + @property + def next_tasks(self): + """Gets the next_tasks of this PlaybookTask. # noqa: E501 + + + :return: The next_tasks of this PlaybookTask. # noqa: E501 + :rtype: dict(str, list[str]) + """ + return self._next_tasks + + @next_tasks.setter + def next_tasks(self, next_tasks): + """Sets the next_tasks of this PlaybookTask. + + + :param next_tasks: The next_tasks of this PlaybookTask. # noqa: E501 + :type: dict(str, list[str]) + """ + + self._next_tasks = next_tasks + + @property + def note(self): + """Gets the note of this PlaybookTask. # noqa: E501 + + + :return: The note of this PlaybookTask. # noqa: E501 + :rtype: bool + """ + return self._note + + @note.setter + def note(self, note): + """Sets the note of this PlaybookTask. + + + :param note: The note of this PlaybookTask. # noqa: E501 + :type: bool + """ + + self._note = note + + @property + def quiet_mode(self): + """Gets the quiet_mode of this PlaybookTask. # noqa: E501 + + + :return: The quiet_mode of this PlaybookTask. # noqa: E501 + :rtype: QuietMode + """ + return self._quiet_mode + + @quiet_mode.setter + def quiet_mode(self, quiet_mode): + """Sets the quiet_mode of this PlaybookTask. + + + :param quiet_mode: The quiet_mode of this PlaybookTask. # noqa: E501 + :type: QuietMode + """ + + self._quiet_mode = quiet_mode + + @property + def reputation_calc(self): + """Gets the reputation_calc of this PlaybookTask. # noqa: E501 + + + :return: The reputation_calc of this PlaybookTask. # noqa: E501 + :rtype: ReputationCalcAlg + """ + return self._reputation_calc + + @reputation_calc.setter + def reputation_calc(self, reputation_calc): + """Sets the reputation_calc of this PlaybookTask. + + + :param reputation_calc: The reputation_calc of this PlaybookTask. # noqa: E501 + :type: ReputationCalcAlg + """ + + self._reputation_calc = reputation_calc + + @property + def restricted_completion(self): + """Gets the restricted_completion of this PlaybookTask. # noqa: E501 + + + :return: The restricted_completion of this PlaybookTask. # noqa: E501 + :rtype: bool + """ + return self._restricted_completion + + @restricted_completion.setter + def restricted_completion(self, restricted_completion): + """Sets the restricted_completion of this PlaybookTask. + + + :param restricted_completion: The restricted_completion of this PlaybookTask. # noqa: E501 + :type: bool + """ + + self._restricted_completion = restricted_completion + + @property + def script_arguments(self): + """Gets the script_arguments of this PlaybookTask. # noqa: E501 + + + :return: The script_arguments of this PlaybookTask. # noqa: E501 + :rtype: dict(str, AdvanceArg) + """ + return self._script_arguments + + @script_arguments.setter + def script_arguments(self, script_arguments): + """Sets the script_arguments of this PlaybookTask. + + + :param script_arguments: The script_arguments of this PlaybookTask. # noqa: E501 + :type: dict(str, AdvanceArg) + """ + + self._script_arguments = script_arguments + + @property + def separate_context(self): + """Gets the separate_context of this PlaybookTask. # noqa: E501 + + + :return: The separate_context of this PlaybookTask. # noqa: E501 + :rtype: bool + """ + return self._separate_context + + @separate_context.setter + def separate_context(self, separate_context): + """Sets the separate_context of this PlaybookTask. + + + :param separate_context: The separate_context of this PlaybookTask. # noqa: E501 + :type: bool + """ + + self._separate_context = separate_context + + @property + def skip_unavailable(self): + """Gets the skip_unavailable of this PlaybookTask. # noqa: E501 + + SkipUnavailable if true then will check if automation exists, integration of that command is installed and active or sub playbook exists in Demisto # noqa: E501 + + :return: The skip_unavailable of this PlaybookTask. # noqa: E501 + :rtype: bool + """ + return self._skip_unavailable + + @skip_unavailable.setter + def skip_unavailable(self, skip_unavailable): + """Sets the skip_unavailable of this PlaybookTask. + + SkipUnavailable if true then will check if automation exists, integration of that command is installed and active or sub playbook exists in Demisto # noqa: E501 + + :param skip_unavailable: The skip_unavailable of this PlaybookTask. # noqa: E501 + :type: bool + """ + + self._skip_unavailable = skip_unavailable + + @property + def sla(self): + """Gets the sla of this PlaybookTask. # noqa: E501 + + + :return: The sla of this PlaybookTask. # noqa: E501 + :rtype: SLA + """ + return self._sla + + @sla.setter + def sla(self, sla): + """Sets the sla of this PlaybookTask. + + + :param sla: The sla of this PlaybookTask. # noqa: E501 + :type: SLA + """ + + self._sla = sla + + @property + def sla_reminder(self): + """Gets the sla_reminder of this PlaybookTask. # noqa: E501 + + + :return: The sla_reminder of this PlaybookTask. # noqa: E501 + :rtype: SLA + """ + return self._sla_reminder + + @sla_reminder.setter + def sla_reminder(self, sla_reminder): + """Sets the sla_reminder of this PlaybookTask. + + + :param sla_reminder: The sla_reminder of this PlaybookTask. # noqa: E501 + :type: SLA + """ + + self._sla_reminder = sla_reminder + + @property + def task(self): + """Gets the task of this PlaybookTask. # noqa: E501 + + + :return: The task of this PlaybookTask. # noqa: E501 + :rtype: Task + """ + return self._task + + @task.setter + def task(self, task): + """Sets the task of this PlaybookTask. + + + :param task: The task of this PlaybookTask. # noqa: E501 + :type: Task + """ + + self._task = task + + @property + def task_id(self): + """Gets the task_id of this PlaybookTask. # noqa: E501 + + + :return: The task_id of this PlaybookTask. # noqa: E501 + :rtype: str + """ + return self._task_id + + @task_id.setter + def task_id(self, task_id): + """Sets the task_id of this PlaybookTask. + + + :param task_id: The task_id of this PlaybookTask. # noqa: E501 + :type: str + """ + + self._task_id = task_id + + @property + def timer_triggers(self): + """Gets the timer_triggers of this PlaybookTask. # noqa: E501 + + SLA fields # noqa: E501 + + :return: The timer_triggers of this PlaybookTask. # noqa: E501 + :rtype: list[TimerTrigger] + """ + return self._timer_triggers + + @timer_triggers.setter + def timer_triggers(self, timer_triggers): + """Sets the timer_triggers of this PlaybookTask. + + SLA fields # noqa: E501 + + :param timer_triggers: The timer_triggers of this PlaybookTask. # noqa: E501 + :type: list[TimerTrigger] + """ + + self._timer_triggers = timer_triggers + + @property + def type(self): + """Gets the type of this PlaybookTask. # noqa: E501 + + + :return: The type of this PlaybookTask. # noqa: E501 + :rtype: TaskType + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PlaybookTask. + + + :param type: The type of this PlaybookTask. # noqa: E501 + :type: TaskType + """ + + self._type = type + + @property + def view(self): + """Gets the view of this PlaybookTask. # noqa: E501 + + + :return: The view of this PlaybookTask. # noqa: E501 + :rtype: TaskView + """ + return self._view + + @view.setter + def view(self, view): + """Sets the view of this PlaybookTask. + + + :param view: The view of this PlaybookTask. # noqa: E501 + :type: TaskView + """ + + self._view = view + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PlaybookTask, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PlaybookTask): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/quiet_mode.py b/demisto_client/demisto_api/models/quiet_mode.py new file mode 100644 index 0000000..aaaa428 --- /dev/null +++ b/demisto_client/demisto_api/models/quiet_mode.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class QuietMode(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """QuietMode - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(QuietMode, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, QuietMode): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/reliability.py b/demisto_client/demisto_api/models/reliability.py new file mode 100644 index 0000000..901ac0d --- /dev/null +++ b/demisto_client/demisto_api/models/reliability.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Reliability(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """Reliability - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Reliability, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Reliability): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/script_api.py b/demisto_client/demisto_api/models/script_api.py new file mode 100644 index 0000000..4e4a415 --- /dev/null +++ b/demisto_client/demisto_api/models/script_api.py @@ -0,0 +1,718 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from demisto_client.demisto_api.models.argument import Argument # noqa: F401,E501 +from demisto_client.demisto_api.models.output import Output # noqa: F401,E501 +from demisto_client.demisto_api.models.script_target import ScriptTarget # noqa: F401,E501 +from demisto_client.demisto_api.models.script_type import ScriptType # noqa: F401,E501 + + +class ScriptAPI(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'arguments': 'list[Argument]', + 'comment': 'str', + 'context_keys': 'list[str]', + 'depends_on': 'dict(str, list[str])', + 'deprecated': 'bool', + 'detached': 'bool', + 'docker_image': 'str', + 'enabled': 'bool', + 'hidden': 'bool', + 'id': 'str', + 'locked': 'bool', + 'modified': 'datetime', + 'name': 'str', + 'outputs': 'list[Output]', + 'permitted': 'bool', + 'propagation_labels': 'list[str]', + 'roles': 'list[str]', + 'run_as': 'str', + 'script_target': 'ScriptTarget', + 'system': 'bool', + 'tags': 'list[str]', + 'type': 'ScriptType', + 'user': 'str', + 'version': 'int' + } + + attribute_map = { + 'arguments': 'arguments', + 'comment': 'comment', + 'context_keys': 'contextKeys', + 'depends_on': 'dependsOn', + 'deprecated': 'deprecated', + 'detached': 'detached', + 'docker_image': 'dockerImage', + 'enabled': 'enabled', + 'hidden': 'hidden', + 'id': 'id', + 'locked': 'locked', + 'modified': 'modified', + 'name': 'name', + 'outputs': 'outputs', + 'permitted': 'permitted', + 'propagation_labels': 'propagationLabels', + 'roles': 'roles', + 'run_as': 'runAs', + 'script_target': 'scriptTarget', + 'system': 'system', + 'tags': 'tags', + 'type': 'type', + 'user': 'user', + 'version': 'version' + } + + def __init__(self, arguments=None, comment=None, context_keys=None, depends_on=None, deprecated=None, detached=None, docker_image=None, enabled=None, hidden=None, id=None, locked=None, modified=None, name=None, outputs=None, permitted=None, propagation_labels=None, roles=None, run_as=None, script_target=None, system=None, tags=None, type=None, user=None, version=None): # noqa: E501 + """ScriptAPI - a model defined in Swagger""" # noqa: E501 + + self._arguments = None + self._comment = None + self._context_keys = None + self._depends_on = None + self._deprecated = None + self._detached = None + self._docker_image = None + self._enabled = None + self._hidden = None + self._id = None + self._locked = None + self._modified = None + self._name = None + self._outputs = None + self._permitted = None + self._propagation_labels = None + self._roles = None + self._run_as = None + self._script_target = None + self._system = None + self._tags = None + self._type = None + self._user = None + self._version = None + self.discriminator = None + + if arguments is not None: + self.arguments = arguments + if comment is not None: + self.comment = comment + if context_keys is not None: + self.context_keys = context_keys + if depends_on is not None: + self.depends_on = depends_on + if deprecated is not None: + self.deprecated = deprecated + if detached is not None: + self.detached = detached + if docker_image is not None: + self.docker_image = docker_image + if enabled is not None: + self.enabled = enabled + if hidden is not None: + self.hidden = hidden + if id is not None: + self.id = id + if locked is not None: + self.locked = locked + if modified is not None: + self.modified = modified + if name is not None: + self.name = name + if outputs is not None: + self.outputs = outputs + if permitted is not None: + self.permitted = permitted + if propagation_labels is not None: + self.propagation_labels = propagation_labels + if roles is not None: + self.roles = roles + if run_as is not None: + self.run_as = run_as + if script_target is not None: + self.script_target = script_target + if system is not None: + self.system = system + if tags is not None: + self.tags = tags + if type is not None: + self.type = type + if user is not None: + self.user = user + if version is not None: + self.version = version + + @property + def arguments(self): + """Gets the arguments of this ScriptAPI. # noqa: E501 + + + :return: The arguments of this ScriptAPI. # noqa: E501 + :rtype: list[Argument] + """ + return self._arguments + + @arguments.setter + def arguments(self, arguments): + """Sets the arguments of this ScriptAPI. + + + :param arguments: The arguments of this ScriptAPI. # noqa: E501 + :type: list[Argument] + """ + + self._arguments = arguments + + @property + def comment(self): + """Gets the comment of this ScriptAPI. # noqa: E501 + + + :return: The comment of this ScriptAPI. # noqa: E501 + :rtype: str + """ + return self._comment + + @comment.setter + def comment(self, comment): + """Sets the comment of this ScriptAPI. + + + :param comment: The comment of this ScriptAPI. # noqa: E501 + :type: str + """ + + self._comment = comment + + @property + def context_keys(self): + """Gets the context_keys of this ScriptAPI. # noqa: E501 + + + :return: The context_keys of this ScriptAPI. # noqa: E501 + :rtype: list[str] + """ + return self._context_keys + + @context_keys.setter + def context_keys(self, context_keys): + """Sets the context_keys of this ScriptAPI. + + + :param context_keys: The context_keys of this ScriptAPI. # noqa: E501 + :type: list[str] + """ + + self._context_keys = context_keys + + @property + def depends_on(self): + """Gets the depends_on of this ScriptAPI. # noqa: E501 + + + :return: The depends_on of this ScriptAPI. # noqa: E501 + :rtype: dict(str, list[str]) + """ + return self._depends_on + + @depends_on.setter + def depends_on(self, depends_on): + """Sets the depends_on of this ScriptAPI. + + + :param depends_on: The depends_on of this ScriptAPI. # noqa: E501 + :type: dict(str, list[str]) + """ + + self._depends_on = depends_on + + @property + def deprecated(self): + """Gets the deprecated of this ScriptAPI. # noqa: E501 + + + :return: The deprecated of this ScriptAPI. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this ScriptAPI. + + + :param deprecated: The deprecated of this ScriptAPI. # noqa: E501 + :type: bool + """ + + self._deprecated = deprecated + + @property + def detached(self): + """Gets the detached of this ScriptAPI. # noqa: E501 + + + :return: The detached of this ScriptAPI. # noqa: E501 + :rtype: bool + """ + return self._detached + + @detached.setter + def detached(self, detached): + """Sets the detached of this ScriptAPI. + + + :param detached: The detached of this ScriptAPI. # noqa: E501 + :type: bool + """ + + self._detached = detached + + @property + def docker_image(self): + """Gets the docker_image of this ScriptAPI. # noqa: E501 + + + :return: The docker_image of this ScriptAPI. # noqa: E501 + :rtype: str + """ + return self._docker_image + + @docker_image.setter + def docker_image(self, docker_image): + """Sets the docker_image of this ScriptAPI. + + + :param docker_image: The docker_image of this ScriptAPI. # noqa: E501 + :type: str + """ + + self._docker_image = docker_image + + @property + def enabled(self): + """Gets the enabled of this ScriptAPI. # noqa: E501 + + + :return: The enabled of this ScriptAPI. # noqa: E501 + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this ScriptAPI. + + + :param enabled: The enabled of this ScriptAPI. # noqa: E501 + :type: bool + """ + + self._enabled = enabled + + @property + def hidden(self): + """Gets the hidden of this ScriptAPI. # noqa: E501 + + + :return: The hidden of this ScriptAPI. # noqa: E501 + :rtype: bool + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this ScriptAPI. + + + :param hidden: The hidden of this ScriptAPI. # noqa: E501 + :type: bool + """ + + self._hidden = hidden + + @property + def id(self): + """Gets the id of this ScriptAPI. # noqa: E501 + + + :return: The id of this ScriptAPI. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ScriptAPI. + + + :param id: The id of this ScriptAPI. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def locked(self): + """Gets the locked of this ScriptAPI. # noqa: E501 + + + :return: The locked of this ScriptAPI. # noqa: E501 + :rtype: bool + """ + return self._locked + + @locked.setter + def locked(self, locked): + """Sets the locked of this ScriptAPI. + + + :param locked: The locked of this ScriptAPI. # noqa: E501 + :type: bool + """ + + self._locked = locked + + @property + def modified(self): + """Gets the modified of this ScriptAPI. # noqa: E501 + + + :return: The modified of this ScriptAPI. # noqa: E501 + :rtype: datetime + """ + return self._modified + + @modified.setter + def modified(self, modified): + """Sets the modified of this ScriptAPI. + + + :param modified: The modified of this ScriptAPI. # noqa: E501 + :type: datetime + """ + + self._modified = modified + + @property + def name(self): + """Gets the name of this ScriptAPI. # noqa: E501 + + + :return: The name of this ScriptAPI. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ScriptAPI. + + + :param name: The name of this ScriptAPI. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def outputs(self): + """Gets the outputs of this ScriptAPI. # noqa: E501 + + + :return: The outputs of this ScriptAPI. # noqa: E501 + :rtype: list[Output] + """ + return self._outputs + + @outputs.setter + def outputs(self, outputs): + """Sets the outputs of this ScriptAPI. + + + :param outputs: The outputs of this ScriptAPI. # noqa: E501 + :type: list[Output] + """ + + self._outputs = outputs + + @property + def permitted(self): + """Gets the permitted of this ScriptAPI. # noqa: E501 + + + :return: The permitted of this ScriptAPI. # noqa: E501 + :rtype: bool + """ + return self._permitted + + @permitted.setter + def permitted(self, permitted): + """Sets the permitted of this ScriptAPI. + + + :param permitted: The permitted of this ScriptAPI. # noqa: E501 + :type: bool + """ + + self._permitted = permitted + + @property + def propagation_labels(self): + """Gets the propagation_labels of this ScriptAPI. # noqa: E501 + + + :return: The propagation_labels of this ScriptAPI. # noqa: E501 + :rtype: list[str] + """ + return self._propagation_labels + + @propagation_labels.setter + def propagation_labels(self, propagation_labels): + """Sets the propagation_labels of this ScriptAPI. + + + :param propagation_labels: The propagation_labels of this ScriptAPI. # noqa: E501 + :type: list[str] + """ + + self._propagation_labels = propagation_labels + + @property + def roles(self): + """Gets the roles of this ScriptAPI. # noqa: E501 + + + :return: The roles of this ScriptAPI. # noqa: E501 + :rtype: list[str] + """ + return self._roles + + @roles.setter + def roles(self, roles): + """Sets the roles of this ScriptAPI. + + + :param roles: The roles of this ScriptAPI. # noqa: E501 + :type: list[str] + """ + + self._roles = roles + + @property + def run_as(self): + """Gets the run_as of this ScriptAPI. # noqa: E501 + + + :return: The run_as of this ScriptAPI. # noqa: E501 + :rtype: str + """ + return self._run_as + + @run_as.setter + def run_as(self, run_as): + """Sets the run_as of this ScriptAPI. + + + :param run_as: The run_as of this ScriptAPI. # noqa: E501 + :type: str + """ + + self._run_as = run_as + + @property + def script_target(self): + """Gets the script_target of this ScriptAPI. # noqa: E501 + + + :return: The script_target of this ScriptAPI. # noqa: E501 + :rtype: ScriptTarget + """ + return self._script_target + + @script_target.setter + def script_target(self, script_target): + """Sets the script_target of this ScriptAPI. + + + :param script_target: The script_target of this ScriptAPI. # noqa: E501 + :type: ScriptTarget + """ + + self._script_target = script_target + + @property + def system(self): + """Gets the system of this ScriptAPI. # noqa: E501 + + + :return: The system of this ScriptAPI. # noqa: E501 + :rtype: bool + """ + return self._system + + @system.setter + def system(self, system): + """Sets the system of this ScriptAPI. + + + :param system: The system of this ScriptAPI. # noqa: E501 + :type: bool + """ + + self._system = system + + @property + def tags(self): + """Gets the tags of this ScriptAPI. # noqa: E501 + + + :return: The tags of this ScriptAPI. # noqa: E501 + :rtype: list[str] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this ScriptAPI. + + + :param tags: The tags of this ScriptAPI. # noqa: E501 + :type: list[str] + """ + + self._tags = tags + + @property + def type(self): + """Gets the type of this ScriptAPI. # noqa: E501 + + + :return: The type of this ScriptAPI. # noqa: E501 + :rtype: ScriptType + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ScriptAPI. + + + :param type: The type of this ScriptAPI. # noqa: E501 + :type: ScriptType + """ + + self._type = type + + @property + def user(self): + """Gets the user of this ScriptAPI. # noqa: E501 + + + :return: The user of this ScriptAPI. # noqa: E501 + :rtype: str + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this ScriptAPI. + + + :param user: The user of this ScriptAPI. # noqa: E501 + :type: str + """ + + self._user = user + + @property + def version(self): + """Gets the version of this ScriptAPI. # noqa: E501 + + + :return: The version of this ScriptAPI. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this ScriptAPI. + + + :param version: The version of this ScriptAPI. # noqa: E501 + :type: int + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ScriptAPI, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ScriptAPI): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/demisto_client/demisto_api/models/version.py b/demisto_client/demisto_api/models/version.py new file mode 100644 index 0000000..1c3cb76 --- /dev/null +++ b/demisto_client/demisto_api/models/version.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Demisto API + + This is the public REST API to integrate with the demisto server. HTTP request can be sent using any HTTP-client. For an example dedicated client take a look at: https://github.com/demisto/demisto-py. Requests must include API-key that can be generated in the Demisto web client under 'Settings' -> 'Integrations' -> 'API keys' Optimistic Locking and Versioning\\: When using Demisto REST API, you will need to make sure to work on the latest version of the item (incident, entry, etc.), otherwise, you will get a DB version error (which not allow you to override a newer item). In addition, you can pass 'version\\: -1' to force data override (make sure that other users data might be lost). Assume that Alice and Bob both read the same data from Demisto server, then they both changed the data, and then both tried to write the new versions back to the server. Whose changes should be saved? Alice’s? Bob’s? To solve this, each data item in Demisto has a numeric incremental version. If Alice saved an item with version 4 and Bob trying to save the same item with version 3, Demisto will rollback Bob request and returns a DB version conflict error. Bob will need to get the latest item and work on it so Alice work will not get lost. Example request using 'curl'\\: ``` curl 'https://hostname:443/incidents/search' -H 'content-type: application/json' -H 'accept: application/json' -H 'Authorization: ' --data-binary '{\"filter\":{\"query\":\"-status:closed -category:job\",\"period\":{\"by\":\"day\",\"fromValue\":7}}}' --compressed ``` # noqa: E501 + + OpenAPI spec version: 2.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Version(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'digits': 'list[int]', + 'label': 'str' + } + + attribute_map = { + 'digits': 'Digits', + 'label': 'Label' + } + + def __init__(self, digits=None, label=None): # noqa: E501 + """Version - a model defined in Swagger""" # noqa: E501 + + self._digits = None + self._label = None + self.discriminator = None + + if digits is not None: + self.digits = digits + if label is not None: + self.label = label + + @property + def digits(self): + """Gets the digits of this Version. # noqa: E501 + + + :return: The digits of this Version. # noqa: E501 + :rtype: list[int] + """ + return self._digits + + @digits.setter + def digits(self, digits): + """Sets the digits of this Version. + + + :param digits: The digits of this Version. # noqa: E501 + :type: list[int] + """ + + self._digits = digits + + @property + def label(self): + """Gets the label of this Version. # noqa: E501 + + + :return: The label of this Version. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this Version. + + + :param label: The label of this Version. # noqa: E501 + :type: str + """ + + self._label = label + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Version, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Version): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other From 5dfe5d282848ba758f30a2b9fbd6be507af95eda Mon Sep 17 00:00:00 2001 From: ShahafBenYakir Date: Tue, 21 Apr 2020 09:34:44 +0300 Subject: [PATCH 5/5] Added missing dependencies --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 952014e..1347deb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ [PyPI History][1] [1]: https://pypi.org/project/demisto-py/#history +## 2.0.11 +* Added `import_playbook` method for importing a playbook to Demisto. +* Added `import_script` method for importing a script to Demisto. +* Added `import_incident_fields` method for importing an incident field to Demisto. +* Added `import_incident_types_handler` method for importing an incident type to Demisto. +* Added `import_widget` method for import a widget to Demisto. +* Added `import_dashboard` method for import a dashboard to Demisto. +* Added `import_classifier` method for importing a classifier to Demisto. +* Added `import_layout` method for importing a layout to Demisto. + + ## 2.0.10 * Enabled host and path parameters to function with trailing or leading slashes.