export type UnmatchRequest = {reason: string}; export type DeleteApiV1MatchingGroupsMatchGroupIdArgs = {'X-Request-Id'?: string | undefined, matchGroupId: string, contextId: string, body: UnmatchRequest}; export type DeleteApiV1MatchingGroupsMatchGroupIdOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Break/Unmatch a match group * * DELETE /v1/matching/groups/{matchGroupId} */ export const deleteApiV1MatchingGroupsMatchGroupId = async (args: DeleteApiV1MatchingGroupsMatchGroupIdArgs, options?: DeleteApiV1MatchingGroupsMatchGroupIdOptions) => { const {baseUrl = "https://identity.sandbox.lerian.net", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-Request-Id'] != null) headers.set("X-Request-Id", String(args['X-Request-Id'])) if (args.contextId != null) query.append("contextId", String(args.contextId)) if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/matching/groups/${encodeURIComponent(String(args.matchGroupId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", 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 };