export type VagaroMerchantModelRequestGetServiceProvidersByServiceRequest = {serviceID?: number | undefined, businessID?: number | undefined}; export type CreateApiGroupApiVVersionMerchantGetserviceprovidersbyserviceArgs = {group: string, version: string, body: VagaroMerchantModelRequestGetServiceProvidersByServiceRequest}; export type CreateApiGroupApiVVersionMerchantGetserviceprovidersbyserviceOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /{group}/api/v{version}/merchant/getserviceprovidersbyservice */ export const createApiGroupApiVVersionMerchantGetserviceprovidersbyservice = async (args: CreateApiGroupApiVVersionMerchantGetserviceprovidersbyserviceArgs, options: CreateApiGroupApiVVersionMerchantGetserviceprovidersbyserviceOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/${encodeURIComponent(String(args.group))}/api/v${encodeURIComponent(String(args.version))}/merchant/getserviceprovidersbyservice${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };