export type Archivo = {height?: number | undefined, timestamp?: string | undefined, uri?: (string | null) | undefined, fileName?: (string | null) | undefined, data?: (string | null) | undefined}; export type BannersRqs = {bannerID?: number | undefined, paisID?: (number | null) | undefined, url?: (string | null) | undefined, isActive?: boolean | undefined, posicion?: number | undefined, imgBanner?: Archivo | undefined}; export type UpdateApiV1ApiBannersBannerIDArgs = {BannerID: number, body: BannersRqs}; export type UpdateApiV1ApiBannersBannerIDOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * PUT /v1/api/Banners/{BannerID} */ export const updateApiV1ApiBannersBannerID = async (args: UpdateApiV1ApiBannersBannerIDArgs, options: UpdateApiV1ApiBannersBannerIDOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/v1/api/Banners/${encodeURIComponent(String(args.BannerID))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };