export type UpdateApiApiUsersIdMartAttributesMartAttributeIdArgs = {id: number, martAttributeId: number}; export type UpdateApiApiUsersIdMartAttributesMartAttributeIdOptions = {baseUrl: string, token?: string | undefined, fetch?: typeof fetch | undefined}; /** * PUT /api/users/{id}/mart-attributes/{martAttributeId} */ export const updateApiApiUsersIdMartAttributesMartAttributeId = async (args: UpdateApiApiUsersIdMartAttributesMartAttributeIdArgs, options: UpdateApiApiUsersIdMartAttributesMartAttributeIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, token} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (token !== undefined) headers.set("X-Deluxe-Auth", token) const url = `${baseUrl.replace(/\/+$/, '')}/api/users/${encodeURIComponent(String(args.id))}/mart-attributes/${encodeURIComponent(String(args.martAttributeId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };