Skip to main content

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