#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CallRequest {
#[prost(string, tag = "1")]
pub method: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub payload: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CallResponse {
#[prost(bytes = "vec", tag = "1")]
pub payload: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ApiVersion {
#[prost(uint32, tag = "1")]
pub major: u32,
#[prost(uint32, tag = "2")]
pub minor: u32,
#[prost(uint32, tag = "3")]
pub patch: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Permissions {
#[prost(string, repeated, tag = "1")]
pub fs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub process: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(bool, tag = "3")]
pub network: bool,
#[prost(string, repeated, tag = "4")]
pub scopes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Hello {
#[prost(message, optional, tag = "1")]
pub api_version: ::core::option::Option<ApiVersion>,
#[prost(string, tag = "2")]
pub extension_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub permissions: ::core::option::Option<Permissions>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Welcome {
#[prost(message, optional, tag = "1")]
pub api_version: ::core::option::Option<ApiVersion>,
#[prost(string, tag = "2")]
pub extension_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub extension_version: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InitializeRequest {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InitializeResponse {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ShutdownRequest {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ShutdownResponse {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HealthRequest {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HealthResponse {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Error {
#[prost(enumeration = "ErrorCode", tag = "1")]
pub code: i32,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Request {
#[prost(uint64, tag = "1")]
pub id: u64,
#[prost(oneof = "request::Body", tags = "100, 200, 201, 202, 300")]
pub body: ::core::option::Option<request::Body>,
}
pub mod request {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Body {
#[prost(message, tag = "100")]
Hello(super::Hello),
#[prost(message, tag = "200")]
Initialize(super::InitializeRequest),
#[prost(message, tag = "201")]
Shutdown(super::ShutdownRequest),
#[prost(message, tag = "202")]
Health(super::HealthRequest),
#[prost(message, tag = "300")]
Call(super::CallRequest),
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Response {
#[prost(uint64, tag = "1")]
pub id: u64,
#[prost(oneof = "response::Result", tags = "2, 100, 200, 201, 202, 300")]
pub result: ::core::option::Option<response::Result>,
}
pub mod response {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Result {
#[prost(message, tag = "2")]
Error(super::Error),
#[prost(message, tag = "100")]
Welcome(super::Welcome),
#[prost(message, tag = "200")]
Initialize(super::InitializeResponse),
#[prost(message, tag = "201")]
Shutdown(super::ShutdownResponse),
#[prost(message, tag = "202")]
Health(super::HealthResponse),
#[prost(message, tag = "300")]
Call(super::CallResponse),
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Event {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub payload: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Cancel {
#[prost(uint64, tag = "1")]
pub id: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Envelope {
#[prost(oneof = "envelope::Kind", tags = "1, 2, 3, 4")]
pub kind: ::core::option::Option<envelope::Kind>,
}
pub mod envelope {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Kind {
#[prost(message, tag = "1")]
Request(super::Request),
#[prost(message, tag = "2")]
Response(super::Response),
#[prost(message, tag = "3")]
Event(super::Event),
#[prost(message, tag = "4")]
Cancel(super::Cancel),
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ErrorCode {
Unspecified = 0,
Failed = 1,
NotFound = 2,
Timeout = 3,
PermissionDenied = 4,
VersionIncompatible = 5,
InvalidArgument = 6,
Cancelled = 7,
}
impl ErrorCode {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "ERROR_CODE_UNSPECIFIED",
Self::Failed => "ERROR_CODE_FAILED",
Self::NotFound => "ERROR_CODE_NOT_FOUND",
Self::Timeout => "ERROR_CODE_TIMEOUT",
Self::PermissionDenied => "ERROR_CODE_PERMISSION_DENIED",
Self::VersionIncompatible => "ERROR_CODE_VERSION_INCOMPATIBLE",
Self::InvalidArgument => "ERROR_CODE_INVALID_ARGUMENT",
Self::Cancelled => "ERROR_CODE_CANCELLED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ERROR_CODE_UNSPECIFIED" => Some(Self::Unspecified),
"ERROR_CODE_FAILED" => Some(Self::Failed),
"ERROR_CODE_NOT_FOUND" => Some(Self::NotFound),
"ERROR_CODE_TIMEOUT" => Some(Self::Timeout),
"ERROR_CODE_PERMISSION_DENIED" => Some(Self::PermissionDenied),
"ERROR_CODE_VERSION_INCOMPATIBLE" => Some(Self::VersionIncompatible),
"ERROR_CODE_INVALID_ARGUMENT" => Some(Self::InvalidArgument),
"ERROR_CODE_CANCELLED" => Some(Self::Cancelled),
_ => None,
}
}
}