export type DeleteApiV2StudentsIdRelationshipsDomainMembershipsDomainIdArgs = {id: string, domain_id: string}; export type DeleteApiV2StudentsIdRelationshipsDomainMembershipsDomainIdOptions = {baseUrl: string, JWTAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove a domain membership from a student * * DELETE /v2/students/{id}/relationships/domain-memberships/{domain_id} */ export const deleteApiV2StudentsIdRelationshipsDomainMembershipsDomainId = async (args: DeleteApiV2StudentsIdRelationshipsDomainMembershipsDomainIdArgs, options: DeleteApiV2StudentsIdRelationshipsDomainMembershipsDomainIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, JWTAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (JWTAuth !== undefined) headers.set('authorization', `Bearer ${JWTAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/students/${encodeURIComponent(String(args.id))}/relationships/domain-memberships/${encodeURIComponent(String(args.domain_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 };