import { ApiResponse , RequestOptions } from '../core' ; import { ListMerchantsResponse , listMerchantsResponseSchema , } from '../models/listMerchantsResponse' ; import { RetrieveMerchantResponse , retrieveMerchantResponseSchema , } from '../models/retrieveMerchantResponse' ; import { number , optional , string } from '../schema' ; import { BaseApi } from './baseApi' ; export class MerchantsApi extends BaseApi { param cursor return async listMerchants ( cursor ? , requestOptions ? ) { const req = this . createRequest ( 'GET' , '/v2/merchants' ) ; const mapped = req . prepareArgs ( { cursor : [ cursor , optional ( number ( ) ) ] } ) ; req . query ( 'cursor' , mapped . cursor ) ; return req . callAsJson ( listMerchantsResponseSchema , requestOptions ) ; } param merchantId return async retrieveMerchant ( merchantId , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { merchantId : [ merchantId , string ( ) ] } ) ; req . appendTemplatePath `/v2/merchants/${ mapped . merchantId }` ; return req . callAsJson ( retrieveMerchantResponseSchema , requestOptions ) ; } }