From 7cc67af2df414d18935e15c23a90a12ae4dfd76e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:16:15 -0500 Subject: [PATCH] Automated Protos Update (#133) Co-authored-by: viambot --- src/gen/google.api.rs | 13 + src/gen/proto.rpc.examples.fileupload.v1.rs | 27 -- .../proto.rpc.examples.fileupload.v1.tonic.rs | 304 ------------------ src/gen/proto.rpc.webrtc.v1.rs | 10 +- 4 files changed, 22 insertions(+), 332 deletions(-) delete mode 100644 src/gen/proto.rpc.examples.fileupload.v1.rs delete mode 100644 src/gen/proto.rpc.examples.fileupload.v1.tonic.rs diff --git a/src/gen/google.api.rs b/src/gen/google.api.rs index f7c58e4..d478502 100644 --- a/src/gen/google.api.rs +++ b/src/gen/google.api.rs @@ -449,6 +449,9 @@ pub struct CommonLanguageSettings { /// The destination where API teams want this client library to be published. #[prost(enumeration="ClientLibraryDestination", repeated, tag="2")] pub destinations: ::prost::alloc::vec::Vec, + /// Configuration for which RPCs should be generated in the GAPIC client. + #[prost(message, optional, tag="3")] + pub selective_gapic_generation: ::core::option::Option, } /// Details about how and where to publish client libraries. #[allow(clippy::derive_partial_eq_without_eq)] @@ -758,6 +761,16 @@ pub mod method_settings { pub total_poll_timeout: ::core::option::Option<::prost_types::Duration>, } } +/// This message is used to configure the generation of a subset of the RPCs in +/// a service for client libraries. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SelectiveGapicGeneration { + /// An allowlist of the fully qualified names of RPCs that should be included + /// on public client surfaces. + #[prost(string, repeated, tag="1")] + pub methods: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} /// The organization for which the client libraries are being published. /// Affects the url where generated docs are published, etc. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] diff --git a/src/gen/proto.rpc.examples.fileupload.v1.rs b/src/gen/proto.rpc.examples.fileupload.v1.rs deleted file mode 100644 index 9e82abf..0000000 --- a/src/gen/proto.rpc.examples.fileupload.v1.rs +++ /dev/null @@ -1,27 +0,0 @@ -// @generated -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UploadFileRequest { - #[prost(oneof="upload_file_request::Data", tags="1, 2")] - pub data: ::core::option::Option, -} -/// Nested message and enum types in `UploadFileRequest`. -pub mod upload_file_request { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Data { - #[prost(string, tag="1")] - Name(::prost::alloc::string::String), - #[prost(bytes, tag="2")] - ChunkData(::prost::alloc::vec::Vec), - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UploadFileResponse { - #[prost(string, tag="1")] - pub name: ::prost::alloc::string::String, - #[prost(int64, tag="2")] - pub size: i64, -} -// @@protoc_insertion_point(module) diff --git a/src/gen/proto.rpc.examples.fileupload.v1.tonic.rs b/src/gen/proto.rpc.examples.fileupload.v1.tonic.rs deleted file mode 100644 index 8c8d107..0000000 --- a/src/gen/proto.rpc.examples.fileupload.v1.tonic.rs +++ /dev/null @@ -1,304 +0,0 @@ -// @generated -/// Generated client implementations. -pub mod file_upload_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 FileUploadServiceClient { - inner: tonic::client::Grpc, - } - impl FileUploadServiceClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl FileUploadServiceClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + 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( - inner: T, - interceptor: F, - ) -> FileUploadServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - FileUploadServiceClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[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 upload_file( - &mut self, - request: impl tonic::IntoStreamingRequest, - ) -> std::result::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( - "/proto.rpc.examples.fileupload.v1.FileUploadService/UploadFile", - ); - let mut req = request.into_streaming_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "proto.rpc.examples.fileupload.v1.FileUploadService", - "UploadFile", - ), - ); - self.inner.client_streaming(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod file_upload_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with FileUploadServiceServer. - #[async_trait] - pub trait FileUploadService: Send + Sync + 'static { - /// - async fn upload_file( - &self, - request: tonic::Request>, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// - #[derive(Debug)] - pub struct FileUploadServiceServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl FileUploadServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - 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( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for FileUploadServiceServer - where - T: FileUploadService, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/proto.rpc.examples.fileupload.v1.FileUploadService/UploadFile" => { - #[allow(non_camel_case_types)] - struct UploadFileSvc(pub Arc); - impl< - T: FileUploadService, - > tonic::server::ClientStreamingService - for UploadFileSvc { - type Response = super::UploadFileResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - tonic::Streaming, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { (*inner).upload_file(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 inner = inner.0; - let method = UploadFileSvc(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.client_streaming(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for FileUploadServiceServer { - 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, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService - for FileUploadServiceServer { - const NAME: &'static str = "proto.rpc.examples.fileupload.v1.FileUploadService"; - } -} diff --git a/src/gen/proto.rpc.webrtc.v1.rs b/src/gen/proto.rpc.webrtc.v1.rs index b0fe63b..46afbb7 100644 --- a/src/gen/proto.rpc.webrtc.v1.rs +++ b/src/gen/proto.rpc.webrtc.v1.rs @@ -272,6 +272,11 @@ pub struct AnswerRequestErrorStage { #[prost(message, optional, tag="1")] pub status: ::core::option::Option, } +/// AnswerRequestHeartbeatStage is sent periodically to verify liveness of answerer. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AnswerRequestHeartbeatStage { +} /// AnswerRequest is the SDP offer that the controlling side is making via the answering /// stream. #[allow(clippy::derive_partial_eq_without_eq)] @@ -279,7 +284,7 @@ pub struct AnswerRequestErrorStage { pub struct AnswerRequest { #[prost(string, tag="1")] pub uuid: ::prost::alloc::string::String, - #[prost(oneof="answer_request::Stage", tags="2, 3, 4, 5")] + #[prost(oneof="answer_request::Stage", tags="2, 3, 4, 5, 6")] pub stage: ::core::option::Option, } /// Nested message and enum types in `AnswerRequest`. @@ -297,6 +302,9 @@ pub mod answer_request { /// error is sent any time before done #[prost(message, tag="5")] Error(super::AnswerRequestErrorStage), + /// heartbeat is sent periodically to verify liveness of answerer + #[prost(message, tag="6")] + Heartbeat(super::AnswerRequestHeartbeatStage), } } /// AnswerResponseInitStage is the first and a one time stage that represents the