# coding: utf-8

"""
    splitit-web-api-public-sdk

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

    OpenAPI spec version: 1.0.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



class CreateInstallmentPlanApi(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
    """

    _REQUIRES_SESSION = True

    def __init__(self, api_client):
        self._api_client = api_client

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

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

        :param async_req bool
        :param float amount_before_fees:
        :param str api_key:
        :param str avs_address:
        :param str avs_zip:
        :param str card_cvv:
        :param str card_exp_month:
        :param str card_exp_year:
        :param str card_holder:
        :param str card_number:
        :param int card_type_id:
        :param str consumer_full_name:
        :param int country_id:
        :param str email:
        :param int installment_number:
        :param str param_x:
        :param str session_id:
        :param str culture: Override culture pre request (optional)

        :return: CreateInstallmentPlanLegacyResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.create_installment_plan_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.create_installment_plan_get_with_http_info(**kwargs)  # noqa: E501
            return data

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

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

        :param async_req bool
        :param float amount_before_fees:
        :param str api_key:
        :param str avs_address:
        :param str avs_zip:
        :param str card_cvv:
        :param str card_exp_month:
        :param str card_exp_year:
        :param str card_holder:
        :param str card_number:
        :param int card_type_id:
        :param str consumer_full_name:
        :param int country_id:
        :param str email:
        :param int installment_number:
        :param str param_x:
        :param str session_id:
        :param str culture: Override culture pre request (optional)
        :return: CreateInstallmentPlanLegacyResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['amount_before_fees', 'api_key', 'avs_address', 'avs_zip', 'card_cvv', 'card_exp_month', 'card_exp_year', 'card_holder', 'card_number', 'card_type_id', 'consumer_full_name', 'country_id', 'email', 'installment_number', 'param_x', 'session_id']  # 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 create_installment_plan_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'amount_before_fees' in params:
            query_params.append(('AmountBeforeFees', params['amount_before_fees']))  # noqa: E501
        if 'api_key' in params:
            query_params.append(('ApiKey', params['api_key']))  # noqa: E501
        if 'avs_address' in params:
            query_params.append(('AvsAddress', params['avs_address']))  # noqa: E501
        if 'avs_zip' in params:
            query_params.append(('AvsZip', params['avs_zip']))  # noqa: E501
        if 'card_cvv' in params:
            query_params.append(('CardCvv', params['card_cvv']))  # noqa: E501
        if 'card_exp_month' in params:
            query_params.append(('CardExpMonth', params['card_exp_month']))  # noqa: E501
        if 'card_exp_year' in params:
            query_params.append(('CardExpYear', params['card_exp_year']))  # noqa: E501
        if 'card_holder' in params:
            query_params.append(('CardHolder', params['card_holder']))  # noqa: E501
        if 'card_number' in params:
            query_params.append(('CardNumber', params['card_number']))  # noqa: E501
        if 'card_type_id' in params:
            query_params.append(('CardTypeId', params['card_type_id']))  # noqa: E501
        if 'consumer_full_name' in params:
            query_params.append(('ConsumerFullName', params['consumer_full_name']))  # noqa: E501
        if 'country_id' in params:
            query_params.append(('CountryId', params['country_id']))  # noqa: E501
        if 'email' in params:
            query_params.append(('Email', params['email']))  # noqa: E501
        if 'installment_number' in params:
            query_params.append(('InstallmentNumber', params['installment_number']))  # noqa: E501
        if 'param_x' in params:
            query_params.append(('ParamX', params['param_x']))  # noqa: E501
        if 'session_id' in params:
            query_params.append(('SessionId', params['session_id']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self._api_client.select_header_accept(
            ['text/plain', 'application/json', 'text/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self._api_client.call_api(
            '/api/CreateInstallmentPlan', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CreateInstallmentPlanLegacyResponse',  # 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,
            _requires_session=self._REQUIRES_SESSION,
            culture=kwargs.get('culture'))

CreateInstallmentPlanApi._REQUIRES_SESSION = "CreateInstallmentPlanApi" != "LoginApi"
