# coding: utf-8

"""
    PAY.JP API v2

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 2.0.0
    Contact: support@pay.jp
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501

import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from pydantic import Field, StrictStr
from typing import Optional
from typing_extensions import Annotated
from payjpv2.models.payment_flow_cancel_request import PaymentFlowCancelRequest
from payjpv2.models.payment_flow_capture_request import PaymentFlowCaptureRequest
from payjpv2.models.payment_flow_confirm_request import PaymentFlowConfirmRequest
from payjpv2.models.payment_flow_create_request import PaymentFlowCreateRequest
from payjpv2.models.payment_flow_list_response import PaymentFlowListResponse
from payjpv2.models.payment_flow_response import PaymentFlowResponse
from payjpv2.models.payment_flow_update_request import PaymentFlowUpdateRequest
from payjpv2.models.payment_refund_list_response import PaymentRefundListResponse

from payjpv2.api_client import ApiClient, RequestSerialized
from payjpv2.api_response import ApiResponse
from payjpv2.rest import RESTResponseType


class PaymentFlowsApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client


    @validate_call
    def cancel_payment_flow(
        self,
        payment_flow_id: StrictStr,
        payment_flow_cancel_request: Optional[PaymentFlowCancelRequest] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PaymentFlowResponse:
        """Cancel Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param payment_flow_cancel_request:
        :type payment_flow_cancel_request: PaymentFlowCancelRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._cancel_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            payment_flow_cancel_request=payment_flow_cancel_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def cancel_payment_flow_with_http_info(
        self,
        payment_flow_id: StrictStr,
        payment_flow_cancel_request: Optional[PaymentFlowCancelRequest] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PaymentFlowResponse]:
        """Cancel Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param payment_flow_cancel_request:
        :type payment_flow_cancel_request: PaymentFlowCancelRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._cancel_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            payment_flow_cancel_request=payment_flow_cancel_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def cancel_payment_flow_without_preload_content(
        self,
        payment_flow_id: StrictStr,
        payment_flow_cancel_request: Optional[PaymentFlowCancelRequest] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Cancel Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param payment_flow_cancel_request:
        :type payment_flow_cancel_request: PaymentFlowCancelRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._cancel_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            payment_flow_cancel_request=payment_flow_cancel_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        return response_data.response


    def _cancel_payment_flow_serialize(
        self,
        payment_flow_id,
        payment_flow_cancel_request,
        _request_auth,
        _content_type,
        _headers,
        _idempotency_key,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        if _idempotency_key is not None:
            _header_params['Idempotency-Key'] = _idempotency_key
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if payment_flow_id is not None:
            _path_params['payment_flow_id'] = payment_flow_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if payment_flow_cancel_request is not None:
            _body_params = payment_flow_cancel_request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json', 
                    'application/problem+json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'HTTPBasic', 
            'HTTPBearer'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v2/payment_flows/{payment_flow_id}/cancel',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def capture_payment_flow(
        self,
        payment_flow_id: StrictStr,
        payment_flow_capture_request: Optional[PaymentFlowCaptureRequest] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PaymentFlowResponse:
        """Capture Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param payment_flow_capture_request:
        :type payment_flow_capture_request: PaymentFlowCaptureRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._capture_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            payment_flow_capture_request=payment_flow_capture_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def capture_payment_flow_with_http_info(
        self,
        payment_flow_id: StrictStr,
        payment_flow_capture_request: Optional[PaymentFlowCaptureRequest] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PaymentFlowResponse]:
        """Capture Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param payment_flow_capture_request:
        :type payment_flow_capture_request: PaymentFlowCaptureRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._capture_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            payment_flow_capture_request=payment_flow_capture_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def capture_payment_flow_without_preload_content(
        self,
        payment_flow_id: StrictStr,
        payment_flow_capture_request: Optional[PaymentFlowCaptureRequest] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Capture Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param payment_flow_capture_request:
        :type payment_flow_capture_request: PaymentFlowCaptureRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._capture_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            payment_flow_capture_request=payment_flow_capture_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        return response_data.response


    def _capture_payment_flow_serialize(
        self,
        payment_flow_id,
        payment_flow_capture_request,
        _request_auth,
        _content_type,
        _headers,
        _idempotency_key,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        if _idempotency_key is not None:
            _header_params['Idempotency-Key'] = _idempotency_key
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if payment_flow_id is not None:
            _path_params['payment_flow_id'] = payment_flow_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if payment_flow_capture_request is not None:
            _body_params = payment_flow_capture_request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json', 
                    'application/problem+json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'HTTPBasic', 
            'HTTPBearer'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v2/payment_flows/{payment_flow_id}/capture',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def confirm_payment_flow(
        self,
        payment_flow_id: StrictStr,
        payment_flow_confirm_request: Optional[PaymentFlowConfirmRequest] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PaymentFlowResponse:
        """Confirm Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param payment_flow_confirm_request:
        :type payment_flow_confirm_request: PaymentFlowConfirmRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._confirm_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            payment_flow_confirm_request=payment_flow_confirm_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def confirm_payment_flow_with_http_info(
        self,
        payment_flow_id: StrictStr,
        payment_flow_confirm_request: Optional[PaymentFlowConfirmRequest] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PaymentFlowResponse]:
        """Confirm Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param payment_flow_confirm_request:
        :type payment_flow_confirm_request: PaymentFlowConfirmRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._confirm_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            payment_flow_confirm_request=payment_flow_confirm_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def confirm_payment_flow_without_preload_content(
        self,
        payment_flow_id: StrictStr,
        payment_flow_confirm_request: Optional[PaymentFlowConfirmRequest] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Confirm Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param payment_flow_confirm_request:
        :type payment_flow_confirm_request: PaymentFlowConfirmRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._confirm_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            payment_flow_confirm_request=payment_flow_confirm_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        return response_data.response


    def _confirm_payment_flow_serialize(
        self,
        payment_flow_id,
        payment_flow_confirm_request,
        _request_auth,
        _content_type,
        _headers,
        _idempotency_key,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        if _idempotency_key is not None:
            _header_params['Idempotency-Key'] = _idempotency_key
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if payment_flow_id is not None:
            _path_params['payment_flow_id'] = payment_flow_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if payment_flow_confirm_request is not None:
            _body_params = payment_flow_confirm_request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json', 
                    'application/problem+json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'HTTPBasic', 
            'HTTPBearer'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v2/payment_flows/{payment_flow_id}/confirm',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def create_payment_flow(
        self,
        payment_flow_create_request: PaymentFlowCreateRequest,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PaymentFlowResponse:
        """Create Payment Flow


        :param payment_flow_create_request: (required)
        :type payment_flow_create_request: PaymentFlowCreateRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._create_payment_flow_serialize(
            payment_flow_create_request=payment_flow_create_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def create_payment_flow_with_http_info(
        self,
        payment_flow_create_request: PaymentFlowCreateRequest,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PaymentFlowResponse]:
        """Create Payment Flow


        :param payment_flow_create_request: (required)
        :type payment_flow_create_request: PaymentFlowCreateRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._create_payment_flow_serialize(
            payment_flow_create_request=payment_flow_create_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def create_payment_flow_without_preload_content(
        self,
        payment_flow_create_request: PaymentFlowCreateRequest,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create Payment Flow


        :param payment_flow_create_request: (required)
        :type payment_flow_create_request: PaymentFlowCreateRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._create_payment_flow_serialize(
            payment_flow_create_request=payment_flow_create_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        return response_data.response


    def _create_payment_flow_serialize(
        self,
        payment_flow_create_request,
        _request_auth,
        _content_type,
        _headers,
        _idempotency_key,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        if _idempotency_key is not None:
            _header_params['Idempotency-Key'] = _idempotency_key
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if payment_flow_create_request is not None:
            _body_params = payment_flow_create_request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json', 
                    'application/problem+json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'HTTPBasic', 
            'HTTPBearer'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v2/payment_flows',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_all_payment_flows(
        self,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="取得するデータの最大件数")] = None,
        starting_after: Annotated[Optional[StrictStr], Field(description="このIDより後のデータを取得")] = None,
        ending_before: Annotated[Optional[StrictStr], Field(description="このIDより前のデータを取得")] = None,
        customer_id: Annotated[Optional[StrictStr], Field(description="指定した顧客のデータのみを取得")] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PaymentFlowListResponse:
        """Get All Payment Flows


        :param limit: 取得するデータの最大件数
        :type limit: int
        :param starting_after: このIDより後のデータを取得
        :type starting_after: str
        :param ending_before: このIDより前のデータを取得
        :type ending_before: str
        :param customer_id: 指定した顧客のデータのみを取得
        :type customer_id: str
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_all_payment_flows_serialize(
            limit=limit,
            starting_after=starting_after,
            ending_before=ending_before,
            customer_id=customer_id,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowListResponse",
            '422': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_all_payment_flows_with_http_info(
        self,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="取得するデータの最大件数")] = None,
        starting_after: Annotated[Optional[StrictStr], Field(description="このIDより後のデータを取得")] = None,
        ending_before: Annotated[Optional[StrictStr], Field(description="このIDより前のデータを取得")] = None,
        customer_id: Annotated[Optional[StrictStr], Field(description="指定した顧客のデータのみを取得")] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PaymentFlowListResponse]:
        """Get All Payment Flows


        :param limit: 取得するデータの最大件数
        :type limit: int
        :param starting_after: このIDより後のデータを取得
        :type starting_after: str
        :param ending_before: このIDより前のデータを取得
        :type ending_before: str
        :param customer_id: 指定した顧客のデータのみを取得
        :type customer_id: str
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_all_payment_flows_serialize(
            limit=limit,
            starting_after=starting_after,
            ending_before=ending_before,
            customer_id=customer_id,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowListResponse",
            '422': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_all_payment_flows_without_preload_content(
        self,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="取得するデータの最大件数")] = None,
        starting_after: Annotated[Optional[StrictStr], Field(description="このIDより後のデータを取得")] = None,
        ending_before: Annotated[Optional[StrictStr], Field(description="このIDより前のデータを取得")] = None,
        customer_id: Annotated[Optional[StrictStr], Field(description="指定した顧客のデータのみを取得")] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get All Payment Flows


        :param limit: 取得するデータの最大件数
        :type limit: int
        :param starting_after: このIDより後のデータを取得
        :type starting_after: str
        :param ending_before: このIDより前のデータを取得
        :type ending_before: str
        :param customer_id: 指定した顧客のデータのみを取得
        :type customer_id: str
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_all_payment_flows_serialize(
            limit=limit,
            starting_after=starting_after,
            ending_before=ending_before,
            customer_id=customer_id,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowListResponse",
            '422': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        return response_data.response


    def _get_all_payment_flows_serialize(
        self,
        limit,
        starting_after,
        ending_before,
        customer_id,
        _request_auth,
        _content_type,
        _headers,
        _idempotency_key,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        if _idempotency_key is not None:
            _header_params['Idempotency-Key'] = _idempotency_key
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if limit is not None:
            
            _query_params.append(('limit', limit))
            
        if starting_after is not None:
            
            _query_params.append(('starting_after', starting_after))
            
        if ending_before is not None:
            
            _query_params.append(('ending_before', ending_before))
            
        if customer_id is not None:
            
            _query_params.append(('customer_id', customer_id))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json', 
                    'application/problem+json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'HTTPBasic', 
            'HTTPBearer'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v2/payment_flows',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_payment_flow(
        self,
        payment_flow_id: StrictStr,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PaymentFlowResponse:
        """Get Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_payment_flow_with_http_info(
        self,
        payment_flow_id: StrictStr,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PaymentFlowResponse]:
        """Get Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_payment_flow_without_preload_content(
        self,
        payment_flow_id: StrictStr,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        return response_data.response


    def _get_payment_flow_serialize(
        self,
        payment_flow_id,
        _request_auth,
        _content_type,
        _headers,
        _idempotency_key,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        if _idempotency_key is not None:
            _header_params['Idempotency-Key'] = _idempotency_key
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if payment_flow_id is not None:
            _path_params['payment_flow_id'] = payment_flow_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json', 
                    'application/problem+json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'HTTPBasic', 
            'HTTPBearer'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v2/payment_flows/{payment_flow_id}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_payment_flow_refunds(
        self,
        payment_flow_id: StrictStr,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="取得するデータの最大件数")] = None,
        starting_after: Annotated[Optional[StrictStr], Field(description="このIDより後のデータを取得")] = None,
        ending_before: Annotated[Optional[StrictStr], Field(description="このIDより前のデータを取得")] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PaymentRefundListResponse:
        """Get Payment Flow Refunds

        Payment Flowに紐づくRefundsをリスト取得する

        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param limit: 取得するデータの最大件数
        :type limit: int
        :param starting_after: このIDより後のデータを取得
        :type starting_after: str
        :param ending_before: このIDより前のデータを取得
        :type ending_before: str
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_payment_flow_refunds_serialize(
            payment_flow_id=payment_flow_id,
            limit=limit,
            starting_after=starting_after,
            ending_before=ending_before,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentRefundListResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_payment_flow_refunds_with_http_info(
        self,
        payment_flow_id: StrictStr,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="取得するデータの最大件数")] = None,
        starting_after: Annotated[Optional[StrictStr], Field(description="このIDより後のデータを取得")] = None,
        ending_before: Annotated[Optional[StrictStr], Field(description="このIDより前のデータを取得")] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PaymentRefundListResponse]:
        """Get Payment Flow Refunds

        Payment Flowに紐づくRefundsをリスト取得する

        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param limit: 取得するデータの最大件数
        :type limit: int
        :param starting_after: このIDより後のデータを取得
        :type starting_after: str
        :param ending_before: このIDより前のデータを取得
        :type ending_before: str
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_payment_flow_refunds_serialize(
            payment_flow_id=payment_flow_id,
            limit=limit,
            starting_after=starting_after,
            ending_before=ending_before,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentRefundListResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_payment_flow_refunds_without_preload_content(
        self,
        payment_flow_id: StrictStr,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="取得するデータの最大件数")] = None,
        starting_after: Annotated[Optional[StrictStr], Field(description="このIDより後のデータを取得")] = None,
        ending_before: Annotated[Optional[StrictStr], Field(description="このIDより前のデータを取得")] = None,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get Payment Flow Refunds

        Payment Flowに紐づくRefundsをリスト取得する

        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param limit: 取得するデータの最大件数
        :type limit: int
        :param starting_after: このIDより後のデータを取得
        :type starting_after: str
        :param ending_before: このIDより前のデータを取得
        :type ending_before: str
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_payment_flow_refunds_serialize(
            payment_flow_id=payment_flow_id,
            limit=limit,
            starting_after=starting_after,
            ending_before=ending_before,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentRefundListResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        return response_data.response


    def _get_payment_flow_refunds_serialize(
        self,
        payment_flow_id,
        limit,
        starting_after,
        ending_before,
        _request_auth,
        _content_type,
        _headers,
        _idempotency_key,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        if _idempotency_key is not None:
            _header_params['Idempotency-Key'] = _idempotency_key
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if payment_flow_id is not None:
            _path_params['payment_flow_id'] = payment_flow_id
        # process the query parameters
        if limit is not None:
            
            _query_params.append(('limit', limit))
            
        if starting_after is not None:
            
            _query_params.append(('starting_after', starting_after))
            
        if ending_before is not None:
            
            _query_params.append(('ending_before', ending_before))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json', 
                    'application/problem+json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'HTTPBasic', 
            'HTTPBearer'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v2/payment_flows/{payment_flow_id}/refunds',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def update_payment_flow(
        self,
        payment_flow_id: StrictStr,
        payment_flow_update_request: PaymentFlowUpdateRequest,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PaymentFlowResponse:
        """Update Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param payment_flow_update_request: (required)
        :type payment_flow_update_request: PaymentFlowUpdateRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            payment_flow_update_request=payment_flow_update_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def update_payment_flow_with_http_info(
        self,
        payment_flow_id: StrictStr,
        payment_flow_update_request: PaymentFlowUpdateRequest,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PaymentFlowResponse]:
        """Update Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param payment_flow_update_request: (required)
        :type payment_flow_update_request: PaymentFlowUpdateRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            payment_flow_update_request=payment_flow_update_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def update_payment_flow_without_preload_content(
        self,
        payment_flow_id: StrictStr,
        payment_flow_update_request: PaymentFlowUpdateRequest,
        *,
        request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth: Optional[Dict[StrictStr, Any]] = None,
        headers: Optional[Dict[StrictStr, Any]] = None,
        idempotency_key: Optional[StrictStr] = None,
        host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update Payment Flow


        :param payment_flow_id: (required)
        :type payment_flow_id: str
        :param payment_flow_update_request: (required)
        :type payment_flow_update_request: PaymentFlowUpdateRequest
        :param request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type request_timeout: int, tuple(int, int), optional
        :param request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type request_auth: dict, optional
        :param headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type headers: dict, optional
        :param idempotency_key: an idempotency key for the request.
                                 used to ensure the request is only processed once.
        :type idempotency_key: str, optional
        :param host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_payment_flow_serialize(
            payment_flow_id=payment_flow_id,
            payment_flow_update_request=payment_flow_update_request,
            _request_auth=request_auth,
            _content_type='application/json',
            _headers=headers,
            _idempotency_key=idempotency_key,
            _host_index=host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaymentFlowResponse",
            '422': "ErrorResponse",
            '404': "ErrorResponse",
            '400': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=request_timeout
        )
        return response_data.response


    def _update_payment_flow_serialize(
        self,
        payment_flow_id,
        payment_flow_update_request,
        _request_auth,
        _content_type,
        _headers,
        _idempotency_key,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        if _idempotency_key is not None:
            _header_params['Idempotency-Key'] = _idempotency_key
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if payment_flow_id is not None:
            _path_params['payment_flow_id'] = payment_flow_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if payment_flow_update_request is not None:
            _body_params = payment_flow_update_request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json', 
                    'application/problem+json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'HTTPBasic', 
            'HTTPBearer'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v2/payment_flows/{payment_flow_id}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


