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