google_cloud_longrunning/model.rs
1// Copyright 2024 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate reqwest;
26extern crate rpc;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// This resource represents a long-running operation that is the result of a
39/// network API call.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct Operation {
43 /// The server-assigned name, which is only unique within the same service that
44 /// originally returns it. If you use the default HTTP mapping, the
45 /// `name` should be a resource name ending with `operations/{unique_id}`.
46 pub name: std::string::String,
47
48 /// Service-specific metadata associated with the operation. It typically
49 /// contains progress information and common metadata such as create time.
50 /// Some services might not provide such metadata. Any method that returns a
51 /// long-running operation should document the metadata type, if any.
52 pub metadata: std::option::Option<wkt::Any>,
53
54 /// If the value is `false`, it means the operation is still in progress.
55 /// If `true`, the operation is completed, and either `error` or `response` is
56 /// available.
57 pub done: bool,
58
59 /// The operation result, which can be either an `error` or a valid `response`.
60 /// If `done` == `false`, neither `error` nor `response` is set.
61 /// If `done` == `true`, exactly one of `error` or `response` can be set.
62 /// Some services might not provide the result.
63 pub result: std::option::Option<crate::model::operation::Result>,
64
65 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
66}
67
68impl Operation {
69 pub fn new() -> Self {
70 std::default::Default::default()
71 }
72
73 /// Sets the value of [name][crate::model::Operation::name].
74 ///
75 /// # Example
76 /// ```ignore,no_run
77 /// # use google_cloud_longrunning::model::Operation;
78 /// let x = Operation::new().set_name("example");
79 /// ```
80 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
81 self.name = v.into();
82 self
83 }
84
85 /// Sets the value of [metadata][crate::model::Operation::metadata].
86 ///
87 /// # Example
88 /// ```ignore,no_run
89 /// # use google_cloud_longrunning::model::Operation;
90 /// use wkt::Any;
91 /// let x = Operation::new().set_metadata(Any::default()/* use setters */);
92 /// ```
93 pub fn set_metadata<T>(mut self, v: T) -> Self
94 where
95 T: std::convert::Into<wkt::Any>,
96 {
97 self.metadata = std::option::Option::Some(v.into());
98 self
99 }
100
101 /// Sets or clears the value of [metadata][crate::model::Operation::metadata].
102 ///
103 /// # Example
104 /// ```ignore,no_run
105 /// # use google_cloud_longrunning::model::Operation;
106 /// use wkt::Any;
107 /// let x = Operation::new().set_or_clear_metadata(Some(Any::default()/* use setters */));
108 /// let x = Operation::new().set_or_clear_metadata(None::<Any>);
109 /// ```
110 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
111 where
112 T: std::convert::Into<wkt::Any>,
113 {
114 self.metadata = v.map(|x| x.into());
115 self
116 }
117
118 /// Sets the value of [done][crate::model::Operation::done].
119 ///
120 /// # Example
121 /// ```ignore,no_run
122 /// # use google_cloud_longrunning::model::Operation;
123 /// let x = Operation::new().set_done(true);
124 /// ```
125 pub fn set_done<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
126 self.done = v.into();
127 self
128 }
129
130 /// Sets the value of [result][crate::model::Operation::result].
131 ///
132 /// Note that all the setters affecting `result` are mutually
133 /// exclusive.
134 ///
135 /// # Example
136 /// ```ignore,no_run
137 /// # use google_cloud_longrunning::model::Operation;
138 /// use rpc::model::Status;
139 /// let x = Operation::new().set_result(Some(
140 /// google_cloud_longrunning::model::operation::Result::Error(Status::default().into())));
141 /// ```
142 pub fn set_result<
143 T: std::convert::Into<std::option::Option<crate::model::operation::Result>>,
144 >(
145 mut self,
146 v: T,
147 ) -> Self {
148 self.result = v.into();
149 self
150 }
151
152 /// The value of [result][crate::model::Operation::result]
153 /// if it holds a `Error`, `None` if the field is not set or
154 /// holds a different branch.
155 pub fn error(&self) -> std::option::Option<&std::boxed::Box<rpc::model::Status>> {
156 #[allow(unreachable_patterns)]
157 self.result.as_ref().and_then(|v| match v {
158 crate::model::operation::Result::Error(v) => std::option::Option::Some(v),
159 _ => std::option::Option::None,
160 })
161 }
162
163 /// Sets the value of [result][crate::model::Operation::result]
164 /// to hold a `Error`.
165 ///
166 /// Note that all the setters affecting `result` are
167 /// mutually exclusive.
168 ///
169 /// # Example
170 /// ```ignore,no_run
171 /// # use google_cloud_longrunning::model::Operation;
172 /// use rpc::model::Status;
173 /// let x = Operation::new().set_error(Status::default()/* use setters */);
174 /// assert!(x.error().is_some());
175 /// assert!(x.response().is_none());
176 /// ```
177 pub fn set_error<T: std::convert::Into<std::boxed::Box<rpc::model::Status>>>(
178 mut self,
179 v: T,
180 ) -> Self {
181 self.result = std::option::Option::Some(crate::model::operation::Result::Error(v.into()));
182 self
183 }
184
185 /// The value of [result][crate::model::Operation::result]
186 /// if it holds a `Response`, `None` if the field is not set or
187 /// holds a different branch.
188 pub fn response(&self) -> std::option::Option<&std::boxed::Box<wkt::Any>> {
189 #[allow(unreachable_patterns)]
190 self.result.as_ref().and_then(|v| match v {
191 crate::model::operation::Result::Response(v) => std::option::Option::Some(v),
192 _ => std::option::Option::None,
193 })
194 }
195
196 /// Sets the value of [result][crate::model::Operation::result]
197 /// to hold a `Response`.
198 ///
199 /// Note that all the setters affecting `result` are
200 /// mutually exclusive.
201 ///
202 /// # Example
203 /// ```ignore,no_run
204 /// # use google_cloud_longrunning::model::Operation;
205 /// use wkt::Any;
206 /// let x = Operation::new().set_response(Any::default()/* use setters */);
207 /// assert!(x.response().is_some());
208 /// assert!(x.error().is_none());
209 /// ```
210 pub fn set_response<T: std::convert::Into<std::boxed::Box<wkt::Any>>>(mut self, v: T) -> Self {
211 self.result =
212 std::option::Option::Some(crate::model::operation::Result::Response(v.into()));
213 self
214 }
215}
216
217impl wkt::message::Message for Operation {
218 fn typename() -> &'static str {
219 "type.googleapis.com/google.longrunning.Operation"
220 }
221}
222
223/// Defines additional types related to [Operation].
224pub mod operation {
225 #[allow(unused_imports)]
226 use super::*;
227
228 /// The operation result, which can be either an `error` or a valid `response`.
229 /// If `done` == `false`, neither `error` nor `response` is set.
230 /// If `done` == `true`, exactly one of `error` or `response` can be set.
231 /// Some services might not provide the result.
232 #[derive(Clone, Debug, PartialEq)]
233 #[non_exhaustive]
234 pub enum Result {
235 /// The error result of the operation in case of failure or cancellation.
236 Error(std::boxed::Box<rpc::model::Status>),
237 /// The normal, successful response of the operation. If the original
238 /// method returns no data on success, such as `Delete`, the response is
239 /// `google.protobuf.Empty`. If the original method is standard
240 /// `Get`/`Create`/`Update`, the response should be the resource. For other
241 /// methods, the response should have the type `XxxResponse`, where `Xxx`
242 /// is the original method name. For example, if the original method name
243 /// is `TakeSnapshot()`, the inferred response type is
244 /// `TakeSnapshotResponse`.
245 Response(std::boxed::Box<wkt::Any>),
246 }
247}
248
249/// The request message for
250/// [Operations.GetOperation][google.longrunning.Operations.GetOperation].
251///
252/// [google.longrunning.Operations.GetOperation]: crate::client::Operations::get_operation
253#[derive(Clone, Default, PartialEq)]
254#[non_exhaustive]
255pub struct GetOperationRequest {
256 /// The name of the operation resource.
257 pub name: std::string::String,
258
259 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
260}
261
262impl GetOperationRequest {
263 pub fn new() -> Self {
264 std::default::Default::default()
265 }
266
267 /// Sets the value of [name][crate::model::GetOperationRequest::name].
268 ///
269 /// # Example
270 /// ```ignore,no_run
271 /// # use google_cloud_longrunning::model::GetOperationRequest;
272 /// let x = GetOperationRequest::new().set_name("example");
273 /// ```
274 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
275 self.name = v.into();
276 self
277 }
278}
279
280impl wkt::message::Message for GetOperationRequest {
281 fn typename() -> &'static str {
282 "type.googleapis.com/google.longrunning.GetOperationRequest"
283 }
284}
285
286/// The request message for
287/// [Operations.ListOperations][google.longrunning.Operations.ListOperations].
288///
289/// [google.longrunning.Operations.ListOperations]: crate::client::Operations::list_operations
290#[derive(Clone, Default, PartialEq)]
291#[non_exhaustive]
292pub struct ListOperationsRequest {
293 /// The name of the operation's parent resource.
294 pub name: std::string::String,
295
296 /// The standard list filter.
297 pub filter: std::string::String,
298
299 /// The standard list page size.
300 pub page_size: i32,
301
302 /// The standard list page token.
303 pub page_token: std::string::String,
304
305 /// When set to `true`, operations that are reachable are returned as normal,
306 /// and those that are unreachable are returned in the
307 /// [ListOperationsResponse.unreachable] field.
308 ///
309 /// This can only be `true` when reading across collections e.g. when `parent`
310 /// is set to `"projects/example/locations/-"`.
311 ///
312 /// This field is not by default supported and will result in an
313 /// `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
314 /// service or product specific documentation.
315 pub return_partial_success: bool,
316
317 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
318}
319
320impl ListOperationsRequest {
321 pub fn new() -> Self {
322 std::default::Default::default()
323 }
324
325 /// Sets the value of [name][crate::model::ListOperationsRequest::name].
326 ///
327 /// # Example
328 /// ```ignore,no_run
329 /// # use google_cloud_longrunning::model::ListOperationsRequest;
330 /// let x = ListOperationsRequest::new().set_name("example");
331 /// ```
332 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
333 self.name = v.into();
334 self
335 }
336
337 /// Sets the value of [filter][crate::model::ListOperationsRequest::filter].
338 ///
339 /// # Example
340 /// ```ignore,no_run
341 /// # use google_cloud_longrunning::model::ListOperationsRequest;
342 /// let x = ListOperationsRequest::new().set_filter("example");
343 /// ```
344 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
345 self.filter = v.into();
346 self
347 }
348
349 /// Sets the value of [page_size][crate::model::ListOperationsRequest::page_size].
350 ///
351 /// # Example
352 /// ```ignore,no_run
353 /// # use google_cloud_longrunning::model::ListOperationsRequest;
354 /// let x = ListOperationsRequest::new().set_page_size(42);
355 /// ```
356 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
357 self.page_size = v.into();
358 self
359 }
360
361 /// Sets the value of [page_token][crate::model::ListOperationsRequest::page_token].
362 ///
363 /// # Example
364 /// ```ignore,no_run
365 /// # use google_cloud_longrunning::model::ListOperationsRequest;
366 /// let x = ListOperationsRequest::new().set_page_token("example");
367 /// ```
368 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
369 self.page_token = v.into();
370 self
371 }
372
373 /// Sets the value of [return_partial_success][crate::model::ListOperationsRequest::return_partial_success].
374 ///
375 /// # Example
376 /// ```ignore,no_run
377 /// # use google_cloud_longrunning::model::ListOperationsRequest;
378 /// let x = ListOperationsRequest::new().set_return_partial_success(true);
379 /// ```
380 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
381 self.return_partial_success = v.into();
382 self
383 }
384}
385
386impl wkt::message::Message for ListOperationsRequest {
387 fn typename() -> &'static str {
388 "type.googleapis.com/google.longrunning.ListOperationsRequest"
389 }
390}
391
392/// The response message for
393/// [Operations.ListOperations][google.longrunning.Operations.ListOperations].
394///
395/// [google.longrunning.Operations.ListOperations]: crate::client::Operations::list_operations
396#[derive(Clone, Default, PartialEq)]
397#[non_exhaustive]
398pub struct ListOperationsResponse {
399 /// A list of operations that matches the specified filter in the request.
400 pub operations: std::vec::Vec<crate::model::Operation>,
401
402 /// The standard List next-page token.
403 pub next_page_token: std::string::String,
404
405 /// Unordered list. Unreachable resources. Populated when the request sets
406 /// `ListOperationsRequest.return_partial_success` and reads across
407 /// collections e.g. when attempting to list all resources across all supported
408 /// locations.
409 pub unreachable: std::vec::Vec<std::string::String>,
410
411 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
412}
413
414impl ListOperationsResponse {
415 pub fn new() -> Self {
416 std::default::Default::default()
417 }
418
419 /// Sets the value of [operations][crate::model::ListOperationsResponse::operations].
420 ///
421 /// # Example
422 /// ```ignore,no_run
423 /// # use google_cloud_longrunning::model::ListOperationsResponse;
424 /// use google_cloud_longrunning::model::Operation;
425 /// let x = ListOperationsResponse::new()
426 /// .set_operations([
427 /// Operation::default()/* use setters */,
428 /// Operation::default()/* use (different) setters */,
429 /// ]);
430 /// ```
431 pub fn set_operations<T, V>(mut self, v: T) -> Self
432 where
433 T: std::iter::IntoIterator<Item = V>,
434 V: std::convert::Into<crate::model::Operation>,
435 {
436 use std::iter::Iterator;
437 self.operations = v.into_iter().map(|i| i.into()).collect();
438 self
439 }
440
441 /// Sets the value of [next_page_token][crate::model::ListOperationsResponse::next_page_token].
442 ///
443 /// # Example
444 /// ```ignore,no_run
445 /// # use google_cloud_longrunning::model::ListOperationsResponse;
446 /// let x = ListOperationsResponse::new().set_next_page_token("example");
447 /// ```
448 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
449 self.next_page_token = v.into();
450 self
451 }
452
453 /// Sets the value of [unreachable][crate::model::ListOperationsResponse::unreachable].
454 ///
455 /// # Example
456 /// ```ignore,no_run
457 /// # use google_cloud_longrunning::model::ListOperationsResponse;
458 /// let x = ListOperationsResponse::new().set_unreachable(["a", "b", "c"]);
459 /// ```
460 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
461 where
462 T: std::iter::IntoIterator<Item = V>,
463 V: std::convert::Into<std::string::String>,
464 {
465 use std::iter::Iterator;
466 self.unreachable = v.into_iter().map(|i| i.into()).collect();
467 self
468 }
469}
470
471impl wkt::message::Message for ListOperationsResponse {
472 fn typename() -> &'static str {
473 "type.googleapis.com/google.longrunning.ListOperationsResponse"
474 }
475}
476
477#[doc(hidden)]
478impl gax::paginator::internal::PageableResponse for ListOperationsResponse {
479 type PageItem = crate::model::Operation;
480
481 fn items(self) -> std::vec::Vec<Self::PageItem> {
482 self.operations
483 }
484
485 fn next_page_token(&self) -> std::string::String {
486 use std::clone::Clone;
487 self.next_page_token.clone()
488 }
489}
490
491/// The request message for
492/// [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
493///
494/// [google.longrunning.Operations.CancelOperation]: crate::client::Operations::cancel_operation
495#[derive(Clone, Default, PartialEq)]
496#[non_exhaustive]
497pub struct CancelOperationRequest {
498 /// The name of the operation resource to be cancelled.
499 pub name: std::string::String,
500
501 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
502}
503
504impl CancelOperationRequest {
505 pub fn new() -> Self {
506 std::default::Default::default()
507 }
508
509 /// Sets the value of [name][crate::model::CancelOperationRequest::name].
510 ///
511 /// # Example
512 /// ```ignore,no_run
513 /// # use google_cloud_longrunning::model::CancelOperationRequest;
514 /// let x = CancelOperationRequest::new().set_name("example");
515 /// ```
516 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
517 self.name = v.into();
518 self
519 }
520}
521
522impl wkt::message::Message for CancelOperationRequest {
523 fn typename() -> &'static str {
524 "type.googleapis.com/google.longrunning.CancelOperationRequest"
525 }
526}
527
528/// The request message for
529/// [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
530///
531/// [google.longrunning.Operations.DeleteOperation]: crate::client::Operations::delete_operation
532#[derive(Clone, Default, PartialEq)]
533#[non_exhaustive]
534pub struct DeleteOperationRequest {
535 /// The name of the operation resource to be deleted.
536 pub name: std::string::String,
537
538 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
539}
540
541impl DeleteOperationRequest {
542 pub fn new() -> Self {
543 std::default::Default::default()
544 }
545
546 /// Sets the value of [name][crate::model::DeleteOperationRequest::name].
547 ///
548 /// # Example
549 /// ```ignore,no_run
550 /// # use google_cloud_longrunning::model::DeleteOperationRequest;
551 /// let x = DeleteOperationRequest::new().set_name("example");
552 /// ```
553 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
554 self.name = v.into();
555 self
556 }
557}
558
559impl wkt::message::Message for DeleteOperationRequest {
560 fn typename() -> &'static str {
561 "type.googleapis.com/google.longrunning.DeleteOperationRequest"
562 }
563}
564
565/// The request message for
566/// [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
567#[derive(Clone, Default, PartialEq)]
568#[non_exhaustive]
569pub struct WaitOperationRequest {
570 /// The name of the operation resource to wait on.
571 pub name: std::string::String,
572
573 /// The maximum duration to wait before timing out. If left blank, the wait
574 /// will be at most the time permitted by the underlying HTTP/RPC protocol.
575 /// If RPC context deadline is also specified, the shorter one will be used.
576 pub timeout: std::option::Option<wkt::Duration>,
577
578 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
579}
580
581impl WaitOperationRequest {
582 pub fn new() -> Self {
583 std::default::Default::default()
584 }
585
586 /// Sets the value of [name][crate::model::WaitOperationRequest::name].
587 ///
588 /// # Example
589 /// ```ignore,no_run
590 /// # use google_cloud_longrunning::model::WaitOperationRequest;
591 /// let x = WaitOperationRequest::new().set_name("example");
592 /// ```
593 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
594 self.name = v.into();
595 self
596 }
597
598 /// Sets the value of [timeout][crate::model::WaitOperationRequest::timeout].
599 ///
600 /// # Example
601 /// ```ignore,no_run
602 /// # use google_cloud_longrunning::model::WaitOperationRequest;
603 /// use wkt::Duration;
604 /// let x = WaitOperationRequest::new().set_timeout(Duration::default()/* use setters */);
605 /// ```
606 pub fn set_timeout<T>(mut self, v: T) -> Self
607 where
608 T: std::convert::Into<wkt::Duration>,
609 {
610 self.timeout = std::option::Option::Some(v.into());
611 self
612 }
613
614 /// Sets or clears the value of [timeout][crate::model::WaitOperationRequest::timeout].
615 ///
616 /// # Example
617 /// ```ignore,no_run
618 /// # use google_cloud_longrunning::model::WaitOperationRequest;
619 /// use wkt::Duration;
620 /// let x = WaitOperationRequest::new().set_or_clear_timeout(Some(Duration::default()/* use setters */));
621 /// let x = WaitOperationRequest::new().set_or_clear_timeout(None::<Duration>);
622 /// ```
623 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
624 where
625 T: std::convert::Into<wkt::Duration>,
626 {
627 self.timeout = v.map(|x| x.into());
628 self
629 }
630}
631
632impl wkt::message::Message for WaitOperationRequest {
633 fn typename() -> &'static str {
634 "type.googleapis.com/google.longrunning.WaitOperationRequest"
635 }
636}
637
638/// A message representing the message types used by a long-running operation.
639///
640/// Example:
641///
642/// ```norust
643/// rpc Export(ExportRequest) returns (google.longrunning.Operation) {
644/// option (google.longrunning.operation_info) = {
645/// response_type: "ExportResponse"
646/// metadata_type: "ExportMetadata"
647/// };
648/// }
649/// ```
650#[derive(Clone, Default, PartialEq)]
651#[non_exhaustive]
652pub struct OperationInfo {
653 /// Required. The message name of the primary return type for this
654 /// long-running operation.
655 /// This type will be used to deserialize the LRO's response.
656 ///
657 /// If the response is in a different package from the rpc, a fully-qualified
658 /// message name must be used (e.g. `google.protobuf.Struct`).
659 ///
660 /// Note: Altering this value constitutes a breaking change.
661 pub response_type: std::string::String,
662
663 /// Required. The message name of the metadata type for this long-running
664 /// operation.
665 ///
666 /// If the response is in a different package from the rpc, a fully-qualified
667 /// message name must be used (e.g. `google.protobuf.Struct`).
668 ///
669 /// Note: Altering this value constitutes a breaking change.
670 pub metadata_type: std::string::String,
671
672 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
673}
674
675impl OperationInfo {
676 pub fn new() -> Self {
677 std::default::Default::default()
678 }
679
680 /// Sets the value of [response_type][crate::model::OperationInfo::response_type].
681 ///
682 /// # Example
683 /// ```ignore,no_run
684 /// # use google_cloud_longrunning::model::OperationInfo;
685 /// let x = OperationInfo::new().set_response_type("example");
686 /// ```
687 pub fn set_response_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
688 self.response_type = v.into();
689 self
690 }
691
692 /// Sets the value of [metadata_type][crate::model::OperationInfo::metadata_type].
693 ///
694 /// # Example
695 /// ```ignore,no_run
696 /// # use google_cloud_longrunning::model::OperationInfo;
697 /// let x = OperationInfo::new().set_metadata_type("example");
698 /// ```
699 pub fn set_metadata_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
700 self.metadata_type = v.into();
701 self
702 }
703}
704
705impl wkt::message::Message for OperationInfo {
706 fn typename() -> &'static str {
707 "type.googleapis.com/google.longrunning.OperationInfo"
708 }
709}