# coding: utf-8

"""
    

    [AHOI cookbook](/ahoi/docs/cookbook/index.html)  [Data Privacy](/sandboxmanager/#/privacy)  [Terms of Service](/sandboxmanager/#/terms)  [Imprint](https://sparkassen-hub.com/impressum/)  &copy; 2016&dash;2017 Starfinanz - Ein Unternehmen der Finanz Informatik  # noqa: E501

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


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from swagger_client.api_client import ApiClient


class NotificationApi(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):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def delete_notification(self, target_id, notification_id, **kwargs):  # noqa: E501
        """Delete notification  # noqa: E501

        Delete notification identified by **notificationId**.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.delete_notification(target_id, notification_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to delete the notification (required)
        :param int notification_id: The **notificationId** to delete (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.delete_notification_with_http_info(target_id, notification_id, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_notification_with_http_info(target_id, notification_id, **kwargs)  # noqa: E501
            return data

    def delete_notification_with_http_info(self, target_id, notification_id, **kwargs):  # noqa: E501
        """Delete notification  # noqa: E501

        Delete notification identified by **notificationId**.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.delete_notification_with_http_info(target_id, notification_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to delete the notification (required)
        :param int notification_id: The **notificationId** to delete (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['target_id', 'notification_id']  # noqa: E501
        all_params.append('async')
        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 delete_notification" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'target_id' is set
        if ('target_id' not in params or
                params['target_id'] is None):
            raise ValueError("Missing the required parameter `target_id` when calling `delete_notification`")  # noqa: E501
        # 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 `delete_notification`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'target_id' in params:
            path_params['targetId'] = params['target_id']  # noqa: E501
        if 'notification_id' in params:
            path_params['notificationId'] = params['notification_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/notificationtargets/{targetId}/notifications/{notificationId}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 get_notification(self, target_id, notification_id, **kwargs):  # noqa: E501
        """Get notification   # noqa: E501

        Retrieve notification identified by **notificationId**.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_notification(target_id, notification_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to retrieve the notification (required)
        :param int notification_id: The *notificationId* to retrieve (required)
        :return: Notification
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_notification_with_http_info(target_id, notification_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_notification_with_http_info(target_id, notification_id, **kwargs)  # noqa: E501
            return data

    def get_notification_with_http_info(self, target_id, notification_id, **kwargs):  # noqa: E501
        """Get notification   # noqa: E501

        Retrieve notification identified by **notificationId**.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_notification_with_http_info(target_id, notification_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to retrieve the notification (required)
        :param int notification_id: The *notificationId* to retrieve (required)
        :return: Notification
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['target_id', 'notification_id']  # noqa: E501
        all_params.append('async')
        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 get_notification" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'target_id' is set
        if ('target_id' not in params or
                params['target_id'] is None):
            raise ValueError("Missing the required parameter `target_id` when calling `get_notification`")  # noqa: E501
        # 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 `get_notification`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'target_id' in params:
            path_params['targetId'] = params['target_id']  # noqa: E501
        if 'notification_id' in params:
            path_params['notificationId'] = params['notification_id']  # noqa: E501

        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'])  # noqa: E501

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

        return self.api_client.call_api(
            '/notificationtargets/{targetId}/notifications/{notificationId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Notification',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 get_notifications(self, target_id, **kwargs):  # noqa: E501
        """List notifications  # noqa: E501

        Retrieve all notifications associated with **targetId**.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_notifications(target_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to retrieve notifications (required)
        :return: list[Notification]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_notifications_with_http_info(target_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_notifications_with_http_info(target_id, **kwargs)  # noqa: E501
            return data

    def get_notifications_with_http_info(self, target_id, **kwargs):  # noqa: E501
        """List notifications  # noqa: E501

        Retrieve all notifications associated with **targetId**.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_notifications_with_http_info(target_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to retrieve notifications (required)
        :return: list[Notification]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['target_id']  # noqa: E501
        all_params.append('async')
        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 get_notifications" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'target_id' is set
        if ('target_id' not in params or
                params['target_id'] is None):
            raise ValueError("Missing the required parameter `target_id` when calling `get_notifications`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'target_id' in params:
            path_params['targetId'] = params['target_id']  # noqa: E501

        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'])  # noqa: E501

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

        return self.api_client.call_api(
            '/notificationtargets/{targetId}/notifications', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[Notification]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 post_balance_change_notification(self, target_id, notification_dto, **kwargs):  # noqa: E501
        """Create a balance change notification  # noqa: E501

        Only one notification per target and account can be created.   Receive notifications when the balance crosses the configured threshold; only one of **lowerThreshold** and **upperThreshold** may be set.    This example sends a notification when the balance is less than 0 &euro;    ```json {   \"type\": \"BalanceChangeNotification\",   \"accountId\": 0,   \"upperThreshold\": {     \"value\": 0,     \"currency\": \"EUR\"   } } ```  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.post_balance_change_notification(target_id, notification_dto, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to create the notification (required)
        :param BalanceChangeNotification notification_dto: The balance change notification to create (required)
        :return: BalanceChangeNotification
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.post_balance_change_notification_with_http_info(target_id, notification_dto, **kwargs)  # noqa: E501
        else:
            (data) = self.post_balance_change_notification_with_http_info(target_id, notification_dto, **kwargs)  # noqa: E501
            return data

    def post_balance_change_notification_with_http_info(self, target_id, notification_dto, **kwargs):  # noqa: E501
        """Create a balance change notification  # noqa: E501

        Only one notification per target and account can be created.   Receive notifications when the balance crosses the configured threshold; only one of **lowerThreshold** and **upperThreshold** may be set.    This example sends a notification when the balance is less than 0 &euro;    ```json {   \"type\": \"BalanceChangeNotification\",   \"accountId\": 0,   \"upperThreshold\": {     \"value\": 0,     \"currency\": \"EUR\"   } } ```  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.post_balance_change_notification_with_http_info(target_id, notification_dto, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to create the notification (required)
        :param BalanceChangeNotification notification_dto: The balance change notification to create (required)
        :return: BalanceChangeNotification
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['target_id', 'notification_dto']  # noqa: E501
        all_params.append('async')
        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 post_balance_change_notification" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'target_id' is set
        if ('target_id' not in params or
                params['target_id'] is None):
            raise ValueError("Missing the required parameter `target_id` when calling `post_balance_change_notification`")  # noqa: E501
        # verify the required parameter 'notification_dto' is set
        if ('notification_dto' not in params or
                params['notification_dto'] is None):
            raise ValueError("Missing the required parameter `notification_dto` when calling `post_balance_change_notification`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'target_id' in params:
            path_params['targetId'] = params['target_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'notification_dto' in params:
            body_params = params['notification_dto']
        # 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'])  # noqa: E501

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

        return self.api_client.call_api(
            '/notificationtargets/{targetId}/notifications/balancechangenotification', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BalanceChangeNotification',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 post_budget_notification(self, target_id, notification_dto, **kwargs):  # noqa: E501
        """Create a budget change notification  # noqa: E501

        Receive notifications when the calculated budget for the current month crosses the configured threshold; only one of **lowerThreshold** and **upperThreshold** may be set.    This example send a notification when the budget crosses 100 &euro;    ```json {   \"type\": \"BudgetNotification\",   \"accountId\": 0,   \"lowerThreshold\": {     \"value\": 10000,     \"currency\": \"EUR\"   } } ```  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.post_budget_notification(target_id, notification_dto, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to create the notification (required)
        :param BudgetNotification notification_dto: The budget change notification to create (required)
        :return: BudgetNotification
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.post_budget_notification_with_http_info(target_id, notification_dto, **kwargs)  # noqa: E501
        else:
            (data) = self.post_budget_notification_with_http_info(target_id, notification_dto, **kwargs)  # noqa: E501
            return data

    def post_budget_notification_with_http_info(self, target_id, notification_dto, **kwargs):  # noqa: E501
        """Create a budget change notification  # noqa: E501

        Receive notifications when the calculated budget for the current month crosses the configured threshold; only one of **lowerThreshold** and **upperThreshold** may be set.    This example send a notification when the budget crosses 100 &euro;    ```json {   \"type\": \"BudgetNotification\",   \"accountId\": 0,   \"lowerThreshold\": {     \"value\": 10000,     \"currency\": \"EUR\"   } } ```  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.post_budget_notification_with_http_info(target_id, notification_dto, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to create the notification (required)
        :param BudgetNotification notification_dto: The budget change notification to create (required)
        :return: BudgetNotification
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['target_id', 'notification_dto']  # noqa: E501
        all_params.append('async')
        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 post_budget_notification" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'target_id' is set
        if ('target_id' not in params or
                params['target_id'] is None):
            raise ValueError("Missing the required parameter `target_id` when calling `post_budget_notification`")  # noqa: E501
        # verify the required parameter 'notification_dto' is set
        if ('notification_dto' not in params or
                params['notification_dto'] is None):
            raise ValueError("Missing the required parameter `notification_dto` when calling `post_budget_notification`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'target_id' in params:
            path_params['targetId'] = params['target_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'notification_dto' in params:
            body_params = params['notification_dto']
        # 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'])  # noqa: E501

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

        return self.api_client.call_api(
            '/notificationtargets/{targetId}/notifications/budgetnotification', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BudgetNotification',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 post_daily_summary_notification(self, target_id, notification_dto, **kwargs):  # noqa: E501
        """Create a daily summary notification  # noqa: E501

        Receive a notification for your account status on the configured days and at the configured time. Please make sure to pass your timezone or adjust for UTC.    This example notifies you every day at 12:03 UTC    ```json {   \"type\": \"DailySummaryNotification\",   \"accountId\": 0,   \"daysOfWeek\": [     'MONDAY', 'TUESDAY', 'WEDNESDAY',      'THURSDAY', 'FRIDAY', 'SATURDAY',      'SUNDAY'   ],   \"timeOfDay\": \"12:03Z\" } ```  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.post_daily_summary_notification(target_id, notification_dto, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to create the notification (required)
        :param DailySummaryNotification notification_dto: The daily summary notification to create (required)
        :return: DailySummaryNotification
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.post_daily_summary_notification_with_http_info(target_id, notification_dto, **kwargs)  # noqa: E501
        else:
            (data) = self.post_daily_summary_notification_with_http_info(target_id, notification_dto, **kwargs)  # noqa: E501
            return data

    def post_daily_summary_notification_with_http_info(self, target_id, notification_dto, **kwargs):  # noqa: E501
        """Create a daily summary notification  # noqa: E501

        Receive a notification for your account status on the configured days and at the configured time. Please make sure to pass your timezone or adjust for UTC.    This example notifies you every day at 12:03 UTC    ```json {   \"type\": \"DailySummaryNotification\",   \"accountId\": 0,   \"daysOfWeek\": [     'MONDAY', 'TUESDAY', 'WEDNESDAY',      'THURSDAY', 'FRIDAY', 'SATURDAY',      'SUNDAY'   ],   \"timeOfDay\": \"12:03Z\" } ```  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.post_daily_summary_notification_with_http_info(target_id, notification_dto, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to create the notification (required)
        :param DailySummaryNotification notification_dto: The daily summary notification to create (required)
        :return: DailySummaryNotification
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['target_id', 'notification_dto']  # noqa: E501
        all_params.append('async')
        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 post_daily_summary_notification" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'target_id' is set
        if ('target_id' not in params or
                params['target_id'] is None):
            raise ValueError("Missing the required parameter `target_id` when calling `post_daily_summary_notification`")  # noqa: E501
        # verify the required parameter 'notification_dto' is set
        if ('notification_dto' not in params or
                params['notification_dto'] is None):
            raise ValueError("Missing the required parameter `notification_dto` when calling `post_daily_summary_notification`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'target_id' in params:
            path_params['targetId'] = params['target_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'notification_dto' in params:
            body_params = params['notification_dto']
        # 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'])  # noqa: E501

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

        return self.api_client.call_api(
            '/notificationtargets/{targetId}/notifications/dailysummarynotification', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DailySummaryNotification',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 post_new_transaction_notification(self, target_id, notification_dto, **kwargs):  # noqa: E501
        """Create a new transaction notification  # noqa: E501

        Receive a notification for every new transaction, for transactions within a given threshold or that match a **searchKeyword**. To receive all transactions, simply leave the optional fields blank.     This example notifies you of every transaction that contains the keyword \"food\" between 20 &euro; and 60 &euro;:    ```json {   \"type\": \"NewTransactionNotification\",   \"accountId\": 0,   \"lowerThreshold\": {     \"value\": 2000,     \"currency\": \"EUR\"   },   \"upperThreshold\": {     \"value\": 6000,     \"currency\": \"EUR\"   },   \"searchKeyword\": \"Rent\" } ```  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.post_new_transaction_notification(target_id, notification_dto, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to create the notification (required)
        :param NewTransactionNotification notification_dto: The new transaction notification to create (required)
        :return: NewTransactionNotification
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.post_new_transaction_notification_with_http_info(target_id, notification_dto, **kwargs)  # noqa: E501
        else:
            (data) = self.post_new_transaction_notification_with_http_info(target_id, notification_dto, **kwargs)  # noqa: E501
            return data

    def post_new_transaction_notification_with_http_info(self, target_id, notification_dto, **kwargs):  # noqa: E501
        """Create a new transaction notification  # noqa: E501

        Receive a notification for every new transaction, for transactions within a given threshold or that match a **searchKeyword**. To receive all transactions, simply leave the optional fields blank.     This example notifies you of every transaction that contains the keyword \"food\" between 20 &euro; and 60 &euro;:    ```json {   \"type\": \"NewTransactionNotification\",   \"accountId\": 0,   \"lowerThreshold\": {     \"value\": 2000,     \"currency\": \"EUR\"   },   \"upperThreshold\": {     \"value\": 6000,     \"currency\": \"EUR\"   },   \"searchKeyword\": \"Rent\" } ```  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.post_new_transaction_notification_with_http_info(target_id, notification_dto, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to create the notification (required)
        :param NewTransactionNotification notification_dto: The new transaction notification to create (required)
        :return: NewTransactionNotification
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['target_id', 'notification_dto']  # noqa: E501
        all_params.append('async')
        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 post_new_transaction_notification" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'target_id' is set
        if ('target_id' not in params or
                params['target_id'] is None):
            raise ValueError("Missing the required parameter `target_id` when calling `post_new_transaction_notification`")  # noqa: E501
        # verify the required parameter 'notification_dto' is set
        if ('notification_dto' not in params or
                params['notification_dto'] is None):
            raise ValueError("Missing the required parameter `notification_dto` when calling `post_new_transaction_notification`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'target_id' in params:
            path_params['targetId'] = params['target_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'notification_dto' in params:
            body_params = params['notification_dto']
        # 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'])  # noqa: E501

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

        return self.api_client.call_api(
            '/notificationtargets/{targetId}/notifications/newtransactionnotification', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='NewTransactionNotification',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 put_notification(self, target_id, notification_id, notification_dto, **kwargs):  # noqa: E501
        """Update notification  # noqa: E501

        Update the notification identified by **notificationId**. The **notificationId** must match the **id** in **notificationDto**. Please note that type depending restrictions from creating a notification also apply here.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.put_notification(target_id, notification_id, notification_dto, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to create the notification (required)
        :param int notification_id: The **notificationId** to update (required)
        :param Notification notification_dto: The notification data to update (required)
        :return: Notification
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.put_notification_with_http_info(target_id, notification_id, notification_dto, **kwargs)  # noqa: E501
        else:
            (data) = self.put_notification_with_http_info(target_id, notification_id, notification_dto, **kwargs)  # noqa: E501
            return data

    def put_notification_with_http_info(self, target_id, notification_id, notification_dto, **kwargs):  # noqa: E501
        """Update notification  # noqa: E501

        Update the notification identified by **notificationId**. The **notificationId** must match the **id** in **notificationDto**. Please note that type depending restrictions from creating a notification also apply here.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.put_notification_with_http_info(target_id, notification_id, notification_dto, async=True)
        >>> result = thread.get()

        :param async bool
        :param int target_id: The **targetId** for which to create the notification (required)
        :param int notification_id: The **notificationId** to update (required)
        :param Notification notification_dto: The notification data to update (required)
        :return: Notification
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['target_id', 'notification_id', 'notification_dto']  # noqa: E501
        all_params.append('async')
        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 put_notification" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'target_id' is set
        if ('target_id' not in params or
                params['target_id'] is None):
            raise ValueError("Missing the required parameter `target_id` when calling `put_notification`")  # noqa: E501
        # 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 `put_notification`")  # noqa: E501
        # verify the required parameter 'notification_dto' is set
        if ('notification_dto' not in params or
                params['notification_dto'] is None):
            raise ValueError("Missing the required parameter `notification_dto` when calling `put_notification`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'target_id' in params:
            path_params['targetId'] = params['target_id']  # noqa: E501
        if 'notification_id' in params:
            path_params['notificationId'] = params['notification_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'notification_dto' in params:
            body_params = params['notification_dto']
        # 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'])  # noqa: E501

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

        return self.api_client.call_api(
            '/notificationtargets/{targetId}/notifications/{notificationId}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Notification',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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)
