44a0-96e8-eeee761a9cfb","timestamp":"2026-03-07T12:40:09.610Z"} {"parentUuid":"7aecda29-9edb-44a0-96e8-eeee761a9cfb","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:09.639Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01RZfeyuD35SMNi4MiJL3rks","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01EUZSipu6sNpG32N4t1Yqxm","name":"Read","input":{"file_path":"/home/josie/development/irc-now/crates/pics/src/routes/image.rs","limit":300},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":6513,"cache_read_input_tokens":67726,"cache_creation":{"ephemeral_5m_input_tokens":6513,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard","inference_geo":"not_available"},"context_management":null},"requestId":"req_011CYojbaXxczeBizuNAcN6w","uuid":"a6f947dd-2548-48d9-9125-c5ef6b62cbdc"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"0e47e241-8f36-46bd-8f0d-33d1c193c9da","timestamp":"2026-03-07T12:40:09.639Z"} {"parentUuid":"0e47e241-8f36-46bd-8f0d-33d1c193c9da","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01EUZSipu6sNpG32N4t1Yqxm","type":"tool_result","content":" 1→use axum::{\n 2→ extract::{Multipart, Path, State},\n 3→ http::StatusCode,\n 4→ response::{IntoResponse, Redirect, Response},\n 5→};\n 6→use askama::Template;\n 7→use askama_web::WebTemplate;\n 8→use sha2::{Digest, Sha256};\n 9→use sqlx::FromRow;\n 10→\n 11→use crate::auth_guard::{AuthUser, OptionalAuth};\n 12→use crate::csam::CsamResult;\n 13→use crate::state::AppState;\n 14→\n 15→const MAX_FILE_SIZE: usize = 10 * 1024 * 1024;\n 16→const FREE_STORAGE_LIMIT: i64 = 50 * 1024 * 1024;\n 17→const PRO_STORAGE_LIMIT: i64 = 1024 * 1024 * 1024;\n 18→const THUMB_MAX_DIM: u32 = 300;\n 19→\n 20→const FREE_EXPIRY_DAYS: i64 = 90;\n 21→const PRO_EXPIRY_DAYS: i64 = 90;\n 22→\n 23→const ALLOWED_TYPES: &[&str] = &[\"image/jpeg\", \"image/png\", \"image/gif\", \"image/webp\"];\n 24→\n 25→fn detect_content_type(data: &[u8]) -> Option<&'static str> {\n 26→ if data.len() < 12 {\n 27→ return None;\n 28→ }\n 29→ if data[0..3] == [0xFF, 0xD8, 0xFF] {\n 30→ Some(\"image/jpeg\")\n 31→ } else if data[0..4] == [0x89, 0x50, 0x4E, 0x47] {\n 32→ Some(\"image/png\")\n 33→ } else if data[0..3] == [0x47, 0x49, 0x46] {\n 34→ Some(\"image/gif\")\n 35→ } else if data[0..4] == [0x52, 0x49, 0x46, 0x46] && data[8..12] == [0x57, 0x45, 0x42, 0x50] {\n 36→ Some(\"image/webp\")\n 37→ } else {\n 38→ None\n 39→ }\n 40→}\n 41→\n 42→fn generate_thumbnail_from_image(img: &::image::DynamicImage) -> Result, String> {\n 43→ let thumb = img.resize(THUMB_MAX_DIM, THUMB_MAX_DIM, ::image::imageops::FilterType::Lanczos3);\n 44→ let mut buf = std::io::Cursor::new(Vec::new());\n 45→ thumb\n 46→ .write_to(&mut buf, ::image::ImageFormat::WebP)\n 47→ .map_err(|e| format!(\"thumbnail encode failed: {e}\"))?;\n 48→ Ok(buf.into_inner())\n 49→}\n 50→\n 51→fn format_time(t: time::OffsetDateTime) -> String {\n 52→ format!(\n 53→ \"{:04}-{:02}-{:02} {:02}:{:02} UTC\",\n 54→ t.year(),\n 55→ t.month() as u8,\n 56→ t.day(),\n 57→ t.hour(),\n 58→ t.minute(),\n 59→ )\n 60→}\n 61→\n 62→fn format_size(bytes: i64) -> String {\n 63→ if bytes < 1024 {\n 64→ format!(\"{bytes} B\")\n 65→ } else if bytes < 1024 * 1024 {\n 66→ format!(\"{:.1} KB\", bytes as f64 / 1024.0)\n 67→ } else {\n 68→ format!(\"{:.1} MB\", bytes as f64 / (1024.0 * 1024.0))\n 69→ }\n 70→}\n 71→\n 72→#[derive(FromRow)]\n 73→#[allow(dead_code)]\n 74→struct ImageRow {\n 75→ id: String,\n 76→ user_id: String,\n 77→ filename: String,\n 78→ content_type: String,\n 79→ size_bytes: i64,\n 80→ width: Option,\n 81→ height: Option,\n 82→ created_at: time::OffsetDateTime,\n 83→ expires_at: Option,\n 84→}\n 85→\n 86→#[derive(Template, WebTemplate)]\n 87→#[template(path = \"upload.html\")]\n 88→#[allow(dead_code)]\n 89→pub struct UploadTemplate {\n 90→ pub email: Option,\n 91→}\n 92→\n 93→pub async fn index(AuthUser(user): AuthUser) -> UploadTemplate {\n 94→ UploadTemplate {\n 95→ email: user.email,\n 96→ }\n 97→}\n 98→\n 99→pub async fn upload(\n 100→ State(state): State,\n 101→ AuthUser(user): AuthUser,\n 102→ mut multipart: Multipart,\n 103→) -> Result {\n 104→ let is_pro = user.is_pro();\n 105→\n 106→ {\n 107→ let mut limiter = state.upload_limiter.lock().await;\n 108→ let entries = limiter.entry(user.sub.clone()).or_default();\n 109→ if !crate::state::check_rate_limit(entries, is_pro) {\n 110→ return Err((StatusCode::TOO_MANY_REQUESTS, \"upload rate limit exceeded\").into_response());\n 111→ }\n 112→ }\n 113→\n 114→ let storage_limit = if is_pro { PRO_STORAGE_LIMIT } else { FREE_STORAGE_LIMIT };\n 115→\n 116→ let used: (Option,) =\n 117→ sqlx::query_as(\"SELECT sum(size_bytes) FROM images WHERE user_id = $1\")\n 118→ .bind(&user.sub)\n 119→ .fetch_one(&state.db)\n 120→ .await\n 121→ .map_err(|e| {\n 122→ tracing::error!(\"storage query failed: {e}\");\n 123→ (StatusCode::INTERNAL_SERVER_ERROR, \"internal error\").into_response()\n 124→ })?;\n 125→ let used_bytes = used.0.unwrap_or(0);\n 126→\n 127→ let mut file_data: Option<(String, String, Vec)> = None;\n 128→\n 129→ while let Ok(Some(field)) = multipart.next_field().await {\n 130→ if field.name() == Some(\"file\") {\n 131→ let filename = field\n 132→ .file_name()\n 133→ .unwrap_or(\"upload\")\n 134→ .to_string();\n 135→ let content_type = field\n 136→ .content_type()\n 137→ .unwrap_or(\"application/octet-stream\")\n 138→ .to_string();\n 139→ let data = field.bytes().await.map_err(|e| {\n 140→ tracing::error!(\"multipart read failed: {e}\");\n 141→ (StatusCode::BAD_REQUEST, \"failed to read upload\").into_response()\n 142→ })?;\n 143→ file_data = Some((filename, content_type, data.to_vec()));\n 144→ break;\n 145→ }\n 146→ }\n 147→\n 148→ let (filename, claimed_type, data) = file_data.ok_or_else(|| {\n 149→ (StatusCode::BAD_REQUEST, \"no file uploaded\").into_response()\n 150→ })?;\n 151→\n 152→ if data.len() > MAX_FILE_SIZE {\n 153→ return Err((StatusCode::BAD_REQUEST, \"file too large (10MB max)\").into_response());\n 154→ }\n 155→\n 156→ let detected_type = detect_content_type(&data).ok_or_else(|| {\n 157→ (StatusCode::BAD_REQUEST, \"unsupported image format\").into_response()\n 158→ })?;\n 159→\n 160→ if !ALLOWED_TYPES.contains(&claimed_type.as_str()) || detected_type != claimed_type {\n 161→ return Err(\n 162→ (StatusCode::BAD_REQUEST, \"content type mismatch or unsupported format\").into_response(),\n 163→ );\n 164→ }\n 165→\n 166→ if let Some(scanner) = &state.csam_scanner {\n 167→ match scanner.check(&data).await {\n 168→ Ok(CsamResult::Match) => {\n 169→ let hash = hex::encode(Sha256::digest(&data));\n 170→ tracing::error!(\"CSAM match detected for user {} hash {}\", user.sub, hash);\n 171→ let _ = sqlx::query(\n 172→ \"INSERT INTO csam_incidents (user_id, image_hash) VALUES ($1, $2)\",\n 173→ )\n 174→ .bind(&user.sub)\n 175→ .bind(&hash)\n 176→ .execute(&state.db)\n 177→ .await;\n 178→ return Err((StatusCode::FORBIDDEN, \"upload rejected\").into_response());\n 179→ }\n 180→ Ok(CsamResult::Clean) => {}\n 181→ Err(e) => {\n 182→ tracing::error!(\"CSAM scanner unavailable: {e}\");\n 183→ return Err((\n 184→ StatusCode::SERVICE_UNAVAILABLE,\n 185→ \"upload temporarily unavailable\",\n 186→ )\n 187→ .into_response());\n 188→ }\n 189→ }\n 190→ }\n 191→\n 192→ let size_bytes = data.len() as i64;\n 193→ if used_bytes + size_bytes > storage_limit {\n 194→ return Err((\n 195→ StatusCode::FORBIDDEN,\n 196→ \"storage limit reached -- upgrade to pro for more space\",\n 197→ )\n 198→ .into_response());\n 199→ }\n 200→\n 201→ const MAX_DECODED_BYTES: u64 = 100 * 1024 * 1024;\n 202→ let img = ::image::load_from_memory(&data).map_err(|_| {\n 203→ (StatusCode::BAD_REQUEST, \"invalid image data\").into_response()\n 204→ })?;\n 205→ let (w, h) = (img.width(), img.height());\n 206→ if (w as u64) * (h as u64) * 4 > MAX_DECODED_BYTES {\n 207→ return Err((StatusCode::BAD_REQUEST, \"image dimensions too large\").into_response());\n 208→ }\n 209→ let (width, height) = (Some(w as i32), Some(h as i32));\n 210→\n 211→ let thumb_data = generate_thumbnail_from_image(&img).map_err(|e| {\n 212→ tracing::error!(\"thumbnail generation failed: {e}\");\n 213→ (StatusCode::INTERNAL_SERVER_ERROR, \"thumbnail failed\").into_response()\n 214→ })?;\n 215→\n 216→ let expires_at = if !is_pro {\n 217→ Some(time::OffsetDateTime::now_utc() + time::Duration::days(FREE_EXPIRY_DAYS))\n 218→ } else if user.content_expires() {\n 219→ Some(time::OffsetDateTime::now_utc() + time::Duration::days(PRO_EXPIRY_DAYS))\n 220→ } else {\n 221→ None\n 222→ };\n 223→\n 224→ let id = nanoid::nanoid!(8);\n 225→ let filename: String = filename\n 226→ .chars()\n 227→ .map(|c| if c.is_alphanumeric() || c == '.' || c == '_' || c == '-' { c } else { '_' })\n 228→ .collect();\n 229→ let original_key = format!(\"{id}/{filename}\");\n 230→ let thumb_key = format!(\"{id}/thumb.webp\");\n 231→\n 232→ state\n 233→ .storage\n 234→ .put(&original_key, &data, &claimed_type)\n 235→ .await\n 236→ .map_err(|e| {\n 237→ tracing::error!(\"S3 upload failed: {e}\");\n 238→ (StatusCode::INTERNAL_SERVER_ERROR, \"upload failed\").into_response()\n 239→ })?;\n 240→\n 241→ state\n 242→ .storage\n 243→ .put(&thumb_key, &thumb_data, \"image/webp\")\n 244→ .await\n 245→ .map_err(|e| {\n 246→ tracing::error!(\"S3 thumbnail upload failed: {e}\");\n 247→ (StatusCode::INTERNAL_SERVER_ERROR, \"thumbnail upload failed\").into_response()\n 248→ })?;\n 249→\n 250→ sqlx::query(\n 251→ \"INSERT INTO images (id, user_id, filename, content_type, size_bytes, width, height, expires_at)\n 252→ VALUES ($1, $2, $3, $4, $5, $6, $7, $8)\",\n 253→ )\n 254→ .bind(&id)\n 255→ .bind(&user.sub)\n 256→ .bind(&filename)\n 257→ .bind(&claimed_type)\n 258→ .bind(size_bytes)\n 259→ .bind(width)\n 260→ .bind(height)\n 261→ .bind(expires_at)\n 262→ .execute(&state.db)\n 263→ .await\n 264→ .map_err(|e| {\n 265→ tracing::error!(\"image insert failed: {e}\");\n 266→ (StatusCode::INTERNAL_SERVER_ERROR, \"internal error\").into_response()\n 267→ })?;\n 268→\n 269→ Ok(Redirect::to(&format!(\"/{id}\")))\n 270→}\n 271→\n 272→#[derive(Template, WebTemplate)]\n 273→#[template(path = \"view.html\")]\n 274→pub struct ViewTemplate {\n 275→ pub id: String,\n 276→ pub filename: String,\n 277→ pub content_type: String,\n 278→ pub size: String,\n 279→ pub width: Option,\n 280→ pub height: Option,\n 281→ pub created_at: String,\n 282→ pub is_owner: bool,\n 283→}\n 284→\n 285→pub async fn view(\n 286→ State(state): State,\n 287→ OptionalAuth(user): OptionalAuth,\n 288→ Path(id): Path,\n 289→) -> Result {\n 290→ let row = sqlx::query_as::<_, ImageRow>(\n 291→ \"SELECT * FROM images WHERE id = $1 AND hidden = false\",\n 292→ )\n 293→ .bind(&id)\n 294→ .fetch_optional(&state.db)\n 295→ .await\n 296→ .map_err(|e| {\n 297→ tracing::error!(\"image query failed: {e}\");\n 298→ StatusCode::INTERNAL_SERVER_ERROR\n 299→ })?\n 300→ .ok_or(StatusCode::NOT_FOUND)?;"}]},"uuid":"dc4d5a90-d52e-4d84-9a61-7312741f0e41","timestamp":"2026-03-07T12:40:09.724Z"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"d1614e64-3d3f-450c-bcd9-fb6c3977fdcf","timestamp":"2026-03-07T12:40:10.019Z"} {"parentUuid":"d1614e64-3d3f-450c-bcd9-fb6c3977fdcf","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:10.045Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01RZfeyuD35SMNi4MiJL3rks","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01APuP9WKnRUpBcnRCNrSPwc","name":"Read","input":{"file_path":"/home/josie/development/irc-now/crates/web-api/src/ergo_admin.rs","limit":200},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":6513,"cache_read_input_tokens":67726,"cache_creation":{"ephemeral_5m_input_tokens":6513,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard","inference_geo":"not_available"},"context_management":null},"requestId":"req_011CYojbaXxczeBizuNAcN6w","uuid":"b8115235-56dd-44de-87c7-ba035a35c326"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"3ffcfeb2-556d-4a1c-984e-f87292d9d00a","timestamp":"2026-03-07T12:40:10.045Z"} {"parentUuid":"3ffcfeb2-556d-4a1c-984e-f87292d9d00a","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01APuP9WKnRUpBcnRCNrSPwc","type":"tool_result","content":" 1→use k8s_openapi::api::core::v1::Secret;\n 2→use kube::Api;\n 3→use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader};\n 4→use tokio::net::TcpStream;\n 5→\n 6→const ERGO_HOST: &str = \"irc-now-net\";\n 7→const ERGO_PORT: u16 = 6667;\n 8→const OPER_SECRET_NAME: &str = \"irc-now-net-oper\";\n 9→const TIMEOUT: std::time::Duration = std::time::Duration::from_secs(10);\n 10→\n 11→async fn read_oper_password(kube: &kube::Client, namespace: &str) -> Result {\n 12→ let api: Api = Api::namespaced(kube.clone(), namespace);\n 13→ let secret = api\n 14→ .get(OPER_SECRET_NAME)\n 15→ .await\n 16→ .map_err(|e| format!(\"failed to get oper secret: {e}\"))?;\n 17→\n 18→ secret\n 19→ .data\n 20→ .as_ref()\n 21→ .and_then(|d| d.get(\"password\"))\n 22→ .map(|b| String::from_utf8_lossy(&b.0).trim().to_string())\n 23→ .ok_or_else(|| \"missing 'password' key in oper secret\".to_string())\n 24→}\n 25→\n 26→fn validate_irc_param(s: &str) -> Result<(), String> {\n 27→ let re = regex::Regex::new(r\"^[a-zA-Z0-9_\\-]{1,50}$\").unwrap();\n 28→ if re.is_match(s) {\n 29→ Ok(())\n 30→ } else {\n 31→ Err(format!(\"invalid IRC parameter: {s}\"))\n 32→ }\n 33→}\n 34→\n 35→pub async fn ensure_ergo_account(\n 36→ kube: &kube::Client,\n 37→ namespace: &str,\n 38→ username: &str,\n 39→ password: &str,\n 40→) -> Result<(), String> {\n 41→ validate_irc_param(username)?;\n 42→ let oper_password = read_oper_password(kube, namespace).await?;\n 43→\n 44→ tokio::time::timeout(TIMEOUT, async {\n 45→ let stream = TcpStream::connect((ERGO_HOST, ERGO_PORT))\n 46→ .await\n 47→ .map_err(|e| format!(\"connect to ergo failed: {e}\"))?;\n 48→\n 49→ let (reader, mut writer) = stream.into_split();\n 50→ let mut lines = BufReader::new(reader).lines();\n 51→\n 52→ writer\n 53→ .write_all(b\"NICK ergo-admin\\r\\nUSER ergo-admin 0 * :admin\\r\\n\")\n 54→ .await\n 55→ .map_err(|e| format!(\"write failed: {e}\"))?;\n 56→\n 57→ loop {\n 58→ let line = lines\n 59→ .next_line()\n 60→ .await\n 61→ .map_err(|e| format!(\"read failed: {e}\"))?\n 62→ .ok_or(\"connection closed before welcome\")?;\n 63→\n 64→ if line.starts_with(\"PING\") {\n 65→ let token = line.splitn(2, ' ').nth(1).unwrap_or(\"\");\n 66→ writer\n 67→ .write_all(format!(\"PONG {token}\\r\\n\").as_bytes())\n 68→ .await\n 69→ .map_err(|e| format!(\"write failed: {e}\"))?;\n 70→ }\n 71→\n 72→ if line.contains(\" 001 \") {\n 73→ break;\n 74→ }\n 75→ }\n 76→\n 77→ writer\n 78→ .write_all(format!(\"OPER admin {oper_password}\\r\\n\").as_bytes())\n 79→ .await\n 80→ .map_err(|e| format!(\"write failed: {e}\"))?;\n 81→\n 82→ loop {\n 83→ let line = lines\n 84→ .next_line()\n 85→ .await\n 86→ .map_err(|e| format!(\"read failed: {e}\"))?\n 87→ .ok_or(\"connection closed before oper reply\")?;\n 88→\n 89→ if line.starts_with(\"PING\") {\n 90→ let token = line.splitn(2, ' ').nth(1).unwrap_or(\"\");\n 91→ writer\n 92→ .write_all(format!(\"PONG {token}\\r\\n\").as_bytes())\n 93→ .await\n 94→ .map_err(|e| format!(\"write failed: {e}\"))?;\n 95→ }\n 96→\n 97→ if line.contains(\" 381 \") {\n 98→ break;\n 99→ }\n 100→\n 101→ if line.contains(\" 491 \") || line.contains(\"ERR_NOOPERHOST\") {\n 102→ return Err(\"OPER authentication failed\".to_string());\n 103→ }\n 104→ }\n 105→\n 106→ writer\n 107→ .write_all(\n 108→ format!(\"NS SAREGISTER {username} {password}\\r\\n\").as_bytes(),\n 109→ )\n 110→ .await\n 111→ .map_err(|e| format!(\"write failed: {e}\"))?;\n 112→\n 113→ loop {\n 114→ let line = lines\n 115→ .next_line()\n 116→ .await\n 117→ .map_err(|e| format!(\"read failed: {e}\"))?\n 118→ .ok_or(\"connection closed before SAREGISTER reply\")?;\n 119→\n 120→ if line.starts_with(\"PING\") {\n 121→ let token = line.splitn(2, ' ').nth(1).unwrap_or(\"\");\n 122→ writer\n 123→ .write_all(format!(\"PONG {token}\\r\\n\").as_bytes())\n 124→ .await\n 125→ .map_err(|e| format!(\"write failed: {e}\"))?;\n 126→ }\n 127→\n 128→ if line.contains(\"NickServ\") || line.contains(\"nickserv\") {\n 129→ let lower = line.to_lowercase();\n 130→\n 131→ if lower.contains(\"successfully registered\") || lower.contains(\"registered account\") {\n 132→ tracing::info!(\"registered ergo account '{username}'\");\n 133→ let _ = writer.write_all(b\"QUIT\\r\\n\").await;\n 134→ return Ok(());\n 135→ }\n 136→\n 137→ if lower.contains(\"account already exists\") {\n 138→ tracing::info!(\"ergo account '{username}' exists, resetting password\");\n 139→ writer\n 140→ .write_all(\n 141→ format!(\"NS SAPASSWD {username} {password}\\r\\n\").as_bytes(),\n 142→ )\n 143→ .await\n 144→ .map_err(|e| format!(\"write failed: {e}\"))?;\n 145→\n 146→ loop {\n 147→ let line2 = lines\n 148→ .next_line()\n 149→ .await\n 150→ .map_err(|e| format!(\"read failed: {e}\"))?\n 151→ .ok_or(\"connection closed before SAPASSWD reply\")?;\n 152→\n 153→ if line2.starts_with(\"PING\") {\n 154→ let token = line2.splitn(2, ' ').nth(1).unwrap_or(\"\");\n 155→ writer\n 156→ .write_all(format!(\"PONG {token}\\r\\n\").as_bytes())\n 157→ .await\n 158→ .map_err(|e| format!(\"write failed: {e}\"))?;\n 159→ }\n 160→\n 161→ if line2.contains(\"NickServ\") || line2.contains(\"nickserv\") {\n 162→ let lower2 = line2.to_lowercase();\n 163→ let _ = writer.write_all(b\"QUIT\\r\\n\").await;\n 164→\n 165→ if lower2.contains(\"error\") || lower2.contains(\"fail\") || lower2.contains(\"unknown command\") {\n 166→ return Err(format!(\"SAPASSWD failed: {line2}\"));\n 167→ }\n 168→\n 169→ tracing::info!(\"reset ergo password for '{username}'\");\n 170→ return Ok(());\n 171→ }\n 172→ }\n 173→ }\n 174→\n 175→ if lower.contains(\"error\") || lower.contains(\"fail\") {\n 176→ let _ = writer.write_all(b\"QUIT\\r\\n\").await;\n 177→ return Err(format!(\"SAREGISTER failed: {line}\"));\n 178→ }\n 179→\n 180→ let _ = writer.write_all(b\"QUIT\\r\\n\").await;\n 181→ tracing::info!(\"SAREGISTER response: {line}\");\n 182→ return Ok(());\n 183→ }\n 184→ }\n 185→ })\n 186→ .await\n 187→ .map_err(|_| \"ergo admin connection timed out\".to_string())?\n 188→}\n 189→\n 190→pub fn generate_password() -> String {\n 191→ use rand::Rng;\n 192→ const CHARSET: &[u8] = b\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n 193→ let mut rng = rand::thread_rng();\n 194→ (0..24)\n 195→ .map(|_| {\n 196→ let idx = rng.gen_range(0..CHARSET.len());\n 197→ CHARSET[idx] as char\n 198→ })\n 199→ .collect()\n 200→}"}]},"uuid":"5c5fc593-12c6-4c39-99af-b5b139ddfbac","timestamp":"2026-03-07T12:40:10.118Z"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"cdaeff09-ea6c-42e8-b279-4ff84b07a283","timestamp":"2026-03-07T12:40:10.181Z"} {"parentUuid":"cdaeff09-ea6c-42e8-b279-4ff84b07a283","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:12.542Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01ERRDPWkUriuvah7hTSmp22","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01S3V62EQfG1wNR6G8yzXCkA","name":"Read","input":{"file_path":"/home/josie/development/irc-now/crates/soju-operator/src/resources/configmap.rs","limit":250},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":10007,"cache_read_input_tokens":74239,"cache_creation":{"ephemeral_5m_input_tokens":10007,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard","inference_geo":"not_available"},"context_management":null},"requestId":"req_011CYojbo52PinL9NguiaAPb","uuid":"0329bb88-f10f-4a9b-b607-33b17aa6864e"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"f03a80e8-202e-4cd9-ae23-1fdc0bae210a","timestamp":"2026-03-07T12:40:12.542Z"} {"parentUuid":"f03a80e8-202e-4cd9-ae23-1fdc0bae210a","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01S3V62EQfG1wNR6G8yzXCkA","type":"tool_result","content":" 1→use k8s_openapi::api::core::v1::ConfigMap;\n 2→use kube::api::ObjectMeta;\n 3→use kube::Resource;\n 4→\n 5→use crate::types::{Listener, SojuBouncer, SojuBouncerSpec};\n 6→\n 7→pub fn build_configmap(bouncer: &SojuBouncer, db_uri: &str, auth_url: Option<&str>) -> ConfigMap {\n 8→ let name = bouncer.metadata.name.clone().unwrap();\n 9→ let ns = bouncer.metadata.namespace.clone().unwrap();\n 10→ let oref = bouncer.controller_owner_ref(&()).unwrap();\n 11→\n 12→ let config = generate_soju_config(&bouncer.spec, db_uri, auth_url);\n 13→\n 14→ ConfigMap {\n 15→ metadata: ObjectMeta {\n 16→ name: Some(format!(\"{name}-config\")),\n 17→ namespace: Some(ns),\n 18→ owner_references: Some(vec![oref]),\n 19→ ..Default::default()\n 20→ },\n 21→ data: Some([(\"config\".to_string(), config)].into()),\n 22→ ..Default::default()\n 23→ }\n 24→}\n 25→\n 26→fn sanitize_config_value(s: &str) -> String {\n 27→ s.chars().filter(|c| *c != '\\n' && *c != '\\r').collect()\n 28→}\n 29→\n 30→fn generate_soju_config(spec: &SojuBouncerSpec, db_uri: &str, auth_url: Option<&str>) -> String {\n 31→ let mut lines = Vec::new();\n 32→\n 33→ let hostname = sanitize_config_value(&spec.hostname);\n 34→ lines.push(format!(\"hostname {hostname}\"));\n 35→\n 36→ if let Some(cloak) = &spec.hostname_cloak {\n 37→ let cloak = sanitize_config_value(cloak);\n 38→ lines.push(format!(\"hostname-cloak {cloak}\"));\n 39→ }\n 40→\n 41→ if let Some(title) = &spec.title {\n 42→ let title = sanitize_config_value(title);\n 43→ lines.push(format!(\"title \\\"{title}\\\"\"));\n 44→ }\n 45→\n 46→ if spec.tls.is_some() {\n 47→ lines.push(\"tls /etc/soju/tls/tls.crt /etc/soju/tls/tls.key\".to_string());\n 48→ }\n 49→\n 50→ for listener in &spec.listeners {\n 51→ lines.push(format!(\"listen {}\", listener_uri(listener)));\n 52→ }\n 53→\n 54→ lines.push(format!(\"db postgres \\\"{db_uri}\\\"\"));\n 55→ lines.push(\"message-store db\".to_string());\n 56→\n 57→ if let (Some(_), Some(url)) = (&spec.auth, auth_url) {\n 58→ let url = sanitize_config_value(url);\n 59→ lines.push(format!(\"auth oauth2 {url}\"));\n 60→ lines.push(\"enable-user-on-auth true\".to_string());\n 61→ } else {\n 62→ lines.push(\"auth internal\".to_string());\n 63→ }\n 64→\n 65→ lines.join(\"\\n\")\n 66→}\n 67→\n 68→fn listener_uri(listener: &Listener) -> String {\n 69→ let addr = &listener.address;\n 70→ let host_port = if addr.starts_with(':') {\n 71→ format!(\"0.0.0.0{addr}\")\n 72→ } else {\n 73→ addr.clone()\n 74→ };\n 75→\n 76→ match (listener.websocket, listener.tls) {\n 77→ (true, true) => format!(\"wss://{host_port}\"),\n 78→ (true, false) => format!(\"ws+insecure://{host_port}\"),\n 79→ (false, true) => format!(\"ircs://{host_port}\"),\n 80→ (false, false) => format!(\"irc+insecure://{host_port}\"),\n 81→ }\n 82→}\n 83→\n 84→#[cfg(test)]\n 85→mod tests {\n 86→ use super::*;\n 87→ use crate::testutil::test_bouncer;\n 88→\n 89→ #[test]\n 90→ fn generates_soju_config_with_listeners() {\n 91→ let db_uri = \"host=db.svc port=5432 user=test password=secret dbname=soju_test sslmode=disable\";\n 92→ let cm = build_configmap(&test_bouncer(), db_uri, None);\n 93→ let data = cm.data.unwrap();\n 94→ let config = &data[\"config\"];\n 95→ assert!(config.contains(\"listen ircs://0.0.0.0:6697\"));\n 96→ assert!(config.contains(\"listen irc+insecure://0.0.0.0:6667\"));\n 97→ assert!(config.contains(\"hostname irc.example.com\"));\n 98→ assert!(config.contains(\"title \\\"Test Bouncer\\\"\"));\n 99→ assert!(config.contains(\"tls /etc/soju/tls/tls.crt /etc/soju/tls/tls.key\"));\n 100→ assert!(config.contains(\"db postgres\"));\n 101→ }\n 102→\n 103→ #[test]\n 104→ fn configmap_has_owner_reference() {\n 105→ let cm = build_configmap(&test_bouncer(), \"host=localhost dbname=test\", None);\n 106→ let orefs = cm.metadata.owner_references.unwrap();\n 107→ assert_eq!(orefs.len(), 1);\n 108→ assert_eq!(orefs[0].name, \"test-bouncer\");\n 109→ }\n 110→\n 111→ #[test]\n 112→ fn generates_websocket_listener_uri() {\n 113→ let mut bouncer = test_bouncer();\n 114→ bouncer.spec.listeners.push(Listener {\n 115→ address: \":8080\".to_string(),\n 116→ tls: false,\n 117→ websocket: true,\n 118→ });\n 119→ let cm = build_configmap(\n 120→ &bouncer,\n 121→ \"host=db.svc port=5432 user=test password=secret dbname=soju_test sslmode=disable\",\n 122→ None,\n 123→ );\n 124→ let data = cm.data.unwrap();\n 125→ let config = &data[\"config\"];\n 126→ assert!(config.contains(\"listen ws+insecure://0.0.0.0:8080\"));\n 127→ }\n 128→\n 129→ #[test]\n 130→ fn generates_wss_listener_uri() {\n 131→ let mut bouncer = test_bouncer();\n 132→ bouncer.spec.listeners.push(Listener {\n 133→ address: \":8443\".to_string(),\n 134→ tls: true,\n 135→ websocket: true,\n 136→ });\n 137→ let cm = build_configmap(\n 138→ &bouncer,\n 139→ \"host=db.svc port=5432 user=test password=secret dbname=soju_test sslmode=disable\",\n 140→ None,\n 141→ );\n 142→ let data = cm.data.unwrap();\n 143→ let config = &data[\"config\"];\n 144→ assert!(config.contains(\"listen wss://0.0.0.0:8443\"));\n 145→ }\n 146→\n 147→ #[test]\n 148→ fn generates_oauth2_auth_config() {\n 149→ let mut bouncer = test_bouncer();\n 150→ bouncer.spec.auth = Some(crate::types::AuthSpec {\n 151→ oauth2_url: \"https://auth.example.com/realms/test\".to_string(),\n 152→ secret_ref: None,\n 153→ });\n 154→ let cm = build_configmap(\n 155→ &bouncer,\n 156→ \"host=localhost dbname=test\",\n 157→ Some(\"https://client:secret@auth.example.com/realms/test\"),\n 158→ );\n 159→ let data = cm.data.unwrap();\n 160→ let config = &data[\"config\"];\n 161→ assert!(config.contains(\"auth oauth2 https://client:secret@auth.example.com/realms/test\"));\n 162→ assert!(config.contains(\"enable-user-on-auth true\"));\n 163→ assert!(!config.contains(\"auth internal\"));\n 164→ }\n 165→\n 166→ #[test]\n 167→ fn configmap_named_correctly() {\n 168→ let cm = build_configmap(&test_bouncer(), \"host=localhost dbname=test\", None);\n 169→ assert_eq!(cm.metadata.name.unwrap(), \"test-bouncer-config\");\n 170→ }\n 171→\n 172→ #[test]\n 173→ fn generates_hostname_cloak_directive() {\n 174→ let bouncer = test_bouncer();\n 175→ let cm = build_configmap(&bouncer, \"host=localhost dbname=test\", None);\n 176→ let data = cm.data.unwrap();\n 177→ let config = &data[\"config\"];\n 178→ assert!(config.contains(\"hostname-cloak irc.example.com\"));\n 179→ }\n 180→\n 181→ #[test]\n 182→ fn omits_hostname_cloak_when_not_set() {\n 183→ let mut bouncer = test_bouncer();\n 184→ bouncer.spec.hostname_cloak = None;\n 185→ let cm = build_configmap(&bouncer, \"host=localhost dbname=test\", None);\n 186→ let data = cm.data.unwrap();\n 187→ let config = &data[\"config\"];\n 188→ assert!(!config.contains(\"hostname-cloak\"));\n 189→ }\n 190→}\n 191→"}]},"uuid":"e7bb0c7a-0d55-4ae9-bc5e-ecad00dd8510","timestamp":"2026-03-07T12:40:12.624Z"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"ad53e7df-a125-43fb-af31-0287a00fa010","timestamp":"2026-03-07T12:40:13.143Z"} {"parentUuid":"ad53e7df-a125-43fb-af31-0287a00fa010","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:13.176Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01ERRDPWkUriuvah7hTSmp22","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_014h1ZCX89vE2s93cozD9wRJ","name":"Read","input":{"file_path":"/home/josie/development/irc-now/crates/web-api/src/k8s.rs","limit":250},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":10007,"cache_read_input_tokens":74239,"cache_creation":{"ephemeral_5m_input_tokens":10007,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard","inference_geo":"not_available"},"context_management":null},"requestId":"req_011CYojbo52PinL9NguiaAPb","uuid":"90c7ea28-1c01-4daf-9ac4-e6eed5b7c9fa"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"94712620-64c8-4171-bf4a-228e359d27b5","timestamp":"2026-03-07T12:40:13.176Z"} {"parentUuid":"94712620-64c8-4171-bf4a-228e359d27b5","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:13.265Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01ERRDPWkUriuvah7hTSmp22","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01PUSUqGkz5HKd5ZcpsnmCC9","name":"Read","input":{"file_path":"/home/josie/development/irc-now/crates/web-api/src/stripe_util.rs","limit":250},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":10007,"cache_read_input_tokens":74239,"cache_creation":{"ephemeral_5m_input_tokens":10007,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard","inference_geo":"not_available"},"context_management":null},"requestId":"req_011CYojbo52PinL9NguiaAPb","uuid":"4aaad188-54b9-4c72-ad8c-530062ba9188"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"7bb10586-21c7-4c08-b960-2b0c3a147869","timestamp":"2026-03-07T12:40:13.265Z"} {"parentUuid":"7bb10586-21c7-4c08-b960-2b0c3a147869","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_014h1ZCX89vE2s93cozD9wRJ","type":"tool_result","content":" 1→use kube::CustomResource;\n 2→use schemars::JsonSchema;\n 3→use serde::{Deserialize, Serialize};\n 4→\n 5→pub fn sanitize_bouncer_name(input: &str) -> String {\n 6→ let sanitized: String = input\n 7→ .to_lowercase()\n 8→ .chars()\n 9→ .map(|c| if c.is_alphanumeric() || c == '-' { c } else { '-' })\n 10→ .take(63)\n 11→ .collect();\n 12→ sanitized.trim_matches('-').to_string()\n 13→}\n 14→\n 15→// Minimal SojuBouncer spec -- just enough for the portal to create CRs.\n 16→// The full CRD is defined in the soju-operator crate.\n 17→#[derive(CustomResource, Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 18→#[kube(\n 19→ group = \"irc.now\",\n 20→ version = \"v1alpha1\",\n 21→ kind = \"SojuBouncer\",\n 22→ namespaced,\n 23→ status = \"SojuBouncerStatus\"\n 24→)]\n 25→pub struct SojuBouncerSpec {\n 26→ pub hostname: String,\n 27→ #[serde(default, skip_serializing_if = \"Option::is_none\")]\n 28→ pub owner: Option,\n 29→ #[serde(default, skip_serializing_if = \"Option::is_none\")]\n 30→ pub hostname_cloak: Option,\n 31→ #[serde(default, skip_serializing_if = \"Vec::is_empty\")]\n 32→ pub listeners: Vec,\n 33→ #[serde(default, skip_serializing_if = \"Option::is_none\")]\n 34→ pub auth: Option,\n 35→}\n 36→\n 37→#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 38→pub struct Listener {\n 39→ pub address: String,\n 40→ #[serde(default)]\n 41→ pub tls: bool,\n 42→ #[serde(default)]\n 43→ pub websocket: bool,\n 44→}\n 45→\n 46→#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 47→pub struct AuthSpec {\n 48→ pub oauth2_url: String,\n 49→ #[serde(default, skip_serializing_if = \"Option::is_none\")]\n 50→ pub secret_ref: Option,\n 51→}\n 52→\n 53→pub fn default_bouncer_spec(name: &str, owner: &str, issuer_url: &str) -> SojuBouncerSpec {\n 54→ SojuBouncerSpec {\n 55→ hostname: format!(\"{name}.irc.now\"),\n 56→ owner: Some(owner.to_string()),\n 57→ hostname_cloak: Some(format!(\"{name}.irc.now\")),\n 58→ listeners: vec![\n 59→ Listener { address: \":6667\".to_string(), tls: false, websocket: false },\n 60→ Listener { address: \":8080\".to_string(), tls: false, websocket: true },\n 61→ ],\n 62→ auth: Some(AuthSpec {\n 63→ oauth2_url: issuer_url.to_string(),\n 64→ secret_ref: Some(\"oidc-soju\".to_string()),\n 65→ }),\n 66→ }\n 67→}\n 68→\n 69→#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonSchema)]\n 70→pub struct SojuBouncerStatus {\n 71→ #[serde(default)]\n 72→ pub conditions: Vec,\n 73→}\n 74→\n 75→#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 76→pub struct SojuBouncerCondition {\n 77→ #[serde(rename = \"type\")]\n 78→ pub type_: String,\n 79→ pub status: String,\n 80→ #[serde(default)]\n 81→ pub reason: Option,\n 82→ #[serde(default)]\n 83→ pub message: Option,\n 84→}\n 85→\n 86→pub fn sanitize_name(input: &str) -> String {\n 87→ sanitize_bouncer_name(input)\n 88→}\n 89→\n 90→#[derive(CustomResource, Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 91→#[kube(\n 92→ group = \"irc.now\",\n 93→ version = \"v1alpha1\",\n 94→ kind = \"ErgoNetwork\",\n 95→ namespaced,\n 96→ status = \"ErgoNetworkStatus\"\n 97→)]\n 98→pub struct ErgoNetworkSpec {\n 99→ pub hostname: String,\n 100→ #[serde(default, skip_serializing_if = \"Option::is_none\", rename = \"networkName\")]\n 101→ pub network_name: Option,\n 102→ #[serde(default, skip_serializing_if = \"Vec::is_empty\")]\n 103→ pub listeners: Vec,\n 104→ #[serde(default, skip_serializing_if = \"Option::is_none\")]\n 105→ pub tls: Option,\n 106→ #[serde(default, skip_serializing_if = \"Option::is_none\")]\n 107→ pub route: Option,\n 108→ #[serde(default, skip_serializing_if = \"Option::is_none\")]\n 109→ pub oauth2: Option,\n 110→ #[serde(default, skip_serializing_if = \"Option::is_none\")]\n 111→ pub cloaking: Option,\n 112→ #[serde(default, skip_serializing_if = \"Option::is_none\")]\n 113→ pub storage: Option,\n 114→ #[serde(default, skip_serializing_if = \"Option::is_none\")]\n 115→ pub resources: Option,\n 116→}\n 117→\n 118→#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 119→pub struct ErgoListener {\n 120→ pub address: String,\n 121→ #[serde(default)]\n 122→ pub tls: bool,\n 123→}\n 124→\n 125→#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 126→pub struct ErgoTlsSpec {\n 127→ pub issuer_ref: ErgoIssuerRef,\n 128→ pub dns_names: Vec,\n 129→}\n 130→\n 131→#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 132→pub struct ErgoIssuerRef {\n 133→ pub name: String,\n 134→ pub kind: String,\n 135→}\n 136→\n 137→#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 138→pub struct ErgoRouteSpec {\n 139→ pub host: String,\n 140→}\n 141→\n 142→#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 143→pub struct ErgoOAuth2Spec {\n 144→ pub introspection_url: String,\n 145→ pub secret_ref: String,\n 146→ #[serde(default)]\n 147→ pub autocreate: bool,\n 148→ #[serde(default, skip_serializing_if = \"Option::is_none\", rename = \"clientId\")]\n 149→ pub client_id: Option,\n 150→}\n 151→\n 152→#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 153→pub struct ErgoCloakingSpec {\n 154→ pub netname: String,\n 155→}\n 156→\n 157→#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 158→pub struct ErgoStorageSpec {\n 159→ pub size: String,\n 160→ #[serde(default, skip_serializing_if = \"Option::is_none\", rename = \"storageClassName\")]\n 161→ pub storage_class_name: Option,\n 162→}\n 163→\n 164→#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 165→pub struct ErgoResourceRequirements {\n 166→ #[serde(default, skip_serializing_if = \"Option::is_none\")]\n 167→ pub requests: Option,\n 168→ #[serde(default, skip_serializing_if = \"Option::is_none\")]\n 169→ pub limits: Option,\n 170→}\n 171→\n 172→#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 173→pub struct ErgoResourceList {\n 174→ #[serde(default, skip_serializing_if = \"Option::is_none\")]\n 175→ pub memory: Option,\n 176→ #[serde(default, skip_serializing_if = \"Option::is_none\")]\n 177→ pub cpu: Option,\n 178→}\n 179→\n 180→#[derive(Debug, Clone, Default, Serialize, Deserialize, JsonSchema)]\n 181→pub struct ErgoNetworkStatus {\n 182→ #[serde(default)]\n 183→ pub conditions: Vec,\n 184→}\n 185→\n 186→#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]\n 187→pub struct ErgoNetworkCondition {\n 188→ #[serde(rename = \"type\")]\n 189→ pub type_: String,\n 190→ pub status: String,\n 191→ #[serde(default)]\n 192→ pub reason: Option,\n 193→ #[serde(default)]\n 194→ pub message: Option,\n 195→}\n 196→\n 197→pub fn default_network_spec(name: &str) -> ErgoNetworkSpec {\n 198→ let hostname = format!(\"{name}.irc.now\");\n 199→ ErgoNetworkSpec {\n 200→ hostname: hostname.clone(),\n 201→ network_name: None,\n 202→ listeners: vec![\n 203→ ErgoListener { address: \":6697\".to_string(), tls: true },\n 204→ ErgoListener { address: \":6667\".to_string(), tls: false },\n 205→ ],\n 206→ tls: Some(ErgoTlsSpec {\n 207→ issuer_ref: ErgoIssuerRef {\n 208→ name: \"letsencrypt-prod\".to_string(),\n 209→ kind: \"ClusterIssuer\".to_string(),\n 210→ },\n 211→ dns_names: vec![hostname.clone()],\n 212→ }),\n 213→ route: Some(ErgoRouteSpec { host: hostname.clone() }),\n 214→ oauth2: Some(ErgoOAuth2Spec {\n 215→ introspection_url: \"https://auth.irc.now/realms/irc-now/protocol/openid-connect/token/introspect\".to_string(),\n 216→ secret_ref: \"oidc-ergo\".to_string(),\n 217→ autocreate: true,\n 218→ client_id: None,\n 219→ }),\n 220→ cloaking: Some(ErgoCloakingSpec {\n 221→ netname: hostname,\n 222→ }),\n 223→ storage: Some(ErgoStorageSpec {\n 224→ size: \"1Gi\".to_string(),\n 225→ storage_class_name: Some(\"customer-workload-storage\".to_string()),\n 226→ }),\n 227→ resources: Some(ErgoResourceRequirements {\n 228→ requests: Some(ErgoResourceList {\n 229→ memory: Some(\"64Mi\".to_string()),\n 230→ cpu: Some(\"50m\".to_string()),\n 231→ }),\n 232→ limits: Some(ErgoResourceList {\n 233→ memory: Some(\"256Mi\".to_string()),\n 234→ cpu: Some(\"200m\".to_string()),\n 235→ }),\n 236→ }),\n 237→ }\n 238→}\n 239→\n 240→#[cfg(test)]\n 241→mod tests {\n 242→ use super::*;\n 243→\n 244→ #[test]\n 245→ fn bouncer_name_sanitizes_input() {\n 246→ assert_eq!(sanitize_bouncer_name(\"My Bouncer!\"), \"my-bouncer\");\n 247→ assert_eq!(sanitize_bouncer_name(\"test_123\"), \"test-123\");\n 248→ }\n 249→\n 250→ #[test]"}]},"uuid":"30b3439a-cc24-4c0b-972a-ec530692ea31","timestamp":"2026-03-07T12:40:13.255Z"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"de7854a3-26af-4d1c-8801-4d2addd5ae01","timestamp":"2026-03-07T12:40:13.313Z"} {"parentUuid":"de7854a3-26af-4d1c-8801-4d2addd5ae01","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01PUSUqGkz5HKd5ZcpsnmCC9","type":"tool_result","content":" 1→use hmac::{Hmac, Mac};\n 2→use sha2::Sha256;\n 3→use serde::Deserialize;\n 4→\n 5→#[derive(Debug, Deserialize)]\n 6→pub struct StripeEvent {\n 7→ #[serde(rename = \"type\")]\n 8→ pub event_type: String,\n 9→ pub data: StripeEventData,\n 10→}\n 11→\n 12→#[derive(Debug, Deserialize)]\n 13→pub struct StripeEventData {\n 14→ pub object: serde_json::Value,\n 15→}\n 16→\n 17→pub fn verify_webhook_signature(payload: &str, signature: &str, secret: &str) -> bool {\n 18→ let parts: std::collections::HashMap<&str, &str> = signature\n 19→ .split(',')\n 20→ .filter_map(|part| {\n 21→ let mut kv = part.splitn(2, '=');\n 22→ Some((kv.next()?, kv.next()?))\n 23→ })\n 24→ .collect();\n 25→\n 26→ let timestamp = match parts.get(\"t\") {\n 27→ Some(t) => *t,\n 28→ None => return false,\n 29→ };\n 30→\n 31→ let expected_sig = match parts.get(\"v1\") {\n 32→ Some(s) => *s,\n 33→ None => return false,\n 34→ };\n 35→\n 36→ let signed_payload = format!(\"{}.{}\", timestamp, payload);\n 37→\n 38→ let mut mac = match Hmac::::new_from_slice(secret.as_bytes()) {\n 39→ Ok(m) => m,\n 40→ Err(_) => return false,\n 41→ };\n 42→ mac.update(signed_payload.as_bytes());\n 43→\n 44→ let expected_bytes = match hex::decode(expected_sig) {\n 45→ Ok(b) => b,\n 46→ Err(_) => return false,\n 47→ };\n 48→ mac.verify_slice(&expected_bytes).is_ok()\n 49→}\n 50→\n 51→#[cfg(test)]\n 52→mod tests {\n 53→ use super::*;\n 54→\n 55→ #[test]\n 56→ fn parse_checkout_completed_event() {\n 57→ let payload = r#\"{\"type\":\"checkout.session.completed\",\"data\":{\"object\":{\"customer\":\"cus_123\",\"metadata\":{\"user_id\":\"usr_456\"}}}}\"#;\n 58→ let event: StripeEvent = serde_json::from_str(payload).unwrap();\n 59→ assert_eq!(event.event_type, \"checkout.session.completed\");\n 60→ }\n 61→\n 62→ #[test]\n 63→ fn parse_subscription_deleted_event() {\n 64→ let payload = r#\"{\"type\":\"customer.subscription.deleted\",\"data\":{\"object\":{\"customer\":\"cus_789\"}}}\"#;\n 65→ let event: StripeEvent = serde_json::from_str(payload).unwrap();\n 66→ assert_eq!(event.event_type, \"customer.subscription.deleted\");\n 67→ }\n 68→\n 69→ #[test]\n 70→ fn webhook_signature_rejects_bad_signature() {\n 71→ assert!(!verify_webhook_signature(\"payload\", \"t=123,v1=badsig\", \"secret\"));\n 72→ }\n 73→}\n 74→"}]},"uuid":"9b9f9c4c-263b-4721-8176-0d0ba96d3434","timestamp":"2026-03-07T12:40:13.343Z"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"e96b7319-411b-46e8-97b3-94f943deb7c9","timestamp":"2026-03-07T12:40:13.403Z"} {"parentUuid":"e96b7319-411b-46e8-97b3-94f943deb7c9","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:15.639Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01G5PPu94XaRHekmv94avsgT","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01T6Ch1uEkHCyPwuthU5KMuN","name":"Read","input":{"file_path":"/home/josie/development/irc-now/crates/soju-operator/src/db.rs","limit":200},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":7746,"cache_read_input_tokens":84246,"cache_creation":{"ephemeral_5m_input_tokens":7746,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard","inference_geo":"not_available"},"context_management":null},"requestId":"req_011CYojc2tyWjHwiArkKqNHX","uuid":"d9504bc6-3864-4a33-be90-9f28dab6b0e1"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"570a55fb-e51a-42bb-8784-f666f9f5d0fc","timestamp":"2026-03-07T12:40:15.639Z"} {"parentUuid":"570a55fb-e51a-42bb-8784-f666f9f5d0fc","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01T6Ch1uEkHCyPwuthU5KMuN","type":"tool_result","content":" 1→use tokio_postgres::Client;\n 2→\n 3→pub fn tenant_role_name(bouncer_name: &str) -> String {\n 4→ format!(\"soju_{}\", bouncer_name.replace('-', \"_\"))\n 5→}\n 6→\n 7→pub fn tenant_db_name(bouncer_name: &str) -> String {\n 8→ format!(\"soju_{}\", bouncer_name.replace('-', \"_\"))\n 9→}\n 10→\n 11→fn quote_literal(s: &str) -> String {\n 12→ format!(\"'{}'\", s.replace('\\'', \"''\"))\n 13→}\n 14→\n 15→pub fn create_role_sql(bouncer_name: &str, password: &str) -> String {\n 16→ let role = tenant_role_name(bouncer_name);\n 17→ format!(\"CREATE ROLE \\\"{role}\\\" WITH LOGIN PASSWORD {}\", quote_literal(password))\n 18→}\n 19→\n 20→pub fn create_database_sql(bouncer_name: &str) -> String {\n 21→ let role = tenant_role_name(bouncer_name);\n 22→ let db = tenant_db_name(bouncer_name);\n 23→ format!(\"CREATE DATABASE \\\"{db}\\\" OWNER \\\"{role}\\\"\")\n 24→}\n 25→\n 26→pub fn drop_database_sql(bouncer_name: &str) -> String {\n 27→ let db = tenant_db_name(bouncer_name);\n 28→ format!(\"DROP DATABASE IF EXISTS \\\"{db}\\\"\")\n 29→}\n 30→\n 31→pub fn drop_role_sql(bouncer_name: &str) -> String {\n 32→ let role = tenant_role_name(bouncer_name);\n 33→ format!(\"DROP ROLE IF EXISTS \\\"{role}\\\"\")\n 34→}\n 35→\n 36→pub fn terminate_connections_sql(bouncer_name: &str) -> String {\n 37→ let db = tenant_db_name(bouncer_name);\n 38→ format!(\n 39→ \"SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = {}\",\n 40→ quote_literal(&db)\n 41→ )\n 42→}\n 43→\n 44→pub fn build_tenant_uri(host: &str, port: u16, bouncer_name: &str, password: &str) -> String {\n 45→ let role = tenant_role_name(bouncer_name);\n 46→ let db = tenant_db_name(bouncer_name);\n 47→ let sslmode = std::env::var(\"SOJU_DB_SSLMODE\").unwrap_or_else(|_| \"require\".to_string());\n 48→ format!(\"host={host} port={port} user={role} password={password} dbname={db} sslmode={sslmode}\")\n 49→}\n 50→\n 51→pub fn generate_password() -> String {\n 52→ use rand::Rng;\n 53→ use rand::distr::Alphanumeric;\n 54→ rand::rng()\n 55→ .sample_iter(&Alphanumeric)\n 56→ .take(32)\n 57→ .map(char::from)\n 58→ .collect()\n 59→}\n 60→\n 61→pub async fn provision_tenant_db(\n 62→ client: &Client,\n 63→ bouncer_name: &str,\n 64→ password: &str,\n 65→) -> Result<(), Box> {\n 66→ let role = tenant_role_name(bouncer_name);\n 67→ let create_role = format!(\n 68→ \"DO $$ BEGIN CREATE ROLE \\\"{}\\\" WITH LOGIN PASSWORD {}; EXCEPTION WHEN duplicate_object THEN NULL; END $$\",\n 69→ role, quote_literal(password)\n 70→ );\n 71→ client.batch_execute(&create_role).await?;\n 72→\n 73→ let db = tenant_db_name(bouncer_name);\n 74→ let row = client\n 75→ .query_one(\n 76→ \"SELECT EXISTS(SELECT 1 FROM pg_database WHERE datname = $1)\",\n 77→ &[&db],\n 78→ )\n 79→ .await?;\n 80→ let exists: bool = row.get(0);\n 81→\n 82→ if !exists {\n 83→ client.batch_execute(&create_database_sql(bouncer_name)).await?;\n 84→ }\n 85→\n 86→ Ok(())\n 87→}\n 88→\n 89→pub async fn deprovision_tenant_db(\n 90→ client: &Client,\n 91→ bouncer_name: &str,\n 92→) -> Result<(), Box> {\n 93→ client.batch_execute(&terminate_connections_sql(bouncer_name)).await?;\n 94→ client.batch_execute(&drop_database_sql(bouncer_name)).await?;\n 95→ client.batch_execute(&drop_role_sql(bouncer_name)).await?;\n 96→ Ok(())\n 97→}\n 98→\n 99→#[cfg(test)]\n 100→mod tests {\n 101→ use super::*;\n 102→\n 103→ #[test]\n 104→ fn tenant_role_name_replaces_hyphens() {\n 105→ assert_eq!(tenant_role_name(\"my-bouncer\"), \"soju_my_bouncer\");\n 106→ }\n 107→\n 108→ #[test]\n 109→ fn tenant_db_name_replaces_hyphens() {\n 110→ assert_eq!(tenant_db_name(\"my-bouncer\"), \"soju_my_bouncer\");\n 111→ }\n 112→\n 113→ #[test]\n 114→ fn create_role_sql_uses_quoted_identifier() {\n 115→ let sql = create_role_sql(\"my-bouncer\", \"secretpass\");\n 116→ assert!(sql.contains(\"\\\"soju_my_bouncer\\\"\"));\n 117→ assert!(sql.contains(\"PASSWORD\"));\n 118→ }\n 119→\n 120→ #[test]\n 121→ fn create_database_sql_sets_owner() {\n 122→ let sql = create_database_sql(\"my-bouncer\");\n 123→ assert!(sql.contains(\"OWNER \\\"soju_my_bouncer\\\"\"));\n 124→ }\n 125→\n 126→ #[test]\n 127→ fn drop_database_sql_uses_if_exists() {\n 128→ let sql = drop_database_sql(\"my-bouncer\");\n 129→ assert!(sql.contains(\"DROP DATABASE IF EXISTS \\\"soju_my_bouncer\\\"\"));\n 130→ }\n 131→\n 132→ #[test]\n 133→ fn drop_role_sql_uses_if_exists() {\n 134→ let sql = drop_role_sql(\"my-bouncer\");\n 135→ assert!(sql.contains(\"DROP ROLE IF EXISTS \\\"soju_my_bouncer\\\"\"));\n 136→ }\n 137→\n 138→ #[test]\n 139→ fn terminate_connections_sql_targets_correct_db() {\n 140→ let sql = terminate_connections_sql(\"my-bouncer\");\n 141→ assert!(sql.contains(\"soju_my_bouncer\"));\n 142→ assert!(sql.contains(\"pg_terminate_backend\"));\n 143→ }\n 144→\n 145→ #[test]\n 146→ fn build_tenant_uri_has_all_fields() {\n 147→ let uri = build_tenant_uri(\"db.svc\", 5432, \"my-bouncer\", \"generated-pass\");\n 148→ assert!(uri.contains(\"user=soju_my_bouncer\"));\n 149→ assert!(uri.contains(\"dbname=soju_my_bouncer\"));\n 150→ assert!(uri.contains(\"password=generated-pass\"));\n 151→ assert!(uri.contains(\"host=db.svc\"));\n 152→ assert!(uri.contains(\"port=5432\"));\n 153→ assert!(uri.contains(\"sslmode=require\"));\n 154→ }\n 155→}\n 156→"}]},"uuid":"4866b1dc-e24b-4963-9a00-45d13cf86a2e","timestamp":"2026-03-07T12:40:15.694Z"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"a6b8a519-93aa-4b97-96ee-c28062314e7d","timestamp":"2026-03-07T12:40:16.134Z"} {"parentUuid":"a6b8a519-93aa-4b97-96ee-c28062314e7d","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:16.421Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01G5PPu94XaRHekmv94avsgT","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01XSemGR8VWVMj8DEufMJtWe","name":"Grep","input":{"pattern":"check_internal_token|generate_thumbnail_from_image|sanitize_yaml_value","path":"/home/josie/development/irc-now/crates","output_mode":"content","head_limit":100},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":7746,"cache_read_input_tokens":84246,"cache_creation":{"ephemeral_5m_input_tokens":7746,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard","inference_geo":"not_available"},"context_management":null},"requestId":"req_011CYojc2tyWjHwiArkKqNHX","uuid":"5efcaf84-ff7b-455d-9066-36b67057978a"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"63779785-371e-44b6-b42b-1c84940d0cf5","timestamp":"2026-03-07T12:40:16.421Z"} {"parentUuid":"63779785-371e-44b6-b42b-1c84940d0cf5","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01XSemGR8VWVMj8DEufMJtWe","type":"tool_result","content":"crates/pics/src/routes/image.rs:42:fn generate_thumbnail_from_image(img: &::image::DynamicImage) -> Result, String> {\ncrates/pics/src/routes/image.rs:211: let thumb_data = generate_thumbnail_from_image(&img).map_err(|e| {\ncrates/pics/src/routes/image.rs:449:fn check_internal_token(headers: &axum::http::HeaderMap) -> Result<(), StatusCode> {\ncrates/pics/src/routes/image.rs:465: if let Err(code) = check_internal_token(&headers) {\ncrates/pics/src/routes/image.rs:487: if let Err(code) = check_internal_token(&headers) {\ncrates/pics/src/routes/image.rs:509: if let Err(code) = check_internal_token(&headers) {\ncrates/txt/src/routes/paste.rs:305:fn check_internal_token(headers: &axum::http::HeaderMap) -> Result<(), StatusCode> {\ncrates/txt/src/routes/paste.rs:321: if let Err(code) = check_internal_token(&headers) {\ncrates/txt/src/routes/paste.rs:343: if let Err(code) = check_internal_token(&headers) {\ncrates/txt/src/routes/paste.rs:365: if let Err(code) = check_internal_token(&headers) {\ncrates/ergo-operator/src/resources/configmap.rs:26:fn sanitize_yaml_value(s: &str) -> String {\ncrates/ergo-operator/src/resources/configmap.rs:42: let hostname = sanitize_yaml_value(&spec.hostname);\ncrates/ergo-operator/src/resources/configmap.rs:57: let max_sendq = sanitize_yaml_value(spec.max_sendq.as_deref().unwrap_or(\"96k\"));\ncrates/ergo-operator/src/resources/configmap.rs:64: let netname = sanitize_yaml_value(&cloaking.netname);\ncrates/ergo-operator/src/resources/configmap.rs:70: let network_name = sanitize_yaml_value(network_name);\ncrates/ergo-operator/src/resources/configmap.rs:127: let hash = sanitize_yaml_value(hash);\ncrates/ergo-operator/src/resources/configmap.rs:128: let class_name = sanitize_yaml_value(class_name);\ncrates/ergo-operator/src/resources/configmap.rs:138: let vhost_regexp = sanitize_yaml_value(v\ncrates/ergo-operator/src/resources/configmap.rs:149: let introspection_url = sanitize_yaml_value(&oauth2.introspection_url);\ncrates/ergo-operator/src/resources/configmap.rs:150: let client_id = sanitize_yaml_value(client_id);\ncrates/ergo-operator/src/resources/configmap.rs:151: let secret = sanitize_yaml_value(secret);\n\n[Showing results with pagination = limit: 100, offset: 0]"}]},"uuid":"45222fe0-e752-4cf8-a75f-8dc3d27eed96","timestamp":"2026-03-07T12:40:16.529Z"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"528428a1-d187-4b25-820e-d90a772e4328","timestamp":"2026-03-07T12:40:16.572Z"} {"parentUuid":"528428a1-d187-4b25-820e-d90a772e4328","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:19.209Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01PHx21ULqoXqFWE1N4NjpZ2","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_015gp7qo5gbcSRrix1hG8JuA","name":"Read","input":{"file_path":"/home/josie/development/irc-now/crates/txt/src/routes/paste.rs","offset":305,"limit":100},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":3271,"cache_read_input_tokens":91992,"cache_creation":{"ephemeral_5m_input_tokens":3271,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard","inference_geo":"not_available"},"context_management":null},"requestId":"req_011CYojcGQKu2x8QVNNSyx3Z","uuid":"d300ce19-423f-473d-a24a-b6528eed701e"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"ae8ae4a7-0a01-4067-ae6a-8d3f240af993","timestamp":"2026-03-07T12:40:19.209Z"} {"parentUuid":"ae8ae4a7-0a01-4067-ae6a-8d3f240af993","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_015gp7qo5gbcSRrix1hG8JuA","type":"tool_result","content":" 305→fn check_internal_token(headers: &axum::http::HeaderMap) -> Result<(), StatusCode> {\n 306→ let expected = std::env::var(\"INTERNAL_API_TOKEN\").unwrap_or_default();\n 307→ if expected.is_empty() {\n 308→ return Err(StatusCode::FORBIDDEN);\n 309→ }\n 310→ match headers.get(\"x-internal-token\").and_then(|v| v.to_str().ok()) {\n 311→ Some(token) if token == expected => Ok(()),\n 312→ _ => Err(StatusCode::FORBIDDEN),\n 313→ }\n 314→}\n 315→\n 316→pub async fn internal_hide(\n 317→ headers: axum::http::HeaderMap,\n 318→ State(state): State,\n 319→ Path(id): Path,\n 320→) -> StatusCode {\n 321→ if let Err(code) = check_internal_token(&headers) {\n 322→ return code;\n 323→ }\n 324→ match sqlx::query(\"UPDATE pastes SET hidden = true WHERE id = $1\")\n 325→ .bind(&id)\n 326→ .execute(&state.db)\n 327→ .await\n 328→ {\n 329→ Ok(r) if r.rows_affected() > 0 => StatusCode::OK,\n 330→ Ok(_) => StatusCode::NOT_FOUND,\n 331→ Err(e) => {\n 332→ tracing::error!(\"hide paste failed: {e}\");\n 333→ StatusCode::INTERNAL_SERVER_ERROR\n 334→ }\n 335→ }\n 336→}\n 337→\n 338→pub async fn internal_unhide(\n 339→ headers: axum::http::HeaderMap,\n 340→ State(state): State,\n 341→ Path(id): Path,\n 342→) -> StatusCode {\n 343→ if let Err(code) = check_internal_token(&headers) {\n 344→ return code;\n 345→ }\n 346→ match sqlx::query(\"UPDATE pastes SET hidden = false WHERE id = $1\")\n 347→ .bind(&id)\n 348→ .execute(&state.db)\n 349→ .await\n 350→ {\n 351→ Ok(r) if r.rows_affected() > 0 => StatusCode::OK,\n 352→ Ok(_) => StatusCode::NOT_FOUND,\n 353→ Err(e) => {\n 354→ tracing::error!(\"unhide paste failed: {e}\");\n 355→ StatusCode::INTERNAL_SERVER_ERROR\n 356→ }\n 357→ }\n 358→}\n 359→\n 360→pub async fn internal_delete(\n 361→ headers: axum::http::HeaderMap,\n 362→ State(state): State,\n 363→ Path(id): Path,\n 364→) -> StatusCode {\n 365→ if let Err(code) = check_internal_token(&headers) {\n 366→ return code;\n 367→ }\n 368→ match sqlx::query(\"DELETE FROM pastes WHERE id = $1\")\n 369→ .bind(&id)\n 370→ .execute(&state.db)\n 371→ .await\n 372→ {\n 373→ Ok(r) if r.rows_affected() > 0 => StatusCode::OK,\n 374→ Ok(_) => StatusCode::NOT_FOUND,\n 375→ Err(e) => {\n 376→ tracing::error!(\"internal delete paste failed: {e}\");\n 377→ StatusCode::INTERNAL_SERVER_ERROR\n 378→ }\n 379→ }\n 380→}\n 381→"}]},"uuid":"015daf09-221d-46f0-9a51-84b54f0683bb","timestamp":"2026-03-07T12:40:19.294Z"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"00926ade-a49a-4ba3-bd68-c45b850c6201","timestamp":"2026-03-07T12:40:19.420Z"} {"parentUuid":"00926ade-a49a-4ba3-bd68-c45b850c6201","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:19.632Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01PHx21ULqoXqFWE1N4NjpZ2","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01HNZ2hoqU75Fqc4x945yhdb","name":"Read","input":{"file_path":"/home/josie/development/irc-now/crates/pics/src/routes/image.rs","offset":440,"limit":100},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":3271,"cache_read_input_tokens":91992,"cache_creation":{"ephemeral_5m_input_tokens":3271,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard","inference_geo":"not_available"},"context_management":null},"requestId":"req_011CYojcGQKu2x8QVNNSyx3Z","uuid":"2ca65435-b820-46f3-ad76-438c0686cb55"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"24918103-bc18-47ba-a552-289be527e5c7","timestamp":"2026-03-07T12:40:19.633Z"} {"parentUuid":"24918103-bc18-47ba-a552-289be527e5c7","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01HNZ2hoqU75Fqc4x945yhdb","type":"tool_result","content":" 440→ .await\n 441→ .map_err(|e| {\n 442→ tracing::error!(\"image delete failed: {e}\");\n 443→ StatusCode::INTERNAL_SERVER_ERROR\n 444→ })?;\n 445→\n 446→ Ok(Redirect::to(\"/my\"))\n 447→}\n 448→\n 449→fn check_internal_token(headers: &axum::http::HeaderMap) -> Result<(), StatusCode> {\n 450→ let expected = std::env::var(\"INTERNAL_API_TOKEN\").unwrap_or_default();\n 451→ if expected.is_empty() {\n 452→ return Err(StatusCode::FORBIDDEN);\n 453→ }\n 454→ match headers.get(\"x-internal-token\").and_then(|v| v.to_str().ok()) {\n 455→ Some(token) if token == expected => Ok(()),\n 456→ _ => Err(StatusCode::FORBIDDEN),\n 457→ }\n 458→}\n 459→\n 460→pub async fn internal_hide(\n 461→ headers: axum::http::HeaderMap,\n 462→ State(state): State,\n 463→ Path(id): Path,\n 464→) -> StatusCode {\n 465→ if let Err(code) = check_internal_token(&headers) {\n 466→ return code;\n 467→ }\n 468→ match sqlx::query(\"UPDATE images SET hidden = true WHERE id = $1\")\n 469→ .bind(&id)\n 470→ .execute(&state.db)\n 471→ .await\n 472→ {\n 473→ Ok(r) if r.rows_affected() > 0 => StatusCode::OK,\n 474→ Ok(_) => StatusCode::NOT_FOUND,\n 475→ Err(e) => {\n 476→ tracing::error!(\"hide image failed: {e}\");\n 477→ StatusCode::INTERNAL_SERVER_ERROR\n 478→ }\n 479→ }\n 480→}\n 481→\n 482→pub async fn internal_unhide(\n 483→ headers: axum::http::HeaderMap,\n 484→ State(state): State,\n 485→ Path(id): Path,\n 486→) -> StatusCode {\n 487→ if let Err(code) = check_internal_token(&headers) {\n 488→ return code;\n 489→ }\n 490→ match sqlx::query(\"UPDATE images SET hidden = false WHERE id = $1\")\n 491→ .bind(&id)\n 492→ .execute(&state.db)\n 493→ .await\n 494→ {\n 495→ Ok(r) if r.rows_affected() > 0 => StatusCode::OK,\n 496→ Ok(_) => StatusCode::NOT_FOUND,\n 497→ Err(e) => {\n 498→ tracing::error!(\"unhide image failed: {e}\");\n 499→ StatusCode::INTERNAL_SERVER_ERROR\n 500→ }\n 501→ }\n 502→}\n 503→\n 504→pub async fn internal_delete(\n 505→ headers: axum::http::HeaderMap,\n 506→ State(state): State,\n 507→ Path(id): Path,\n 508→) -> StatusCode {\n 509→ if let Err(code) = check_internal_token(&headers) {\n 510→ return code;\n 511→ }\n 512→ let row = match sqlx::query_as::<_, ImageRow>(\"SELECT * FROM images WHERE id = $1\")\n 513→ .bind(&id)\n 514→ .fetch_optional(&state.db)\n 515→ .await\n 516→ {\n 517→ Ok(Some(r)) => r,\n 518→ Ok(None) => return StatusCode::NOT_FOUND,\n 519→ Err(e) => {\n 520→ tracing::error!(\"internal delete query failed: {e}\");\n 521→ return StatusCode::INTERNAL_SERVER_ERROR;\n 522→ }\n 523→ };\n 524→\n 525→ let original_key = format!(\"{}/{}\", row.id, row.filename);\n 526→ let thumb_key = format!(\"{}/thumb.webp\", row.id);\n 527→ let _ = state.storage.delete(&original_key).await;\n 528→ let _ = state.storage.delete(&thumb_key).await;\n 529→\n 530→ match sqlx::query(\"DELETE FROM images WHERE id = $1\")\n 531→ .bind(&id)\n 532→ .execute(&state.db)\n 533→ .await\n 534→ {\n 535→ Ok(_) => StatusCode::OK,\n 536→ Err(e) => {\n 537→ tracing::error!(\"internal delete failed: {e}\");\n 538→ StatusCode::INTERNAL_SERVER_ERROR\n 539→ }"}]},"uuid":"85f498c3-7206-4be6-914d-d7381e641d4f","timestamp":"2026-03-07T12:40:19.698Z"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"f7477f5a-68d3-4d96-8309-47e7352d4efb","timestamp":"2026-03-07T12:40:19.735Z"} {"parentUuid":"f7477f5a-68d3-4d96-8309-47e7352d4efb","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:19.767Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01PHx21ULqoXqFWE1N4NjpZ2","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01Co74YnMLmEGgqeim8ZZwNa","name":"Read","input":{"file_path":"/home/josie/development/irc-now/crates/bot/src"},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":3271,"cache_read_input_tokens":91992,"cache_creation":{"ephemeral_5m_input_tokens":3271,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard","inference_geo":"not_available"},"context_management":null},"requestId":"req_011CYojcGQKu2x8QVNNSyx3Z","uuid":"c76c1041-8a4f-4dc8-8b08-2e3c9987117c"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"fbec21ba-1280-413f-a01b-d106994d3e76","timestamp":"2026-03-07T12:40:19.767Z"} {"parentUuid":"fbec21ba-1280-413f-a01b-d106994d3e76","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"user","message":{"role":"user","content":[{"type":"tool_result","content":"EISDIR: illegal operation on a directory, read '/home/josie/development/irc-now/crates/bot/src'","is_error":true,"tool_use_id":"toolu_01Co74YnMLmEGgqeim8ZZwNa"}]},"uuid":"0958e74d-a1fe-481f-957e-a9d790ab176b","timestamp":"2026-03-07T12:40:19.841Z","toolUseResult":"Error: EISDIR: illegal operation on a directory, read '/home/josie/development/irc-now/crates/bot/src'"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"044d07e4-8890-4a43-a68a-42f51f8bd3bb","timestamp":"2026-03-07T12:40:19.841Z"} {"parentUuid":"044d07e4-8890-4a43-a68a-42f51f8bd3bb","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:22.082Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01YVtMbEKbSP4VrZWZNY4fPU","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01LkPQ2M8hyFSSuSk8ctPSPh","name":"Glob","input":{"pattern":"crates/bot/src/lua/*.rs","path":"/home/josie/development/irc-now"},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":3017,"cache_read_input_tokens":95263,"cache_creation":{"ephemeral_5m_input_tokens":3017,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard","inference_geo":"not_available"},"context_management":null},"requestId":"req_011CYojcWWeAnXCG65EuvZRn","uuid":"3a75288b-15db-4a4f-b2a0-544612042399"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"4e2b5025-ee7f-4a94-9813-eee7cf9ecb3c","timestamp":"2026-03-07T12:40:22.082Z"} {"parentUuid":"4e2b5025-ee7f-4a94-9813-eee7cf9ecb3c","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01LkPQ2M8hyFSSuSk8ctPSPh","type":"tool_result","content":"/home/josie/development/irc-now/crates/bot/src/lua/mod.rs\n/home/josie/development/irc-now/crates/bot/src/lua/dispatch.rs\n/home/josie/development/irc-now/crates/bot/src/lua/api.rs\n/home/josie/development/irc-now/crates/bot/src/lua/sandbox.rs"}]},"uuid":"159d9cd0-ecd1-4011-a032-dc79139f038a","timestamp":"2026-03-07T12:40:22.230Z"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"9dd773e0-3bb2-4cf9-a4c5-12609e47c77e","timestamp":"2026-03-07T12:40:22.272Z"} {"parentUuid":"9dd773e0-3bb2-4cf9-a4c5-12609e47c77e","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:23.750Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01Fjd84qfPkXVu44e2KxbLe7","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01H2T4RZCyPK5FzQQB3cmNsL","name":"Read","input":{"file_path":"/home/josie/development/irc-now/crates/bot/src/lua/sandbox.rs","limit":250},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":250,"cache_read_input_tokens":98280,"cache_creation":{"ephemeral_5m_input_tokens":250,"ephemeral_1h_input_tokens":0},"output_tokens":25,"service_tier":"standard","inference_geo":"not_available"},"context_management":null},"requestId":"req_011CYojcgmnSExL8icAv9Lbw","uuid":"88054696-c281-4ea6-9d74-1c7341bc4a5e"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"d06f149b-5fc7-4dba-b252-cf01ff04c4e9","timestamp":"2026-03-07T12:40:23.751Z"} {"parentUuid":"d06f149b-5fc7-4dba-b252-cf01ff04c4e9","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01H2T4RZCyPK5FzQQB3cmNsL","type":"tool_result","content":" 1→use mlua::{Lua, Result as LuaResult, VmState};\n 2→\n 3→const MEMORY_LIMIT: usize = 8 * 1024 * 1024;\n 4→const INSTRUCTION_LIMIT: u32 = 1_000_000;\n 5→\n 6→pub fn create_sandbox() -> LuaResult {\n 7→ let lua = Lua::new();\n 8→\n 9→ lua.set_memory_limit(MEMORY_LIMIT)?;\n 10→\n 11→ lua.set_hook(\n 12→ mlua::HookTriggers::new().every_nth_instruction(10000),\n 13→ move |lua, _| {\n 14→ let count: u32 = lua\n 15→ .named_registry_value(\"__instruction_count\")\n 16→ .unwrap_or(0);\n 17→ let new_count = count + 10000;\n 18→ lua.set_named_registry_value(\"__instruction_count\", new_count)?;\n 19→ if new_count >= INSTRUCTION_LIMIT {\n 20→ Err(mlua::Error::RuntimeError(\n 21→ \"instruction limit exceeded\".to_string(),\n 22→ ))\n 23→ } else {\n 24→ Ok(VmState::Continue)\n 25→ }\n 26→ },\n 27→ )?;\n 28→\n 29→ {\n 30→ let globals = lua.globals();\n 31→ globals.raw_remove(\"os\")?;\n 32→ globals.raw_remove(\"io\")?;\n 33→ globals.raw_remove(\"loadfile\")?;\n 34→ globals.raw_remove(\"dofile\")?;\n 35→ globals.raw_remove(\"require\")?;\n 36→ globals.raw_remove(\"package\")?;\n 37→ globals.raw_remove(\"debug\")?;\n 38→ globals.raw_remove(\"load\")?;\n 39→ globals.raw_remove(\"coroutine\")?;\n 40→ globals.raw_remove(\"rawset\")?;\n 41→ globals.raw_remove(\"rawget\")?;\n 42→ }\n 43→\n 44→ Ok(lua)\n 45→}\n 46→\n 47→pub fn reset_instruction_counter(lua: &Lua) -> LuaResult<()> {\n 48→ lua.set_named_registry_value(\"__instruction_count\", 0u32)\n 49→}\n 50→"}]},"uuid":"39d8c162-9794-460c-a2fd-8c95ab566c0d","timestamp":"2026-03-07T12:40:23.814Z"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"e841c8e0-b9af-4710-b76e-46611b9c843d","timestamp":"2026-03-07T12:40:23.849Z"} {"parentUuid":"e841c8e0-b9af-4710-b76e-46611b9c843d","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:26.333Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_0165qMvntn7zysRbDFL2R8C2","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01DgRfWq1Pvi1r4GxYARaEx5","name":"Bash","input":{"command":"find crates -name \"*.rs\" -type f -exec grep -l \"^#\\[cfg(test)\\]\" {} \\; | sort | uniq"},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":1,"cache_creation_input_tokens":789,"cache_read_input_tokens":98530,"cache_creation":{"ephemeral_5m_input_tokens":789,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard","inference_geo":"not_available"},"context_management":null},"requestId":"req_011CYojcoYaMQR5tqV5Go3RC","uuid":"2ae0ede7-a8a2-43d1-8c35-c1c5d580f24b"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"e665a0bc-6d9d-4c7b-9459-2b5e1bc11131","timestamp":"2026-03-07T12:40:26.333Z"} {"parentUuid":"e665a0bc-6d9d-4c7b-9459-2b5e1bc11131","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01DgRfWq1Pvi1r4GxYARaEx5","type":"tool_result","content":"crates/bot/src/irc/parser.rs\ncrates/common/src/auth.rs\ncrates/common/src/db.rs\ncrates/common/src/error.rs\ncrates/common/src/metrics.rs\ncrates/ergo-operator/src/lib.rs\ncrates/ergo-operator/src/resources/certificate.rs\ncrates/ergo-operator/src/resources/configmap.rs\ncrates/ergo-operator/src/resources/deployment.rs\ncrates/ergo-operator/src/resources/pvc.rs\ncrates/ergo-operator/src/resources/route.rs\ncrates/ergo-operator/src/resources/service.rs\ncrates/ergo-operator/src/types.rs\ncrates/platform-operator/src/lib.rs\ncrates/platform-operator/src/resources/certificate.rs\ncrates/platform-operator/src/resources/deployment.rs\ncrates/platform-operator/src/resources/pvc.rs\ncrates/platform-operator/src/resources/route.rs\ncrates/platform-operator/src/resources/service.rs\ncrates/platform-operator/src/types/chatservice.rs\ncrates/platform-operator/src/types/minioinstance.rs\ncrates/platform-operator/src/types/webservice.rs\ncrates/soju-operator/src/db.rs\ncrates/soju-operator/src/lib.rs\ncrates/soju-operator/src/resources/certificate.rs\ncrates/soju-operator/src/resources/configmap.rs\ncrates/soju-operator/src/resources/deployment.rs\ncrates/soju-operator/src/resources/route.rs\ncrates/soju-operator/src/resources/secret.rs\ncrates/soju-operator/src/resources/service.rs\ncrates/soju-operator/src/types.rs\ncrates/web-api/src/irccloud.rs\ncrates/web-api/src/k8s.rs\ncrates/web-api/src/stripe_util.rs","is_error":false}]},"uuid":"3a43e2a3-d54a-45d0-9c5e-f4328b3cd74d","timestamp":"2026-03-07T12:40:29.128Z"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"e49debcb-ddb1-4132-add9-aa8a070f5567","timestamp":"2026-03-07T12:40:29.168Z"} {"parentUuid":"e49debcb-ddb1-4132-add9-aa8a070f5567","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:31.495Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01VGZJhNsrMDvHR5xSRQC6Qd","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01Y2CnKvcASZ6ieLnfwMnsNu","name":"Bash","input":{"command":"for crate in txt pics web-api bot; do echo \"=== $crate ===\"; find \"crates/$crate\" -name \"*.rs\" -exec grep -l \"^#\\[cfg(test)\\]\" {} \\; 2>/dev/null | wc -l; done"},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":0,"cache_creation_input_tokens":904,"cache_read_input_tokens":99319,"cache_creation":{"ephemeral_5m_input_tokens":904,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard","inference_geo":"not_available"},"context_management":null},"requestId":"req_011CYojdCFpYQTsWk9ywP7SX","uuid":"852e425e-4522-488c-b726-3e9821431eab"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"10198b74-6a33-4356-bfd9-7aab466d5630","timestamp":"2026-03-07T12:40:31.495Z"} {"parentUuid":"10198b74-6a33-4356-bfd9-7aab466d5630","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01Y2CnKvcASZ6ieLnfwMnsNu","type":"tool_result","content":"=== txt ===\n0\n=== pics ===\n0\n=== web-api ===\n3\n=== bot ===\n1","is_error":false}]},"uuid":"1646710e-91f5-40c4-a62d-201a533f2e87","timestamp":"2026-03-07T12:40:34.122Z"},"type":"agent_progress","prompt":"","agentId":"a3a82f69f155b3b79"},"toolUseID":"agent_msg_01DpcAH59121hNZshdGAMEMp","parentToolUseID":"toolu_01AChx92B32WiuBAkYh3ksZT","uuid":"06c426ad-cee7-412b-9a86-24e50ae6b684","timestamp":"2026-03-07T12:40:34.161Z"} {"parentUuid":"06c426ad-cee7-412b-9a86-24e50ae6b684","isSidechain":false,"userType":"external","cwd":"/home/josie/development/irc-now","sessionId":"517a9bed-fc51-43d7-86aa-b95c1b870529","version":"2.1.70","gitBranch":"master","slug":"groovy-beaming-scroll","type":"progress","data":{"message":{"type":"assistant","timestamp":"2026-03-07T12:40:35.669Z","message":{"model":"claude-haiku-4-5-20251001","id":"msg_01S5QDJYmUa7koXCBtst3UTJ","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_012E2FXYHmHfRQXUcsCrLipk","name":"Bash","input":{"command"// TODO: better import syntax? import { BaseAPIRequestFactory, RequiredError } from './baseapi.js'; import { HttpMethod, HttpInfo } from '../http/http.js'; import { ObjectSerializer } from '../models/ObjectSerializer.js'; import { ApiException } from './exception.js'; import { isCodeInRange } from '../util.js'; /** * no description */ export class BatchV1ApiRequestFactory extends BaseAPIRequestFactory { /** * create a CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */ async createNamespacedCronJob(namespace, body, pretty, dryRun, fieldManager, fieldValidation, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "createNamespacedCronJob", "namespace"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("BatchV1Api", "createNamespacedCronJob", "body"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldManager !== undefined) { requestContext.setQueryParam("fieldManager", ObjectSerializer.serialize(fieldManager, "string", "")); } // Query Params if (fieldValidation !== undefined) { requestContext.setQueryParam("fieldValidation", ObjectSerializer.serialize(fieldValidation, "string", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "V1CronJob", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * create a Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */ async createNamespacedJob(namespace, body, pretty, dryRun, fieldManager, fieldValidation, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "createNamespacedJob", "namespace"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("BatchV1Api", "createNamespacedJob", "body"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/jobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldManager !== undefined) { requestContext.setQueryParam("fieldManager", ObjectSerializer.serialize(fieldManager, "string", "")); } // Query Params if (fieldValidation !== undefined) { requestContext.setQueryParam("fieldValidation", ObjectSerializer.serialize(fieldValidation, "string", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "V1Job", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * delete collection of CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ async deleteCollectionNamespacedCronJob(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "deleteCollectionNamespacedCronJob", "namespace"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (_continue !== undefined) { requestContext.setQueryParam("continue", ObjectSerializer.serialize(_continue, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldSelector !== undefined) { requestContext.setQueryParam("fieldSelector", ObjectSerializer.serialize(fieldSelector, "string", "")); } // Query Params if (gracePeriodSeconds !== undefined) { requestContext.setQueryParam("gracePeriodSeconds", ObjectSerializer.serialize(gracePeriodSeconds, "number", "")); } // Query Params if (ignoreStoreReadErrorWithClusterBreakingPotential !== undefined) { requestContext.setQueryParam("ignoreStoreReadErrorWithClusterBreakingPotential", ObjectSerializer.serialize(ignoreStoreReadErrorWithClusterBreakingPotential, "boolean", "")); } // Query Params if (labelSelector !== undefined) { requestContext.setQueryParam("labelSelector", ObjectSerializer.serialize(labelSelector, "string", "")); } // Query Params if (limit !== undefined) { requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", "")); } // Query Params if (orphanDependents !== undefined) { requestContext.setQueryParam("orphanDependents", ObjectSerializer.serialize(orphanDependents, "boolean", "")); } // Query Params if (propagationPolicy !== undefined) { requestContext.setQueryParam("propagationPolicy", ObjectSerializer.serialize(propagationPolicy, "string", "")); } // Query Params if (resourceVersion !== undefined) { requestContext.setQueryParam("resourceVersion", ObjectSerializer.serialize(resourceVersion, "string", "")); } // Query Params if (resourceVersionMatch !== undefined) { requestContext.setQueryParam("resourceVersionMatch", ObjectSerializer.serialize(resourceVersionMatch, "string", "")); } // Query Params if (sendInitialEvents !== undefined) { requestContext.setQueryParam("sendInitialEvents", ObjectSerializer.serialize(sendInitialEvents, "boolean", "")); } // Query Params if (timeoutSeconds !== undefined) { requestContext.setQueryParam("timeoutSeconds", ObjectSerializer.serialize(timeoutSeconds, "number", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "V1DeleteOptions", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * delete collection of Job * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ async deleteCollectionNamespacedJob(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "deleteCollectionNamespacedJob", "namespace"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/jobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (_continue !== undefined) { requestContext.setQueryParam("continue", ObjectSerializer.serialize(_continue, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldSelector !== undefined) { requestContext.setQueryParam("fieldSelector", ObjectSerializer.serialize(fieldSelector, "string", "")); } // Query Params if (gracePeriodSeconds !== undefined) { requestContext.setQueryParam("gracePeriodSeconds", ObjectSerializer.serialize(gracePeriodSeconds, "number", "")); } // Query Params if (ignoreStoreReadErrorWithClusterBreakingPotential !== undefined) { requestContext.setQueryParam("ignoreStoreReadErrorWithClusterBreakingPotential", ObjectSerializer.serialize(ignoreStoreReadErrorWithClusterBreakingPotential, "boolean", "")); } // Query Params if (labelSelector !== undefined) { requestContext.setQueryParam("labelSelector", ObjectSerializer.serialize(labelSelector, "string", "")); } // Query Params if (limit !== undefined) { requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", "")); } // Query Params if (orphanDependents !== undefined) { requestContext.setQueryParam("orphanDependents", ObjectSerializer.serialize(orphanDependents, "boolean", "")); } // Query Params if (propagationPolicy !== undefined) { requestContext.setQueryParam("propagationPolicy", ObjectSerializer.serialize(propagationPolicy, "string", "")); } // Query Params if (resourceVersion !== undefined) { requestContext.setQueryParam("resourceVersion", ObjectSerializer.serialize(resourceVersion, "string", "")); } // Query Params if (resourceVersionMatch !== undefined) { requestContext.setQueryParam("resourceVersionMatch", ObjectSerializer.serialize(resourceVersionMatch, "string", "")); } // Query Params if (sendInitialEvents !== undefined) { requestContext.setQueryParam("sendInitialEvents", ObjectSerializer.serialize(sendInitialEvents, "boolean", "")); } // Query Params if (timeoutSeconds !== undefined) { requestContext.setQueryParam("timeoutSeconds", ObjectSerializer.serialize(timeoutSeconds, "number", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "V1DeleteOptions", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * delete a CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ async deleteNamespacedCronJob(name, namespace, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("BatchV1Api", "deleteNamespacedCronJob", "name"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "deleteNamespacedCronJob", "namespace"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (gracePeriodSeconds !== undefined) { requestContext.setQueryParam("gracePeriodSeconds", ObjectSerializer.serialize(gracePeriodSeconds, "number", "")); } // Query Params if (ignoreStoreReadErrorWithClusterBreakingPotential !== undefined) { requestContext.setQueryParam("ignoreStoreReadErrorWithClusterBreakingPotential", ObjectSerializer.serialize(ignoreStoreReadErrorWithClusterBreakingPotential, "boolean", "")); } // Query Params if (orphanDependents !== undefined) { requestContext.setQueryParam("orphanDependents", ObjectSerializer.serialize(orphanDependents, "boolean", "")); } // Query Params if (propagationPolicy !== undefined) { requestContext.setQueryParam("propagationPolicy", ObjectSerializer.serialize(propagationPolicy, "string", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "V1DeleteOptions", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * delete a Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param ignoreStoreReadErrorWithClusterBreakingPotential if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ async deleteNamespacedJob(name, namespace, pretty, dryRun, gracePeriodSeconds, ignoreStoreReadErrorWithClusterBreakingPotential, orphanDependents, propagationPolicy, body, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("BatchV1Api", "deleteNamespacedJob", "name"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "deleteNamespacedJob", "namespace"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/jobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (gracePeriodSeconds !== undefined) { requestContext.setQueryParam("gracePeriodSeconds", ObjectSerializer.serialize(gracePeriodSeconds, "number", "")); } // Query Params if (ignoreStoreReadErrorWithClusterBreakingPotential !== undefined) { requestContext.setQueryParam("ignoreStoreReadErrorWithClusterBreakingPotential", ObjectSerializer.serialize(ignoreStoreReadErrorWithClusterBreakingPotential, "boolean", "")); } // Query Params if (orphanDependents !== undefined) { requestContext.setQueryParam("orphanDependents", ObjectSerializer.serialize(orphanDependents, "boolean", "")); } // Query Params if (propagationPolicy !== undefined) { requestContext.setQueryParam("propagationPolicy", ObjectSerializer.serialize(propagationPolicy, "string", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "V1DeleteOptions", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * get available resources */ async getAPIResources(_options) { var _a; let _config = _options || this.configuration; // Path Params const localVarPath = '/apis/batch/v1/'; // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * list or watch objects of kind CronJob * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ async listCronJobForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _options) { var _a; let _config = _options || this.configuration; // Path Params const localVarPath = '/apis/batch/v1/cronjobs'; // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (allowWatchBookmarks !== undefined) { requestContext.setQueryParam("allowWatchBookmarks", ObjectSerializer.serialize(allowWatchBookmarks, "boolean", "")); } // Query Params if (_continue !== undefined) { requestContext.setQueryParam("continue", ObjectSerializer.serialize(_continue, "string", "")); } // Query Params if (fieldSelector !== undefined) { requestContext.setQueryParam("fieldSelector", ObjectSerializer.serialize(fieldSelector, "string", "")); } // Query Params if (labelSelector !== undefined) { requestContext.setQueryParam("labelSelector", ObjectSerializer.serialize(labelSelector, "string", "")); } // Query Params if (limit !== undefined) { requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", "")); } // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (resourceVersion !== undefined) { requestContext.setQueryParam("resourceVersion", ObjectSerializer.serialize(resourceVersion, "string", "")); } // Query Params if (resourceVersionMatch !== undefined) { requestContext.setQueryParam("resourceVersionMatch", ObjectSerializer.serialize(resourceVersionMatch, "string", "")); } // Query Params if (sendInitialEvents !== undefined) { requestContext.setQueryParam("sendInitialEvents", ObjectSerializer.serialize(sendInitialEvents, "boolean", "")); } // Query Params if (timeoutSeconds !== undefined) { requestContext.setQueryParam("timeoutSeconds", ObjectSerializer.serialize(timeoutSeconds, "number", "")); } // Query Params if (watch !== undefined) { requestContext.setQueryParam("watch", ObjectSerializer.serialize(watch, "boolean", "")); } let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * list or watch objects of kind Job * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ async listJobForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _options) { var _a; let _config = _options || this.configuration; // Path Params const localVarPath = '/apis/batch/v1/jobs'; // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (allowWatchBookmarks !== undefined) { requestContext.setQueryParam("allowWatchBookmarks", ObjectSerializer.serialize(allowWatchBookmarks, "boolean", "")); } // Query Params if (_continue !== undefined) { requestContext.setQueryParam("continue", ObjectSerializer.serialize(_continue, "string", "")); } // Query Params if (fieldSelector !== undefined) { requestContext.setQueryParam("fieldSelector", ObjectSerializer.serialize(fieldSelector, "string", "")); } // Query Params if (labelSelector !== undefined) { requestContext.setQueryParam("labelSelector", ObjectSerializer.serialize(labelSelector, "string", "")); } // Query Params if (limit !== undefined) { requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", "")); } // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (resourceVersion !== undefined) { requestContext.setQueryParam("resourceVersion", ObjectSerializer.serialize(resourceVersion, "string", "")); } // Query Params if (resourceVersionMatch !== undefined) { requestContext.setQueryParam("resourceVersionMatch", ObjectSerializer.serialize(resourceVersionMatch, "string", "")); } // Query Params if (sendInitialEvents !== undefined) { requestContext.setQueryParam("sendInitialEvents", ObjectSerializer.serialize(sendInitialEvents, "boolean", "")); } // Query Params if (timeoutSeconds !== undefined) { requestContext.setQueryParam("timeoutSeconds", ObjectSerializer.serialize(timeoutSeconds, "number", "")); } // Query Params if (watch !== undefined) { requestContext.setQueryParam("watch", ObjectSerializer.serialize(watch, "boolean", "")); } let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * list or watch objects of kind CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ async listNamespacedCronJob(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "listNamespacedCronJob", "namespace"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (allowWatchBookmarks !== undefined) { requestContext.setQueryParam("allowWatchBookmarks", ObjectSerializer.serialize(allowWatchBookmarks, "boolean", "")); } // Query Params if (_continue !== undefined) { requestContext.setQueryParam("continue", ObjectSerializer.serialize(_continue, "string", "")); } // Query Params if (fieldSelector !== undefined) { requestContext.setQueryParam("fieldSelector", ObjectSerializer.serialize(fieldSelector, "string", "")); } // Query Params if (labelSelector !== undefined) { requestContext.setQueryParam("labelSelector", ObjectSerializer.serialize(labelSelector, "string", "")); } // Query Params if (limit !== undefined) { requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", "")); } // Query Params if (resourceVersion !== undefined) { requestContext.setQueryParam("resourceVersion", ObjectSerializer.serialize(resourceVersion, "string", "")); } // Query Params if (resourceVersionMatch !== undefined) { requestContext.setQueryParam("resourceVersionMatch", ObjectSerializer.serialize(resourceVersionMatch, "string", "")); } // Query Params if (sendInitialEvents !== undefined) { requestContext.setQueryParam("sendInitialEvents", ObjectSerializer.serialize(sendInitialEvents, "boolean", "")); } // Query Params if (timeoutSeconds !== undefined) { requestContext.setQueryParam("timeoutSeconds", ObjectSerializer.serialize(timeoutSeconds, "number", "")); } // Query Params if (watch !== undefined) { requestContext.setQueryParam("watch", ObjectSerializer.serialize(watch, "boolean", "")); } let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * list or watch objects of kind Job * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param sendInitialEvents `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ async listNamespacedJob(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "listNamespacedJob", "namespace"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/jobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (allowWatchBookmarks !== undefined) { requestContext.setQueryParam("allowWatchBookmarks", ObjectSerializer.serialize(allowWatchBookmarks, "boolean", "")); } // Query Params if (_continue !== undefined) { requestContext.setQueryParam("continue", ObjectSerializer.serialize(_continue, "string", "")); } // Query Params if (fieldSelector !== undefined) { requestContext.setQueryParam("fieldSelector", ObjectSerializer.serialize(fieldSelector, "string", "")); } // Query Params if (labelSelector !== undefined) { requestContext.setQueryParam("labelSelector", ObjectSerializer.serialize(labelSelector, "string", "")); } // Query Params if (limit !== undefined) { requestContext.setQueryParam("limit", ObjectSerializer.serialize(limit, "number", "")); } // Query Params if (resourceVersion !== undefined) { requestContext.setQueryParam("resourceVersion", ObjectSerializer.serialize(resourceVersion, "string", "")); } // Query Params if (resourceVersionMatch !== undefined) { requestContext.setQueryParam("resourceVersionMatch", ObjectSerializer.serialize(resourceVersionMatch, "string", "")); } // Query Params if (sendInitialEvents !== undefined) { requestContext.setQueryParam("sendInitialEvents", ObjectSerializer.serialize(sendInitialEvents, "boolean", "")); } // Query Params if (timeoutSeconds !== undefined) { requestContext.setQueryParam("timeoutSeconds", ObjectSerializer.serialize(timeoutSeconds, "number", "")); } // Query Params if (watch !== undefined) { requestContext.setQueryParam("watch", ObjectSerializer.serialize(watch, "boolean", "")); } let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * partially update the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ async patchNamespacedCronJob(name, namespace, body, pretty, dryRun, fieldManager, fieldValidation, force, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("BatchV1Api", "patchNamespacedCronJob", "name"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "patchNamespacedCronJob", "namespace"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("BatchV1Api", "patchNamespacedCronJob", "body"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldManager !== undefined) { requestContext.setQueryParam("fieldManager", ObjectSerializer.serialize(fieldManager, "string", "")); } // Query Params if (fieldValidation !== undefined) { requestContext.setQueryParam("fieldValidation", ObjectSerializer.serialize(fieldValidation, "string", "")); } // Query Params if (force !== undefined) { requestContext.setQueryParam("force", ObjectSerializer.serialize(force, "boolean", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json-patch+json", "application/merge-patch+json", "application/strategic-merge-patch+json", "application/apply-patch+yaml", "application/apply-patch+cbor" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "any", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * partially update status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ async patchNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, fieldManager, fieldValidation, force, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("BatchV1Api", "patchNamespacedCronJobStatus", "name"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "patchNamespacedCronJobStatus", "namespace"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("BatchV1Api", "patchNamespacedCronJobStatus", "body"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldManager !== undefined) { requestContext.setQueryParam("fieldManager", ObjectSerializer.serialize(fieldManager, "string", "")); } // Query Params if (fieldValidation !== undefined) { requestContext.setQueryParam("fieldValidation", ObjectSerializer.serialize(fieldValidation, "string", "")); } // Query Params if (force !== undefined) { requestContext.setQueryParam("force", ObjectSerializer.serialize(force, "boolean", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json-patch+json", "application/merge-patch+json", "application/strategic-merge-patch+json", "application/apply-patch+yaml", "application/apply-patch+cbor" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "any", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * partially update the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ async patchNamespacedJob(name, namespace, body, pretty, dryRun, fieldManager, fieldValidation, force, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("BatchV1Api", "patchNamespacedJob", "name"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "patchNamespacedJob", "namespace"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("BatchV1Api", "patchNamespacedJob", "body"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/jobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldManager !== undefined) { requestContext.setQueryParam("fieldManager", ObjectSerializer.serialize(fieldManager, "string", "")); } // Query Params if (fieldValidation !== undefined) { requestContext.setQueryParam("fieldValidation", ObjectSerializer.serialize(fieldValidation, "string", "")); } // Query Params if (force !== undefined) { requestContext.setQueryParam("force", ObjectSerializer.serialize(force, "boolean", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json-patch+json", "application/merge-patch+json", "application/strategic-merge-patch+json", "application/apply-patch+yaml", "application/apply-patch+cbor" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "any", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * partially update status of the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ async patchNamespacedJobStatus(name, namespace, body, pretty, dryRun, fieldManager, fieldValidation, force, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("BatchV1Api", "patchNamespacedJobStatus", "name"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "patchNamespacedJobStatus", "namespace"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("BatchV1Api", "patchNamespacedJobStatus", "body"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldManager !== undefined) { requestContext.setQueryParam("fieldManager", ObjectSerializer.serialize(fieldManager, "string", "")); } // Query Params if (fieldValidation !== undefined) { requestContext.setQueryParam("fieldValidation", ObjectSerializer.serialize(fieldValidation, "string", "")); } // Query Params if (force !== undefined) { requestContext.setQueryParam("force", ObjectSerializer.serialize(force, "boolean", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ "application/json-patch+json", "application/merge-patch+json", "application/strategic-merge-patch+json", "application/apply-patch+yaml", "application/apply-patch+cbor" ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "any", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * read the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ async readNamespacedCronJob(name, namespace, pretty, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("BatchV1Api", "readNamespacedCronJob", "name"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "readNamespacedCronJob", "namespace"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * read status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ async readNamespacedCronJobStatus(name, namespace, pretty, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("BatchV1Api", "readNamespacedCronJobStatus", "name"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "readNamespacedCronJobStatus", "namespace"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * read the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ async readNamespacedJob(name, namespace, pretty, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("BatchV1Api", "readNamespacedJob", "name"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "readNamespacedJob", "namespace"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/jobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * read status of the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ async readNamespacedJobStatus(name, namespace, pretty, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("BatchV1Api", "readNamespacedJobStatus", "name"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "readNamespacedJobStatus", "namespace"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * replace the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */ async replaceNamespacedCronJob(name, namespace, body, pretty, dryRun, fieldManager, fieldValidation, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("BatchV1Api", "replaceNamespacedCronJob", "name"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "replaceNamespacedCronJob", "namespace"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("BatchV1Api", "replaceNamespacedCronJob", "body"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldManager !== undefined) { requestContext.setQueryParam("fieldManager", ObjectSerializer.serialize(fieldManager, "string", "")); } // Query Params if (fieldValidation !== undefined) { requestContext.setQueryParam("fieldValidation", ObjectSerializer.serialize(fieldValidation, "string", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "V1CronJob", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * replace status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */ async replaceNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, fieldManager, fieldValidation, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("BatchV1Api", "replaceNamespacedCronJobStatus", "name"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "replaceNamespacedCronJobStatus", "namespace"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("BatchV1Api", "replaceNamespacedCronJobStatus", "body"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldManager !== undefined) { requestContext.setQueryParam("fieldManager", ObjectSerializer.serialize(fieldManager, "string", "")); } // Query Params if (fieldValidation !== undefined) { requestContext.setQueryParam("fieldValidation", ObjectSerializer.serialize(fieldValidation, "string", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "V1CronJob", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * replace the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */ async replaceNamespacedJob(name, namespace, body, pretty, dryRun, fieldManager, fieldValidation, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("BatchV1Api", "replaceNamespacedJob", "name"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "replaceNamespacedJob", "namespace"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("BatchV1Api", "replaceNamespacedJob", "body"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/jobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldManager !== undefined) { requestContext.setQueryParam("fieldManager", ObjectSerializer.serialize(fieldManager, "string", "")); } // Query Params if (fieldValidation !== undefined) { requestContext.setQueryParam("fieldValidation", ObjectSerializer.serialize(fieldValidation, "string", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "V1Job", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } /** * replace status of the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. Defaults to \'false\' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */ async replaceNamespacedJobStatus(name, namespace, body, pretty, dryRun, fieldManager, fieldValidation, _options) { var _a; let _config = _options || this.configuration; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new RequiredError("BatchV1Api", "replaceNamespacedJobStatus", "name"); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new RequiredError("BatchV1Api", "replaceNamespacedJobStatus", "namespace"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("BatchV1Api", "replaceNamespacedJobStatus", "body"); } // Path Params const localVarPath = '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); // Make Request Context const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); // Query Params if (pretty !== undefined) { requestContext.setQueryParam("pretty", ObjectSerializer.serialize(pretty, "string", "")); } // Query Params if (dryRun !== undefined) { requestContext.setQueryParam("dryRun", ObjectSerializer.serialize(dryRun, "string", "")); } // Query Params if (fieldManager !== undefined) { requestContext.setQueryParam("fieldManager", ObjectSerializer.serialize(fieldManager, "string", "")); } // Query Params if (fieldValidation !== undefined) { requestContext.setQueryParam("fieldValidation", ObjectSerializer.serialize(fieldValidation, "string", "")); } // Body Params const contentType = ObjectSerializer.getPreferredMediaType([]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify(ObjectSerializer.serialize(body, "V1Job", ""), contentType); requestContext.setBody(serializedBody); let authMethod; // Apply auth methods authMethod = _config.authMethods["BearerToken"]; if (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication) { await (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext)); } const defaultAuth = (_a = _config === null || _config === void 0 ? void 0 : _config.authMethods) === null || _a === void 0 ? void 0 : _a.default; if (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication) { await (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext)); } return requestContext; } } export class BatchV1ApiResponseProcessor { /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to createNamespacedCronJob * @throws ApiException if the response code was not in [200, 299] */ async createNamespacedCronJobWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("201", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("202", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to createNamespacedJob * @throws ApiException if the response code was not in [200, 299] */ async createNamespacedJobWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("201", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("202", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to deleteCollectionNamespacedCronJob * @throws ApiException if the response code was not in [200, 299] */ async deleteCollectionNamespacedCronJobWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Status", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Status", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to deleteCollectionNamespacedJob * @throws ApiException if the response code was not in [200, 299] */ async deleteCollectionNamespacedJobWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Status", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Status", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to deleteNamespacedCronJob * @throws ApiException if the response code was not in [200, 299] */ async deleteNamespacedCronJobWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Status", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("202", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Status", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Status", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to deleteNamespacedJob * @throws ApiException if the response code was not in [200, 299] */ async deleteNamespacedJobWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Status", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("202", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Status", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Status", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to getAPIResources * @throws ApiException if the response code was not in [200, 299] */ async getAPIResourcesWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1APIResourceList", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1APIResourceList", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to listCronJobForAllNamespaces * @throws ApiException if the response code was not in [200, 299] */ async listCronJobForAllNamespacesWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJobList", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJobList", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to listJobForAllNamespaces * @throws ApiException if the response code was not in [200, 299] */ async listJobForAllNamespacesWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1JobList", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1JobList", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to listNamespacedCronJob * @throws ApiException if the response code was not in [200, 299] */ async listNamespacedCronJobWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJobList", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJobList", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to listNamespacedJob * @throws ApiException if the response code was not in [200, 299] */ async listNamespacedJobWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1JobList", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1JobList", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to patchNamespacedCronJob * @throws ApiException if the response code was not in [200, 299] */ async patchNamespacedCronJobWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("201", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to patchNamespacedCronJobStatus * @throws ApiException if the response code was not in [200, 299] */ async patchNamespacedCronJobStatusWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("201", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to patchNamespacedJob * @throws ApiException if the response code was not in [200, 299] */ async patchNamespacedJobWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("201", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to patchNamespacedJobStatus * @throws ApiException if the response code was not in [200, 299] */ async patchNamespacedJobStatusWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("201", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to readNamespacedCronJob * @throws ApiException if the response code was not in [200, 299] */ async readNamespacedCronJobWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to readNamespacedCronJobStatus * @throws ApiException if the response code was not in [200, 299] */ async readNamespacedCronJobStatusWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to readNamespacedJob * @throws ApiException if the response code was not in [200, 299] */ async readNamespacedJobWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to readNamespacedJobStatus * @throws ApiException if the response code was not in [200, 299] */ async readNamespacedJobStatusWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to replaceNamespacedCronJob * @throws ApiException if the response code was not in [200, 299] */ async replaceNamespacedCronJobWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("201", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to replaceNamespacedCronJobStatus * @throws ApiException if the response code was not in [200, 299] */ async replaceNamespacedCronJobStatusWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("201", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1CronJob", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to replaceNamespacedJob * @throws ApiException if the response code was not in [200, 299] */ async replaceNamespacedJobWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("201", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * * @params response Response returned by the server for a request to replaceNamespacedJobStatus * @throws ApiException if the response code was not in [200, 299] */ async replaceNamespacedJobStatusWithHttpInfo(response) { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (isCodeInRange("200", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("201", response.httpStatusCode)) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } if (isCodeInRange("401", response.httpStatusCode)) { throw new ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers); } // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { const body = ObjectSerializer.deserialize(ObjectSerializer.parse(await response.body.text(), contentType), "V1Job", ""); return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); } throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } } //# sourceMappingURL=BatchV1Api.js.map