import { ApiResponse , RequestOptions } from '../core' ; import { CreateCheckoutRequest , createCheckoutRequestSchema , } from '../models/createCheckoutRequest' ; import { CreateCheckoutResponse , createCheckoutResponseSchema , } from '../models/createCheckoutResponse' ; import { string } from '../schema' ; import { BaseApi } from './baseApi' ; export class CheckoutApi extends BaseApi { param locationId param body return async createCheckout ( locationId , body , requestOptions ? ) { const req = this . createRequest ( 'POST' ) ; const mapped = req . prepareArgs ( { locationId : [ locationId , string ( ) ] , body : [ body , createCheckoutRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; req . appendTemplatePath `/v2/locations/${ mapped . locationId }/checkouts` ; return req . callAsJson ( createCheckoutResponseSchema , requestOptions ) ; } }