#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RepeatRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub info: ::core::option::Option<ComplianceData>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RepeatResponse {
#[prost(message, optional, tag = "1")]
pub info: ::core::option::Option<ComplianceData>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ComplianceData {
#[prost(string, tag = "1")]
pub f_string: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub f_int32: i32,
#[prost(sint32, tag = "3")]
pub f_sint32: i32,
#[prost(sfixed32, tag = "4")]
pub f_sfixed32: i32,
#[prost(uint32, tag = "5")]
pub f_uint32: u32,
#[prost(fixed32, tag = "6")]
pub f_fixed32: u32,
#[prost(int64, tag = "7")]
pub f_int64: i64,
#[prost(sint64, tag = "8")]
pub f_sint64: i64,
#[prost(sfixed64, tag = "9")]
pub f_sfixed64: i64,
#[prost(uint64, tag = "10")]
pub f_uint64: u64,
#[prost(fixed64, tag = "11")]
pub f_fixed64: u64,
#[prost(double, tag = "12")]
pub f_double: f64,
#[prost(float, tag = "13")]
pub f_float: f32,
#[prost(bool, tag = "14")]
pub f_bool: bool,
#[prost(bytes = "vec", tag = "15")]
pub f_bytes: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "16")]
pub f_child: ::core::option::Option<ComplianceDataChild>,
#[prost(string, optional, tag = "17")]
pub p_string: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int32, optional, tag = "18")]
pub p_int32: ::core::option::Option<i32>,
#[prost(double, optional, tag = "19")]
pub p_double: ::core::option::Option<f64>,
#[prost(bool, optional, tag = "20")]
pub p_bool: ::core::option::Option<bool>,
#[prost(message, optional, tag = "21")]
pub p_child: ::core::option::Option<ComplianceDataChild>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ComplianceDataChild {
#[prost(string, tag = "1")]
pub f_string: ::prost::alloc::string::String,
#[prost(float, tag = "2")]
pub f_float: f32,
#[prost(double, tag = "3")]
pub f_double: f64,
#[prost(bool, tag = "4")]
pub f_bool: bool,
#[prost(message, optional, tag = "5")]
pub f_child: ::core::option::Option<ComplianceDataGrandchild>,
#[prost(string, optional, tag = "6")]
pub p_string: ::core::option::Option<::prost::alloc::string::String>,
#[prost(float, optional, tag = "7")]
pub p_float: ::core::option::Option<f32>,
#[prost(double, optional, tag = "8")]
pub p_double: ::core::option::Option<f64>,
#[prost(bool, optional, tag = "9")]
pub p_bool: ::core::option::Option<bool>,
#[prost(message, optional, tag = "10")]
pub p_child: ::core::option::Option<ComplianceDataGrandchild>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ComplianceDataGrandchild {
#[prost(string, tag = "1")]
pub f_string: ::prost::alloc::string::String,
#[prost(double, tag = "2")]
pub f_double: f64,
#[prost(bool, tag = "3")]
pub f_bool: bool,
}
#[doc = r" Generated client implementations."]
pub mod compliance_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " This service is used to test that GAPICs can transcode proto3 requests to"]
#[doc = " REST format correctly for various types of HTTP annotations..."]
#[derive(Debug, Clone)]
pub struct ComplianceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> ComplianceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<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_interceptor<F>(
inner: T,
interceptor: F,
) -> ComplianceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
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,
{
ComplianceClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " This method echoes the ComplianceData request. This method exercises"]
#[doc = " sending the entire request object in the REST body."]
pub async fn repeat_data_body(
&mut self,
request: impl tonic::IntoRequest<super::RepeatRequest>,
) -> Result<tonic::Response<super::RepeatResponse>, 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.example.showcase.v1beta2.Compliance/RepeatDataBody",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " This method echoes the ComplianceData request. This method exercises"]
#[doc = " sending the a message-type field in the REST body. Per AIP-127, only"]
#[doc = " top-level, non-repeated fields can be sent this way."]
pub async fn repeat_data_body_info(
&mut self,
request: impl tonic::IntoRequest<super::RepeatRequest>,
) -> Result<tonic::Response<super::RepeatResponse>, 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.example.showcase.v1beta2.Compliance/RepeatDataBodyInfo",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " This method echoes the ComplianceData request. This method exercises"]
#[doc = " sending all request fields as query parameters."]
pub async fn repeat_data_query(
&mut self,
request: impl tonic::IntoRequest<super::RepeatRequest>,
) -> Result<tonic::Response<super::RepeatResponse>, 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.example.showcase.v1beta2.Compliance/RepeatDataQuery",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " This method echoes the ComplianceData request. This method exercises"]
#[doc = " sending some parameters as \"simple\" path variables (i.e., of the form"]
#[doc = " \"/bar/{foo}\" rather than \"/{foo=bar/*}\"), and the rest as query parameters."]
pub async fn repeat_data_simple_path(
&mut self,
request: impl tonic::IntoRequest<super::RepeatRequest>,
) -> Result<tonic::Response<super::RepeatResponse>, 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.example.showcase.v1beta2.Compliance/RepeatDataSimplePath",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Same as RepeatDataSimplePath, but with a path resource."]
pub async fn repeat_data_path_resource(
&mut self,
request: impl tonic::IntoRequest<super::RepeatRequest>,
) -> Result<tonic::Response<super::RepeatResponse>, 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.example.showcase.v1beta2.Compliance/RepeatDataPathResource",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Same as RepeatDataSimplePath, but with a trailing resource."]
pub async fn repeat_data_path_trailing_resource(
&mut self,
request: impl tonic::IntoRequest<super::RepeatRequest>,
) -> Result<tonic::Response<super::RepeatResponse>, 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.example.showcase.v1beta2.Compliance/RepeatDataPathTrailingResource",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EchoRequest {
#[prost(enumeration = "Severity", tag = "3")]
pub severity: i32,
#[prost(oneof = "echo_request::Response", tags = "1, 2")]
pub response: ::core::option::Option<echo_request::Response>,
}
pub mod echo_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(string, tag = "1")]
Content(::prost::alloc::string::String),
#[prost(message, tag = "2")]
Error(super::super::super::super::rpc::Status),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EchoResponse {
#[prost(string, tag = "1")]
pub content: ::prost::alloc::string::String,
#[prost(enumeration = "Severity", tag = "2")]
pub severity: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpandRequest {
#[prost(string, tag = "1")]
pub content: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub error: ::core::option::Option<super::super::super::rpc::Status>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PagedExpandRequest {
#[prost(string, tag = "1")]
pub content: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub page_size: i32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PagedExpandResponse {
#[prost(message, repeated, tag = "1")]
pub responses: ::prost::alloc::vec::Vec<EchoResponse>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WaitRequest {
#[prost(oneof = "wait_request::End", tags = "1, 4")]
pub end: ::core::option::Option<wait_request::End>,
#[prost(oneof = "wait_request::Response", tags = "2, 3")]
pub response: ::core::option::Option<wait_request::Response>,
}
pub mod wait_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum End {
#[prost(message, tag = "1")]
EndTime(::prost_types::Timestamp),
#[prost(message, tag = "4")]
Ttl(::prost_types::Duration),
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag = "2")]
Error(super::super::super::super::rpc::Status),
#[prost(message, tag = "3")]
Success(super::WaitResponse),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WaitResponse {
#[prost(string, tag = "1")]
pub content: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockRequest {
#[prost(message, optional, tag = "1")]
pub response_delay: ::core::option::Option<::prost_types::Duration>,
#[prost(oneof = "block_request::Response", tags = "2, 3")]
pub response: ::core::option::Option<block_request::Response>,
}
pub mod block_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag = "2")]
Error(super::super::super::super::rpc::Status),
#[prost(message, tag = "3")]
Success(super::BlockResponse),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockResponse {
#[prost(string, tag = "1")]
pub content: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Severity {
Unnecessary = 0,
Necessary = 1,
Urgent = 2,
Critical = 3,
}
#[doc = r" Generated client implementations."]
pub mod echo_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " This service is used showcase the four main types of rpcs - unary, server"]
#[doc = " side streaming, client side streaming, and bidirectional streaming. This"]
#[doc = " service also exposes methods that explicitly implement server delay, and"]
#[doc = " paginated calls. Set the 'showcase-trailer' metadata key on any method"]
#[doc = " to have the values echoed in the response trailers."]
#[derive(Debug, Clone)]
pub struct EchoClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> EchoClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<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_interceptor<F>(inner: T, interceptor: F) -> EchoClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
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,
{
EchoClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " This method simply echoes the request. This method showcases unary RPCs."]
pub async fn echo(
&mut self,
request: impl tonic::IntoRequest<super::EchoRequest>,
) -> Result<tonic::Response<super::EchoResponse>, 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.example.showcase.v1beta2.Echo/Echo");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " This method splits the given content into words and will pass each word"]
#[doc = " back through the stream. This method showcases server-side streaming RPCs."]
pub async fn expand(
&mut self,
request: impl tonic::IntoRequest<super::ExpandRequest>,
) -> Result<tonic::Response<tonic::codec::Streaming<super::EchoResponse>>, 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.example.showcase.v1beta2.Echo/Expand",
);
self.inner.server_streaming(request.into_request(), path, codec).await
}
#[doc = " This method will collect the words given to it. When the stream is closed"]
#[doc = " by the client, this method will return the a concatenation of the strings"]
#[doc = " passed to it. This method showcases client-side streaming RPCs."]
pub async fn collect(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::EchoRequest>,
) -> Result<tonic::Response<super::EchoResponse>, 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.example.showcase.v1beta2.Echo/Collect",
);
self.inner.client_streaming(request.into_streaming_request(), path, codec).await
}
#[doc = " This method, upon receiving a request on the stream, will pass the same"]
#[doc = " content back on the stream. This method showcases bidirectional"]
#[doc = " streaming RPCs."]
pub async fn chat(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::EchoRequest>,
) -> Result<tonic::Response<tonic::codec::Streaming<super::EchoResponse>>, 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.example.showcase.v1beta2.Echo/Chat");
self.inner.streaming(request.into_streaming_request(), path, codec).await
}
#[doc = " This is similar to the Expand method but instead of returning a stream of"]
#[doc = " expanded words, this method returns a paged list of expanded words."]
pub async fn paged_expand(
&mut self,
request: impl tonic::IntoRequest<super::PagedExpandRequest>,
) -> Result<tonic::Response<super::PagedExpandResponse>, 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.example.showcase.v1beta2.Echo/PagedExpand",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " This method will wait for the requested amount of time and then return."]
#[doc = " This method showcases how a client handles a request timeout."]
pub async fn wait(
&mut self,
request: impl tonic::IntoRequest<super::WaitRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
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.example.showcase.v1beta2.Echo/Wait");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " This method will block (wait) for the requested amount of time"]
#[doc = " and then return the response or error."]
#[doc = " This method showcases how a client handles delays or retries."]
pub async fn block(
&mut self,
request: impl tonic::IntoRequest<super::BlockRequest>,
) -> Result<tonic::Response<super::BlockResponse>, 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.example.showcase.v1beta2.Echo/Block");
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Sequence {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub responses: ::prost::alloc::vec::Vec<sequence::Response>,
}
pub mod sequence {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Response {
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<super::super::super::super::rpc::Status>,
#[prost(message, optional, tag = "2")]
pub delay: ::core::option::Option<::prost_types::Duration>,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SequenceReport {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub attempts: ::prost::alloc::vec::Vec<sequence_report::Attempt>,
}
pub mod sequence_report {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Attempt {
#[prost(int32, tag = "1")]
pub attempt_number: i32,
#[prost(message, optional, tag = "2")]
pub attempt_deadline: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub response_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub attempt_delay: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "5")]
pub status: ::core::option::Option<super::super::super::super::rpc::Status>,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSequenceRequest {
#[prost(message, optional, tag = "1")]
pub sequence: ::core::option::Option<Sequence>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AttemptSequenceRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSequenceReportRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[doc = r" Generated client implementations."]
pub mod sequence_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct SequenceServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> SequenceServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<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_interceptor<F>(
inner: T,
interceptor: F,
) -> SequenceServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
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,
{
SequenceServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Creates a sequence."]
pub async fn create_sequence(
&mut self,
request: impl tonic::IntoRequest<super::CreateSequenceRequest>,
) -> Result<tonic::Response<super::Sequence>, 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.example.showcase.v1beta2.SequenceService/CreateSequence",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Retrieves a sequence."]
pub async fn get_sequence_report(
&mut self,
request: impl tonic::IntoRequest<super::GetSequenceReportRequest>,
) -> Result<tonic::Response<super::SequenceReport>, 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.example.showcase.v1beta2.SequenceService/GetSequenceReport",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Attempts a sequence."]
pub async fn attempt_sequence(
&mut self,
request: impl tonic::IntoRequest<super::AttemptSequenceRequest>,
) -> Result<tonic::Response<()>, 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.example.showcase.v1beta2.SequenceService/AttemptSequence",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Session {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(enumeration = "session::Version", tag = "2")]
pub version: i32,
}
pub mod session {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Version {
Unspecified = 0,
V1Latest = 1,
V10 = 2,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSessionRequest {
#[prost(message, optional, tag = "1")]
pub session: ::core::option::Option<Session>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSessionRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSessionsRequest {
#[prost(int32, tag = "1")]
pub page_size: i32,
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSessionsResponse {
#[prost(message, repeated, tag = "1")]
pub sessions: ::prost::alloc::vec::Vec<Session>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteSessionRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReportSessionRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReportSessionResponse {
#[prost(enumeration = "report_session_response::Result", tag = "1")]
pub result: i32,
#[prost(message, repeated, tag = "2")]
pub test_runs: ::prost::alloc::vec::Vec<TestRun>,
}
pub mod report_session_response {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Result {
Unspecified = 0,
Passed = 1,
Failed = 2,
Incomplete = 3,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Test {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(enumeration = "test::ExpectationLevel", tag = "2")]
pub expectation_level: i32,
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub blueprints: ::prost::alloc::vec::Vec<test::Blueprint>,
}
pub mod test {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Blueprint {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub request: ::core::option::Option<blueprint::Invocation>,
#[prost(message, repeated, tag = "4")]
pub additional_requests: ::prost::alloc::vec::Vec<blueprint::Invocation>,
}
pub mod blueprint {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Invocation {
#[prost(string, tag = "1")]
pub method: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub serialized_request: ::prost::alloc::vec::Vec<u8>,
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ExpectationLevel {
Unspecified = 0,
Required = 1,
Recommended = 2,
Optional = 3,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Issue {
#[prost(enumeration = "issue::Type", tag = "1")]
pub r#type: i32,
#[prost(enumeration = "issue::Severity", tag = "2")]
pub severity: i32,
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
}
pub mod issue {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Type {
Unspecified = 0,
Skipped = 1,
Pending = 2,
IncorrectConfirmation = 3,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Severity {
Unspecified = 0,
Error = 1,
Warning = 2,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTestsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub page_size: i32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTestsResponse {
#[prost(message, repeated, tag = "1")]
pub tests: ::prost::alloc::vec::Vec<Test>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TestRun {
#[prost(string, tag = "1")]
pub test: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub issue: ::core::option::Option<Issue>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTestRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifyTestRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub answer: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", repeated, tag = "3")]
pub answers: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifyTestResponse {
#[prost(message, optional, tag = "1")]
pub issue: ::core::option::Option<Issue>,
}
#[doc = r" Generated client implementations."]
pub mod testing_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " A service to facilitate running discrete sets of tests"]
#[doc = " against Showcase."]
#[derive(Debug, Clone)]
pub struct TestingClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> TestingClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<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_interceptor<F>(
inner: T,
interceptor: F,
) -> TestingClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
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,
{
TestingClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Creates a new testing session."]
pub async fn create_session(
&mut self,
request: impl tonic::IntoRequest<super::CreateSessionRequest>,
) -> Result<tonic::Response<super::Session>, 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.example.showcase.v1beta2.Testing/CreateSession",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets a testing session."]
pub async fn get_session(
&mut self,
request: impl tonic::IntoRequest<super::GetSessionRequest>,
) -> Result<tonic::Response<super::Session>, 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.example.showcase.v1beta2.Testing/GetSession",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists the current test sessions."]
pub async fn list_sessions(
&mut self,
request: impl tonic::IntoRequest<super::ListSessionsRequest>,
) -> Result<tonic::Response<super::ListSessionsResponse>, 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.example.showcase.v1beta2.Testing/ListSessions",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Delete a test session."]
pub async fn delete_session(
&mut self,
request: impl tonic::IntoRequest<super::DeleteSessionRequest>,
) -> Result<tonic::Response<()>, 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.example.showcase.v1beta2.Testing/DeleteSession",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Report on the status of a session."]
#[doc = " This generates a report detailing which tests have been completed,"]
#[doc = " and an overall rollup."]
pub async fn report_session(
&mut self,
request: impl tonic::IntoRequest<super::ReportSessionRequest>,
) -> Result<tonic::Response<super::ReportSessionResponse>, 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.example.showcase.v1beta2.Testing/ReportSession",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " List the tests of a sessesion."]
pub async fn list_tests(
&mut self,
request: impl tonic::IntoRequest<super::ListTestsRequest>,
) -> Result<tonic::Response<super::ListTestsResponse>, 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.example.showcase.v1beta2.Testing/ListTests",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Explicitly decline to implement a test."]
#[doc = ""]
#[doc = " This removes the test from subsequent `ListTests` calls, and"]
#[doc = " attempting to do the test will error."]
#[doc = ""]
#[doc = " This method will error if attempting to delete a required test."]
pub async fn delete_test(
&mut self,
request: impl tonic::IntoRequest<super::DeleteTestRequest>,
) -> Result<tonic::Response<()>, 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.example.showcase.v1beta2.Testing/DeleteTest",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Register a response to a test."]
#[doc = ""]
#[doc = " In cases where a test involves registering a final answer at the"]
#[doc = " end of the test, this method provides the means to do so."]
pub async fn verify_test(
&mut self,
request: impl tonic::IntoRequest<super::VerifyTestRequest>,
) -> Result<tonic::Response<super::VerifyTestResponse>, 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.example.showcase.v1beta2.Testing/VerifyTest",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}