export type DeleteApiV1OrganizationsOrganizationIdHoldersHolderIdArgs = {organization_id: string, holder_id: string, 'X-Request-Id'?: string | undefined, Authorization?: string | undefined, hard_delete?: string | undefined}; export type DeleteApiV1OrganizationsOrganizationIdHoldersHolderIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Holder * * DELETE /v1/organizations/{organization_id}/holders/{holder_id} */ export const deleteApiV1OrganizationsOrganizationIdHoldersHolderId = async (args: DeleteApiV1OrganizationsOrganizationIdHoldersHolderIdArgs, options?: DeleteApiV1OrganizationsOrganizationIdHoldersHolderIdOptions) => { const {baseUrl = "https://identity.sandbox.lerian.net", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Request-Id'] != null) headers.set("X-Request-Id", String(args['X-Request-Id'])) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (args.hard_delete != null) query.append("hard_delete", String(args.hard_delete)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/organizations/${encodeURIComponent(String(args.organization_id))}/holders/${encodeURIComponent(String(args.holder_id))}${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 };