export type UpdateCreatorDto = {partnerName?: string | undefined, avatarAssetId?: string | undefined, profileColor?: string | undefined, userName?: string | undefined}; export type PatchApiV1AdminCreatorsCreatorIdArgs = {creatorId: string, body: UpdateCreatorDto}; export type PatchApiV1AdminCreatorsCreatorIdOptions = {baseUrl: string, accessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * PATCH /v1/admin/creators/{creatorId} */ export const patchApiV1AdminCreatorsCreatorId = async (args: PatchApiV1AdminCreatorsCreatorIdArgs, options: PatchApiV1AdminCreatorsCreatorIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, accessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (accessToken !== undefined) headers.set('authorization', `Bearer ${accessToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/admin/creators/${encodeURIComponent(String(args.creatorId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };