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