google_cloud_common/
model.rs1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate bytes;
21extern crate serde;
22extern crate serde_json;
23extern crate serde_with;
24extern crate std;
25extern crate wkt;
26
27mod debug;
28mod deserialize;
29mod serialize;
30
31#[derive(Clone, Default, PartialEq)]
33#[non_exhaustive]
34pub struct OperationMetadata {
35 pub create_time: std::option::Option<wkt::Timestamp>,
37
38 pub end_time: std::option::Option<wkt::Timestamp>,
40
41 pub target: std::string::String,
43
44 pub verb: std::string::String,
46
47 pub status_detail: std::string::String,
49
50 pub cancel_requested: bool,
55
56 pub api_version: std::string::String,
58
59 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
60}
61
62impl OperationMetadata {
63 pub fn new() -> Self {
64 std::default::Default::default()
65 }
66
67 pub fn set_create_time<T>(mut self, v: T) -> Self
69 where
70 T: std::convert::Into<wkt::Timestamp>,
71 {
72 self.create_time = std::option::Option::Some(v.into());
73 self
74 }
75
76 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
78 where
79 T: std::convert::Into<wkt::Timestamp>,
80 {
81 self.create_time = v.map(|x| x.into());
82 self
83 }
84
85 pub fn set_end_time<T>(mut self, v: T) -> Self
87 where
88 T: std::convert::Into<wkt::Timestamp>,
89 {
90 self.end_time = std::option::Option::Some(v.into());
91 self
92 }
93
94 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
96 where
97 T: std::convert::Into<wkt::Timestamp>,
98 {
99 self.end_time = v.map(|x| x.into());
100 self
101 }
102
103 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
105 self.target = v.into();
106 self
107 }
108
109 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
111 self.verb = v.into();
112 self
113 }
114
115 pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
117 self.status_detail = v.into();
118 self
119 }
120
121 pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
123 self.cancel_requested = v.into();
124 self
125 }
126
127 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
129 self.api_version = v.into();
130 self
131 }
132}
133
134impl wkt::message::Message for OperationMetadata {
135 fn typename() -> &'static str {
136 "type.googleapis.com/google.cloud.common.OperationMetadata"
137 }
138}