export type DeleteApiApiAtlasV2GroupsGroupIdClustersClusterNameSnapshotsSnapshotIdArgs = {envelope?: boolean | undefined, groupId: string, pretty?: boolean | undefined, clusterName: string, snapshotId: string}; export type DeleteApiApiAtlasV2GroupsGroupIdClustersClusterNameSnapshotsSnapshotIdOptions = {baseUrl?: string | undefined, ServiceAccounts?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove One Legacy Backup Snapshot * * DELETE /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshots/{snapshotId} * * Also accepts auth: DigestAuth */ export const deleteApiApiAtlasV2GroupsGroupIdClustersClusterNameSnapshotsSnapshotId = async (args: DeleteApiApiAtlasV2GroupsGroupIdClustersClusterNameSnapshotsSnapshotIdArgs, options?: DeleteApiApiAtlasV2GroupsGroupIdClustersClusterNameSnapshotsSnapshotIdOptions) => { 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))}/snapshots/${encodeURIComponent(String(args.snapshotId))}${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 };