#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Value {
#[prost(oneof = "value::Kind", tags = "1, 2, 3, 4, 5")]
pub kind: ::core::option::Option<value::Kind>,
}
pub mod value {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Kind {
#[prost(string, tag = "1")]
StrValue(::prost::alloc::string::String),
#[prost(int64, tag = "2")]
IntValue(i64),
#[prost(bool, tag = "3")]
BoolValue(bool),
#[prost(message, tag = "4")]
MapValue(super::MapValue),
#[prost(message, tag = "5")]
ListValue(super::ListValue),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MapValue {
#[prost(message, repeated, tag = "1")]
pub entries: ::prost::alloc::vec::Vec<MapEntry>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MapEntry {
#[prost(message, optional, tag = "1")]
pub key: ::core::option::Option<Value>,
#[prost(message, optional, tag = "2")]
pub value: ::core::option::Option<Value>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListValue {
#[prost(message, repeated, tag = "1")]
pub items: ::prost::alloc::vec::Vec<Value>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetValue {
#[prost(message, repeated, tag = "1")]
pub items: ::prost::alloc::vec::Vec<Value>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RoleRef {
#[prost(string, tag = "1")]
pub role_name: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub role_id: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Arg {
#[prost(enumeration = "ArgType", tag = "1")]
pub r#type: i32,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub value: ::core::option::Option<Value>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Status {
#[prost(enumeration = "StatusCode", tag = "1")]
pub code: i32,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Interval {
#[prost(int64, tag = "1")]
pub start_unix_nano: i64,
#[prost(int64, tag = "2")]
pub end_unix_nano: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RoleState {
#[prost(message, optional, tag = "1")]
pub role: ::core::option::Option<RoleRef>,
#[prost(map = "string, message", tag = "2")]
pub state: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ExecOptions {
#[prost(bool, tag = "1")]
pub capture_state: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActionSequence {
#[prost(message, repeated, tag = "1")]
pub requests: ::prost::alloc::vec::Vec<ExecuteActionRequest>,
#[prost(message, optional, tag = "2")]
pub options: ::core::option::Option<ExecOptions>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActionSequenceResult {
#[prost(message, repeated, tag = "1")]
pub responses: ::prost::alloc::vec::Vec<ExecuteActionResponse>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InitRequest {
#[prost(string, tag = "1")]
pub test_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub args: ::prost::alloc::vec::Vec<Arg>,
#[prost(message, optional, tag = "3")]
pub options: ::core::option::Option<ExecOptions>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InitResponse {
#[prost(message, optional, tag = "1")]
pub exec_time: ::core::option::Option<Interval>,
#[prost(message, optional, tag = "2")]
pub status: ::core::option::Option<Status>,
#[prost(message, repeated, tag = "3")]
pub roles: ::prost::alloc::vec::Vec<RoleRef>,
#[prost(message, repeated, tag = "4")]
pub role_states: ::prost::alloc::vec::Vec<RoleState>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CleanupRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CleanupResponse {
#[prost(message, optional, tag = "1")]
pub exec_time: ::core::option::Option<Interval>,
#[prost(message, optional, tag = "2")]
pub status: ::core::option::Option<Status>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecuteActionRequest {
#[prost(message, optional, tag = "1")]
pub role: ::core::option::Option<RoleRef>,
#[prost(string, tag = "2")]
pub action_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub args: ::prost::alloc::vec::Vec<Arg>,
#[prost(message, optional, tag = "4")]
pub options: ::core::option::Option<ExecOptions>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecuteActionResponse {
#[prost(message, repeated, tag = "1")]
pub return_values: ::prost::alloc::vec::Vec<Value>,
#[prost(message, optional, tag = "2")]
pub exec_time: ::core::option::Option<Interval>,
#[prost(message, optional, tag = "3")]
pub status: ::core::option::Option<Status>,
#[prost(message, repeated, tag = "4")]
pub roles: ::prost::alloc::vec::Vec<RoleRef>,
#[prost(message, repeated, tag = "5")]
pub role_states: ::prost::alloc::vec::Vec<RoleState>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecuteActionSequencesRequest {
#[prost(message, repeated, tag = "1")]
pub action_sequence: ::prost::alloc::vec::Vec<ActionSequence>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecuteActionSequencesResponse {
#[prost(message, repeated, tag = "1")]
pub results: ::prost::alloc::vec::Vec<ActionSequenceResult>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ArgType {
Unknown = 0,
Any = 1,
}
impl ArgType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "ARG_TYPE_UNKNOWN",
Self::Any => "ARG_TYPE_ANY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ARG_TYPE_UNKNOWN" => Some(Self::Unknown),
"ARG_TYPE_ANY" => Some(Self::Any),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum StatusCode {
StatusUnknown = 0,
StatusOk = 1,
StatusNotImplemented = 2,
StatusInvalidRole = 3,
StatusInvalidAction = 4,
StatusExecutionFailed = 5,
}
impl StatusCode {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::StatusUnknown => "STATUS_UNKNOWN",
Self::StatusOk => "STATUS_OK",
Self::StatusNotImplemented => "STATUS_NOT_IMPLEMENTED",
Self::StatusInvalidRole => "STATUS_INVALID_ROLE",
Self::StatusInvalidAction => "STATUS_INVALID_ACTION",
Self::StatusExecutionFailed => "STATUS_EXECUTION_FAILED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATUS_UNKNOWN" => Some(Self::StatusUnknown),
"STATUS_OK" => Some(Self::StatusOk),
"STATUS_NOT_IMPLEMENTED" => Some(Self::StatusNotImplemented),
"STATUS_INVALID_ROLE" => Some(Self::StatusInvalidRole),
"STATUS_INVALID_ACTION" => Some(Self::StatusInvalidAction),
"STATUS_EXECUTION_FAILED" => Some(Self::StatusExecutionFailed),
_ => None,
}
}
}
pub mod fizz_bee_mbt_plugin_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 FizzBeeMbtPluginServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl FizzBeeMbtPluginServiceClient<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> FizzBeeMbtPluginServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
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,
) -> FizzBeeMbtPluginServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
FizzBeeMbtPluginServiceClient::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 init(
&mut self,
request: impl tonic::IntoRequest<super::InitRequest>,
) -> std::result::Result<tonic::Response<super::InitResponse>, 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(
"/fizzbee.mbt.FizzBeeMbtPluginService/Init",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("fizzbee.mbt.FizzBeeMbtPluginService", "Init"));
self.inner.unary(req, path, codec).await
}
pub async fn cleanup(
&mut self,
request: impl tonic::IntoRequest<super::CleanupRequest>,
) -> std::result::Result<
tonic::Response<super::CleanupResponse>,
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(
"/fizzbee.mbt.FizzBeeMbtPluginService/Cleanup",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("fizzbee.mbt.FizzBeeMbtPluginService", "Cleanup"),
);
self.inner.unary(req, path, codec).await
}
pub async fn execute_action(
&mut self,
request: impl tonic::IntoRequest<super::ExecuteActionRequest>,
) -> std::result::Result<
tonic::Response<super::ExecuteActionResponse>,
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(
"/fizzbee.mbt.FizzBeeMbtPluginService/ExecuteAction",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"fizzbee.mbt.FizzBeeMbtPluginService",
"ExecuteAction",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn execute_action_sequences(
&mut self,
request: impl tonic::IntoRequest<super::ExecuteActionSequencesRequest>,
) -> std::result::Result<
tonic::Response<super::ExecuteActionSequencesResponse>,
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(
"/fizzbee.mbt.FizzBeeMbtPluginService/ExecuteActionSequences",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"fizzbee.mbt.FizzBeeMbtPluginService",
"ExecuteActionSequences",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod fizz_bee_mbt_plugin_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait FizzBeeMbtPluginService: std::marker::Send + std::marker::Sync + 'static {
async fn init(
&self,
request: tonic::Request<super::InitRequest>,
) -> std::result::Result<tonic::Response<super::InitResponse>, tonic::Status>;
async fn cleanup(
&self,
request: tonic::Request<super::CleanupRequest>,
) -> std::result::Result<tonic::Response<super::CleanupResponse>, tonic::Status>;
async fn execute_action(
&self,
request: tonic::Request<super::ExecuteActionRequest>,
) -> std::result::Result<
tonic::Response<super::ExecuteActionResponse>,
tonic::Status,
>;
async fn execute_action_sequences(
&self,
request: tonic::Request<super::ExecuteActionSequencesRequest>,
) -> std::result::Result<
tonic::Response<super::ExecuteActionSequencesResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct FizzBeeMbtPluginServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> FizzBeeMbtPluginServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>>
for FizzBeeMbtPluginServiceServer<T>
where
T: FizzBeeMbtPluginService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/fizzbee.mbt.FizzBeeMbtPluginService/Init" => {
#[allow(non_camel_case_types)]
struct InitSvc<T: FizzBeeMbtPluginService>(pub Arc<T>);
impl<
T: FizzBeeMbtPluginService,
> tonic::server::UnaryService<super::InitRequest> for InitSvc<T> {
type Response = super::InitResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::InitRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as FizzBeeMbtPluginService>::init(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = InitSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/fizzbee.mbt.FizzBeeMbtPluginService/Cleanup" => {
#[allow(non_camel_case_types)]
struct CleanupSvc<T: FizzBeeMbtPluginService>(pub Arc<T>);
impl<
T: FizzBeeMbtPluginService,
> tonic::server::UnaryService<super::CleanupRequest>
for CleanupSvc<T> {
type Response = super::CleanupResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CleanupRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as FizzBeeMbtPluginService>::cleanup(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = CleanupSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/fizzbee.mbt.FizzBeeMbtPluginService/ExecuteAction" => {
#[allow(non_camel_case_types)]
struct ExecuteActionSvc<T: FizzBeeMbtPluginService>(pub Arc<T>);
impl<
T: FizzBeeMbtPluginService,
> tonic::server::UnaryService<super::ExecuteActionRequest>
for ExecuteActionSvc<T> {
type Response = super::ExecuteActionResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ExecuteActionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as FizzBeeMbtPluginService>::execute_action(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ExecuteActionSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/fizzbee.mbt.FizzBeeMbtPluginService/ExecuteActionSequences" => {
#[allow(non_camel_case_types)]
struct ExecuteActionSequencesSvc<T: FizzBeeMbtPluginService>(
pub Arc<T>,
);
impl<
T: FizzBeeMbtPluginService,
> tonic::server::UnaryService<super::ExecuteActionSequencesRequest>
for ExecuteActionSequencesSvc<T> {
type Response = super::ExecuteActionSequencesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ExecuteActionSequencesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as FizzBeeMbtPluginService>::execute_action_sequences(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ExecuteActionSequencesSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(empty_body());
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for FizzBeeMbtPluginServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "fizzbee.mbt.FizzBeeMbtPluginService";
impl<T> tonic::server::NamedService for FizzBeeMbtPluginServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}