# coding: utf-8

"""
    3blades API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

    OpenAPI spec version: 1.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import sys
import os
import re

# python 2 and python 3 compatibility library
from six import iteritems

from ..configuration import Configuration
from ..api_client import ApiClient


class NotificationsApi(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        config = Configuration()
        if api_client:
            self.api_client = api_client
        else:
            if not config.api_client:
                config.api_client = ApiClient()
            self.api_client = config.api_client

    def notification_read(self, namespace, notification_id, **kwargs):
        """
        Retrieve a specific notification.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_read(namespace, notification_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team data. (required)
        :param str notification_id: Notification UUID. (required)
        :return: Notification
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.notification_read_with_http_info(namespace, notification_id, **kwargs)
        else:
            (data) = self.notification_read_with_http_info(namespace, notification_id, **kwargs)
            return data

    def notification_read_with_http_info(self, namespace, notification_id, **kwargs):
        """
        Retrieve a specific notification.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_read_with_http_info(namespace, notification_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team data. (required)
        :param str notification_id: Notification UUID. (required)
        :return: Notification
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['namespace', 'notification_id']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

        path_params = {}
        if 'namespace' in params:
            path_params['namespace'] = params['namespace']
        if 'notification_id' in params:
            path_params['notification_id'] = params['notification_id']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])

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

        # Authentication setting
        auth_settings = ['jwt']

        return self.api_client.call_api('/v1/{namespace}/notifications/{notification_id}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='Notification',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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 notification_settings_create(self, namespace, notification_settings_data, **kwargs):
        """
        Create global notification settings
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_settings_create(namespace, notification_settings_data, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team name. (required)
        :param NotificationSettingsData notification_settings_data: (required)
        :return: NotificationSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.notification_settings_create_with_http_info(namespace, notification_settings_data, **kwargs)
        else:
            (data) = self.notification_settings_create_with_http_info(namespace, notification_settings_data, **kwargs)
            return data

    def notification_settings_create_with_http_info(self, namespace, notification_settings_data, **kwargs):
        """
        Create global notification settings
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_settings_create_with_http_info(namespace, notification_settings_data, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team name. (required)
        :param NotificationSettingsData notification_settings_data: (required)
        :return: NotificationSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['namespace', 'notification_settings_data']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

        path_params = {}
        if 'namespace' in params:
            path_params['namespace'] = params['namespace']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'notification_settings_data' in params:
            body_params = params['notification_settings_data']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])

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

        # Authentication setting
        auth_settings = ['jwt']

        return self.api_client.call_api('/v1/{namespace}/notifications/settings/', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='NotificationSettings',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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 notification_settings_entity_create(self, namespace, entity, **kwargs):
        """
        Create global notification settings
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_settings_entity_create(namespace, entity, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team name. (required)
        :param str entity: Entity whose settings should be retrieved. (required)
        :param NotificationSettingsData notification_settings_data:
        :return: NotificationSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.notification_settings_entity_create_with_http_info(namespace, entity, **kwargs)
        else:
            (data) = self.notification_settings_entity_create_with_http_info(namespace, entity, **kwargs)
            return data

    def notification_settings_entity_create_with_http_info(self, namespace, entity, **kwargs):
        """
        Create global notification settings
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_settings_entity_create_with_http_info(namespace, entity, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team name. (required)
        :param str entity: Entity whose settings should be retrieved. (required)
        :param NotificationSettingsData notification_settings_data:
        :return: NotificationSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['namespace', 'entity', 'notification_settings_data']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

        path_params = {}
        if 'namespace' in params:
            path_params['namespace'] = params['namespace']
        if 'entity' in params:
            path_params['entity'] = params['entity']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'notification_settings_data' in params:
            body_params = params['notification_settings_data']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])

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

        # Authentication setting
        auth_settings = ['jwt']

        return self.api_client.call_api('/v1/{namespace}/notifications/settings/entity/{entity}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='NotificationSettings',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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 notification_settings_entity_read(self, namespace, entity, **kwargs):
        """
        Retrieve global notification settings for the authenticated user
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_settings_entity_read(namespace, entity, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team data. (required)
        :param str entity: Entity whose settings should be retrieved. (required)
        :return: list[NotificationSettings]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.notification_settings_entity_read_with_http_info(namespace, entity, **kwargs)
        else:
            (data) = self.notification_settings_entity_read_with_http_info(namespace, entity, **kwargs)
            return data

    def notification_settings_entity_read_with_http_info(self, namespace, entity, **kwargs):
        """
        Retrieve global notification settings for the authenticated user
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_settings_entity_read_with_http_info(namespace, entity, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team data. (required)
        :param str entity: Entity whose settings should be retrieved. (required)
        :return: list[NotificationSettings]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['namespace', 'entity']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

        path_params = {}
        if 'namespace' in params:
            path_params['namespace'] = params['namespace']
        if 'entity' in params:
            path_params['entity'] = params['entity']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])

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

        # Authentication setting
        auth_settings = ['jwt']

        return self.api_client.call_api('/v1/{namespace}/notifications/settings/entity/{entity}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='list[NotificationSettings]',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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 notification_settings_entity_update(self, namespace, entity, **kwargs):
        """
        Modify global notification settings.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_settings_entity_update(namespace, entity, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team name. (required)
        :param str entity: Entity whose settings should be retrieved. (required)
        :param NotificationSettingsData notification_settings_data:
        :return: NotificationSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.notification_settings_entity_update_with_http_info(namespace, entity, **kwargs)
        else:
            (data) = self.notification_settings_entity_update_with_http_info(namespace, entity, **kwargs)
            return data

    def notification_settings_entity_update_with_http_info(self, namespace, entity, **kwargs):
        """
        Modify global notification settings.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_settings_entity_update_with_http_info(namespace, entity, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team name. (required)
        :param str entity: Entity whose settings should be retrieved. (required)
        :param NotificationSettingsData notification_settings_data:
        :return: NotificationSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['namespace', 'entity', 'notification_settings_data']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

        path_params = {}
        if 'namespace' in params:
            path_params['namespace'] = params['namespace']
        if 'entity' in params:
            path_params['entity'] = params['entity']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'notification_settings_data' in params:
            body_params = params['notification_settings_data']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])

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

        # Authentication setting
        auth_settings = ['jwt']

        return self.api_client.call_api('/v1/{namespace}/notifications/settings/entity/{entity}', 'PATCH',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='NotificationSettings',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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 notification_settings_read(self, namespace, **kwargs):
        """
        Retrieve global notification settings for the authenticated user
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_settings_read(namespace, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team data. (required)
        :return: list[NotificationSettings]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.notification_settings_read_with_http_info(namespace, **kwargs)
        else:
            (data) = self.notification_settings_read_with_http_info(namespace, **kwargs)
            return data

    def notification_settings_read_with_http_info(self, namespace, **kwargs):
        """
        Retrieve global notification settings for the authenticated user
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_settings_read_with_http_info(namespace, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team data. (required)
        :return: list[NotificationSettings]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['namespace']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

        path_params = {}
        if 'namespace' in params:
            path_params['namespace'] = params['namespace']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])

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

        # Authentication setting
        auth_settings = ['jwt']

        return self.api_client.call_api('/v1/{namespace}/notifications/settings/', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='list[NotificationSettings]',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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 notification_settings_update(self, namespace, **kwargs):
        """
        Modify global notification settings.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_settings_update(namespace, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team name. (required)
        :param NotificationSettingsData notification_settings_data:
        :return: NotificationSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.notification_settings_update_with_http_info(namespace, **kwargs)
        else:
            (data) = self.notification_settings_update_with_http_info(namespace, **kwargs)
            return data

    def notification_settings_update_with_http_info(self, namespace, **kwargs):
        """
        Modify global notification settings.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_settings_update_with_http_info(namespace, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team name. (required)
        :param NotificationSettingsData notification_settings_data:
        :return: NotificationSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['namespace', 'notification_settings_data']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

        path_params = {}
        if 'namespace' in params:
            path_params['namespace'] = params['namespace']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'notification_settings_data' in params:
            body_params = params['notification_settings_data']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])

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

        # Authentication setting
        auth_settings = ['jwt']

        return self.api_client.call_api('/v1/{namespace}/notifications/settings/', 'PATCH',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='NotificationSettings',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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 notification_update(self, namespace, notification_id, **kwargs):
        """
        Mark a specific notification as either read or unread.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_update(namespace, notification_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team data. (required)
        :param str notification_id: Notification UUID. (required)
        :param NotificationUpdateData notification_data:
        :return: Notification
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.notification_update_with_http_info(namespace, notification_id, **kwargs)
        else:
            (data) = self.notification_update_with_http_info(namespace, notification_id, **kwargs)
            return data

    def notification_update_with_http_info(self, namespace, notification_id, **kwargs):
        """
        Mark a specific notification as either read or unread.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notification_update_with_http_info(namespace, notification_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team data. (required)
        :param str notification_id: Notification UUID. (required)
        :param NotificationUpdateData notification_data:
        :return: Notification
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['namespace', 'notification_id', 'notification_data']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

        path_params = {}
        if 'namespace' in params:
            path_params['namespace'] = params['namespace']
        if 'notification_id' in params:
            path_params['notification_id'] = params['notification_id']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'notification_data' in params:
            body_params = params['notification_data']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])

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

        # Authentication setting
        auth_settings = ['jwt']

        return self.api_client.call_api('/v1/{namespace}/notifications/{notification_id}', 'PATCH',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='Notification',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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 notifications_list(self, namespace, **kwargs):
        """
        Get notifications of all types and entities for the authenticated user.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notifications_list(namespace, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team data. (required)
        :param str limit: Limit when getting items.
        :param str offset: Offset when getting items.
        :param str ordering: Ordering when getting items.
        :param bool read: When true, get only read notifications. When false, get only unread notifications. Default behavior is to return both read and unread.
        :return: list[Notification]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.notifications_list_with_http_info(namespace, **kwargs)
        else:
            (data) = self.notifications_list_with_http_info(namespace, **kwargs)
            return data

    def notifications_list_with_http_info(self, namespace, **kwargs):
        """
        Get notifications of all types and entities for the authenticated user.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notifications_list_with_http_info(namespace, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team data. (required)
        :param str limit: Limit when getting items.
        :param str offset: Offset when getting items.
        :param str ordering: Ordering when getting items.
        :param bool read: When true, get only read notifications. When false, get only unread notifications. Default behavior is to return both read and unread.
        :return: list[Notification]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['namespace', 'limit', 'offset', 'ordering', 'read']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

        path_params = {}
        if 'namespace' in params:
            path_params['namespace'] = params['namespace']

        query_params = []
        if 'limit' in params:
            query_params.append(('limit', params['limit']))
        if 'offset' in params:
            query_params.append(('offset', params['offset']))
        if 'ordering' in params:
            query_params.append(('ordering', params['ordering']))
        if 'read' in params:
            query_params.append(('read', params['read']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])

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

        # Authentication setting
        auth_settings = ['jwt']

        return self.api_client.call_api('/v1/{namespace}/notifications/', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='list[Notification]',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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 notifications_list_entity(self, namespace, entity, **kwargs):
        """
        Get notifications of all types and entities for the authenticated user.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notifications_list_entity(namespace, entity, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team data. (required)
        :param str entity: Entity to filter notifications by. (required)
        :param str limit: Limit when getting items.
        :param str offset: Offset when getting items.
        :param str ordering: Ordering when getting items.
        :param bool read: When true, get only read notifications. When false, get only unread notifications. Default behavior is to return both read and unread.
        :return: list[Notification]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.notifications_list_entity_with_http_info(namespace, entity, **kwargs)
        else:
            (data) = self.notifications_list_entity_with_http_info(namespace, entity, **kwargs)
            return data

    def notifications_list_entity_with_http_info(self, namespace, entity, **kwargs):
        """
        Get notifications of all types and entities for the authenticated user.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notifications_list_entity_with_http_info(namespace, entity, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team data. (required)
        :param str entity: Entity to filter notifications by. (required)
        :param str limit: Limit when getting items.
        :param str offset: Offset when getting items.
        :param str ordering: Ordering when getting items.
        :param bool read: When true, get only read notifications. When false, get only unread notifications. Default behavior is to return both read and unread.
        :return: list[Notification]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['namespace', 'entity', 'limit', 'offset', 'ordering', 'read']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

        path_params = {}
        if 'namespace' in params:
            path_params['namespace'] = params['namespace']
        if 'entity' in params:
            path_params['entity'] = params['entity']

        query_params = []
        if 'limit' in params:
            query_params.append(('limit', params['limit']))
        if 'offset' in params:
            query_params.append(('offset', params['offset']))
        if 'ordering' in params:
            query_params.append(('ordering', params['ordering']))
        if 'read' in params:
            query_params.append(('read', params['read']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])

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

        # Authentication setting
        auth_settings = ['jwt']

        return self.api_client.call_api('/v1/{namespace}/notifications/entity/{entity}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='list[Notification]',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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 notifications_update_entity_list(self, namespace, entity, notification_data, **kwargs):
        """
        Mark a list of notifications as either read or unread.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notifications_update_entity_list(namespace, entity, notification_data, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team name. (required)
        :param str entity: Entity to filter notifications by. (required)
        :param NotificationListUpdateData notification_data: (required)
        :return: Notification
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.notifications_update_entity_list_with_http_info(namespace, entity, notification_data, **kwargs)
        else:
            (data) = self.notifications_update_entity_list_with_http_info(namespace, entity, notification_data, **kwargs)
            return data

    def notifications_update_entity_list_with_http_info(self, namespace, entity, notification_data, **kwargs):
        """
        Mark a list of notifications as either read or unread.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notifications_update_entity_list_with_http_info(namespace, entity, notification_data, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team name. (required)
        :param str entity: Entity to filter notifications by. (required)
        :param NotificationListUpdateData notification_data: (required)
        :return: Notification
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['namespace', 'entity', 'notification_data']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

        path_params = {}
        if 'namespace' in params:
            path_params['namespace'] = params['namespace']
        if 'entity' in params:
            path_params['entity'] = params['entity']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'notification_data' in params:
            body_params = params['notification_data']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])

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

        # Authentication setting
        auth_settings = ['jwt']

        return self.api_client.call_api('/v1/{namespace}/notifications/entity/{entity}', 'PATCH',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='Notification',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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 notifications_update_list(self, namespace, notification_data, **kwargs):
        """
        Mark a list of notifications as either read or unread.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notifications_update_list(namespace, notification_data, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team name. (required)
        :param NotificationListUpdateData notification_data: (required)
        :return: Notification
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.notifications_update_list_with_http_info(namespace, notification_data, **kwargs)
        else:
            (data) = self.notifications_update_list_with_http_info(namespace, notification_data, **kwargs)
            return data

    def notifications_update_list_with_http_info(self, namespace, notification_data, **kwargs):
        """
        Mark a list of notifications as either read or unread.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.notifications_update_list_with_http_info(namespace, notification_data, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str namespace: User or team name. (required)
        :param NotificationListUpdateData notification_data: (required)
        :return: Notification
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['namespace', 'notification_data']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

        path_params = {}
        if 'namespace' in params:
            path_params['namespace'] = params['namespace']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'notification_data' in params:
            body_params = params['notification_data']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])

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

        # Authentication setting
        auth_settings = ['jwt']

        return self.api_client.call_api('/v1/{namespace}/notifications/', 'PATCH',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='Notification',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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)
