#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PythonExecution {
#[prost(string, tag = "1")]
pub code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShellExecution {
#[prost(string, optional, tag = "3")]
pub cwd: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, tag = "4")]
pub interactive: bool,
#[prost(oneof = "shell_execution::Invocation", tags = "1, 2")]
pub invocation: ::core::option::Option<shell_execution::Invocation>,
}
pub mod shell_execution {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Invocation {
#[prost(string, tag = "1")]
Command(::prost::alloc::string::String),
#[prost(message, tag = "2")]
Arguments(super::ShellArguments),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShellArguments {
#[prost(string, repeated, tag = "1")]
pub argv: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionIntent {
#[prost(string, tag = "1")]
pub execution_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub run_id: ::prost::alloc::string::String,
#[prost(uint32, tag = "5")]
pub timeout_ms: u32,
#[prost(oneof = "execution_intent::Execution", tags = "3, 4")]
pub execution: ::core::option::Option<execution_intent::Execution>,
}
pub mod execution_intent {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Execution {
#[prost(message, tag = "3")]
Python(super::PythonExecution),
#[prost(message, tag = "4")]
Shell(super::ShellExecution),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionArtifact {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub media_type: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionSnapshot {
#[prost(string, tag = "1")]
pub execution_id: ::prost::alloc::string::String,
#[prost(enumeration = "ExecutionKind", tag = "2")]
pub kind: i32,
#[prost(enumeration = "ExecutionState", tag = "3")]
pub state: i32,
#[prost(bytes = "vec", tag = "4")]
pub output: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag = "5")]
pub offset: u64,
#[prost(uint64, tag = "6")]
pub next_offset: u64,
#[prost(uint64, tag = "7")]
pub output_size: u64,
#[prost(bool, tag = "8")]
pub has_more: bool,
#[prost(int32, optional, tag = "9")]
pub exit_code: ::core::option::Option<i32>,
#[prost(bool, tag = "11")]
pub truncated: bool,
#[prost(message, repeated, tag = "12")]
pub artifacts: ::prost::alloc::vec::Vec<ExecutionArtifact>,
#[prost(string, tag = "13")]
pub output_path: ::prost::alloc::string::String,
#[prost(string, tag = "14")]
pub notice: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartExecutionOperation {
#[prost(message, optional, tag = "1")]
pub intent: ::core::option::Option<ExecutionIntent>,
#[prost(uint32, optional, tag = "2")]
pub wait_ms: ::core::option::Option<u32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadExecutionOperation {
#[prost(string, tag = "1")]
pub execution_id: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub offset: u64,
#[prost(uint32, optional, tag = "3")]
pub wait_ms: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "4")]
pub max_output_bytes: ::core::option::Option<u32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteStdinOperation {
#[prost(string, tag = "1")]
pub execution_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub operation_id: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "3")]
pub input: ::prost::alloc::vec::Vec<u8>,
#[prost(bool, tag = "4")]
pub close_stdin: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KillExecutionOperation {
#[prost(string, tag = "1")]
pub execution_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetExecutionStatusesOperation {
#[prost(string, repeated, tag = "1")]
pub execution_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionStatus {
#[prost(string, tag = "1")]
pub execution_id: ::prost::alloc::string::String,
#[prost(enumeration = "ExecutionKind", tag = "2")]
pub kind: i32,
#[prost(enumeration = "ExecutionState", tag = "3")]
pub state: i32,
#[prost(uint64, tag = "4")]
pub output_size: u64,
#[prost(int32, optional, tag = "5")]
pub exit_code: ::core::option::Option<i32>,
#[prost(bool, tag = "7")]
pub truncated: bool,
#[prost(string, tag = "8")]
pub notice: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionStatuses {
#[prost(message, repeated, tag = "1")]
pub statuses: ::prost::alloc::vec::Vec<ExecutionStatus>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ExecutionKind {
Unspecified = 0,
Python = 1,
Shell = 2,
}
impl ExecutionKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "EXECUTION_KIND_UNSPECIFIED",
Self::Python => "EXECUTION_KIND_PYTHON",
Self::Shell => "EXECUTION_KIND_SHELL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXECUTION_KIND_UNSPECIFIED" => Some(Self::Unspecified),
"EXECUTION_KIND_PYTHON" => Some(Self::Python),
"EXECUTION_KIND_SHELL" => Some(Self::Shell),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ExecutionState {
Unspecified = 0,
Running = 1,
Exited = 2,
Killed = 3,
Unknown = 4,
TimedOut = 5,
}
impl ExecutionState {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "EXECUTION_STATE_UNSPECIFIED",
Self::Running => "EXECUTION_STATE_RUNNING",
Self::Exited => "EXECUTION_STATE_EXITED",
Self::Killed => "EXECUTION_STATE_KILLED",
Self::Unknown => "EXECUTION_STATE_UNKNOWN",
Self::TimedOut => "EXECUTION_STATE_TIMED_OUT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXECUTION_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"EXECUTION_STATE_RUNNING" => Some(Self::Running),
"EXECUTION_STATE_EXITED" => Some(Self::Exited),
"EXECUTION_STATE_KILLED" => Some(Self::Killed),
"EXECUTION_STATE_UNKNOWN" => Some(Self::Unknown),
"EXECUTION_STATE_TIMED_OUT" => Some(Self::TimedOut),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkspacePath {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkspaceFileEntry {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(bool, tag = "3")]
pub is_directory: bool,
#[prost(uint64, tag = "4")]
pub size: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatFileOperation {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<WorkspacePath>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatFileResult {
#[prost(message, optional, tag = "1")]
pub entry: ::core::option::Option<WorkspaceFileEntry>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFilesOperation {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<WorkspacePath>,
#[prost(uint32, tag = "2")]
pub page_size: u32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFilesResult {
#[prost(message, repeated, tag = "1")]
pub entries: ::prost::alloc::vec::Vec<WorkspaceFileEntry>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FindFilesOperation {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<WorkspacePath>,
#[prost(string, tag = "2")]
pub pattern: ::prost::alloc::string::String,
#[prost(uint32, tag = "3")]
pub max_results: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FindFilesResult {
#[prost(message, repeated, tag = "1")]
pub entries: ::prost::alloc::vec::Vec<WorkspaceFileEntry>,
#[prost(bool, tag = "2")]
pub truncated: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GrepFilesOperation {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<WorkspacePath>,
#[prost(string, tag = "2")]
pub pattern: ::prost::alloc::string::String,
#[prost(bool, tag = "3")]
pub regex: bool,
#[prost(bool, tag = "4")]
pub case_sensitive: bool,
#[prost(uint32, tag = "5")]
pub max_results: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkspaceGrepMatch {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub line_number: u64,
#[prost(string, tag = "3")]
pub text: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GrepFilesResult {
#[prost(message, repeated, tag = "1")]
pub matches: ::prost::alloc::vec::Vec<WorkspaceGrepMatch>,
#[prost(bool, tag = "2")]
pub truncated: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RealpathOperation {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<WorkspacePath>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RealpathResult {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<WorkspacePath>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MkdirOperation {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<WorkspacePath>,
#[prost(bool, tag = "2")]
pub parents: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoveFileOperation {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<WorkspacePath>,
#[prost(bool, tag = "2")]
pub recursive: bool,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct FileMutationResult {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadFileOperation {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<WorkspacePath>,
#[prost(string, tag = "2")]
pub url: ::prost::alloc::string::String,
#[prost(uint64, tag = "3")]
pub max_bytes: u64,
#[prost(uint32, tag = "4")]
pub wait_ms: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadFileResult {
#[prost(enumeration = "DownloadState", tag = "1")]
pub state: i32,
#[prost(uint64, tag = "2")]
pub size: u64,
#[prost(string, tag = "3")]
pub sha256: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "4")]
pub head: ::prost::alloc::vec::Vec<u8>,
#[prost(string, tag = "5")]
pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkspaceFileOperation {
#[prost(
oneof = "workspace_file_operation::Operation",
tags = "1, 2, 3, 4, 5, 6, 7, 8"
)]
pub operation: ::core::option::Option<workspace_file_operation::Operation>,
}
pub mod workspace_file_operation {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Operation {
#[prost(message, tag = "1")]
Stat(super::StatFileOperation),
#[prost(message, tag = "2")]
List(super::ListFilesOperation),
#[prost(message, tag = "3")]
Find(super::FindFilesOperation),
#[prost(message, tag = "4")]
Grep(super::GrepFilesOperation),
#[prost(message, tag = "5")]
Realpath(super::RealpathOperation),
#[prost(message, tag = "6")]
Mkdir(super::MkdirOperation),
#[prost(message, tag = "7")]
Remove(super::RemoveFileOperation),
#[prost(message, tag = "8")]
Download(super::DownloadFileOperation),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkspaceFileResult {
#[prost(oneof = "workspace_file_result::Result", tags = "1, 2, 3, 4, 5, 6, 7, 8")]
pub result: ::core::option::Option<workspace_file_result::Result>,
}
pub mod workspace_file_result {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Result {
#[prost(message, tag = "1")]
Stat(super::StatFileResult),
#[prost(message, tag = "2")]
List(super::ListFilesResult),
#[prost(message, tag = "3")]
Find(super::FindFilesResult),
#[prost(message, tag = "4")]
Grep(super::GrepFilesResult),
#[prost(message, tag = "5")]
Realpath(super::RealpathResult),
#[prost(message, tag = "6")]
Mkdir(super::FileMutationResult),
#[prost(message, tag = "7")]
Remove(super::FileMutationResult),
#[prost(message, tag = "8")]
Download(super::DownloadFileResult),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadFileOperation {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<WorkspacePath>,
#[prost(uint64, tag = "2")]
pub offset: u64,
#[prost(uint32, optional, tag = "3")]
pub max_bytes: ::core::option::Option<u32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileChunk {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag = "2")]
pub offset: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteFileOperation {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<WorkspacePath>,
#[prost(message, optional, tag = "2")]
pub chunk: ::core::option::Option<FileChunk>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct WriteFileResult {
#[prost(uint64, tag = "1")]
pub written: u64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DownloadState {
Unspecified = 0,
Loading = 1,
Ready = 2,
TooLarge = 3,
Failed = 4,
}
impl DownloadState {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "DOWNLOAD_STATE_UNSPECIFIED",
Self::Loading => "DOWNLOAD_STATE_LOADING",
Self::Ready => "DOWNLOAD_STATE_READY",
Self::TooLarge => "DOWNLOAD_STATE_TOO_LARGE",
Self::Failed => "DOWNLOAD_STATE_FAILED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DOWNLOAD_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"DOWNLOAD_STATE_LOADING" => Some(Self::Loading),
"DOWNLOAD_STATE_READY" => Some(Self::Ready),
"DOWNLOAD_STATE_TOO_LARGE" => Some(Self::TooLarge),
"DOWNLOAD_STATE_FAILED" => Some(Self::Failed),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Sandbox {
#[prost(string, tag = "1")]
pub sandbox_rid: ::prost::alloc::string::String,
#[prost(enumeration = "SandboxStatus", tag = "2")]
pub status: i32,
#[prost(message, optional, tag = "3")]
pub created_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "4")]
pub last_activity_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(uint32, tag = "5")]
pub idle_timeout_seconds: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSandboxRequest {
#[prost(string, tag = "1")]
pub parent_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSandboxResponse {
#[prost(message, optional, tag = "1")]
pub sandbox: ::core::option::Option<Sandbox>,
#[prost(bool, tag = "2")]
pub created: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSandboxRequest {
#[prost(string, tag = "1")]
pub sandbox_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSandboxResponse {
#[prost(message, optional, tag = "1")]
pub sandbox: ::core::option::Option<Sandbox>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteSandboxRequest {
#[prost(string, tag = "1")]
pub sandbox_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteSandboxResponse {
#[prost(message, optional, tag = "1")]
pub sandbox: ::core::option::Option<Sandbox>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RestartInterpreterRequest {
#[prost(string, tag = "1")]
pub sandbox_rid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RestartInterpreterResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SandboxScope {
#[prost(string, tag = "1")]
pub sandbox_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub parent_rid: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub organization_rid: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub run_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartExecutionRequest {
#[prost(message, optional, tag = "1")]
pub scope: ::core::option::Option<SandboxScope>,
#[prost(message, optional, tag = "2")]
pub operation: ::core::option::Option<StartExecutionOperation>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartExecutionResponse {
#[prost(message, optional, tag = "1")]
pub execution: ::core::option::Option<ExecutionSnapshot>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadExecutionRequest {
#[prost(message, optional, tag = "1")]
pub scope: ::core::option::Option<SandboxScope>,
#[prost(message, optional, tag = "2")]
pub operation: ::core::option::Option<ReadExecutionOperation>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadExecutionResponse {
#[prost(message, optional, tag = "1")]
pub execution: ::core::option::Option<ExecutionSnapshot>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteStdinRequest {
#[prost(message, optional, tag = "1")]
pub scope: ::core::option::Option<SandboxScope>,
#[prost(message, optional, tag = "2")]
pub operation: ::core::option::Option<WriteStdinOperation>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteStdinResponse {
#[prost(message, optional, tag = "1")]
pub execution: ::core::option::Option<ExecutionStatus>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KillExecutionRequest {
#[prost(message, optional, tag = "1")]
pub scope: ::core::option::Option<SandboxScope>,
#[prost(message, optional, tag = "2")]
pub operation: ::core::option::Option<KillExecutionOperation>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KillExecutionResponse {
#[prost(message, optional, tag = "1")]
pub execution: ::core::option::Option<ExecutionStatus>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetExecutionStatusesRequest {
#[prost(message, optional, tag = "1")]
pub scope: ::core::option::Option<SandboxScope>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetExecutionStatusesResponse {
#[prost(message, repeated, tag = "1")]
pub sessions: ::prost::alloc::vec::Vec<ExecutionSession>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkspaceFileOperationRequest {
#[prost(message, optional, tag = "1")]
pub scope: ::core::option::Option<SandboxScope>,
#[prost(message, optional, tag = "2")]
pub operation: ::core::option::Option<WorkspaceFileOperation>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkspaceFileOperationResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<WorkspaceFileResult>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadFileRequest {
#[prost(message, optional, tag = "1")]
pub scope: ::core::option::Option<SandboxScope>,
#[prost(message, optional, tag = "2")]
pub operation: ::core::option::Option<ReadFileOperation>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadFileResponse {
#[prost(message, optional, tag = "1")]
pub chunk: ::core::option::Option<FileChunk>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteFileRequest {
#[prost(message, optional, tag = "1")]
pub scope: ::core::option::Option<SandboxScope>,
#[prost(message, optional, tag = "2")]
pub operation: ::core::option::Option<WriteFileOperation>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct WriteFileResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<WriteFileResult>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionSession {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<ExecutionStatus>,
#[prost(uint64, tag = "2")]
pub next_offset: u64,
#[prost(bool, tag = "3")]
pub terminal_pending: bool,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SandboxStatus {
Unspecified = 0,
Creating = 1,
Ready = 2,
Terminating = 3,
Terminated = 4,
Failed = 5,
}
impl SandboxStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SANDBOX_STATUS_UNSPECIFIED",
Self::Creating => "SANDBOX_STATUS_CREATING",
Self::Ready => "SANDBOX_STATUS_READY",
Self::Terminating => "SANDBOX_STATUS_TERMINATING",
Self::Terminated => "SANDBOX_STATUS_TERMINATED",
Self::Failed => "SANDBOX_STATUS_FAILED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SANDBOX_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"SANDBOX_STATUS_CREATING" => Some(Self::Creating),
"SANDBOX_STATUS_READY" => Some(Self::Ready),
"SANDBOX_STATUS_TERMINATING" => Some(Self::Terminating),
"SANDBOX_STATUS_TERMINATED" => Some(Self::Terminated),
"SANDBOX_STATUS_FAILED" => Some(Self::Failed),
_ => None,
}
}
}
pub mod internal_code_sandbox_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct InternalCodeSandboxServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl InternalCodeSandboxServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> InternalCodeSandboxServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InternalCodeSandboxServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
InternalCodeSandboxServiceClient::new(
InterceptedService::new(inner, interceptor),
)
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create_sandbox(
&mut self,
request: impl tonic::IntoRequest<super::CreateSandboxRequest>,
) -> std::result::Result<
tonic::Response<super::CreateSandboxResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalcodesandbox.v1.InternalCodeSandboxService/CreateSandbox",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalcodesandbox.v1.InternalCodeSandboxService",
"CreateSandbox",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_sandbox(
&mut self,
request: impl tonic::IntoRequest<super::GetSandboxRequest>,
) -> std::result::Result<
tonic::Response<super::GetSandboxResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalcodesandbox.v1.InternalCodeSandboxService/GetSandbox",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalcodesandbox.v1.InternalCodeSandboxService",
"GetSandbox",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_sandbox(
&mut self,
request: impl tonic::IntoRequest<super::DeleteSandboxRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteSandboxResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalcodesandbox.v1.InternalCodeSandboxService/DeleteSandbox",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalcodesandbox.v1.InternalCodeSandboxService",
"DeleteSandbox",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn restart_interpreter(
&mut self,
request: impl tonic::IntoRequest<super::RestartInterpreterRequest>,
) -> std::result::Result<
tonic::Response<super::RestartInterpreterResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalcodesandbox.v1.InternalCodeSandboxService/RestartInterpreter",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalcodesandbox.v1.InternalCodeSandboxService",
"RestartInterpreter",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn start_execution(
&mut self,
request: impl tonic::IntoRequest<super::StartExecutionRequest>,
) -> std::result::Result<
tonic::Response<super::StartExecutionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalcodesandbox.v1.InternalCodeSandboxService/StartExecution",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalcodesandbox.v1.InternalCodeSandboxService",
"StartExecution",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn read_execution(
&mut self,
request: impl tonic::IntoRequest<super::ReadExecutionRequest>,
) -> std::result::Result<
tonic::Response<super::ReadExecutionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalcodesandbox.v1.InternalCodeSandboxService/ReadExecution",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalcodesandbox.v1.InternalCodeSandboxService",
"ReadExecution",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn write_stdin(
&mut self,
request: impl tonic::IntoRequest<super::WriteStdinRequest>,
) -> std::result::Result<
tonic::Response<super::WriteStdinResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalcodesandbox.v1.InternalCodeSandboxService/WriteStdin",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalcodesandbox.v1.InternalCodeSandboxService",
"WriteStdin",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn kill_execution(
&mut self,
request: impl tonic::IntoRequest<super::KillExecutionRequest>,
) -> std::result::Result<
tonic::Response<super::KillExecutionResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalcodesandbox.v1.InternalCodeSandboxService/KillExecution",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalcodesandbox.v1.InternalCodeSandboxService",
"KillExecution",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_execution_statuses(
&mut self,
request: impl tonic::IntoRequest<super::GetExecutionStatusesRequest>,
) -> std::result::Result<
tonic::Response<super::GetExecutionStatusesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalcodesandbox.v1.InternalCodeSandboxService/GetExecutionStatuses",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalcodesandbox.v1.InternalCodeSandboxService",
"GetExecutionStatuses",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn workspace_file_operation(
&mut self,
request: impl tonic::IntoRequest<super::WorkspaceFileOperationRequest>,
) -> std::result::Result<
tonic::Response<super::WorkspaceFileOperationResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalcodesandbox.v1.InternalCodeSandboxService/WorkspaceFileOperation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalcodesandbox.v1.InternalCodeSandboxService",
"WorkspaceFileOperation",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn read_file(
&mut self,
request: impl tonic::IntoRequest<super::ReadFileRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ReadFileResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalcodesandbox.v1.InternalCodeSandboxService/ReadFile",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalcodesandbox.v1.InternalCodeSandboxService",
"ReadFile",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn write_file(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::WriteFileRequest>,
) -> std::result::Result<
tonic::Response<super::WriteFileResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalcodesandbox.v1.InternalCodeSandboxService/WriteFile",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalcodesandbox.v1.InternalCodeSandboxService",
"WriteFile",
),
);
self.inner.client_streaming(req, path, codec).await
}
}
}