nominal_api_proto/proto/
nominal.internalusagemetadata.v1.rs1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct WorkspaceUsageMetadata {
4 #[prost(string, tag = "1")]
5 pub workspace_rid: ::prost::alloc::string::String,
6 #[prost(string, tag = "2")]
7 pub usage_dataset_rid: ::prost::alloc::string::String,
8}
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct UpdateWorkspaceUsageMetadataRequest {
11 #[prost(message, optional, tag = "1")]
12 pub workspace_usage_metadata: ::core::option::Option<WorkspaceUsageMetadata>,
13}
14#[derive(Clone, PartialEq, ::prost::Message)]
15pub struct UpdateWorkspaceUsageMetadataResponse {
16 #[prost(message, optional, tag = "1")]
17 pub workspace_usage_metadata: ::core::option::Option<WorkspaceUsageMetadata>,
18}
19#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
20#[repr(i32)]
21pub enum InternalUsageMetadataError {
22 InvalidArgument = 0,
23}
24impl InternalUsageMetadataError {
25 pub fn as_str_name(&self) -> &'static str {
30 match self {
31 Self::InvalidArgument => "INTERNAL_USAGE_METADATA_ERROR_INVALID_ARGUMENT",
32 }
33 }
34 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
36 match value {
37 "INTERNAL_USAGE_METADATA_ERROR_INVALID_ARGUMENT" => {
38 Some(Self::InvalidArgument)
39 }
40 _ => None,
41 }
42 }
43}
44pub mod internal_usage_metadata_service_client {
46 #![allow(
47 unused_variables,
48 dead_code,
49 missing_docs,
50 clippy::wildcard_imports,
51 clippy::let_unit_value,
52 )]
53 use tonic::codegen::*;
54 use tonic::codegen::http::Uri;
55 #[derive(Debug, Clone)]
56 pub struct InternalUsageMetadataServiceClient<T> {
57 inner: tonic::client::Grpc<T>,
58 }
59 impl InternalUsageMetadataServiceClient<tonic::transport::Channel> {
60 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
62 where
63 D: TryInto<tonic::transport::Endpoint>,
64 D::Error: Into<StdError>,
65 {
66 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
67 Ok(Self::new(conn))
68 }
69 }
70 impl<T> InternalUsageMetadataServiceClient<T>
71 where
72 T: tonic::client::GrpcService<tonic::body::Body>,
73 T::Error: Into<StdError>,
74 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
75 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
76 {
77 pub fn new(inner: T) -> Self {
78 let inner = tonic::client::Grpc::new(inner);
79 Self { inner }
80 }
81 pub fn with_origin(inner: T, origin: Uri) -> Self {
82 let inner = tonic::client::Grpc::with_origin(inner, origin);
83 Self { inner }
84 }
85 pub fn with_interceptor<F>(
86 inner: T,
87 interceptor: F,
88 ) -> InternalUsageMetadataServiceClient<InterceptedService<T, F>>
89 where
90 F: tonic::service::Interceptor,
91 T::ResponseBody: Default,
92 T: tonic::codegen::Service<
93 http::Request<tonic::body::Body>,
94 Response = http::Response<
95 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
96 >,
97 >,
98 <T as tonic::codegen::Service<
99 http::Request<tonic::body::Body>,
100 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
101 {
102 InternalUsageMetadataServiceClient::new(
103 InterceptedService::new(inner, interceptor),
104 )
105 }
106 #[must_use]
111 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
112 self.inner = self.inner.send_compressed(encoding);
113 self
114 }
115 #[must_use]
117 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
118 self.inner = self.inner.accept_compressed(encoding);
119 self
120 }
121 #[must_use]
125 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
126 self.inner = self.inner.max_decoding_message_size(limit);
127 self
128 }
129 #[must_use]
133 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
134 self.inner = self.inner.max_encoding_message_size(limit);
135 self
136 }
137 pub async fn update_workspace_usage_metadata(
138 &mut self,
139 request: impl tonic::IntoRequest<super::UpdateWorkspaceUsageMetadataRequest>,
140 ) -> std::result::Result<
141 tonic::Response<super::UpdateWorkspaceUsageMetadataResponse>,
142 tonic::Status,
143 > {
144 self.inner
145 .ready()
146 .await
147 .map_err(|e| {
148 tonic::Status::unknown(
149 format!("Service was not ready: {}", e.into()),
150 )
151 })?;
152 let codec = tonic::codec::ProstCodec::default();
153 let path = http::uri::PathAndQuery::from_static(
154 "/nominal.internalusagemetadata.v1.InternalUsageMetadataService/UpdateWorkspaceUsageMetadata",
155 );
156 let mut req = request.into_request();
157 req.extensions_mut()
158 .insert(
159 GrpcMethod::new(
160 "nominal.internalusagemetadata.v1.InternalUsageMetadataService",
161 "UpdateWorkspaceUsageMetadata",
162 ),
163 );
164 self.inner.unary(req, path, codec).await
165 }
166 }
167}