export type CreateApiV1SubjectRightsRequestsDsarIdIdentificationArgs = {dsarId: string, body: BodyInit}; export type CreateApiV1SubjectRightsRequestsDsarIdIdentificationOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update Identification Photo * * POST /v1/subject-rights/requests/{dsarId}/identification */ export const createApiV1SubjectRightsRequestsDsarIdIdentification = async (args: CreateApiV1SubjectRightsRequestsDsarIdIdentificationArgs, options?: CreateApiV1SubjectRightsRequestsDsarIdIdentificationOptions) => { const {baseUrl = "https://api.osano.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "image/webp") if (ApiKeyAuth !== undefined) headers.set("x-osano-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/subject-rights/requests/${encodeURIComponent(String(args.dsarId))}/identification${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };