# coding: utf-8

"""
    CardPay REST API

    Welcome to the CardPay REST API. The CardPay API uses HTTP verbs and a [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) resources endpoint structure (see more info about REST). Request and response payloads are formatted as JSON. Merchant uses API to create payments, refunds, payouts or recurrings, check or update transaction status and get information about created transactions. In API authentication process based on [OAuth 2.0](https://oauth.net/2/) standard. For recent changes see changelog section.  # noqa: E501

    OpenAPI spec version: 3.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 cardpay.api_client import ApiClient


class RecurringsApi(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 create_filing(self, **kwargs):  # noqa: E501
        """Create filing  # noqa: E501

        :param FilingRequest filing_request: Filing request parameters
        :return: RecurringGatewayCreationResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.create_filing_with_http_info(**kwargs)  # noqa: E501
        return data

    def create_filing_with_http_info(self, **kwargs):  # noqa: E501
        """Create filing  # noqa: E501

        :param FilingRequest filing_request: Filing request parameters
        :return: RecurringGatewayCreationResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ["filing_request"]  # noqa: E501
        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_filing" % key
                )
            params[key] = val
        del params["kwargs"]

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if "filing_request" in params:
            body_params = params["filing_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

        return self.api_client.call_api(
            "/api/recurring_filings",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="RecurringGatewayCreationResponse",  # noqa: E501
            _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 create_plan(self, recurring_plan_request, **kwargs):  # noqa: E501
        """Create recurring plan  # noqa: E501

        :param RecurringPlanRequest recurring_plan_request: recurringPlanRequest (required)
        :return: RecurringPlanResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.create_plan_with_http_info(
            recurring_plan_request, **kwargs
        )  # noqa: E501
        return data

    def create_plan_with_http_info(
        self, recurring_plan_request, **kwargs
    ):  # noqa: E501
        """Create recurring plan  # noqa: E501

        :param RecurringPlanRequest recurring_plan_request: recurringPlanRequest (required)
        :return: RecurringPlanResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if "recurring_plan_request" in params:
            body_params = params["recurring_plan_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

        return self.api_client.call_api(
            "/api/recurring_plans",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="RecurringPlanResponse",  # noqa: E501
            _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 create_recurring(self, recurring_request, **kwargs):  # noqa: E501
        """Create recurring  # noqa: E501

        :param RecurringCreationRequest recurring_request: Recurring Request (required)
        :return: RecurringGatewayCreationResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.create_recurring_with_http_info(
            recurring_request, **kwargs
        )  # noqa: E501
        return data

    def create_recurring_with_http_info(
        self, recurring_request, **kwargs
    ):  # noqa: E501
        """Create recurring  # noqa: E501

        :param RecurringCreationRequest recurring_request: Recurring Request (required)
        :return: RecurringGatewayCreationResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if "recurring_request" in params:
            body_params = params["recurring_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

        return self.api_client.call_api(
            "/api/recurrings",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="RecurringGatewayCreationResponse",  # noqa: E501
            _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 delete_plan(self, plan_id, **kwargs):  # noqa: E501
        """Delete plan  # noqa: E501

        :param str plan_id: Plan ID (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.delete_plan_with_http_info(plan_id, **kwargs)  # noqa: E501
        return data

    def delete_plan_with_http_info(self, plan_id, **kwargs):  # noqa: E501
        """Delete plan  # noqa: E501

        :param str plan_id: Plan ID (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if "plan_id" in params:
            path_params["plan_id"] = params["plan_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(
            ["*/*"]
        )  # noqa: E501

        return self.api_client.call_api(
            "/api/recurring_plans/{plan_id}",
            "DELETE",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            _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_change_status_claim(
        self, claim_id, subscription_id, **kwargs
    ):  # noqa: E501
        """Get information about Change subscription status claim  # noqa: E501

        :param str claim_id: claimId (required)
        :param str subscription_id: subscription id (required)
        :return: ChangeSubscriptionStatusClaimResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.get_change_status_claim_with_http_info(
            claim_id, subscription_id, **kwargs
        )  # noqa: E501
        return data

    def get_change_status_claim_with_http_info(
        self, claim_id, subscription_id, **kwargs
    ):  # noqa: E501
        """Get information about Change subscription status claim  # noqa: E501

        :param str claim_id: claimId (required)
        :param str subscription_id: subscription id (required)
        :return: ChangeSubscriptionStatusClaimResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if "claim_id" in params:
            path_params["claimId"] = params["claim_id"]  # noqa: E501
        if "subscription_id" in params:
            path_params["subscriptionId"] = params["subscription_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

        return self.api_client.call_api(
            "/api/recurring_subscriptions/{subscriptionId}/change_status_claims/{claimId}",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="ChangeSubscriptionStatusClaimResponse",  # noqa: E501
            _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_filing(self, filing_id, **kwargs):  # noqa: E501
        """Get filing order information  # noqa: E501

        :param str filing_id: filing order id (required)
        :return: RecurringResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.get_filing_with_http_info(filing_id, **kwargs)  # noqa: E501
        return data

    def get_filing_with_http_info(self, filing_id, **kwargs):  # noqa: E501
        """Get filing order information  # noqa: E501

        :param str filing_id: filing order id (required)
        :return: RecurringResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if "filing_id" in params:
            path_params["filingId"] = params["filing_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

        return self.api_client.call_api(
            "/api/recurring_filings/{filingId}",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="RecurringResponse",  # noqa: E501
            _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_plan(self, plan_id, **kwargs):  # noqa: E501
        """Get plan information  # noqa: E501

        :param str plan_id: Plan ID (required)
        :return: RecurringPlanResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.get_plan_with_http_info(plan_id, **kwargs)  # noqa: E501
        return data

    def get_plan_with_http_info(self, plan_id, **kwargs):  # noqa: E501
        """Get plan information  # noqa: E501

        :param str plan_id: Plan ID (required)
        :return: RecurringPlanResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if "plan_id" in params:
            path_params["plan_id"] = params["plan_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

        return self.api_client.call_api(
            "/api/recurring_plans/{plan_id}",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="RecurringPlanResponse",  # noqa: E501
            _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_plans(self, request_id, **kwargs):  # noqa: E501
        """Get plans information  # noqa: E501

        :param str request_id: Request ID (required)
        :param int max_count: Limit number of returned plans (must be less than 10000, default is 1000)
        :param int offset: Offset (must be less than 10000)
        :param str sort_order: Sort based on order of results. 'asc' for ascending order or 'desc' for descending order (default value)
        :return: PlanDataList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.get_plans_with_http_info(request_id, **kwargs)  # noqa: E501
        return data

    def get_plans_with_http_info(self, request_id, **kwargs):  # noqa: E501
        """Get plans information  # noqa: E501

        :param str request_id: Request ID (required)
        :param int max_count: Limit number of returned plans (must be less than 10000, default is 1000)
        :param int offset: Offset (must be less than 10000)
        :param str sort_order: Sort based on order of results. 'asc' for ascending order or 'desc' for descending order (default value)
        :return: PlanDataList
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ["request_id", "max_count", "offset", "sort_order"]  # noqa: E501
        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_plans" % key
                )
            params[key] = val
        del params["kwargs"]
        # verify the required parameter 'request_id' is set
        if "request_id" not in params or params["request_id"] is None:
            raise ValueError(
                "Missing the required parameter `request_id` when calling `get_plans`"
            )  # noqa: E501

        if "max_count" in params and params["max_count"] > 10000:  # noqa: E501
            raise ValueError(
                "Invalid value for parameter `max_count` when calling `get_plans`, must be a value less than or equal to `10000`"
            )  # noqa: E501
        if "max_count" in params and params["max_count"] < 1:  # noqa: E501
            raise ValueError(
                "Invalid value for parameter `max_count` when calling `get_plans`, must be a value greater than or equal to `1`"
            )  # noqa: E501
        if "offset" in params and params["offset"] > 10000:  # noqa: E501
            raise ValueError(
                "Invalid value for parameter `offset` when calling `get_plans`, must be a value less than or equal to `10000`"
            )  # noqa: E501
        if "offset" in params and params["offset"] < 0:  # noqa: E501
            raise ValueError(
                "Invalid value for parameter `offset` when calling `get_plans`, must be a value greater than or equal to `0`"
            )  # noqa: E501
        if "sort_order" in params and not re.search(
            r"asc|desc", params["sort_order"]
        ):  # noqa: E501
            raise ValueError(
                "Invalid value for parameter `sort_order` when calling `get_plans`, must conform to the pattern `/asc|desc/`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if "max_count" in params:
            query_params.append(("max_count", params["max_count"]))  # noqa: E501
        if "offset" in params:
            query_params.append(("offset", params["offset"]))  # noqa: E501
        if "request_id" in params:
            query_params.append(("request_id", params["request_id"]))  # noqa: E501
        if "sort_order" in params:
            query_params.append(("sort_order", params["sort_order"]))  # noqa: E501

        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

        return self.api_client.call_api(
            "/api/recurring_plans",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="PlanDataList",  # noqa: E501
            _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_recurring(self, recurring_id, **kwargs):  # noqa: E501
        """Get recurring information  # noqa: E501

        :param str recurring_id: Recurring ID (required)
        :return: RecurringResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.get_recurring_with_http_info(recurring_id, **kwargs)  # noqa: E501
        return data

    def get_recurring_with_http_info(self, recurring_id, **kwargs):  # noqa: E501
        """Get recurring information  # noqa: E501

        :param str recurring_id: Recurring ID (required)
        :return: RecurringResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if "recurring_id" in params:
            path_params["recurringId"] = params["recurring_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

        return self.api_client.call_api(
            "/api/recurrings/{recurringId}",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="RecurringResponse",  # noqa: E501
            _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_recurrings(self, request_id, **kwargs):  # noqa: E501
        """Get recurring list information  # noqa: E501

        :param str request_id: Request ID (required)
        :param str currency: [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of transactions currency
        :param datetime end_time: Date and time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period ends (not inclusive), UTC time, must be less than 7 days after 'start_time', default is current time (format: yyyy-MM-dd'T'HH:mm:ss'Z')
        :param int max_count: Limit number of returned transactions (must be less than 10000, default is 1000)
        :param str merchant_order_id: Merchant order number from the merchant system
        :param str payment_method: Used payment method type name from payment methods list
        :param list[str] recurring_types:
        :param str sort_order: Sort based on order of results. `asc` for ascending order or `desc` for descending order (default value)
        :param datetime start_time: Date and time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period starts (inclusive), UTC time, default is 24 hours before 'end_time' (format: yyyy-MM-dd'T'HH:mm:ss'Z')
        :param str type: Filter recurring payments by certain type (applicable to /api/recurrings endpoint only): `SCHEDULED` for scheduled recurring payments `ONECLICK` for one-click payments `INSTALLMENT` for installment payments
        :return: RecurringsList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.get_recurrings_with_http_info(request_id, **kwargs)  # noqa: E501
        return data

    def get_recurrings_with_http_info(self, request_id, **kwargs):  # noqa: E501
        """Get recurring list information  # noqa: E501

        :param str request_id: Request ID (required)
        :param str currency: [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of transactions currency
        :param datetime end_time: Date and time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period ends (not inclusive), UTC time, must be less than 7 days after 'start_time', default is current time (format: yyyy-MM-dd'T'HH:mm:ss'Z')
        :param int max_count: Limit number of returned transactions (must be less than 10000, default is 1000)
        :param str merchant_order_id: Merchant order number from the merchant system
        :param str payment_method: Used payment method type name from payment methods list
        :param list[str] recurring_types:
        :param str sort_order: Sort based on order of results. `asc` for ascending order or `desc` for descending order (default value)
        :param datetime start_time: Date and time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period starts (inclusive), UTC time, default is 24 hours before 'end_time' (format: yyyy-MM-dd'T'HH:mm:ss'Z')
        :param str type: Filter recurring payments by certain type (applicable to /api/recurrings endpoint only): `SCHEDULED` for scheduled recurring payments `ONECLICK` for one-click payments `INSTALLMENT` for installment payments
        :return: RecurringsList
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = [
            "request_id",
            "currency",
            "end_time",
            "max_count",
            "merchant_order_id",
            "payment_method",
            "recurring_types",
            "sort_order",
            "start_time",
            "type",
        ]  # noqa: E501
        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_recurrings" % key
                )
            params[key] = val
        del params["kwargs"]
        # verify the required parameter 'request_id' is set
        if "request_id" not in params or params["request_id"] is None:
            raise ValueError(
                "Missing the required parameter `request_id` when calling `get_recurrings`"
            )  # noqa: E501

        if "request_id" in params and len(params["request_id"]) > 50:
            raise ValueError(
                "Invalid value for parameter `request_id` when calling `get_recurrings`, length must be less than or equal to `50`"
            )  # noqa: E501
        if "request_id" in params and len(params["request_id"]) < 0:
            raise ValueError(
                "Invalid value for parameter `request_id` when calling `get_recurrings`, length must be greater than or equal to `0`"
            )  # noqa: E501
        if "max_count" in params and params["max_count"] > 10000:  # noqa: E501
            raise ValueError(
                "Invalid value for parameter `max_count` when calling `get_recurrings`, must be a value less than or equal to `10000`"
            )  # noqa: E501
        if "merchant_order_id" in params and len(params["merchant_order_id"]) > 50:
            raise ValueError(
                "Invalid value for parameter `merchant_order_id` when calling `get_recurrings`, length must be less than or equal to `50`"
            )  # noqa: E501
        if "merchant_order_id" in params and len(params["merchant_order_id"]) < 0:
            raise ValueError(
                "Invalid value for parameter `merchant_order_id` when calling `get_recurrings`, length must be greater than or equal to `0`"
            )  # noqa: E501
        if "payment_method" in params and len(params["payment_method"]) > 100:
            raise ValueError(
                "Invalid value for parameter `payment_method` when calling `get_recurrings`, length must be less than or equal to `100`"
            )  # noqa: E501
        if "payment_method" in params and len(params["payment_method"]) < 0:
            raise ValueError(
                "Invalid value for parameter `payment_method` when calling `get_recurrings`, length must be greater than or equal to `0`"
            )  # noqa: E501
        if "sort_order" in params and not re.search(
            r"asc|desc", params["sort_order"]
        ):  # noqa: E501
            raise ValueError(
                "Invalid value for parameter `sort_order` when calling `get_recurrings`, must conform to the pattern `/asc|desc/`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if "currency" in params:
            query_params.append(("currency", params["currency"]))  # noqa: E501
        if "end_time" in params:
            query_params.append(("end_time", params["end_time"]))  # noqa: E501
        if "max_count" in params:
            query_params.append(("max_count", params["max_count"]))  # noqa: E501
        if "merchant_order_id" in params:
            query_params.append(
                ("merchant_order_id", params["merchant_order_id"])
            )  # noqa: E501
        if "payment_method" in params:
            query_params.append(
                ("payment_method", params["payment_method"])
            )  # noqa: E501
        if "recurring_types" in params:
            query_params.append(
                ("recurring_types", params["recurring_types"])
            )  # noqa: E501
            collection_formats["recurring_types"] = "multi"  # noqa: E501
        if "request_id" in params:
            query_params.append(("request_id", params["request_id"]))  # noqa: E501
        if "sort_order" in params:
            query_params.append(("sort_order", params["sort_order"]))  # noqa: E501
        if "start_time" in params:
            query_params.append(("start_time", params["start_time"]))  # noqa: E501
        if "type" in params:
            query_params.append(("type", params["type"]))  # noqa: E501

        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

        return self.api_client.call_api(
            "/api/recurrings",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="RecurringsList",  # noqa: E501
            _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_subscription(self, subscription_id, **kwargs):  # noqa: E501
        """Get subscription information  # noqa: E501

        :param str subscription_id: subscription id (required)
        :return: SubscriptionGetResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.get_subscription_with_http_info(
            subscription_id, **kwargs
        )  # noqa: E501
        return data

    def get_subscription_with_http_info(self, subscription_id, **kwargs):  # noqa: E501
        """Get subscription information  # noqa: E501

        :param str subscription_id: subscription id (required)
        :return: SubscriptionGetResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if "subscription_id" in params:
            path_params["subscriptionId"] = params["subscription_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

        return self.api_client.call_api(
            "/api/recurring_subscriptions/{subscriptionId}",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="SubscriptionGetResponse",  # noqa: E501
            _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_subscriptions(self, request_id, **kwargs):  # noqa: E501
        """Get subscription information  # noqa: E501

        :param str request_id: Request ID (required)
        :param str account_id: Merchant identifier of customer account
        :param str currency: [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of transactions currency
        :param datetime end_time: Date and time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period ends (not inclusive), UTC time, must be less than 7 days after 'start_time', default is current time (format: yyyy-MM-dd'T'HH:mm:ss'Z')
        :param int max_count: Limit number of returned subscriptions (must be less than 10000, default is 1000)
        :param int offset: Offset (must be less than 10000)
        :param str plan_id: Id of plan. Use for searching scheduled subscriptions by plan
        :param str sort_order: Sort based on order of results. 'asc' for ascending order or 'desc' for descending order (default value)
        :param datetime start_time: Date and time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period starts (inclusive), UTC time, default is 24 hours before 'end_time' (format: yyyy-MM-dd'T'HH:mm:ss'Z')
        :param str status: Status of subscription
        :param str type: Type of subscription. 'ONECLICK' type will be ignored.
        :return: SubscriptionList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.get_subscriptions_with_http_info(
            request_id, **kwargs
        )  # noqa: E501
        return data

    def get_subscriptions_with_http_info(self, request_id, **kwargs):  # noqa: E501
        """Get subscription information  # noqa: E501

        :param str request_id: Request ID (required)
        :param str account_id: Merchant identifier of customer account
        :param str currency: [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of transactions currency
        :param datetime end_time: Date and time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period ends (not inclusive), UTC time, must be less than 7 days after 'start_time', default is current time (format: yyyy-MM-dd'T'HH:mm:ss'Z')
        :param int max_count: Limit number of returned subscriptions (must be less than 10000, default is 1000)
        :param int offset: Offset (must be less than 10000)
        :param str plan_id: Id of plan. Use for searching scheduled subscriptions by plan
        :param str sort_order: Sort based on order of results. 'asc' for ascending order or 'desc' for descending order (default value)
        :param datetime start_time: Date and time up to milliseconds (in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when requested period starts (inclusive), UTC time, default is 24 hours before 'end_time' (format: yyyy-MM-dd'T'HH:mm:ss'Z')
        :param str status: Status of subscription
        :param str type: Type of subscription. 'ONECLICK' type will be ignored.
        :return: SubscriptionList
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = [
            "request_id",
            "account_id",
            "currency",
            "end_time",
            "max_count",
            "offset",
            "plan_id",
            "sort_order",
            "start_time",
            "status",
            "type",
        ]  # noqa: E501
        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_subscriptions" % key
                )
            params[key] = val
        del params["kwargs"]
        # verify the required parameter 'request_id' is set
        if "request_id" not in params or params["request_id"] is None:
            raise ValueError(
                "Missing the required parameter `request_id` when calling `get_subscriptions`"
            )  # noqa: E501

        if "request_id" in params and len(params["request_id"]) > 50:
            raise ValueError(
                "Invalid value for parameter `request_id` when calling `get_subscriptions`, length must be less than or equal to `50`"
            )  # noqa: E501
        if "request_id" in params and len(params["request_id"]) < 1:
            raise ValueError(
                "Invalid value for parameter `request_id` when calling `get_subscriptions`, length must be greater than or equal to `1`"
            )  # noqa: E501
        if "account_id" in params and len(params["account_id"]) > 32:
            raise ValueError(
                "Invalid value for parameter `account_id` when calling `get_subscriptions`, length must be less than or equal to `32`"
            )  # noqa: E501
        if "account_id" in params and len(params["account_id"]) < 0:
            raise ValueError(
                "Invalid value for parameter `account_id` when calling `get_subscriptions`, length must be greater than or equal to `0`"
            )  # noqa: E501
        if "max_count" in params and params["max_count"] > 10000:  # noqa: E501
            raise ValueError(
                "Invalid value for parameter `max_count` when calling `get_subscriptions`, must be a value less than or equal to `10000`"
            )  # noqa: E501
        if "max_count" in params and params["max_count"] < 1:  # noqa: E501
            raise ValueError(
                "Invalid value for parameter `max_count` when calling `get_subscriptions`, must be a value greater than or equal to `1`"
            )  # noqa: E501
        if "offset" in params and params["offset"] > 10000:  # noqa: E501
            raise ValueError(
                "Invalid value for parameter `offset` when calling `get_subscriptions`, must be a value less than or equal to `10000`"
            )  # noqa: E501
        if "offset" in params and params["offset"] < 0:  # noqa: E501
            raise ValueError(
                "Invalid value for parameter `offset` when calling `get_subscriptions`, must be a value greater than or equal to `0`"
            )  # noqa: E501
        if "plan_id" in params and len(params["plan_id"]) > 32:
            raise ValueError(
                "Invalid value for parameter `plan_id` when calling `get_subscriptions`, length must be less than or equal to `32`"
            )  # noqa: E501
        if "plan_id" in params and len(params["plan_id"]) < 0:
            raise ValueError(
                "Invalid value for parameter `plan_id` when calling `get_subscriptions`, length must be greater than or equal to `0`"
            )  # noqa: E501
        if "sort_order" in params and not re.search(
            r"asc|desc", params["sort_order"]
        ):  # noqa: E501
            raise ValueError(
                "Invalid value for parameter `sort_order` when calling `get_subscriptions`, must conform to the pattern `/asc|desc/`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if "account_id" in params:
            query_params.append(("account_id", params["account_id"]))  # noqa: E501
        if "currency" in params:
            query_params.append(("currency", params["currency"]))  # noqa: E501
        if "end_time" in params:
            query_params.append(("end_time", params["end_time"]))  # noqa: E501
        if "max_count" in params:
            query_params.append(("max_count", params["max_count"]))  # noqa: E501
        if "offset" in params:
            query_params.append(("offset", params["offset"]))  # noqa: E501
        if "plan_id" in params:
            query_params.append(("plan_id", params["plan_id"]))  # noqa: E501
        if "request_id" in params:
            query_params.append(("request_id", params["request_id"]))  # noqa: E501
        if "sort_order" in params:
            query_params.append(("sort_order", params["sort_order"]))  # noqa: E501
        if "start_time" in params:
            query_params.append(("start_time", params["start_time"]))  # noqa: E501
        if "status" in params:
            query_params.append(("status", params["status"]))  # noqa: E501
        if "type" in params:
            query_params.append(("type", params["type"]))  # noqa: E501

        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

        return self.api_client.call_api(
            "/api/recurring_subscriptions",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="SubscriptionList",  # noqa: E501
            _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 update_plan(self, plan_id, plan_update_request, **kwargs):  # noqa: E501
        """Update plan  # noqa: E501

        :param str plan_id: Plan ID (required)
        :param PlanUpdateRequest plan_update_request: planUpdateRequest (required)
        :return: PlanUpdateResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.update_plan_with_http_info(
            plan_id, plan_update_request, **kwargs
        )  # noqa: E501
        return data

    def update_plan_with_http_info(
        self, plan_id, plan_update_request, **kwargs
    ):  # noqa: E501
        """Update plan  # noqa: E501

        :param str plan_id: Plan ID (required)
        :param PlanUpdateRequest plan_update_request: planUpdateRequest (required)
        :return: PlanUpdateResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if "plan_id" in params:
            path_params["plan_id"] = params["plan_id"]  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if "plan_update_request" in params:
            body_params = params["plan_update_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

        return self.api_client.call_api(
            "/api/recurring_plans/{plan_id}",
            "PATCH",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="PlanUpdateResponse",  # noqa: E501
            _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 update_recurring(
        self, recurring_id, recurring_patch_request, **kwargs
    ):  # noqa: E501
        """Update recurring  # noqa: E501

        :param str recurring_id: Recurring ID (required)
        :param RecurringPatchRequest recurring_patch_request: recurringPatchRequest (required)
        :return: RecurringUpdateResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.update_recurring_with_http_info(
            recurring_id, recurring_patch_request, **kwargs
        )  # noqa: E501
        return data

    def update_recurring_with_http_info(
        self, recurring_id, recurring_patch_request, **kwargs
    ):  # noqa: E501
        """Update recurring  # noqa: E501

        :param str recurring_id: Recurring ID (required)
        :param RecurringPatchRequest recurring_patch_request: recurringPatchRequest (required)
        :return: RecurringUpdateResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if "recurring_id" in params:
            path_params["recurringId"] = params["recurring_id"]  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if "recurring_patch_request" in params:
            body_params = params["recurring_patch_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

        return self.api_client.call_api(
            "/api/recurrings/{recurringId}",
            "PATCH",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="RecurringUpdateResponse",  # noqa: E501
            _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 update_subscription(
        self, subscription_id, subscription_update_request, **kwargs
    ):  # noqa: E501
        """Update subscription  # noqa: E501

        :param str subscription_id: Subscription ID (required)
        :param SubscriptionUpdateRequest subscription_update_request: subscriptionUpdateRequest (required)
        :return: SubscriptionUpdateResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True

        (data) = self.update_subscription_with_http_info(
            subscription_id, subscription_update_request, **kwargs
        )  # noqa: E501
        return data

    def update_subscription_with_http_info(
        self, subscription_id, subscription_update_request, **kwargs
    ):  # noqa: E501
        """Update subscription  # noqa: E501

        :param str subscription_id: Subscription ID (required)
        :param SubscriptionUpdateRequest subscription_update_request: subscriptionUpdateRequest (required)
        :return: SubscriptionUpdateResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if "subscription_id" in params:
            path_params["subscriptionId"] = params["subscription_id"]  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if "subscription_update_request" in params:
            body_params = params["subscription_update_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

        return self.api_client.call_api(
            "/api/recurring_subscriptions/{subscriptionId}",
            "PATCH",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="SubscriptionUpdateResponse",  # noqa: E501
            _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,
        )
