1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct PythonExecution {
4 #[prost(string, tag = "1")]
5 pub code: ::prost::alloc::string::String,
6}
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct ShellExecution {
9 #[prost(string, optional, tag = "3")]
10 pub cwd: ::core::option::Option<::prost::alloc::string::String>,
11 #[prost(bool, tag = "4")]
12 pub interactive: bool,
13 #[prost(oneof = "shell_execution::Invocation", tags = "1, 2")]
14 pub invocation: ::core::option::Option<shell_execution::Invocation>,
15}
16pub mod shell_execution {
18 #[derive(Clone, PartialEq, ::prost::Oneof)]
19 pub enum Invocation {
20 #[prost(string, tag = "1")]
21 Command(::prost::alloc::string::String),
22 #[prost(message, tag = "2")]
23 Arguments(super::ShellArguments),
24 }
25}
26#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct ShellArguments {
28 #[prost(string, repeated, tag = "1")]
29 pub argv: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
30}
31#[derive(Clone, PartialEq, ::prost::Message)]
32pub struct ExecutionIntent {
33 #[prost(string, tag = "1")]
34 pub execution_id: ::prost::alloc::string::String,
35 #[prost(string, tag = "2")]
36 pub run_id: ::prost::alloc::string::String,
37 #[prost(uint32, tag = "5")]
38 pub timeout_ms: u32,
39 #[prost(oneof = "execution_intent::Execution", tags = "3, 4")]
40 pub execution: ::core::option::Option<execution_intent::Execution>,
41}
42pub mod execution_intent {
44 #[derive(Clone, PartialEq, ::prost::Oneof)]
45 pub enum Execution {
46 #[prost(message, tag = "3")]
47 Python(super::PythonExecution),
48 #[prost(message, tag = "4")]
49 Shell(super::ShellExecution),
50 }
51}
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct ExecutionArtifact {
54 #[prost(string, tag = "1")]
55 pub path: ::prost::alloc::string::String,
56 #[prost(string, tag = "2")]
57 pub media_type: ::prost::alloc::string::String,
58}
59#[derive(Clone, PartialEq, ::prost::Message)]
60pub struct ExecutionOutput {
61 #[prost(oneof = "execution_output::Output", tags = "1, 2, 3, 4")]
62 pub output: ::core::option::Option<execution_output::Output>,
63}
64pub mod execution_output {
66 #[derive(Clone, PartialEq, ::prost::Message)]
67 pub struct Stream {
68 #[prost(enumeration = "StreamName", tag = "1")]
69 pub name: i32,
70 #[prost(string, tag = "2")]
71 pub text: ::prost::alloc::string::String,
72 }
73 #[derive(Clone, PartialEq, ::prost::Message)]
74 pub struct Result {
75 #[prost(string, tag = "1")]
76 pub text_plain: ::prost::alloc::string::String,
77 }
78 #[derive(Clone, PartialEq, ::prost::Message)]
79 pub struct Display {
80 #[prost(string, tag = "1")]
81 pub text_plain: ::prost::alloc::string::String,
82 #[prost(uint32, optional, tag = "2")]
83 pub artifact_index: ::core::option::Option<u32>,
84 }
85 #[derive(Clone, PartialEq, ::prost::Message)]
86 pub struct Error {
87 #[prost(string, tag = "1")]
88 pub ename: ::prost::alloc::string::String,
89 #[prost(string, tag = "2")]
90 pub evalue: ::prost::alloc::string::String,
91 #[prost(string, repeated, tag = "3")]
92 pub traceback: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
93 }
94 #[derive(
95 Clone,
96 Copy,
97 Debug,
98 PartialEq,
99 Eq,
100 Hash,
101 PartialOrd,
102 Ord,
103 ::prost::Enumeration
104 )]
105 #[repr(i32)]
106 pub enum StreamName {
107 Unspecified = 0,
108 Stdout = 1,
109 Stderr = 2,
110 }
111 impl StreamName {
112 pub fn as_str_name(&self) -> &'static str {
117 match self {
118 Self::Unspecified => "STREAM_NAME_UNSPECIFIED",
119 Self::Stdout => "STREAM_NAME_STDOUT",
120 Self::Stderr => "STREAM_NAME_STDERR",
121 }
122 }
123 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
125 match value {
126 "STREAM_NAME_UNSPECIFIED" => Some(Self::Unspecified),
127 "STREAM_NAME_STDOUT" => Some(Self::Stdout),
128 "STREAM_NAME_STDERR" => Some(Self::Stderr),
129 _ => None,
130 }
131 }
132 }
133 #[derive(Clone, PartialEq, ::prost::Oneof)]
134 pub enum Output {
135 #[prost(message, tag = "1")]
136 Stream(Stream),
137 #[prost(message, tag = "2")]
138 Result(Result),
139 #[prost(message, tag = "3")]
140 Display(Display),
141 #[prost(message, tag = "4")]
142 Error(Error),
143 }
144}
145#[derive(Clone, PartialEq, ::prost::Message)]
146pub struct ExecutionSnapshot {
147 #[prost(string, tag = "1")]
148 pub execution_id: ::prost::alloc::string::String,
149 #[prost(enumeration = "ExecutionKind", tag = "2")]
150 pub kind: i32,
151 #[prost(enumeration = "ExecutionState", tag = "3")]
152 pub state: i32,
153 #[prost(bytes = "vec", tag = "4")]
154 pub output: ::prost::alloc::vec::Vec<u8>,
155 #[prost(uint64, tag = "5")]
156 pub offset: u64,
157 #[prost(uint64, tag = "6")]
158 pub next_offset: u64,
159 #[prost(uint64, tag = "7")]
160 pub output_size: u64,
161 #[prost(bool, tag = "8")]
162 pub has_more: bool,
163 #[prost(int32, optional, tag = "9")]
164 pub exit_code: ::core::option::Option<i32>,
165 #[prost(bool, tag = "11")]
166 pub truncated: bool,
167 #[prost(message, repeated, tag = "12")]
168 pub artifacts: ::prost::alloc::vec::Vec<ExecutionArtifact>,
169 #[prost(string, tag = "13")]
170 pub output_path: ::prost::alloc::string::String,
171 #[prost(string, tag = "14")]
172 pub notice: ::prost::alloc::string::String,
173 #[prost(message, repeated, tag = "15")]
174 pub outputs: ::prost::alloc::vec::Vec<ExecutionOutput>,
175 #[prost(bool, tag = "16")]
176 pub outputs_truncated: bool,
177}
178#[derive(Clone, PartialEq, ::prost::Message)]
179pub struct StartExecutionOperation {
180 #[prost(message, optional, tag = "1")]
181 pub intent: ::core::option::Option<ExecutionIntent>,
182 #[prost(uint32, optional, tag = "2")]
183 pub wait_ms: ::core::option::Option<u32>,
184}
185#[derive(Clone, PartialEq, ::prost::Message)]
186pub struct ReadExecutionOperation {
187 #[prost(string, tag = "1")]
188 pub execution_id: ::prost::alloc::string::String,
189 #[prost(uint64, tag = "2")]
190 pub offset: u64,
191 #[prost(uint32, optional, tag = "3")]
192 pub wait_ms: ::core::option::Option<u32>,
193 #[prost(uint32, optional, tag = "4")]
194 pub max_output_bytes: ::core::option::Option<u32>,
195}
196#[derive(Clone, PartialEq, ::prost::Message)]
197pub struct WriteStdinOperation {
198 #[prost(string, tag = "1")]
199 pub execution_id: ::prost::alloc::string::String,
200 #[prost(string, tag = "2")]
201 pub operation_id: ::prost::alloc::string::String,
202 #[prost(bytes = "vec", tag = "3")]
203 pub input: ::prost::alloc::vec::Vec<u8>,
204 #[prost(bool, tag = "4")]
205 pub close_stdin: bool,
206}
207#[derive(Clone, PartialEq, ::prost::Message)]
208pub struct KillExecutionOperation {
209 #[prost(string, tag = "1")]
210 pub execution_id: ::prost::alloc::string::String,
211}
212#[derive(Clone, PartialEq, ::prost::Message)]
213pub struct GetExecutionStatusesOperation {
214 #[prost(string, repeated, tag = "1")]
215 pub execution_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
216}
217#[derive(Clone, PartialEq, ::prost::Message)]
218pub struct ExecutionStatus {
219 #[prost(string, tag = "1")]
220 pub execution_id: ::prost::alloc::string::String,
221 #[prost(enumeration = "ExecutionKind", tag = "2")]
222 pub kind: i32,
223 #[prost(enumeration = "ExecutionState", tag = "3")]
224 pub state: i32,
225 #[prost(uint64, tag = "4")]
226 pub output_size: u64,
227 #[prost(int32, optional, tag = "5")]
228 pub exit_code: ::core::option::Option<i32>,
229 #[prost(bool, tag = "7")]
230 pub truncated: bool,
231 #[prost(string, tag = "8")]
232 pub notice: ::prost::alloc::string::String,
233}
234#[derive(Clone, PartialEq, ::prost::Message)]
235pub struct ExecutionStatuses {
236 #[prost(message, repeated, tag = "1")]
237 pub statuses: ::prost::alloc::vec::Vec<ExecutionStatus>,
238}
239#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
240#[repr(i32)]
241pub enum ExecutionKind {
242 Unspecified = 0,
243 Python = 1,
244 Shell = 2,
245}
246impl ExecutionKind {
247 pub fn as_str_name(&self) -> &'static str {
252 match self {
253 Self::Unspecified => "EXECUTION_KIND_UNSPECIFIED",
254 Self::Python => "EXECUTION_KIND_PYTHON",
255 Self::Shell => "EXECUTION_KIND_SHELL",
256 }
257 }
258 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
260 match value {
261 "EXECUTION_KIND_UNSPECIFIED" => Some(Self::Unspecified),
262 "EXECUTION_KIND_PYTHON" => Some(Self::Python),
263 "EXECUTION_KIND_SHELL" => Some(Self::Shell),
264 _ => None,
265 }
266 }
267}
268#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
269#[repr(i32)]
270pub enum ExecutionState {
271 Unspecified = 0,
272 Running = 1,
273 Exited = 2,
274 Killed = 3,
275 Unknown = 4,
276 TimedOut = 5,
277}
278impl ExecutionState {
279 pub fn as_str_name(&self) -> &'static str {
284 match self {
285 Self::Unspecified => "EXECUTION_STATE_UNSPECIFIED",
286 Self::Running => "EXECUTION_STATE_RUNNING",
287 Self::Exited => "EXECUTION_STATE_EXITED",
288 Self::Killed => "EXECUTION_STATE_KILLED",
289 Self::Unknown => "EXECUTION_STATE_UNKNOWN",
290 Self::TimedOut => "EXECUTION_STATE_TIMED_OUT",
291 }
292 }
293 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
295 match value {
296 "EXECUTION_STATE_UNSPECIFIED" => Some(Self::Unspecified),
297 "EXECUTION_STATE_RUNNING" => Some(Self::Running),
298 "EXECUTION_STATE_EXITED" => Some(Self::Exited),
299 "EXECUTION_STATE_KILLED" => Some(Self::Killed),
300 "EXECUTION_STATE_UNKNOWN" => Some(Self::Unknown),
301 "EXECUTION_STATE_TIMED_OUT" => Some(Self::TimedOut),
302 _ => None,
303 }
304 }
305}
306#[derive(Clone, PartialEq, ::prost::Message)]
307pub struct WorkspacePath {
308 #[prost(string, tag = "1")]
309 pub path: ::prost::alloc::string::String,
310}
311#[derive(Clone, PartialEq, ::prost::Message)]
312pub struct WorkspaceFileEntry {
313 #[prost(string, tag = "1")]
314 pub path: ::prost::alloc::string::String,
315 #[prost(string, tag = "2")]
316 pub name: ::prost::alloc::string::String,
317 #[prost(bool, tag = "3")]
318 pub is_directory: bool,
319 #[prost(uint64, tag = "4")]
320 pub size: u64,
321}
322#[derive(Clone, PartialEq, ::prost::Message)]
323pub struct StatFileOperation {
324 #[prost(message, optional, tag = "1")]
325 pub path: ::core::option::Option<WorkspacePath>,
326}
327#[derive(Clone, PartialEq, ::prost::Message)]
328pub struct StatFileResult {
329 #[prost(message, optional, tag = "1")]
330 pub entry: ::core::option::Option<WorkspaceFileEntry>,
331}
332#[derive(Clone, PartialEq, ::prost::Message)]
333pub struct ListFilesOperation {
334 #[prost(message, optional, tag = "1")]
335 pub path: ::core::option::Option<WorkspacePath>,
336 #[prost(uint32, tag = "2")]
337 pub page_size: u32,
338 #[prost(string, tag = "3")]
339 pub page_token: ::prost::alloc::string::String,
340}
341#[derive(Clone, PartialEq, ::prost::Message)]
342pub struct ListFilesResult {
343 #[prost(message, repeated, tag = "1")]
344 pub entries: ::prost::alloc::vec::Vec<WorkspaceFileEntry>,
345 #[prost(string, tag = "2")]
346 pub next_page_token: ::prost::alloc::string::String,
347}
348#[derive(Clone, PartialEq, ::prost::Message)]
349pub struct FindFilesOperation {
350 #[prost(message, optional, tag = "1")]
351 pub path: ::core::option::Option<WorkspacePath>,
352 #[prost(string, tag = "2")]
353 pub pattern: ::prost::alloc::string::String,
354 #[prost(uint32, tag = "3")]
355 pub max_results: u32,
356}
357#[derive(Clone, PartialEq, ::prost::Message)]
358pub struct FindFilesResult {
359 #[prost(message, repeated, tag = "1")]
360 pub entries: ::prost::alloc::vec::Vec<WorkspaceFileEntry>,
361 #[prost(bool, tag = "2")]
362 pub truncated: bool,
363}
364#[derive(Clone, PartialEq, ::prost::Message)]
365pub struct GrepFilesOperation {
366 #[prost(message, optional, tag = "1")]
367 pub path: ::core::option::Option<WorkspacePath>,
368 #[prost(string, tag = "2")]
369 pub pattern: ::prost::alloc::string::String,
370 #[prost(bool, tag = "3")]
371 pub regex: bool,
372 #[prost(bool, tag = "4")]
373 pub case_sensitive: bool,
374 #[prost(uint32, tag = "5")]
375 pub max_results: u32,
376}
377#[derive(Clone, PartialEq, ::prost::Message)]
378pub struct WorkspaceGrepMatch {
379 #[prost(string, tag = "1")]
380 pub path: ::prost::alloc::string::String,
381 #[prost(uint64, tag = "2")]
382 pub line_number: u64,
383 #[prost(string, tag = "3")]
384 pub text: ::prost::alloc::string::String,
385}
386#[derive(Clone, PartialEq, ::prost::Message)]
387pub struct GrepFilesResult {
388 #[prost(message, repeated, tag = "1")]
389 pub matches: ::prost::alloc::vec::Vec<WorkspaceGrepMatch>,
390 #[prost(bool, tag = "2")]
391 pub truncated: bool,
392}
393#[derive(Clone, PartialEq, ::prost::Message)]
394pub struct RealpathOperation {
395 #[prost(message, optional, tag = "1")]
396 pub path: ::core::option::Option<WorkspacePath>,
397}
398#[derive(Clone, PartialEq, ::prost::Message)]
399pub struct RealpathResult {
400 #[prost(message, optional, tag = "1")]
401 pub path: ::core::option::Option<WorkspacePath>,
402}
403#[derive(Clone, PartialEq, ::prost::Message)]
404pub struct MkdirOperation {
405 #[prost(message, optional, tag = "1")]
406 pub path: ::core::option::Option<WorkspacePath>,
407 #[prost(bool, tag = "2")]
408 pub parents: bool,
409}
410#[derive(Clone, PartialEq, ::prost::Message)]
411pub struct RemoveFileOperation {
412 #[prost(message, optional, tag = "1")]
413 pub path: ::core::option::Option<WorkspacePath>,
414 #[prost(bool, tag = "2")]
415 pub recursive: bool,
416}
417#[derive(Clone, Copy, PartialEq, ::prost::Message)]
418pub struct FileMutationResult {}
419#[derive(Clone, PartialEq, ::prost::Message)]
420pub struct DownloadFileOperation {
421 #[prost(message, optional, tag = "1")]
422 pub path: ::core::option::Option<WorkspacePath>,
423 #[prost(string, tag = "2")]
424 pub url: ::prost::alloc::string::String,
425 #[prost(uint64, tag = "3")]
426 pub max_bytes: u64,
427 #[prost(uint32, tag = "4")]
428 pub wait_ms: u32,
429}
430#[derive(Clone, PartialEq, ::prost::Message)]
431pub struct DownloadFileResult {
432 #[prost(enumeration = "DownloadState", tag = "1")]
433 pub state: i32,
434 #[prost(uint64, tag = "2")]
435 pub size: u64,
436 #[prost(string, tag = "3")]
437 pub sha256: ::prost::alloc::string::String,
438 #[prost(bytes = "vec", tag = "4")]
439 pub head: ::prost::alloc::vec::Vec<u8>,
440 #[prost(string, tag = "5")]
441 pub reason: ::prost::alloc::string::String,
442}
443#[derive(Clone, PartialEq, ::prost::Message)]
444pub struct WorkspaceFileOperation {
445 #[prost(
446 oneof = "workspace_file_operation::Operation",
447 tags = "1, 2, 3, 4, 5, 6, 7, 8"
448 )]
449 pub operation: ::core::option::Option<workspace_file_operation::Operation>,
450}
451pub mod workspace_file_operation {
453 #[derive(Clone, PartialEq, ::prost::Oneof)]
454 pub enum Operation {
455 #[prost(message, tag = "1")]
456 Stat(super::StatFileOperation),
457 #[prost(message, tag = "2")]
458 List(super::ListFilesOperation),
459 #[prost(message, tag = "3")]
460 Find(super::FindFilesOperation),
461 #[prost(message, tag = "4")]
462 Grep(super::GrepFilesOperation),
463 #[prost(message, tag = "5")]
464 Realpath(super::RealpathOperation),
465 #[prost(message, tag = "6")]
466 Mkdir(super::MkdirOperation),
467 #[prost(message, tag = "7")]
468 Remove(super::RemoveFileOperation),
469 #[prost(message, tag = "8")]
470 Download(super::DownloadFileOperation),
471 }
472}
473#[derive(Clone, PartialEq, ::prost::Message)]
474pub struct WorkspaceFileResult {
475 #[prost(oneof = "workspace_file_result::Result", tags = "1, 2, 3, 4, 5, 6, 7, 8")]
476 pub result: ::core::option::Option<workspace_file_result::Result>,
477}
478pub mod workspace_file_result {
480 #[derive(Clone, PartialEq, ::prost::Oneof)]
481 pub enum Result {
482 #[prost(message, tag = "1")]
483 Stat(super::StatFileResult),
484 #[prost(message, tag = "2")]
485 List(super::ListFilesResult),
486 #[prost(message, tag = "3")]
487 Find(super::FindFilesResult),
488 #[prost(message, tag = "4")]
489 Grep(super::GrepFilesResult),
490 #[prost(message, tag = "5")]
491 Realpath(super::RealpathResult),
492 #[prost(message, tag = "6")]
493 Mkdir(super::FileMutationResult),
494 #[prost(message, tag = "7")]
495 Remove(super::FileMutationResult),
496 #[prost(message, tag = "8")]
497 Download(super::DownloadFileResult),
498 }
499}
500#[derive(Clone, PartialEq, ::prost::Message)]
501pub struct ReadFileOperation {
502 #[prost(message, optional, tag = "1")]
503 pub path: ::core::option::Option<WorkspacePath>,
504 #[prost(uint64, tag = "2")]
505 pub offset: u64,
506 #[prost(uint32, optional, tag = "3")]
507 pub max_bytes: ::core::option::Option<u32>,
508}
509#[derive(Clone, PartialEq, ::prost::Message)]
510pub struct FileChunk {
511 #[prost(bytes = "vec", tag = "1")]
512 pub data: ::prost::alloc::vec::Vec<u8>,
513 #[prost(uint64, tag = "2")]
514 pub offset: u64,
515}
516#[derive(Clone, PartialEq, ::prost::Message)]
517pub struct WriteFileOperation {
518 #[prost(message, optional, tag = "1")]
519 pub path: ::core::option::Option<WorkspacePath>,
520 #[prost(message, optional, tag = "2")]
521 pub chunk: ::core::option::Option<FileChunk>,
522}
523#[derive(Clone, Copy, PartialEq, ::prost::Message)]
524pub struct WriteFileResult {
525 #[prost(uint64, tag = "1")]
526 pub written: u64,
527}
528#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
529#[repr(i32)]
530pub enum DownloadState {
531 Unspecified = 0,
532 Loading = 1,
533 Ready = 2,
534 TooLarge = 3,
535 Failed = 4,
536}
537impl DownloadState {
538 pub fn as_str_name(&self) -> &'static str {
543 match self {
544 Self::Unspecified => "DOWNLOAD_STATE_UNSPECIFIED",
545 Self::Loading => "DOWNLOAD_STATE_LOADING",
546 Self::Ready => "DOWNLOAD_STATE_READY",
547 Self::TooLarge => "DOWNLOAD_STATE_TOO_LARGE",
548 Self::Failed => "DOWNLOAD_STATE_FAILED",
549 }
550 }
551 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
553 match value {
554 "DOWNLOAD_STATE_UNSPECIFIED" => Some(Self::Unspecified),
555 "DOWNLOAD_STATE_LOADING" => Some(Self::Loading),
556 "DOWNLOAD_STATE_READY" => Some(Self::Ready),
557 "DOWNLOAD_STATE_TOO_LARGE" => Some(Self::TooLarge),
558 "DOWNLOAD_STATE_FAILED" => Some(Self::Failed),
559 _ => None,
560 }
561 }
562}
563#[derive(Clone, PartialEq, ::prost::Message)]
564pub struct Sandbox {
565 #[prost(string, tag = "1")]
566 pub sandbox_rid: ::prost::alloc::string::String,
567 #[prost(enumeration = "SandboxStatus", tag = "2")]
568 pub status: i32,
569 #[prost(message, optional, tag = "3")]
570 pub created_at: ::core::option::Option<
571 super::super::super::google::protobuf::Timestamp,
572 >,
573 #[prost(message, optional, tag = "4")]
574 pub last_activity_at: ::core::option::Option<
575 super::super::super::google::protobuf::Timestamp,
576 >,
577 #[prost(uint32, tag = "5")]
578 pub idle_timeout_seconds: u32,
579}
580#[derive(Clone, PartialEq, ::prost::Message)]
581pub struct CreateSandboxRequest {
582 #[prost(string, tag = "1")]
583 pub parent_rid: ::prost::alloc::string::String,
584}
585#[derive(Clone, PartialEq, ::prost::Message)]
586pub struct CreateSandboxResponse {
587 #[prost(message, optional, tag = "1")]
588 pub sandbox: ::core::option::Option<Sandbox>,
589 #[prost(bool, tag = "2")]
590 pub created: bool,
591}
592#[derive(Clone, PartialEq, ::prost::Message)]
593pub struct GetSandboxRequest {
594 #[prost(string, tag = "1")]
595 pub sandbox_rid: ::prost::alloc::string::String,
596}
597#[derive(Clone, PartialEq, ::prost::Message)]
598pub struct GetSandboxResponse {
599 #[prost(message, optional, tag = "1")]
600 pub sandbox: ::core::option::Option<Sandbox>,
601}
602#[derive(Clone, PartialEq, ::prost::Message)]
603pub struct GetLiveSandboxRequest {
604 #[prost(string, tag = "1")]
605 pub parent_rid: ::prost::alloc::string::String,
606}
607#[derive(Clone, PartialEq, ::prost::Message)]
608pub struct GetLiveSandboxResponse {
609 #[prost(message, optional, tag = "1")]
610 pub sandbox: ::core::option::Option<Sandbox>,
611}
612#[derive(Clone, PartialEq, ::prost::Message)]
613pub struct DeleteSandboxRequest {
614 #[prost(string, tag = "1")]
615 pub sandbox_rid: ::prost::alloc::string::String,
616}
617#[derive(Clone, PartialEq, ::prost::Message)]
618pub struct DeleteSandboxResponse {
619 #[prost(message, optional, tag = "1")]
620 pub sandbox: ::core::option::Option<Sandbox>,
621}
622#[derive(Clone, PartialEq, ::prost::Message)]
623pub struct RestartInterpreterRequest {
624 #[prost(string, tag = "1")]
625 pub sandbox_rid: ::prost::alloc::string::String,
626}
627#[derive(Clone, Copy, PartialEq, ::prost::Message)]
628pub struct RestartInterpreterResponse {}
629#[derive(Clone, PartialEq, ::prost::Message)]
630pub struct SandboxScope {
631 #[prost(string, tag = "1")]
632 pub sandbox_rid: ::prost::alloc::string::String,
633 #[prost(string, tag = "2")]
634 pub parent_rid: ::prost::alloc::string::String,
635 #[prost(string, tag = "3")]
636 pub organization_rid: ::prost::alloc::string::String,
637 #[prost(string, tag = "4")]
638 pub workspace_rid: ::prost::alloc::string::String,
639 #[prost(string, tag = "5")]
640 pub run_id: ::prost::alloc::string::String,
641}
642#[derive(Clone, PartialEq, ::prost::Message)]
643pub struct StartExecutionRequest {
644 #[prost(message, optional, tag = "1")]
645 pub scope: ::core::option::Option<SandboxScope>,
646 #[prost(message, optional, tag = "2")]
647 pub operation: ::core::option::Option<StartExecutionOperation>,
648}
649#[derive(Clone, PartialEq, ::prost::Message)]
650pub struct StartExecutionResponse {
651 #[prost(message, optional, tag = "1")]
652 pub execution: ::core::option::Option<ExecutionSnapshot>,
653}
654#[derive(Clone, PartialEq, ::prost::Message)]
655pub struct ReadExecutionRequest {
656 #[prost(message, optional, tag = "1")]
657 pub scope: ::core::option::Option<SandboxScope>,
658 #[prost(message, optional, tag = "2")]
659 pub operation: ::core::option::Option<ReadExecutionOperation>,
660}
661#[derive(Clone, PartialEq, ::prost::Message)]
662pub struct ReadExecutionResponse {
663 #[prost(message, optional, tag = "1")]
664 pub execution: ::core::option::Option<ExecutionSnapshot>,
665}
666#[derive(Clone, PartialEq, ::prost::Message)]
667pub struct WriteStdinRequest {
668 #[prost(message, optional, tag = "1")]
669 pub scope: ::core::option::Option<SandboxScope>,
670 #[prost(message, optional, tag = "2")]
671 pub operation: ::core::option::Option<WriteStdinOperation>,
672}
673#[derive(Clone, PartialEq, ::prost::Message)]
674pub struct WriteStdinResponse {
675 #[prost(message, optional, tag = "1")]
676 pub execution: ::core::option::Option<ExecutionStatus>,
677}
678#[derive(Clone, PartialEq, ::prost::Message)]
679pub struct KillExecutionRequest {
680 #[prost(message, optional, tag = "1")]
681 pub scope: ::core::option::Option<SandboxScope>,
682 #[prost(message, optional, tag = "2")]
683 pub operation: ::core::option::Option<KillExecutionOperation>,
684}
685#[derive(Clone, PartialEq, ::prost::Message)]
686pub struct KillExecutionResponse {
687 #[prost(message, optional, tag = "1")]
688 pub execution: ::core::option::Option<ExecutionStatus>,
689}
690#[derive(Clone, PartialEq, ::prost::Message)]
691pub struct GetExecutionStatusesRequest {
692 #[prost(message, optional, tag = "1")]
693 pub scope: ::core::option::Option<SandboxScope>,
694}
695#[derive(Clone, PartialEq, ::prost::Message)]
696pub struct GetExecutionStatusesResponse {
697 #[prost(message, repeated, tag = "1")]
698 pub sessions: ::prost::alloc::vec::Vec<ExecutionSession>,
699}
700#[derive(Clone, PartialEq, ::prost::Message)]
701pub struct WorkspaceFileOperationRequest {
702 #[prost(message, optional, tag = "1")]
703 pub scope: ::core::option::Option<SandboxScope>,
704 #[prost(message, optional, tag = "2")]
705 pub operation: ::core::option::Option<WorkspaceFileOperation>,
706}
707#[derive(Clone, PartialEq, ::prost::Message)]
708pub struct WorkspaceFileOperationResponse {
709 #[prost(message, optional, tag = "1")]
710 pub result: ::core::option::Option<WorkspaceFileResult>,
711}
712#[derive(Clone, PartialEq, ::prost::Message)]
713pub struct ReadFileRequest {
714 #[prost(message, optional, tag = "1")]
715 pub scope: ::core::option::Option<SandboxScope>,
716 #[prost(message, optional, tag = "2")]
717 pub operation: ::core::option::Option<ReadFileOperation>,
718}
719#[derive(Clone, PartialEq, ::prost::Message)]
720pub struct ReadFileResponse {
721 #[prost(message, optional, tag = "1")]
722 pub chunk: ::core::option::Option<FileChunk>,
723}
724#[derive(Clone, PartialEq, ::prost::Message)]
725pub struct WriteFileRequest {
726 #[prost(message, optional, tag = "1")]
727 pub scope: ::core::option::Option<SandboxScope>,
728 #[prost(message, optional, tag = "2")]
729 pub operation: ::core::option::Option<WriteFileOperation>,
730}
731#[derive(Clone, Copy, PartialEq, ::prost::Message)]
732pub struct WriteFileResponse {
733 #[prost(message, optional, tag = "1")]
734 pub result: ::core::option::Option<WriteFileResult>,
735}
736#[derive(Clone, PartialEq, ::prost::Message)]
737pub struct ExecutionSession {
738 #[prost(message, optional, tag = "1")]
739 pub status: ::core::option::Option<ExecutionStatus>,
740 #[prost(uint64, tag = "2")]
741 pub next_offset: u64,
742 #[prost(bool, tag = "3")]
743 pub terminal_pending: bool,
744}
745#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
746#[repr(i32)]
747pub enum SandboxStatus {
748 Unspecified = 0,
749 Creating = 1,
750 Ready = 2,
751 Terminating = 3,
752 Terminated = 4,
753 Failed = 5,
754}
755impl SandboxStatus {
756 pub fn as_str_name(&self) -> &'static str {
761 match self {
762 Self::Unspecified => "SANDBOX_STATUS_UNSPECIFIED",
763 Self::Creating => "SANDBOX_STATUS_CREATING",
764 Self::Ready => "SANDBOX_STATUS_READY",
765 Self::Terminating => "SANDBOX_STATUS_TERMINATING",
766 Self::Terminated => "SANDBOX_STATUS_TERMINATED",
767 Self::Failed => "SANDBOX_STATUS_FAILED",
768 }
769 }
770 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
772 match value {
773 "SANDBOX_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
774 "SANDBOX_STATUS_CREATING" => Some(Self::Creating),
775 "SANDBOX_STATUS_READY" => Some(Self::Ready),
776 "SANDBOX_STATUS_TERMINATING" => Some(Self::Terminating),
777 "SANDBOX_STATUS_TERMINATED" => Some(Self::Terminated),
778 "SANDBOX_STATUS_FAILED" => Some(Self::Failed),
779 _ => None,
780 }
781 }
782}
783pub mod internal_code_sandbox_service_client {
785 #![allow(
786 unused_variables,
787 dead_code,
788 missing_docs,
789 clippy::wildcard_imports,
790 clippy::let_unit_value,
791 )]
792 use tonic::codegen::*;
793 use tonic::codegen::http::Uri;
794 #[derive(Debug, Clone)]
795 pub struct InternalCodeSandboxServiceClient<T> {
796 inner: tonic::client::Grpc<T>,
797 }
798 impl InternalCodeSandboxServiceClient<tonic::transport::Channel> {
799 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
801 where
802 D: TryInto<tonic::transport::Endpoint>,
803 D::Error: Into<StdError>,
804 {
805 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
806 Ok(Self::new(conn))
807 }
808 }
809 impl<T> InternalCodeSandboxServiceClient<T>
810 where
811 T: tonic::client::GrpcService<tonic::body::Body>,
812 T::Error: Into<StdError>,
813 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
814 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
815 {
816 pub fn new(inner: T) -> Self {
817 let inner = tonic::client::Grpc::new(inner);
818 Self { inner }
819 }
820 pub fn with_origin(inner: T, origin: Uri) -> Self {
821 let inner = tonic::client::Grpc::with_origin(inner, origin);
822 Self { inner }
823 }
824 pub fn with_interceptor<F>(
825 inner: T,
826 interceptor: F,
827 ) -> InternalCodeSandboxServiceClient<InterceptedService<T, F>>
828 where
829 F: tonic::service::Interceptor,
830 T::ResponseBody: Default,
831 T: tonic::codegen::Service<
832 http::Request<tonic::body::Body>,
833 Response = http::Response<
834 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
835 >,
836 >,
837 <T as tonic::codegen::Service<
838 http::Request<tonic::body::Body>,
839 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
840 {
841 InternalCodeSandboxServiceClient::new(
842 InterceptedService::new(inner, interceptor),
843 )
844 }
845 #[must_use]
850 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
851 self.inner = self.inner.send_compressed(encoding);
852 self
853 }
854 #[must_use]
856 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
857 self.inner = self.inner.accept_compressed(encoding);
858 self
859 }
860 #[must_use]
864 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
865 self.inner = self.inner.max_decoding_message_size(limit);
866 self
867 }
868 #[must_use]
872 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
873 self.inner = self.inner.max_encoding_message_size(limit);
874 self
875 }
876 pub async fn create_sandbox(
877 &mut self,
878 request: impl tonic::IntoRequest<super::CreateSandboxRequest>,
879 ) -> std::result::Result<
880 tonic::Response<super::CreateSandboxResponse>,
881 tonic::Status,
882 > {
883 self.inner
884 .ready()
885 .await
886 .map_err(|e| {
887 tonic::Status::unknown(
888 format!("Service was not ready: {}", e.into()),
889 )
890 })?;
891 let codec = tonic::codec::ProstCodec::default();
892 let path = http::uri::PathAndQuery::from_static(
893 "/nominal.internalcodesandbox.v1.InternalCodeSandboxService/CreateSandbox",
894 );
895 let mut req = request.into_request();
896 req.extensions_mut()
897 .insert(
898 GrpcMethod::new(
899 "nominal.internalcodesandbox.v1.InternalCodeSandboxService",
900 "CreateSandbox",
901 ),
902 );
903 self.inner.unary(req, path, codec).await
904 }
905 pub async fn get_sandbox(
906 &mut self,
907 request: impl tonic::IntoRequest<super::GetSandboxRequest>,
908 ) -> std::result::Result<
909 tonic::Response<super::GetSandboxResponse>,
910 tonic::Status,
911 > {
912 self.inner
913 .ready()
914 .await
915 .map_err(|e| {
916 tonic::Status::unknown(
917 format!("Service was not ready: {}", e.into()),
918 )
919 })?;
920 let codec = tonic::codec::ProstCodec::default();
921 let path = http::uri::PathAndQuery::from_static(
922 "/nominal.internalcodesandbox.v1.InternalCodeSandboxService/GetSandbox",
923 );
924 let mut req = request.into_request();
925 req.extensions_mut()
926 .insert(
927 GrpcMethod::new(
928 "nominal.internalcodesandbox.v1.InternalCodeSandboxService",
929 "GetSandbox",
930 ),
931 );
932 self.inner.unary(req, path, codec).await
933 }
934 pub async fn get_live_sandbox(
935 &mut self,
936 request: impl tonic::IntoRequest<super::GetLiveSandboxRequest>,
937 ) -> std::result::Result<
938 tonic::Response<super::GetLiveSandboxResponse>,
939 tonic::Status,
940 > {
941 self.inner
942 .ready()
943 .await
944 .map_err(|e| {
945 tonic::Status::unknown(
946 format!("Service was not ready: {}", e.into()),
947 )
948 })?;
949 let codec = tonic::codec::ProstCodec::default();
950 let path = http::uri::PathAndQuery::from_static(
951 "/nominal.internalcodesandbox.v1.InternalCodeSandboxService/GetLiveSandbox",
952 );
953 let mut req = request.into_request();
954 req.extensions_mut()
955 .insert(
956 GrpcMethod::new(
957 "nominal.internalcodesandbox.v1.InternalCodeSandboxService",
958 "GetLiveSandbox",
959 ),
960 );
961 self.inner.unary(req, path, codec).await
962 }
963 pub async fn delete_sandbox(
964 &mut self,
965 request: impl tonic::IntoRequest<super::DeleteSandboxRequest>,
966 ) -> std::result::Result<
967 tonic::Response<super::DeleteSandboxResponse>,
968 tonic::Status,
969 > {
970 self.inner
971 .ready()
972 .await
973 .map_err(|e| {
974 tonic::Status::unknown(
975 format!("Service was not ready: {}", e.into()),
976 )
977 })?;
978 let codec = tonic::codec::ProstCodec::default();
979 let path = http::uri::PathAndQuery::from_static(
980 "/nominal.internalcodesandbox.v1.InternalCodeSandboxService/DeleteSandbox",
981 );
982 let mut req = request.into_request();
983 req.extensions_mut()
984 .insert(
985 GrpcMethod::new(
986 "nominal.internalcodesandbox.v1.InternalCodeSandboxService",
987 "DeleteSandbox",
988 ),
989 );
990 self.inner.unary(req, path, codec).await
991 }
992 pub async fn restart_interpreter(
993 &mut self,
994 request: impl tonic::IntoRequest<super::RestartInterpreterRequest>,
995 ) -> std::result::Result<
996 tonic::Response<super::RestartInterpreterResponse>,
997 tonic::Status,
998 > {
999 self.inner
1000 .ready()
1001 .await
1002 .map_err(|e| {
1003 tonic::Status::unknown(
1004 format!("Service was not ready: {}", e.into()),
1005 )
1006 })?;
1007 let codec = tonic::codec::ProstCodec::default();
1008 let path = http::uri::PathAndQuery::from_static(
1009 "/nominal.internalcodesandbox.v1.InternalCodeSandboxService/RestartInterpreter",
1010 );
1011 let mut req = request.into_request();
1012 req.extensions_mut()
1013 .insert(
1014 GrpcMethod::new(
1015 "nominal.internalcodesandbox.v1.InternalCodeSandboxService",
1016 "RestartInterpreter",
1017 ),
1018 );
1019 self.inner.unary(req, path, codec).await
1020 }
1021 pub async fn start_execution(
1022 &mut self,
1023 request: impl tonic::IntoRequest<super::StartExecutionRequest>,
1024 ) -> std::result::Result<
1025 tonic::Response<super::StartExecutionResponse>,
1026 tonic::Status,
1027 > {
1028 self.inner
1029 .ready()
1030 .await
1031 .map_err(|e| {
1032 tonic::Status::unknown(
1033 format!("Service was not ready: {}", e.into()),
1034 )
1035 })?;
1036 let codec = tonic::codec::ProstCodec::default();
1037 let path = http::uri::PathAndQuery::from_static(
1038 "/nominal.internalcodesandbox.v1.InternalCodeSandboxService/StartExecution",
1039 );
1040 let mut req = request.into_request();
1041 req.extensions_mut()
1042 .insert(
1043 GrpcMethod::new(
1044 "nominal.internalcodesandbox.v1.InternalCodeSandboxService",
1045 "StartExecution",
1046 ),
1047 );
1048 self.inner.unary(req, path, codec).await
1049 }
1050 pub async fn read_execution(
1051 &mut self,
1052 request: impl tonic::IntoRequest<super::ReadExecutionRequest>,
1053 ) -> std::result::Result<
1054 tonic::Response<super::ReadExecutionResponse>,
1055 tonic::Status,
1056 > {
1057 self.inner
1058 .ready()
1059 .await
1060 .map_err(|e| {
1061 tonic::Status::unknown(
1062 format!("Service was not ready: {}", e.into()),
1063 )
1064 })?;
1065 let codec = tonic::codec::ProstCodec::default();
1066 let path = http::uri::PathAndQuery::from_static(
1067 "/nominal.internalcodesandbox.v1.InternalCodeSandboxService/ReadExecution",
1068 );
1069 let mut req = request.into_request();
1070 req.extensions_mut()
1071 .insert(
1072 GrpcMethod::new(
1073 "nominal.internalcodesandbox.v1.InternalCodeSandboxService",
1074 "ReadExecution",
1075 ),
1076 );
1077 self.inner.unary(req, path, codec).await
1078 }
1079 pub async fn write_stdin(
1080 &mut self,
1081 request: impl tonic::IntoRequest<super::WriteStdinRequest>,
1082 ) -> std::result::Result<
1083 tonic::Response<super::WriteStdinResponse>,
1084 tonic::Status,
1085 > {
1086 self.inner
1087 .ready()
1088 .await
1089 .map_err(|e| {
1090 tonic::Status::unknown(
1091 format!("Service was not ready: {}", e.into()),
1092 )
1093 })?;
1094 let codec = tonic::codec::ProstCodec::default();
1095 let path = http::uri::PathAndQuery::from_static(
1096 "/nominal.internalcodesandbox.v1.InternalCodeSandboxService/WriteStdin",
1097 );
1098 let mut req = request.into_request();
1099 req.extensions_mut()
1100 .insert(
1101 GrpcMethod::new(
1102 "nominal.internalcodesandbox.v1.InternalCodeSandboxService",
1103 "WriteStdin",
1104 ),
1105 );
1106 self.inner.unary(req, path, codec).await
1107 }
1108 pub async fn kill_execution(
1109 &mut self,
1110 request: impl tonic::IntoRequest<super::KillExecutionRequest>,
1111 ) -> std::result::Result<
1112 tonic::Response<super::KillExecutionResponse>,
1113 tonic::Status,
1114 > {
1115 self.inner
1116 .ready()
1117 .await
1118 .map_err(|e| {
1119 tonic::Status::unknown(
1120 format!("Service was not ready: {}", e.into()),
1121 )
1122 })?;
1123 let codec = tonic::codec::ProstCodec::default();
1124 let path = http::uri::PathAndQuery::from_static(
1125 "/nominal.internalcodesandbox.v1.InternalCodeSandboxService/KillExecution",
1126 );
1127 let mut req = request.into_request();
1128 req.extensions_mut()
1129 .insert(
1130 GrpcMethod::new(
1131 "nominal.internalcodesandbox.v1.InternalCodeSandboxService",
1132 "KillExecution",
1133 ),
1134 );
1135 self.inner.unary(req, path, codec).await
1136 }
1137 pub async fn get_execution_statuses(
1138 &mut self,
1139 request: impl tonic::IntoRequest<super::GetExecutionStatusesRequest>,
1140 ) -> std::result::Result<
1141 tonic::Response<super::GetExecutionStatusesResponse>,
1142 tonic::Status,
1143 > {
1144 self.inner
1145 .ready()
1146 .await
1147 .map_err(|e| {
1148 tonic::Status::unknown(
1149 format!("Service was not ready: {}", e.into()),
1150 )
1151 })?;
1152 let codec = tonic::codec::ProstCodec::default();
1153 let path = http::uri::PathAndQuery::from_static(
1154 "/nominal.internalcodesandbox.v1.InternalCodeSandboxService/GetExecutionStatuses",
1155 );
1156 let mut req = request.into_request();
1157 req.extensions_mut()
1158 .insert(
1159 GrpcMethod::new(
1160 "nominal.internalcodesandbox.v1.InternalCodeSandboxService",
1161 "GetExecutionStatuses",
1162 ),
1163 );
1164 self.inner.unary(req, path, codec).await
1165 }
1166 pub async fn workspace_file_operation(
1167 &mut self,
1168 request: impl tonic::IntoRequest<super::WorkspaceFileOperationRequest>,
1169 ) -> std::result::Result<
1170 tonic::Response<super::WorkspaceFileOperationResponse>,
1171 tonic::Status,
1172 > {
1173 self.inner
1174 .ready()
1175 .await
1176 .map_err(|e| {
1177 tonic::Status::unknown(
1178 format!("Service was not ready: {}", e.into()),
1179 )
1180 })?;
1181 let codec = tonic::codec::ProstCodec::default();
1182 let path = http::uri::PathAndQuery::from_static(
1183 "/nominal.internalcodesandbox.v1.InternalCodeSandboxService/WorkspaceFileOperation",
1184 );
1185 let mut req = request.into_request();
1186 req.extensions_mut()
1187 .insert(
1188 GrpcMethod::new(
1189 "nominal.internalcodesandbox.v1.InternalCodeSandboxService",
1190 "WorkspaceFileOperation",
1191 ),
1192 );
1193 self.inner.unary(req, path, codec).await
1194 }
1195 pub async fn read_file(
1196 &mut self,
1197 request: impl tonic::IntoRequest<super::ReadFileRequest>,
1198 ) -> std::result::Result<
1199 tonic::Response<tonic::codec::Streaming<super::ReadFileResponse>>,
1200 tonic::Status,
1201 > {
1202 self.inner
1203 .ready()
1204 .await
1205 .map_err(|e| {
1206 tonic::Status::unknown(
1207 format!("Service was not ready: {}", e.into()),
1208 )
1209 })?;
1210 let codec = tonic::codec::ProstCodec::default();
1211 let path = http::uri::PathAndQuery::from_static(
1212 "/nominal.internalcodesandbox.v1.InternalCodeSandboxService/ReadFile",
1213 );
1214 let mut req = request.into_request();
1215 req.extensions_mut()
1216 .insert(
1217 GrpcMethod::new(
1218 "nominal.internalcodesandbox.v1.InternalCodeSandboxService",
1219 "ReadFile",
1220 ),
1221 );
1222 self.inner.server_streaming(req, path, codec).await
1223 }
1224 pub async fn write_file(
1225 &mut self,
1226 request: impl tonic::IntoStreamingRequest<Message = super::WriteFileRequest>,
1227 ) -> std::result::Result<
1228 tonic::Response<super::WriteFileResponse>,
1229 tonic::Status,
1230 > {
1231 self.inner
1232 .ready()
1233 .await
1234 .map_err(|e| {
1235 tonic::Status::unknown(
1236 format!("Service was not ready: {}", e.into()),
1237 )
1238 })?;
1239 let codec = tonic::codec::ProstCodec::default();
1240 let path = http::uri::PathAndQuery::from_static(
1241 "/nominal.internalcodesandbox.v1.InternalCodeSandboxService/WriteFile",
1242 );
1243 let mut req = request.into_streaming_request();
1244 req.extensions_mut()
1245 .insert(
1246 GrpcMethod::new(
1247 "nominal.internalcodesandbox.v1.InternalCodeSandboxService",
1248 "WriteFile",
1249 ),
1250 );
1251 self.inner.client_streaming(req, path, codec).await
1252 }
1253 }
1254}