#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ParseRequest {
#[prost(string, tag = "1")]
pub cel_source: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub syntax_version: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub source_location: ::prost::alloc::string::String,
#[prost(bool, tag = "4")]
pub disable_macros: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ParseResponse {
#[prost(message, optional, tag = "1")]
pub parsed_expr: ::core::option::Option<super::super::v1alpha1::ParsedExpr>,
#[prost(message, repeated, tag = "2")]
pub issues: ::prost::alloc::vec::Vec<super::super::super::super::rpc::Status>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckRequest {
#[prost(message, optional, tag = "1")]
pub parsed_expr: ::core::option::Option<super::super::v1alpha1::ParsedExpr>,
#[prost(message, repeated, tag = "2")]
pub type_env: ::prost::alloc::vec::Vec<super::super::v1alpha1::Decl>,
#[prost(string, tag = "3")]
pub container: ::prost::alloc::string::String,
#[prost(bool, tag = "4")]
pub no_std_env: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckResponse {
#[prost(message, optional, tag = "1")]
pub checked_expr: ::core::option::Option<super::super::v1alpha1::CheckedExpr>,
#[prost(message, repeated, tag = "2")]
pub issues: ::prost::alloc::vec::Vec<super::super::super::super::rpc::Status>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EvalRequest {
#[prost(map = "string, message", tag = "3")]
pub bindings: ::std::collections::HashMap<
::prost::alloc::string::String,
super::super::v1alpha1::ExprValue,
>,
#[prost(string, tag = "4")]
pub container: ::prost::alloc::string::String,
#[prost(oneof = "eval_request::ExprKind", tags = "1, 2")]
pub expr_kind: ::core::option::Option<eval_request::ExprKind>,
}
pub mod eval_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ExprKind {
#[prost(message, tag = "1")]
ParsedExpr(super::super::super::v1alpha1::ParsedExpr),
#[prost(message, tag = "2")]
CheckedExpr(super::super::super::v1alpha1::CheckedExpr),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EvalResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<super::super::v1alpha1::ExprValue>,
#[prost(message, repeated, tag = "2")]
pub issues: ::prost::alloc::vec::Vec<super::super::super::super::rpc::Status>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SourcePosition {
#[prost(string, tag = "1")]
pub location: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub offset: i32,
#[prost(int32, tag = "3")]
pub line: i32,
#[prost(int32, tag = "4")]
pub column: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IssueDetails {
#[prost(enumeration = "issue_details::Severity", tag = "1")]
pub severity: i32,
#[prost(message, optional, tag = "2")]
pub position: ::core::option::Option<SourcePosition>,
#[prost(int64, tag = "3")]
pub id: i64,
}
pub mod issue_details {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Severity {
Unspecified = 0,
Deprecation = 1,
Warning = 2,
Error = 3,
}
impl Severity {
pub fn as_str_name(&self) -> &'static str {
match self {
Severity::Unspecified => "SEVERITY_UNSPECIFIED",
Severity::Deprecation => "DEPRECATION",
Severity::Warning => "WARNING",
Severity::Error => "ERROR",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SEVERITY_UNSPECIFIED" => Some(Self::Unspecified),
"DEPRECATION" => Some(Self::Deprecation),
"WARNING" => Some(Self::Warning),
"ERROR" => Some(Self::Error),
_ => None,
}
}
}
}
pub mod conformance_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ConformanceServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ConformanceServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ConformanceServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> ConformanceServiceClient<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> + Send + Sync,
{
ConformanceServiceClient::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
}
pub async fn parse(
&mut self,
request: impl tonic::IntoRequest<super::ParseRequest>,
) -> Result<tonic::Response<super::ParseResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.api.expr.conformance.v1alpha1.ConformanceService/Parse",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn check(
&mut self,
request: impl tonic::IntoRequest<super::CheckRequest>,
) -> Result<tonic::Response<super::CheckResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.api.expr.conformance.v1alpha1.ConformanceService/Check",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn eval(
&mut self,
request: impl tonic::IntoRequest<super::EvalRequest>,
) -> Result<tonic::Response<super::EvalResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.api.expr.conformance.v1alpha1.ConformanceService/Eval",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}