Module mailslurp_client.api.api_audit_log_controller_api

MailSlurp API

MailSlurp is an API for sending and receiving emails and SMS from dynamically allocated email addresses and phone numbers. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - Homepage - Get an API KEY - Generated SDK Clients - Examples repository # noqa: E501

The version of the OpenAPI document: 6.5.2 Contact: contact@mailslurp.dev Generated by: https://openapi-generator.tech

Classes

class ApiAuditLogControllerApi (api_client=None)

NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech

Do not edit the class manually.

Expand source code
class ApiAuditLogControllerApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def get_audit_log_by_event_id(self, event_id, **kwargs):  # noqa: E501
        """get_audit_log_by_event_id  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_audit_log_by_event_id(event_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str event_id: (required)
        :param datetime since:
        :param datetime before:
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: AuditLogEventDto
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.get_audit_log_by_event_id_with_http_info(event_id, **kwargs)  # noqa: E501

    def get_audit_log_by_event_id_with_http_info(self, event_id, **kwargs):  # noqa: E501
        """get_audit_log_by_event_id  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_audit_log_by_event_id_with_http_info(event_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str event_id: (required)
        :param datetime since:
        :param datetime before:
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(AuditLogEventDto, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'event_id',
            'since',
            'before'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_audit_log_by_event_id" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'event_id' is set
        if self.api_client.client_side_validation and ('event_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['event_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `event_id` when calling `get_audit_log_by_event_id`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'event_id' in local_var_params:
            path_params['eventId'] = local_var_params['event_id']  # noqa: E501

        query_params = []
        if 'since' in local_var_params and local_var_params['since'] is not None:  # noqa: E501
            query_params.append(('since', local_var_params['since']))  # noqa: E501
        if 'before' in local_var_params and local_var_params['before'] is not None:  # noqa: E501
            query_params.append(('before', local_var_params['before']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['API_KEY']  # noqa: E501

        return self.api_client.call_api(
            '/audit-logs/{eventId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AuditLogEventDto',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_audit_logs(self, **kwargs):  # noqa: E501
        """get_audit_logs  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_audit_logs(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param datetime since:
        :param datetime before:
        :param str action:
        :param str user_id:
        :param str actor_user_id:
        :param str target_user_id:
        :param str resource_type:
        :param str resource_id:
        :param str outcome:
        :param str request_id:
        :param str ip_address:
        :param int page_size:
        :param str cursor:
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: AuditLogPageDto
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.get_audit_logs_with_http_info(**kwargs)  # noqa: E501

    def get_audit_logs_with_http_info(self, **kwargs):  # noqa: E501
        """get_audit_logs  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_audit_logs_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param datetime since:
        :param datetime before:
        :param str action:
        :param str user_id:
        :param str actor_user_id:
        :param str target_user_id:
        :param str resource_type:
        :param str resource_id:
        :param str outcome:
        :param str request_id:
        :param str ip_address:
        :param int page_size:
        :param str cursor:
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(AuditLogPageDto, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'since',
            'before',
            'action',
            'user_id',
            'actor_user_id',
            'target_user_id',
            'resource_type',
            'resource_id',
            'outcome',
            'request_id',
            'ip_address',
            'page_size',
            'cursor'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_audit_logs" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'since' in local_var_params and local_var_params['since'] is not None:  # noqa: E501
            query_params.append(('since', local_var_params['since']))  # noqa: E501
        if 'before' in local_var_params and local_var_params['before'] is not None:  # noqa: E501
            query_params.append(('before', local_var_params['before']))  # noqa: E501
        if 'action' in local_var_params and local_var_params['action'] is not None:  # noqa: E501
            query_params.append(('action', local_var_params['action']))  # noqa: E501
        if 'user_id' in local_var_params and local_var_params['user_id'] is not None:  # noqa: E501
            query_params.append(('userId', local_var_params['user_id']))  # noqa: E501
        if 'actor_user_id' in local_var_params and local_var_params['actor_user_id'] is not None:  # noqa: E501
            query_params.append(('actorUserId', local_var_params['actor_user_id']))  # noqa: E501
        if 'target_user_id' in local_var_params and local_var_params['target_user_id'] is not None:  # noqa: E501
            query_params.append(('targetUserId', local_var_params['target_user_id']))  # noqa: E501
        if 'resource_type' in local_var_params and local_var_params['resource_type'] is not None:  # noqa: E501
            query_params.append(('resourceType', local_var_params['resource_type']))  # noqa: E501
        if 'resource_id' in local_var_params and local_var_params['resource_id'] is not None:  # noqa: E501
            query_params.append(('resourceId', local_var_params['resource_id']))  # noqa: E501
        if 'outcome' in local_var_params and local_var_params['outcome'] is not None:  # noqa: E501
            query_params.append(('outcome', local_var_params['outcome']))  # noqa: E501
        if 'request_id' in local_var_params and local_var_params['request_id'] is not None:  # noqa: E501
            query_params.append(('requestId', local_var_params['request_id']))  # noqa: E501
        if 'ip_address' in local_var_params and local_var_params['ip_address'] is not None:  # noqa: E501
            query_params.append(('ipAddress', local_var_params['ip_address']))  # noqa: E501
        if 'page_size' in local_var_params and local_var_params['page_size'] is not None:  # noqa: E501
            query_params.append(('pageSize', local_var_params['page_size']))  # noqa: E501
        if 'cursor' in local_var_params and local_var_params['cursor'] is not None:  # noqa: E501
            query_params.append(('cursor', local_var_params['cursor']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['API_KEY']  # noqa: E501

        return self.api_client.call_api(
            '/audit-logs', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AuditLogPageDto',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def search_audit_logs(self, audit_log_search_options, **kwargs):  # noqa: E501
        """search_audit_logs  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.search_audit_logs(audit_log_search_options, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param AuditLogSearchOptions audit_log_search_options: (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: AuditLogPageDto
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.search_audit_logs_with_http_info(audit_log_search_options, **kwargs)  # noqa: E501

    def search_audit_logs_with_http_info(self, audit_log_search_options, **kwargs):  # noqa: E501
        """search_audit_logs  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.search_audit_logs_with_http_info(audit_log_search_options, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param AuditLogSearchOptions audit_log_search_options: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(AuditLogPageDto, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'audit_log_search_options'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method search_audit_logs" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'audit_log_search_options' is set
        if self.api_client.client_side_validation and ('audit_log_search_options' not in local_var_params or  # noqa: E501
                                                        local_var_params['audit_log_search_options'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `audit_log_search_options` when calling `search_audit_logs`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'audit_log_search_options' in local_var_params:
            body_params = local_var_params['audit_log_search_options']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['*/*'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['API_KEY']  # noqa: E501

        return self.api_client.call_api(
            '/audit-logs/search', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AuditLogPageDto',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

Methods

def get_audit_log_by_event_id(self, event_id, **kwargs)

get_audit_log_by_event_id # noqa: E501

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True

>>> thread = api.get_audit_log_by_event_id(event_id, async_req=True)
>>> result = thread.get()

:param async_req bool: execute request asynchronously :param str event_id: (required) :param datetime since: :param datetime before: :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: AuditLogEventDto If the method is called asynchronously, returns the request thread.

def get_audit_log_by_event_id_with_http_info(self, event_id, **kwargs)

get_audit_log_by_event_id # noqa: E501

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True

>>> thread = api.get_audit_log_by_event_id_with_http_info(event_id, async_req=True)
>>> result = thread.get()

:param async_req bool: execute request asynchronously :param str event_id: (required) :param datetime since: :param datetime before: :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(AuditLogEventDto, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread.

def get_audit_logs(self, **kwargs)

get_audit_logs # noqa: E501

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True

>>> thread = api.get_audit_logs(async_req=True)
>>> result = thread.get()

:param async_req bool: execute request asynchronously :param datetime since: :param datetime before: :param str action: :param str user_id: :param str actor_user_id: :param str target_user_id: :param str resource_type: :param str resource_id: :param str outcome: :param str request_id: :param str ip_address: :param int page_size: :param str cursor: :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: AuditLogPageDto If the method is called asynchronously, returns the request thread.

def get_audit_logs_with_http_info(self, **kwargs)

get_audit_logs # noqa: E501

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True

>>> thread = api.get_audit_logs_with_http_info(async_req=True)
>>> result = thread.get()

:param async_req bool: execute request asynchronously :param datetime since: :param datetime before: :param str action: :param str user_id: :param str actor_user_id: :param str target_user_id: :param str resource_type: :param str resource_id: :param str outcome: :param str request_id: :param str ip_address: :param int page_size: :param str cursor: :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(AuditLogPageDto, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread.

def search_audit_logs(self, audit_log_search_options, **kwargs)

search_audit_logs # noqa: E501

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True

>>> thread = api.search_audit_logs(audit_log_search_options, async_req=True)
>>> result = thread.get()

:param async_req bool: execute request asynchronously :param AuditLogSearchOptions audit_log_search_options: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: AuditLogPageDto If the method is called asynchronously, returns the request thread.

def search_audit_logs_with_http_info(self, audit_log_search_options, **kwargs)

search_audit_logs # noqa: E501

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True

>>> thread = api.search_audit_logs_with_http_info(audit_log_search_options, async_req=True)
>>> result = thread.get()

:param async_req bool: execute request asynchronously :param AuditLogSearchOptions audit_log_search_options: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(AuditLogPageDto, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread.