export type GetApiV1CsatSurveyIdSharesArgs = {surveyId: number, maxResults?: number | undefined, page?: number | undefined, type?: ('EMAIL' | 'SMS' | 'SYSTEM' | 'LINK' | 'INAPP' | 'MOBILE_SDK' | 'EMAIL_EMBED' | 'QR_CODE' | 'SLACK' | 'TEAMS' | 'WHATSAPP' | 'OFFLINE' | 'SPOTCHECK' | 'SMART_REACH') | undefined, mode?: ('BLAST' | 'RECURRING' | 'RELATIVE_RECURRING' | 'TEST' | 'LINK' | 'INTERCOM' | 'INAPP' | 'MOBILE_SDK' | 'EMAIL_EMBED' | 'QR_CODE' | 'WHATSAPP' | 'OFFLINE' | 'SPOTCHECK') | undefined}; export type GetApiV1CsatSurveyIdSharesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * List csat channels * * GET /v1/csat/{surveyId}/shares */ export const getApiV1CsatSurveyIdShares = async (args: GetApiV1CsatSurveyIdSharesArgs, options?: GetApiV1CsatSurveyIdSharesOptions) => { const {baseUrl = "https://api.surveysparrow.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.maxResults != null) query.append("maxResults", String(args.maxResults)) if (args.page != null) query.append("page", String(args.page)) if (args.type != null) query.append("type", String(args.type)) if (args.mode != null) query.append("mode", String(args.mode)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/csat/${encodeURIComponent(String(args.surveyId))}/shares${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };