export type GetApiNetworkProfilesArgs = {'broadcast-hint'?: string | undefined}; export type GetApiNetworkProfilesOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Get a description of a network interface. * * GET /network-profiles */ export const getApiNetworkProfiles = async (args: GetApiNetworkProfilesArgs, options: GetApiNetworkProfilesOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['broadcast-hint'] != null) query.append("broadcast-hint", String(args['broadcast-hint'])) const url = `${baseUrl.replace(/\/+$/, '')}/network-profiles${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 undefined };