export type GetApiMoviesMemberArgs = {id?: string | undefined, state?: string | undefined, released?: string | undefined, start?: string | undefined, limit?: string | undefined, order?: string | undefined, summary?: string | undefined, tags?: string | undefined, excluded_tags?: string | undefined, includes?: string | undefined, platforms?: string | undefined, with_rewatch?: string | undefined, locale?: string | undefined}; export type GetApiMoviesMemberOptions = {baseUrl?: string | undefined, BetaSeriesApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Display all movies of a member * * GET /movies/member */ export const getApiMoviesMember = async (args: GetApiMoviesMemberArgs, options?: GetApiMoviesMemberOptions) => { const {baseUrl = "https://api.betaseries.com", fetch: fetchFn = fetch, BetaSeriesApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.id != null) query.append("id", String(args.id)) if (args.state != null) query.append("state", String(args.state)) if (args.released != null) query.append("released", String(args.released)) if (args.start != null) query.append("start", String(args.start)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.order != null) query.append("order", String(args.order)) if (args.summary != null) query.append("summary", String(args.summary)) if (args.tags != null) query.append("tags", String(args.tags)) if (args.excluded_tags != null) query.append("excluded_tags", String(args.excluded_tags)) if (args.includes != null) query.append("includes", String(args.includes)) if (args.platforms != null) query.append("platforms", String(args.platforms)) if (args.with_rewatch != null) query.append("with_rewatch", String(args.with_rewatch)) if (args.locale != null) query.append("locale", String(args.locale)) if (BetaSeriesApiKey !== undefined) headers.set("X-BetaSeries-Key", BetaSeriesApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/movies/member${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 };