1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct BatchCancelRequestsRequest {
4 #[prost(string, repeated, tag = "1")]
5 pub request_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6}
7#[derive(Clone, Copy, PartialEq, ::prost::Message)]
8pub struct BatchCancelRequestsResponse {}
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct BatchGetRequestProgressRequest {
11 #[prost(string, repeated, tag = "1")]
12 pub request_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
13}
14#[derive(Clone, Copy, PartialEq, ::prost::Message)]
15pub struct RequestInProgress {
16 #[prost(int64, tag = "1")]
17 pub read_rows: i64,
18 #[prost(int64, tag = "2")]
19 pub total_rows_approx: i64,
20}
21#[derive(Clone, Copy, PartialEq, ::prost::Message)]
22pub struct RequestInactive {}
23#[derive(Clone, PartialEq, ::prost::Message)]
24pub struct RequestProgress {
25 #[prost(string, tag = "1")]
26 pub request_id: ::prost::alloc::string::String,
27 #[prost(oneof = "request_progress::State", tags = "2, 3")]
28 pub state: ::core::option::Option<request_progress::State>,
29}
30pub mod request_progress {
32 #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
33 pub enum State {
34 #[prost(message, tag = "2")]
35 InProgress(super::RequestInProgress),
36 #[prost(message, tag = "3")]
37 Inactive(super::RequestInactive),
38 }
39}
40#[derive(Clone, PartialEq, ::prost::Message)]
41pub struct BatchGetRequestProgressResponse {
42 #[prost(message, repeated, tag = "1")]
43 pub progress: ::prost::alloc::vec::Vec<RequestProgress>,
44}
45#[derive(Clone, Copy, PartialEq, ::prost::Message)]
46pub struct QuotaWindow {
47 #[prost(message, optional, tag = "1")]
48 pub start_time: ::core::option::Option<
49 super::super::super::google::protobuf::Timestamp,
50 >,
51 #[prost(message, optional, tag = "2")]
52 pub end_time: ::core::option::Option<
53 super::super::super::google::protobuf::Timestamp,
54 >,
55}
56#[derive(Clone, Copy, PartialEq, ::prost::Message)]
57pub struct QuotaResourceUsage {
58 #[prost(enumeration = "QuotaResourceType", tag = "1")]
59 pub resource: i32,
60 #[prost(double, tag = "2")]
61 pub used: f64,
62 #[prost(double, tag = "3")]
63 pub limit: f64,
64}
65#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct QuotaIntervalUsage {
67 #[prost(int64, tag = "1")]
68 pub duration_seconds: i64,
69 #[prost(message, optional, tag = "2")]
70 pub current_window: ::core::option::Option<QuotaWindow>,
71 #[prost(message, repeated, tag = "3")]
72 pub resources: ::prost::alloc::vec::Vec<QuotaResourceUsage>,
73}
74#[derive(Clone, PartialEq, ::prost::Message)]
75pub struct QuotaUsage {
76 #[prost(message, repeated, tag = "1")]
77 pub intervals: ::prost::alloc::vec::Vec<QuotaIntervalUsage>,
78}
79#[derive(Clone, PartialEq, ::prost::Message)]
80pub struct ListQuotaUsageIntervalsRequest {
81 #[prost(int32, optional, tag = "1")]
82 pub page_size: ::core::option::Option<i32>,
83 #[prost(string, tag = "2")]
84 pub page_token: ::prost::alloc::string::String,
85}
86#[derive(Clone, PartialEq, ::prost::Message)]
87pub struct ListQuotaUsageIntervalsResponse {
88 #[prost(message, repeated, tag = "1")]
89 pub intervals: ::prost::alloc::vec::Vec<QuotaIntervalUsage>,
90 #[prost(string, tag = "2")]
91 pub next_page_token: ::prost::alloc::string::String,
92}
93#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
94#[repr(i32)]
95pub enum ComputeRequestControlError {
96 Unspecified = 0,
97 InvalidRequestId = 1,
98 InvalidPageToken = 2,
99 InvalidPageSize = 3,
100}
101impl ComputeRequestControlError {
102 pub fn as_str_name(&self) -> &'static str {
107 match self {
108 Self::Unspecified => "COMPUTE_REQUEST_CONTROL_ERROR_UNSPECIFIED",
109 Self::InvalidRequestId => "COMPUTE_REQUEST_CONTROL_ERROR_INVALID_REQUEST_ID",
110 Self::InvalidPageToken => "COMPUTE_REQUEST_CONTROL_ERROR_INVALID_PAGE_TOKEN",
111 Self::InvalidPageSize => "COMPUTE_REQUEST_CONTROL_ERROR_INVALID_PAGE_SIZE",
112 }
113 }
114 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
116 match value {
117 "COMPUTE_REQUEST_CONTROL_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
118 "COMPUTE_REQUEST_CONTROL_ERROR_INVALID_REQUEST_ID" => {
119 Some(Self::InvalidRequestId)
120 }
121 "COMPUTE_REQUEST_CONTROL_ERROR_INVALID_PAGE_TOKEN" => {
122 Some(Self::InvalidPageToken)
123 }
124 "COMPUTE_REQUEST_CONTROL_ERROR_INVALID_PAGE_SIZE" => {
125 Some(Self::InvalidPageSize)
126 }
127 _ => None,
128 }
129 }
130}
131#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
132#[repr(i32)]
133pub enum QuotaResourceType {
134 Unspecified = 0,
135 ReadRows = 1,
136 ReadBytes = 2,
137 Queries = 3,
138 Errors = 4,
139 ExecutionTime = 5,
140}
141impl QuotaResourceType {
142 pub fn as_str_name(&self) -> &'static str {
147 match self {
148 Self::Unspecified => "QUOTA_RESOURCE_TYPE_UNSPECIFIED",
149 Self::ReadRows => "QUOTA_RESOURCE_TYPE_READ_ROWS",
150 Self::ReadBytes => "QUOTA_RESOURCE_TYPE_READ_BYTES",
151 Self::Queries => "QUOTA_RESOURCE_TYPE_QUERIES",
152 Self::Errors => "QUOTA_RESOURCE_TYPE_ERRORS",
153 Self::ExecutionTime => "QUOTA_RESOURCE_TYPE_EXECUTION_TIME",
154 }
155 }
156 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
158 match value {
159 "QUOTA_RESOURCE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
160 "QUOTA_RESOURCE_TYPE_READ_ROWS" => Some(Self::ReadRows),
161 "QUOTA_RESOURCE_TYPE_READ_BYTES" => Some(Self::ReadBytes),
162 "QUOTA_RESOURCE_TYPE_QUERIES" => Some(Self::Queries),
163 "QUOTA_RESOURCE_TYPE_ERRORS" => Some(Self::Errors),
164 "QUOTA_RESOURCE_TYPE_EXECUTION_TIME" => Some(Self::ExecutionTime),
165 _ => None,
166 }
167 }
168}
169pub mod compute_service_client {
171 #![allow(
172 unused_variables,
173 dead_code,
174 missing_docs,
175 clippy::wildcard_imports,
176 clippy::let_unit_value,
177 )]
178 use tonic::codegen::*;
179 use tonic::codegen::http::Uri;
180 #[derive(Debug, Clone)]
181 pub struct ComputeServiceClient<T> {
182 inner: tonic::client::Grpc<T>,
183 }
184 impl ComputeServiceClient<tonic::transport::Channel> {
185 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
187 where
188 D: TryInto<tonic::transport::Endpoint>,
189 D::Error: Into<StdError>,
190 {
191 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
192 Ok(Self::new(conn))
193 }
194 }
195 impl<T> ComputeServiceClient<T>
196 where
197 T: tonic::client::GrpcService<tonic::body::Body>,
198 T::Error: Into<StdError>,
199 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
200 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
201 {
202 pub fn new(inner: T) -> Self {
203 let inner = tonic::client::Grpc::new(inner);
204 Self { inner }
205 }
206 pub fn with_origin(inner: T, origin: Uri) -> Self {
207 let inner = tonic::client::Grpc::with_origin(inner, origin);
208 Self { inner }
209 }
210 pub fn with_interceptor<F>(
211 inner: T,
212 interceptor: F,
213 ) -> ComputeServiceClient<InterceptedService<T, F>>
214 where
215 F: tonic::service::Interceptor,
216 T::ResponseBody: Default,
217 T: tonic::codegen::Service<
218 http::Request<tonic::body::Body>,
219 Response = http::Response<
220 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
221 >,
222 >,
223 <T as tonic::codegen::Service<
224 http::Request<tonic::body::Body>,
225 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
226 {
227 ComputeServiceClient::new(InterceptedService::new(inner, interceptor))
228 }
229 #[must_use]
234 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
235 self.inner = self.inner.send_compressed(encoding);
236 self
237 }
238 #[must_use]
240 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
241 self.inner = self.inner.accept_compressed(encoding);
242 self
243 }
244 #[must_use]
248 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
249 self.inner = self.inner.max_decoding_message_size(limit);
250 self
251 }
252 #[must_use]
256 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
257 self.inner = self.inner.max_encoding_message_size(limit);
258 self
259 }
260 pub async fn batch_cancel_requests(
261 &mut self,
262 request: impl tonic::IntoRequest<super::BatchCancelRequestsRequest>,
263 ) -> std::result::Result<
264 tonic::Response<super::BatchCancelRequestsResponse>,
265 tonic::Status,
266 > {
267 self.inner
268 .ready()
269 .await
270 .map_err(|e| {
271 tonic::Status::unknown(
272 format!("Service was not ready: {}", e.into()),
273 )
274 })?;
275 let codec = tonic::codec::ProstCodec::default();
276 let path = http::uri::PathAndQuery::from_static(
277 "/nominal.compute.v1.ComputeService/BatchCancelRequests",
278 );
279 let mut req = request.into_request();
280 req.extensions_mut()
281 .insert(
282 GrpcMethod::new(
283 "nominal.compute.v1.ComputeService",
284 "BatchCancelRequests",
285 ),
286 );
287 self.inner.unary(req, path, codec).await
288 }
289 pub async fn batch_get_request_progress(
290 &mut self,
291 request: impl tonic::IntoRequest<super::BatchGetRequestProgressRequest>,
292 ) -> std::result::Result<
293 tonic::Response<super::BatchGetRequestProgressResponse>,
294 tonic::Status,
295 > {
296 self.inner
297 .ready()
298 .await
299 .map_err(|e| {
300 tonic::Status::unknown(
301 format!("Service was not ready: {}", e.into()),
302 )
303 })?;
304 let codec = tonic::codec::ProstCodec::default();
305 let path = http::uri::PathAndQuery::from_static(
306 "/nominal.compute.v1.ComputeService/BatchGetRequestProgress",
307 );
308 let mut req = request.into_request();
309 req.extensions_mut()
310 .insert(
311 GrpcMethod::new(
312 "nominal.compute.v1.ComputeService",
313 "BatchGetRequestProgress",
314 ),
315 );
316 self.inner.unary(req, path, codec).await
317 }
318 pub async fn list_quota_usage_intervals(
319 &mut self,
320 request: impl tonic::IntoRequest<super::ListQuotaUsageIntervalsRequest>,
321 ) -> std::result::Result<
322 tonic::Response<super::ListQuotaUsageIntervalsResponse>,
323 tonic::Status,
324 > {
325 self.inner
326 .ready()
327 .await
328 .map_err(|e| {
329 tonic::Status::unknown(
330 format!("Service was not ready: {}", e.into()),
331 )
332 })?;
333 let codec = tonic::codec::ProstCodec::default();
334 let path = http::uri::PathAndQuery::from_static(
335 "/nominal.compute.v1.ComputeService/ListQuotaUsageIntervals",
336 );
337 let mut req = request.into_request();
338 req.extensions_mut()
339 .insert(
340 GrpcMethod::new(
341 "nominal.compute.v1.ComputeService",
342 "ListQuotaUsageIntervals",
343 ),
344 );
345 self.inner.unary(req, path, codec).await
346 }
347 }
348}