1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
// This file is @generated by prost-build.
/// Request message for SummarizeMaintenances custom method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SummarizeMaintenancesRequest {
/// Required. The parent of the resource maintenance.
/// eg. `projects/123/locations/*`
#[prost(string, tag = "10006")]
pub parent: ::prost::alloc::string::String,
/// The maximum number of resource maintenances to send per page. The default
/// page size is 20 and the maximum is 1000.
#[prost(int32, tag = "10505")]
pub page_size: i32,
/// The page token: If the next_page_token from a previous response
/// is provided, this request will send the subsequent page.
#[prost(string, tag = "10506")]
pub page_token: ::prost::alloc::string::String,
/// Filter the list as specified in <https://google.aip.dev/160.>
/// Supported fields include:
///
/// * `maintenance.maintenanceName`
/// Examples:
/// * `maintenance.maintenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1"`
#[prost(string, tag = "10507")]
pub filter: ::prost::alloc::string::String,
/// Order results as specified in <https://google.aip.dev/132.>
#[prost(string, tag = "10508")]
pub order_by: ::prost::alloc::string::String,
}
/// Request message for SummarizeMaintenances custom method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SummarizeMaintenancesResponse {
/// The resulting summaries.
#[prost(message, repeated, tag = "10509")]
pub maintenances: ::prost::alloc::vec::Vec<MaintenanceSummary>,
/// If present, the next page token can be provided to a subsequent
/// SummarizeMaintenances call to list the next page.
/// If empty, there are no more pages.
#[prost(string, tag = "10510")]
pub next_page_token: ::prost::alloc::string::String,
/// Unordered list. Locations that could not be reached.
#[prost(string, repeated, tag = "10511")]
pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// MaintenanceSummary contains maintenance statistics calculated based on
/// ResourceMaintenances within the scope: project and location.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MaintenanceSummary {
/// Output only. The name of the maintenance.
#[prost(string, tag = "1")]
pub maintenance_name: ::prost::alloc::string::String,
/// Output only. The title of the maintenance.
#[prost(string, tag = "2")]
pub title: ::prost::alloc::string::String,
/// Output only. The description of the maintenance.
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
/// Output only. The category of the maintenance event.
#[prost(enumeration = "MaintenanceCategory", tag = "13")]
pub category: i32,
/// Output only. Scheduled start time of the maintenance. The maintenance will
/// start at `maintenanceScheduledStartTime` or later, with best effort to
/// finish before `maintenanceScheduledEndTime`.
#[prost(message, optional, tag = "6")]
pub maintenance_scheduled_start_time: ::core::option::Option<
::prost_types::Timestamp,
>,
/// Output only. An estimated (best effort, not guaranteed) end time of the
/// scheduled maintenance.
#[prost(message, optional, tag = "7")]
pub maintenance_scheduled_end_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Actual date when the maintenance started. Field present only
/// after the state changed to `RUNNING`.
#[prost(message, optional, tag = "8")]
pub maintenance_start_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Actual date when the maintenance successfully completed. Field
/// present only after the state changed to `SUCCEEDED`.
#[prost(message, optional, tag = "9")]
pub maintenance_end_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Indicates whether the user has some control over that
/// maintenance, either proactively before maintenance was scheduled with
/// maintenance policy or with reactive controls after it was scheduled (see
/// controls field).
#[prost(bool, tag = "10")]
pub user_controllable: bool,
/// Output only. Control available for that Maintenance (might not be available
/// for every resource that maintenance is applied to).
#[prost(message, repeated, tag = "14")]
pub controls: ::prost::alloc::vec::Vec<MaintenanceControl>,
/// Output only. Stats is a field of ResourceMaintenance used to aggregate the
/// stats.
#[prost(message, repeated, tag = "12")]
pub stats: ::prost::alloc::vec::Vec<maintenance_summary::Stats>,
}
/// Nested message and enum types in `MaintenanceSummary`.
pub mod maintenance_summary {
/// Stats indicates the type of aggregate and the corresponding aggregates.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Stats {
/// groupBy specifies the type of aggregate.
/// For example a group_by might be `"state"`
#[prost(string, tag = "1")]
pub group_by: ::prost::alloc::string::String,
/// Aggregates is a list \<group, count> pairs. For example, if the
/// group_by is `"state"` a possible tuple in the aggregates list could be
/// "SCHEDULED" : `11`,
#[prost(message, repeated, tag = "2")]
pub aggregates: ::prost::alloc::vec::Vec<Aggregate>,
}
/// Aggregate is a \<group, count> pair.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Aggregate {
/// Specifies what specific value of the group_by the count represents. For
/// example if group_by is `"state"` its corresponding group could be
/// `"SCHEDULED"`.
#[prost(string, tag = "1")]
pub group: ::prost::alloc::string::String,
/// The count of the group.
#[prost(int64, tag = "2")]
pub count: i64,
}
}
/// ResourceMaintenance is a resource that represents a maintenance operation
/// on a resource.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceMaintenance {
/// Identifier. The name of the resource_maintenance resource.
/// Format:
/// `"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Output only. The resource spec of the resource maintenance.
#[prost(message, optional, tag = "2")]
pub resource: ::core::option::Option<resource_maintenance::Resource>,
/// Output only. The details of the maintenance.
#[prost(message, optional, tag = "3")]
pub maintenance: ::core::option::Option<resource_maintenance::Maintenance>,
/// Output only. The state of the resource maintenance.
#[prost(enumeration = "resource_maintenance::State", tag = "4")]
pub state: i32,
/// Output only. The create time of the resource maintenance.
#[prost(message, optional, tag = "5")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The update time of the resource maintenance.
#[prost(message, optional, tag = "6")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The time when the resource maintenance has started.
#[prost(message, optional, tag = "7")]
pub maintenance_start_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The time when the resource maintenance has completed.
#[prost(message, optional, tag = "8")]
pub maintenance_end_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The time when the resource maintenance was cancelled.
#[prost(message, optional, tag = "9")]
pub maintenance_cancel_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The time when the maintenance on the resource was scheduled to
/// start.
#[prost(message, optional, tag = "10")]
pub maintenance_scheduled_start_time: ::core::option::Option<
::prost_types::Timestamp,
>,
/// Output only. The time when the maintenance on the resource was scheduled to
/// end.
#[prost(message, optional, tag = "11")]
pub maintenance_scheduled_end_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Indicates whether the user has some control over that
/// maintenance, either proactively before maintenance was scheduled with
/// maintenance policy or with reactive controls after it was scheduled (see
/// controls field)
#[prost(bool, tag = "12")]
pub user_controllable: bool,
/// Output only. The controls of the maintenance.
#[prost(message, repeated, tag = "13")]
pub controls: ::prost::alloc::vec::Vec<MaintenanceControl>,
/// Optional. The labels on the resource, which can be used for categorization.
/// similar to Kubernetes resource labels.
#[prost(map = "string, string", tag = "10401")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Optional. Annotations is an unstructured key-value map stored with a
/// resource that may be set by external tools to store and retrieve arbitrary
/// metadata. They are not queryable and should be preserved when modifying
/// objects.
///
/// More info: <https://kubernetes.io/docs/user-guide/annotations>
#[prost(map = "string, string", tag = "10402")]
pub annotations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Output only. The unique identifier of the resource. UID is unique in the
/// time and space for this resource within the scope of the service. It is
/// typically generated by the server on successful creation of a resource
/// and must not be changed. UID is used to uniquely identify resources
/// with resource name reuses. This should be a UUID4.
#[prost(string, tag = "10201")]
pub uid: ::prost::alloc::string::String,
/// Output only. An opaque value that uniquely identifies a version or
/// generation of a resource. It can be used to confirm that the client
/// and server agree on the ordering of a resource being written.
#[prost(string, tag = "10202")]
pub etag: ::prost::alloc::string::String,
}
/// Nested message and enum types in `ResourceMaintenance`.
pub mod resource_maintenance {
/// Resource contains information about the resource affected by maintenance.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Resource {
/// Output only. Name is the reference to the consumer resource affected by
/// the maintenance. Available values can be found here:
/// <https://cloud.google.com/asset-inventory/docs/asset-names>
#[prost(string, tag = "1")]
pub resource_name: ::prost::alloc::string::String,
/// Output only. The location of the resource.
/// Format:
/// `us-central1`
#[prost(string, tag = "2")]
pub location: ::prost::alloc::string::String,
/// Output only. The type of the resource.
/// Available values can be found here:
/// <https://cloud.google.com/asset-inventory/docs/asset-types#supported_resource_types>
/// Please note that not all the resource types will have their maintenances
/// reported.
#[prost(string, tag = "3")]
pub r#type: ::prost::alloc::string::String,
}
/// Maintenance is the maintenance details of a resource's maintenance.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Maintenance {
/// Maintenance is the name of the corresponding maintenance resource
/// following the standard naming scheme: `"{maintenance-id}"`
#[prost(string, tag = "1")]
pub maintenance_name: ::prost::alloc::string::String,
/// Output only. The title of the maintenance.
#[prost(string, tag = "2")]
pub title: ::prost::alloc::string::String,
/// Output only. The description of the maintenance.
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
/// Output only. The category of the maintenance.
#[prost(enumeration = "super::MaintenanceCategory", tag = "4")]
pub category: i32,
}
/// State is the state of a resource maintenance.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
/// Unspecified state.
Unspecified = 0,
/// Scheduled for a particular window. For disruptive maintenance it should
/// respect maintenance policy, i.e. its available windows, exclusions and
/// notification period.
Scheduled = 1,
/// Maintenance is ongoing.
Running = 2,
/// No longer planned, typically when other maintenance (e.g. upgrade to
/// newer version) already happened, or the user skipped the maintenance.
Cancelled = 3,
/// Successfully completed.
Succeeded = 4,
}
impl State {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "STATE_UNSPECIFIED",
Self::Scheduled => "SCHEDULED",
Self::Running => "RUNNING",
Self::Cancelled => "CANCELLED",
Self::Succeeded => "SUCCEEDED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_UNSPECIFIED" => Some(Self::Unspecified),
"SCHEDULED" => Some(Self::Scheduled),
"RUNNING" => Some(Self::Running),
"CANCELLED" => Some(Self::Cancelled),
"SUCCEEDED" => Some(Self::Succeeded),
_ => None,
}
}
}
}
/// The control of the maintenance.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MaintenanceControl {
/// The control of the resource maintenance.
#[prost(enumeration = "maintenance_control::Control", tag = "1")]
pub control: i32,
/// Indicates whether the control is available only in Service Producer API
/// (not through Unified Maintenance).
#[prost(bool, tag = "2")]
pub is_custom: bool,
/// Link to Service Producer documentation about maintenance control. Provided
/// only when `isCustom` is `true`.
#[prost(string, tag = "3")]
pub documentation: ::prost::alloc::string::String,
}
/// Nested message and enum types in `MaintenanceControl`.
pub mod maintenance_control {
/// Sets the type of control supported. comment (as in logs).
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Control {
/// Unspecified control.
Unspecified = 0,
/// Apply control.
Apply = 1,
/// Manage policy control.
ManagePolicy = 2,
/// Reschedule control.
Reschedule = 3,
}
impl Control {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "CONTROL_UNSPECIFIED",
Self::Apply => "APPLY",
Self::ManagePolicy => "MANAGE_POLICY",
Self::Reschedule => "RESCHEDULE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CONTROL_UNSPECIFIED" => Some(Self::Unspecified),
"APPLY" => Some(Self::Apply),
"MANAGE_POLICY" => Some(Self::ManagePolicy),
"RESCHEDULE" => Some(Self::Reschedule),
_ => None,
}
}
}
}
/// The request structure for the ListResourceMaintenances method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListResourceMaintenancesRequest {
/// Required. The parent of the resource maintenance.
#[prost(string, tag = "10006")]
pub parent: ::prost::alloc::string::String,
/// The maximum number of resource maintenances to send per page.
#[prost(int32, tag = "10505")]
pub page_size: i32,
/// The page token: If the next_page_token from a previous response
/// is provided, this request will send the subsequent page.
#[prost(string, tag = "10506")]
pub page_token: ::prost::alloc::string::String,
/// Filter the list as specified in <https://google.aip.dev/160.>
#[prost(string, tag = "10507")]
pub filter: ::prost::alloc::string::String,
/// Order results as specified in <https://google.aip.dev/132.>
#[prost(string, tag = "10508")]
pub order_by: ::prost::alloc::string::String,
}
/// The response structure for the ListResourceMaintenances method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListResourceMaintenancesResponse {
/// The resulting resource maintenances.
#[prost(message, repeated, tag = "10509")]
pub resource_maintenances: ::prost::alloc::vec::Vec<ResourceMaintenance>,
/// If present, the next page token can be provided to a subsequent
/// ListResourceMaintenances call to list the next page.
/// If empty, there are no more pages.
#[prost(string, tag = "10510")]
pub next_page_token: ::prost::alloc::string::String,
/// Locations that could not be reached.
#[prost(string, repeated, tag = "10511")]
pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// The request structure for the GetResourceMaintenance method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetResourceMaintenanceRequest {
/// Required. The resource name of the resource within a service.
#[prost(string, tag = "10001")]
pub name: ::prost::alloc::string::String,
}
/// The Category of the maintenance.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MaintenanceCategory {
/// Unspecified category.
Unspecified = 0,
/// Infrastructure maintenance events are times that Google Cloud performs
/// regular maintenance on network equipment e.g. Google Cloud Interconnect
/// These events are usually scheduled in advance and we provide
/// notification, when possible, so that users can plan for the
/// infrastructure maintenance event and prevent downtime. Infrastructure
/// maintenance events don't have a set interval between occurrences, but
/// generally occur several times a year.
Infrastructure = 1,
/// Updates that can include bug fixes, changes, or new features that are
/// backward compatible with existing versions (including patches).
/// Some SPs allow users to control the scheduling of these maintenance
/// events using maintenance windows and/or deny maintenance features.
ServiceUpdate = 3,
}
impl MaintenanceCategory {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "MAINTENANCE_CATEGORY_UNSPECIFIED",
Self::Infrastructure => "INFRASTRUCTURE",
Self::ServiceUpdate => "SERVICE_UPDATE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MAINTENANCE_CATEGORY_UNSPECIFIED" => Some(Self::Unspecified),
"INFRASTRUCTURE" => Some(Self::Infrastructure),
"SERVICE_UPDATE" => Some(Self::ServiceUpdate),
_ => None,
}
}
}
/// Generated client implementations.
pub mod maintenance_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Unified Maintenance service
#[derive(Debug, Clone)]
pub struct MaintenanceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl MaintenanceClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> MaintenanceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> MaintenanceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
MaintenanceClient::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
}
/// Retrieves the statistics of a specific maintenance.
pub async fn summarize_maintenances(
&mut self,
request: impl tonic::IntoRequest<super::SummarizeMaintenancesRequest>,
) -> std::result::Result<
tonic::Response<super::SummarizeMaintenancesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.maintenance.api.v1.Maintenance/SummarizeMaintenances",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.maintenance.api.v1.Maintenance",
"SummarizeMaintenances",
),
);
self.inner.unary(req, path, codec).await
}
/// Retrieve a collection of resource maintenances.
pub async fn list_resource_maintenances(
&mut self,
request: impl tonic::IntoRequest<super::ListResourceMaintenancesRequest>,
) -> std::result::Result<
tonic::Response<super::ListResourceMaintenancesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.maintenance.api.v1.Maintenance/ListResourceMaintenances",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.maintenance.api.v1.Maintenance",
"ListResourceMaintenances",
),
);
self.inner.unary(req, path, codec).await
}
/// Retrieve a single resource maintenance.
pub async fn get_resource_maintenance(
&mut self,
request: impl tonic::IntoRequest<super::GetResourceMaintenanceRequest>,
) -> std::result::Result<
tonic::Response<super::ResourceMaintenance>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.maintenance.api.v1.Maintenance/GetResourceMaintenance",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.maintenance.api.v1.Maintenance",
"GetResourceMaintenance",
),
);
self.inner.unary(req, path, codec).await
}
}
}