export type GetApiV1StaticIpv6sTxtArgs = {'x-checkly-account'?: string | undefined}; export type GetApiV1StaticIpv6sTxtOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Lists all source IPv6s for check runs as a txt file * * GET /v1/static-ipv6s.txt */ export const getApiV1StaticIpv6sTxt = async (args: GetApiV1StaticIpv6sTxtArgs, options?: GetApiV1StaticIpv6sTxtOptions) => { const {baseUrl = "https://api.checklyhq.com", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") if (args['x-checkly-account'] != null) headers.set("x-checkly-account", String(args['x-checkly-account'])) if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/static-ipv6s.txt${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.text() };