export type DeleteApiApiAtlasV2GroupsGroupIdStreamsTenantNameConnectionsConnectionNameArgs = {envelope?: boolean | undefined, pretty?: boolean | undefined, groupId: string, tenantName: string, connectionName: string}; export type DeleteApiApiAtlasV2GroupsGroupIdStreamsTenantNameConnectionsConnectionNameOptions = {baseUrl?: string | undefined, ServiceAccounts?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete One Stream Connection * * DELETE /api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections/{connectionName} * * Also accepts auth: DigestAuth */ export const deleteApiApiAtlasV2GroupsGroupIdStreamsTenantNameConnectionsConnectionName = async (args: DeleteApiApiAtlasV2GroupsGroupIdStreamsTenantNameConnectionsConnectionNameArgs, options?: DeleteApiApiAtlasV2GroupsGroupIdStreamsTenantNameConnectionsConnectionNameOptions) => { const {baseUrl = "https://cloud.mongodb.com", fetch: fetchFn = fetch, ServiceAccounts} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/vnd.atlas.2023-02-01+json") if (args.envelope != null) query.append("envelope", String(args.envelope)) if (args.pretty != null) query.append("pretty", String(args.pretty)) if (ServiceAccounts !== undefined) headers.set('authorization', `Bearer ${ServiceAccounts}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/atlas/v2/groups/${encodeURIComponent(String(args.groupId))}/streams/${encodeURIComponent(String(args.tenantName))}/connections/${encodeURIComponent(String(args.connectionName))}${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 (await res.json()) as unknown };