export type DeleteApiApiAtlasV2GroupsGroupIdClustersClusterNameOnlineArchivesArchiveIdArgs = {groupId: string, envelope?: boolean | undefined, pretty?: boolean | undefined, archiveId: string, clusterName: string}; export type DeleteApiApiAtlasV2GroupsGroupIdClustersClusterNameOnlineArchivesArchiveIdOptions = {baseUrl?: string | undefined, ServiceAccounts?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove One Online Archive * * DELETE /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/{archiveId} * * Also accepts auth: DigestAuth */ export const deleteApiApiAtlasV2GroupsGroupIdClustersClusterNameOnlineArchivesArchiveId = async (args: DeleteApiApiAtlasV2GroupsGroupIdClustersClusterNameOnlineArchivesArchiveIdArgs, options?: DeleteApiApiAtlasV2GroupsGroupIdClustersClusterNameOnlineArchivesArchiveIdOptions) => { 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-01-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))}/clusters/${encodeURIComponent(String(args.clusterName))}/onlineArchives/${encodeURIComponent(String(args.archiveId))}${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 };