export type DeleteApiApiPersonsPersonIdRequestedAttributePermissionsArgs = {attributes: 'ANONYMOUS' | 'EMAIL' | 'ID_TOKEN' | 'NAME' | 'PHOTO' | 'SYSTEM_ID', credentialProviderId: string, personId: string}; export type DeleteApiApiPersonsPersonIdRequestedAttributePermissionsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete user-provided permissions for sending the attribute types required when issuing a credential type. * * DELETE /api/persons/{personId}/requestedAttributePermissions */ export const deleteApiApiPersonsPersonIdRequestedAttributePermissions = async (args: DeleteApiApiPersonsPersonIdRequestedAttributePermissionsArgs, options: DeleteApiApiPersonsPersonIdRequestedAttributePermissionsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.attributes != null) query.append("attributes", String(args.attributes)) if (args.credentialProviderId != null) query.append("credentialProviderId", String(args.credentialProviderId)) const url = `${baseUrl.replace(/\/+$/, '')}/api/persons/${encodeURIComponent(String(args.personId))}/requestedAttributePermissions${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };