export type GetApiApiLeagueSocialScrapingSettingsArgs = {enabled_status: 'enabled' | 'disabled', name?: string | undefined, genre_id?: Array | undefined, subgenre_id?: Array | undefined, platform?: Array | undefined, week_day?: Array | undefined, order_by?: string | undefined, order?: string | undefined}; export type GetApiApiLeagueSocialScrapingSettingsOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * List social scraping settings for all leagues. * * GET /api/league/social-scraping-settings */ export const getApiApiLeagueSocialScrapingSettings = async (args: GetApiApiLeagueSocialScrapingSettingsArgs, options: GetApiApiLeagueSocialScrapingSettingsOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.enabled_status != null) query.append("enabled_status", String(args.enabled_status)) if (args.name != null) query.append("name", String(args.name)) if (args.genre_id != null) query.append("genre_id", args.genre_id.join(',')) if (args.subgenre_id != null) query.append("subgenre_id", args.subgenre_id.join(',')) if (args.platform != null) query.append("platform", args.platform.join(',')) if (args.week_day != null) query.append("week_day", args.week_day.join(',')) if (args.order_by != null) query.append("order_by", String(args.order_by)) if (args.order != null) query.append("order", String(args.order)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/league/social-scraping-settings${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 };