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