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    /// Creates a new default instance.
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    /// Creates a new default instance.
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]: google-cloud-longrunning::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    /// Creates a new default instance.
322    pub fn new() -> Self {
323        std::default::Default::default()
324    }
325
326    /// Sets the value of [name][crate::model::ListOperationsRequest::name].
327    ///
328    /// # Example
329    /// ```ignore,no_run
330    /// # use google_cloud_longrunning::model::ListOperationsRequest;
331    /// let x = ListOperationsRequest::new().set_name("example");
332    /// ```
333    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
334        self.name = v.into();
335        self
336    }
337
338    /// Sets the value of [filter][crate::model::ListOperationsRequest::filter].
339    ///
340    /// # Example
341    /// ```ignore,no_run
342    /// # use google_cloud_longrunning::model::ListOperationsRequest;
343    /// let x = ListOperationsRequest::new().set_filter("example");
344    /// ```
345    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
346        self.filter = v.into();
347        self
348    }
349
350    /// Sets the value of [page_size][crate::model::ListOperationsRequest::page_size].
351    ///
352    /// # Example
353    /// ```ignore,no_run
354    /// # use google_cloud_longrunning::model::ListOperationsRequest;
355    /// let x = ListOperationsRequest::new().set_page_size(42);
356    /// ```
357    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
358        self.page_size = v.into();
359        self
360    }
361
362    /// Sets the value of [page_token][crate::model::ListOperationsRequest::page_token].
363    ///
364    /// # Example
365    /// ```ignore,no_run
366    /// # use google_cloud_longrunning::model::ListOperationsRequest;
367    /// let x = ListOperationsRequest::new().set_page_token("example");
368    /// ```
369    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
370        self.page_token = v.into();
371        self
372    }
373
374    /// Sets the value of [return_partial_success][crate::model::ListOperationsRequest::return_partial_success].
375    ///
376    /// # Example
377    /// ```ignore,no_run
378    /// # use google_cloud_longrunning::model::ListOperationsRequest;
379    /// let x = ListOperationsRequest::new().set_return_partial_success(true);
380    /// ```
381    pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
382        self.return_partial_success = v.into();
383        self
384    }
385}
386
387impl wkt::message::Message for ListOperationsRequest {
388    fn typename() -> &'static str {
389        "type.googleapis.com/google.longrunning.ListOperationsRequest"
390    }
391}
392
393/// The response message for
394/// [Operations.ListOperations][google.longrunning.Operations.ListOperations].
395///
396/// [google.longrunning.Operations.ListOperations]: google-cloud-longrunning::client::Operations::list_operations
397#[derive(Clone, Default, PartialEq)]
398#[non_exhaustive]
399pub struct ListOperationsResponse {
400    /// A list of operations that matches the specified filter in the request.
401    pub operations: std::vec::Vec<crate::model::Operation>,
402
403    /// The standard List next-page token.
404    pub next_page_token: std::string::String,
405
406    /// Unordered list. Unreachable resources. Populated when the request sets
407    /// `ListOperationsRequest.return_partial_success` and reads across
408    /// collections e.g. when attempting to list all resources across all supported
409    /// locations.
410    pub unreachable: std::vec::Vec<std::string::String>,
411
412    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
413}
414
415impl ListOperationsResponse {
416    /// Creates a new default instance.
417    pub fn new() -> Self {
418        std::default::Default::default()
419    }
420
421    /// Sets the value of [operations][crate::model::ListOperationsResponse::operations].
422    ///
423    /// # Example
424    /// ```ignore,no_run
425    /// # use google_cloud_longrunning::model::ListOperationsResponse;
426    /// use google_cloud_longrunning::model::Operation;
427    /// let x = ListOperationsResponse::new()
428    ///     .set_operations([
429    ///         Operation::default()/* use setters */,
430    ///         Operation::default()/* use (different) setters */,
431    ///     ]);
432    /// ```
433    pub fn set_operations<T, V>(mut self, v: T) -> Self
434    where
435        T: std::iter::IntoIterator<Item = V>,
436        V: std::convert::Into<crate::model::Operation>,
437    {
438        use std::iter::Iterator;
439        self.operations = v.into_iter().map(|i| i.into()).collect();
440        self
441    }
442
443    /// Sets the value of [next_page_token][crate::model::ListOperationsResponse::next_page_token].
444    ///
445    /// # Example
446    /// ```ignore,no_run
447    /// # use google_cloud_longrunning::model::ListOperationsResponse;
448    /// let x = ListOperationsResponse::new().set_next_page_token("example");
449    /// ```
450    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
451        self.next_page_token = v.into();
452        self
453    }
454
455    /// Sets the value of [unreachable][crate::model::ListOperationsResponse::unreachable].
456    ///
457    /// # Example
458    /// ```ignore,no_run
459    /// # use google_cloud_longrunning::model::ListOperationsResponse;
460    /// let x = ListOperationsResponse::new().set_unreachable(["a", "b", "c"]);
461    /// ```
462    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
463    where
464        T: std::iter::IntoIterator<Item = V>,
465        V: std::convert::Into<std::string::String>,
466    {
467        use std::iter::Iterator;
468        self.unreachable = v.into_iter().map(|i| i.into()).collect();
469        self
470    }
471}
472
473impl wkt::message::Message for ListOperationsResponse {
474    fn typename() -> &'static str {
475        "type.googleapis.com/google.longrunning.ListOperationsResponse"
476    }
477}
478
479#[doc(hidden)]
480impl google_cloud_gax::paginator::internal::PageableResponse for ListOperationsResponse {
481    type PageItem = crate::model::Operation;
482
483    fn items(self) -> std::vec::Vec<Self::PageItem> {
484        self.operations
485    }
486
487    fn next_page_token(&self) -> std::string::String {
488        use std::clone::Clone;
489        self.next_page_token.clone()
490    }
491}
492
493/// The request message for
494/// [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
495///
496/// [google.longrunning.Operations.CancelOperation]: google-cloud-longrunning::client::Operations::cancel_operation
497#[derive(Clone, Default, PartialEq)]
498#[non_exhaustive]
499pub struct CancelOperationRequest {
500    /// The name of the operation resource to be cancelled.
501    pub name: std::string::String,
502
503    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
504}
505
506impl CancelOperationRequest {
507    /// Creates a new default instance.
508    pub fn new() -> Self {
509        std::default::Default::default()
510    }
511
512    /// Sets the value of [name][crate::model::CancelOperationRequest::name].
513    ///
514    /// # Example
515    /// ```ignore,no_run
516    /// # use google_cloud_longrunning::model::CancelOperationRequest;
517    /// let x = CancelOperationRequest::new().set_name("example");
518    /// ```
519    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
520        self.name = v.into();
521        self
522    }
523}
524
525impl wkt::message::Message for CancelOperationRequest {
526    fn typename() -> &'static str {
527        "type.googleapis.com/google.longrunning.CancelOperationRequest"
528    }
529}
530
531/// The request message for
532/// [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
533///
534/// [google.longrunning.Operations.DeleteOperation]: google-cloud-longrunning::client::Operations::delete_operation
535#[derive(Clone, Default, PartialEq)]
536#[non_exhaustive]
537pub struct DeleteOperationRequest {
538    /// The name of the operation resource to be deleted.
539    pub name: std::string::String,
540
541    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
542}
543
544impl DeleteOperationRequest {
545    /// Creates a new default instance.
546    pub fn new() -> Self {
547        std::default::Default::default()
548    }
549
550    /// Sets the value of [name][crate::model::DeleteOperationRequest::name].
551    ///
552    /// # Example
553    /// ```ignore,no_run
554    /// # use google_cloud_longrunning::model::DeleteOperationRequest;
555    /// let x = DeleteOperationRequest::new().set_name("example");
556    /// ```
557    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
558        self.name = v.into();
559        self
560    }
561}
562
563impl wkt::message::Message for DeleteOperationRequest {
564    fn typename() -> &'static str {
565        "type.googleapis.com/google.longrunning.DeleteOperationRequest"
566    }
567}
568
569/// The request message for
570/// [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
571#[derive(Clone, Default, PartialEq)]
572#[non_exhaustive]
573pub struct WaitOperationRequest {
574    /// The name of the operation resource to wait on.
575    pub name: std::string::String,
576
577    /// The maximum duration to wait before timing out. If left blank, the wait
578    /// will be at most the time permitted by the underlying HTTP/RPC protocol.
579    /// If RPC context deadline is also specified, the shorter one will be used.
580    pub timeout: std::option::Option<wkt::Duration>,
581
582    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
583}
584
585impl WaitOperationRequest {
586    /// Creates a new default instance.
587    pub fn new() -> Self {
588        std::default::Default::default()
589    }
590
591    /// Sets the value of [name][crate::model::WaitOperationRequest::name].
592    ///
593    /// # Example
594    /// ```ignore,no_run
595    /// # use google_cloud_longrunning::model::WaitOperationRequest;
596    /// let x = WaitOperationRequest::new().set_name("example");
597    /// ```
598    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
599        self.name = v.into();
600        self
601    }
602
603    /// Sets the value of [timeout][crate::model::WaitOperationRequest::timeout].
604    ///
605    /// # Example
606    /// ```ignore,no_run
607    /// # use google_cloud_longrunning::model::WaitOperationRequest;
608    /// use wkt::Duration;
609    /// let x = WaitOperationRequest::new().set_timeout(Duration::default()/* use setters */);
610    /// ```
611    pub fn set_timeout<T>(mut self, v: T) -> Self
612    where
613        T: std::convert::Into<wkt::Duration>,
614    {
615        self.timeout = std::option::Option::Some(v.into());
616        self
617    }
618
619    /// Sets or clears the value of [timeout][crate::model::WaitOperationRequest::timeout].
620    ///
621    /// # Example
622    /// ```ignore,no_run
623    /// # use google_cloud_longrunning::model::WaitOperationRequest;
624    /// use wkt::Duration;
625    /// let x = WaitOperationRequest::new().set_or_clear_timeout(Some(Duration::default()/* use setters */));
626    /// let x = WaitOperationRequest::new().set_or_clear_timeout(None::<Duration>);
627    /// ```
628    pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
629    where
630        T: std::convert::Into<wkt::Duration>,
631    {
632        self.timeout = v.map(|x| x.into());
633        self
634    }
635}
636
637impl wkt::message::Message for WaitOperationRequest {
638    fn typename() -> &'static str {
639        "type.googleapis.com/google.longrunning.WaitOperationRequest"
640    }
641}
642
643/// A message representing the message types used by a long-running operation.
644///
645/// Example:
646///
647/// ```norust
648/// rpc Export(ExportRequest) returns (google.longrunning.Operation) {
649///   option (google.longrunning.operation_info) = {
650///     response_type: "ExportResponse"
651///     metadata_type: "ExportMetadata"
652///   };
653/// }
654/// ```
655#[derive(Clone, Default, PartialEq)]
656#[non_exhaustive]
657pub struct OperationInfo {
658    /// Required. The message name of the primary return type for this
659    /// long-running operation.
660    /// This type will be used to deserialize the LRO's response.
661    ///
662    /// If the response is in a different package from the rpc, a fully-qualified
663    /// message name must be used (e.g. `google.protobuf.Struct`).
664    ///
665    /// Note: Altering this value constitutes a breaking change.
666    pub response_type: std::string::String,
667
668    /// Required. The message name of the metadata type for this long-running
669    /// operation.
670    ///
671    /// If the response is in a different package from the rpc, a fully-qualified
672    /// message name must be used (e.g. `google.protobuf.Struct`).
673    ///
674    /// Note: Altering this value constitutes a breaking change.
675    pub metadata_type: std::string::String,
676
677    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
678}
679
680impl OperationInfo {
681    /// Creates a new default instance.
682    pub fn new() -> Self {
683        std::default::Default::default()
684    }
685
686    /// Sets the value of [response_type][crate::model::OperationInfo::response_type].
687    ///
688    /// # Example
689    /// ```ignore,no_run
690    /// # use google_cloud_longrunning::model::OperationInfo;
691    /// let x = OperationInfo::new().set_response_type("example");
692    /// ```
693    pub fn set_response_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
694        self.response_type = v.into();
695        self
696    }
697
698    /// Sets the value of [metadata_type][crate::model::OperationInfo::metadata_type].
699    ///
700    /// # Example
701    /// ```ignore,no_run
702    /// # use google_cloud_longrunning::model::OperationInfo;
703    /// let x = OperationInfo::new().set_metadata_type("example");
704    /// ```
705    pub fn set_metadata_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
706        self.metadata_type = v.into();
707        self
708    }
709}
710
711impl wkt::message::Message for OperationInfo {
712    fn typename() -> &'static str {
713        "type.googleapis.com/google.longrunning.OperationInfo"
714    }
715}