# coding: utf-8

"""
    Hydrogen Proton API

    Financial engineering module of Hydrogen Atom  # noqa: E501

    OpenAPI spec version: 1.8.0
    Contact: info@hydrogenplatform.com
    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 proton_api.api_client import ApiClient


class AnnuitiesApi(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 annuity_calculator_accumulation_horizon(self, annuity_calculator_accumulation_horizon_request, **kwargs):  # noqa: E501
        """Annuity Calculator - Accumulation Horizon  # noqa: E501

        Calculate the necessary fixed annuity contribution period  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.annuity_calculator_accumulation_horizon(annuity_calculator_accumulation_horizon_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AnnuityCalculatorAccumulationHorizonRequest annuity_calculator_accumulation_horizon_request: Request payload for Annuity Calculator - Accumulation Horizon (required)
        :return: dict(str, object)
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.annuity_calculator_accumulation_horizon_with_http_info(annuity_calculator_accumulation_horizon_request, **kwargs)  # noqa: E501
        else:
            (data) = self.annuity_calculator_accumulation_horizon_with_http_info(annuity_calculator_accumulation_horizon_request, **kwargs)  # noqa: E501
            return data

    def annuity_calculator_accumulation_horizon_with_http_info(self, annuity_calculator_accumulation_horizon_request, **kwargs):  # noqa: E501
        """Annuity Calculator - Accumulation Horizon  # noqa: E501

        Calculate the necessary fixed annuity contribution period  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.annuity_calculator_accumulation_horizon_with_http_info(annuity_calculator_accumulation_horizon_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AnnuityCalculatorAccumulationHorizonRequest annuity_calculator_accumulation_horizon_request: Request payload for Annuity Calculator - Accumulation Horizon (required)
        :return: dict(str, object)
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['annuity_calculator_accumulation_horizon_request']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'annuity_calculator_accumulation_horizon_request' in params:
            body_params = params['annuity_calculator_accumulation_horizon_request']
        # 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(
            '/annuity_calculator/accumulation_horizon', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='dict(str, object)',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def annuity_calculator_annuity_amount(self, annuity_calculator_annuity_amount_request, **kwargs):  # noqa: E501
        """Annuity Calculator - Annuity Amount  # noqa: E501

        Calculate the achievable fixed annuity amount  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.annuity_calculator_annuity_amount(annuity_calculator_annuity_amount_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AnnuityCalculatorAnnuityAmountRequest annuity_calculator_annuity_amount_request: Request payload for Annuity Calculator - Annuity Amount (required)
        :return: dict(str, object)
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.annuity_calculator_annuity_amount_with_http_info(annuity_calculator_annuity_amount_request, **kwargs)  # noqa: E501
        else:
            (data) = self.annuity_calculator_annuity_amount_with_http_info(annuity_calculator_annuity_amount_request, **kwargs)  # noqa: E501
            return data

    def annuity_calculator_annuity_amount_with_http_info(self, annuity_calculator_annuity_amount_request, **kwargs):  # noqa: E501
        """Annuity Calculator - Annuity Amount  # noqa: E501

        Calculate the achievable fixed annuity amount  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.annuity_calculator_annuity_amount_with_http_info(annuity_calculator_annuity_amount_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AnnuityCalculatorAnnuityAmountRequest annuity_calculator_annuity_amount_request: Request payload for Annuity Calculator - Annuity Amount (required)
        :return: dict(str, object)
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['annuity_calculator_annuity_amount_request']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'annuity_calculator_annuity_amount_request' in params:
            body_params = params['annuity_calculator_annuity_amount_request']
        # 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(
            '/annuity_calculator/annuity_amount', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='dict(str, object)',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def annuity_calculator_decumulation_horizon(self, annuity_calculator_decumulation_horizon_request, **kwargs):  # noqa: E501
        """Annuity Calculator - Decumulation Horizon  # noqa: E501

        Calculate the achievable fixed annuity payout period  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.annuity_calculator_decumulation_horizon(annuity_calculator_decumulation_horizon_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AnnuityCalculatorDecumulationHorizonRequest annuity_calculator_decumulation_horizon_request: Request payload for Annuity Calculator - Decumulation Horizon (required)
        :return: dict(str, object)
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.annuity_calculator_decumulation_horizon_with_http_info(annuity_calculator_decumulation_horizon_request, **kwargs)  # noqa: E501
        else:
            (data) = self.annuity_calculator_decumulation_horizon_with_http_info(annuity_calculator_decumulation_horizon_request, **kwargs)  # noqa: E501
            return data

    def annuity_calculator_decumulation_horizon_with_http_info(self, annuity_calculator_decumulation_horizon_request, **kwargs):  # noqa: E501
        """Annuity Calculator - Decumulation Horizon  # noqa: E501

        Calculate the achievable fixed annuity payout period  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.annuity_calculator_decumulation_horizon_with_http_info(annuity_calculator_decumulation_horizon_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AnnuityCalculatorDecumulationHorizonRequest annuity_calculator_decumulation_horizon_request: Request payload for Annuity Calculator - Decumulation Horizon (required)
        :return: dict(str, object)
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['annuity_calculator_decumulation_horizon_request']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'annuity_calculator_decumulation_horizon_request' in params:
            body_params = params['annuity_calculator_decumulation_horizon_request']
        # 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(
            '/annuity_calculator/decumulation_horizon', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='dict(str, object)',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def annuity_calculator_deposit_amount(self, annuity_calculator_deposit_amount_request, **kwargs):  # noqa: E501
        """Annuity Calculator - Deposit Amount  # noqa: E501

        Calculate the necessary periodic deposit amount for a fixed annuity  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.annuity_calculator_deposit_amount(annuity_calculator_deposit_amount_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AnnuityCalculatorDepositAmountRequest annuity_calculator_deposit_amount_request: Request payload for Annuity Calculator - Deposit Amount (required)
        :return: dict(str, object)
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.annuity_calculator_deposit_amount_with_http_info(annuity_calculator_deposit_amount_request, **kwargs)  # noqa: E501
        else:
            (data) = self.annuity_calculator_deposit_amount_with_http_info(annuity_calculator_deposit_amount_request, **kwargs)  # noqa: E501
            return data

    def annuity_calculator_deposit_amount_with_http_info(self, annuity_calculator_deposit_amount_request, **kwargs):  # noqa: E501
        """Annuity Calculator - Deposit Amount  # noqa: E501

        Calculate the necessary periodic deposit amount for a fixed annuity  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.annuity_calculator_deposit_amount_with_http_info(annuity_calculator_deposit_amount_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AnnuityCalculatorDepositAmountRequest annuity_calculator_deposit_amount_request: Request payload for Annuity Calculator - Deposit Amount (required)
        :return: dict(str, object)
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['annuity_calculator_deposit_amount_request']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'annuity_calculator_deposit_amount_request' in params:
            body_params = params['annuity_calculator_deposit_amount_request']
        # 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(
            '/annuity_calculator/deposit_amount', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='dict(str, object)',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def annuity_calculator_initial_balance(self, annuity_calculator_initial_balance_request, **kwargs):  # noqa: E501
        """Annuity Calculator - Initial Balance  # noqa: E501

        Calculate the necessary initial balance for a fixed annuity  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.annuity_calculator_initial_balance(annuity_calculator_initial_balance_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AnnuityCalculatorInitialBalanceRequest annuity_calculator_initial_balance_request: Request payload for Annuity Calculator - Initial Balance (required)
        :return: dict(str, object)
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.annuity_calculator_initial_balance_with_http_info(annuity_calculator_initial_balance_request, **kwargs)  # noqa: E501
        else:
            (data) = self.annuity_calculator_initial_balance_with_http_info(annuity_calculator_initial_balance_request, **kwargs)  # noqa: E501
            return data

    def annuity_calculator_initial_balance_with_http_info(self, annuity_calculator_initial_balance_request, **kwargs):  # noqa: E501
        """Annuity Calculator - Initial Balance  # noqa: E501

        Calculate the necessary initial balance for a fixed annuity  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.annuity_calculator_initial_balance_with_http_info(annuity_calculator_initial_balance_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AnnuityCalculatorInitialBalanceRequest annuity_calculator_initial_balance_request: Request payload for Annuity Calculator - Initial Balance (required)
        :return: dict(str, object)
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['annuity_calculator_initial_balance_request']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'annuity_calculator_initial_balance_request' in params:
            body_params = params['annuity_calculator_initial_balance_request']
        # 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(
            '/annuity_calculator/initial_balance', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='dict(str, object)',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def variable_annuity(self, variable_annuity_request, **kwargs):  # noqa: E501
        """Variable Annuity  # noqa: E501

        Project the behavior of a variable annuity over time  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.variable_annuity(variable_annuity_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param VariableAnnuityRequest variable_annuity_request: Request payload for Variable Annuity (required)
        :return: dict(str, object)
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.variable_annuity_with_http_info(variable_annuity_request, **kwargs)  # noqa: E501
        else:
            (data) = self.variable_annuity_with_http_info(variable_annuity_request, **kwargs)  # noqa: E501
            return data

    def variable_annuity_with_http_info(self, variable_annuity_request, **kwargs):  # noqa: E501
        """Variable Annuity  # noqa: E501

        Project the behavior of a variable annuity over time  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.variable_annuity_with_http_info(variable_annuity_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param VariableAnnuityRequest variable_annuity_request: Request payload for Variable Annuity (required)
        :return: dict(str, object)
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['variable_annuity_request']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'variable_annuity_request' in params:
            body_params = params['variable_annuity_request']
        # 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(
            '/variable_annuity', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='dict(str, object)',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
