satstream_rust_sdk/models/
github_com_satstream_ss_utils_rpc_block.rs1#[allow(unused_imports)]
13use serde_json::Value;
14
15#[derive(Debug, Serialize, Deserialize)]
16pub struct GithubComSatstreamSsUtilsRpcBlock {
17 #[serde(rename = "bits")]
18 bits: Option<String>,
19 #[serde(rename = "chainwork")]
20 chainwork: Option<String>,
21 #[serde(rename = "confirmations")]
22 confirmations: Option<i32>,
23 #[serde(rename = "difficulty")]
24 difficulty: Option<f32>,
25 #[serde(rename = "hash")]
26 hash: Option<String>,
27 #[serde(rename = "height")]
28 height: Option<i32>,
29 #[serde(rename = "mediantime")]
30 mediantime: Option<i32>,
31 #[serde(rename = "merkleroot")]
32 merkleroot: Option<String>,
33 #[serde(rename = "nTx")]
34 n_tx: Option<i32>,
35 #[serde(rename = "nonce")]
36 nonce: Option<i32>,
37 #[serde(rename = "previousblockhash")]
38 previousblockhash: Option<String>,
39 #[serde(rename = "size")]
40 size: Option<i32>,
41 #[serde(rename = "strippedSize")]
42 stripped_size: Option<i32>,
43 #[serde(rename = "time")]
44 time: Option<i32>,
45 #[serde(rename = "tx")]
47 tx: Option<Vec<::models::GithubComSatstreamSsUtilsRpcBtcTx>>,
48 #[serde(rename = "version")]
49 version: Option<i32>,
50 #[serde(rename = "versionHex")]
51 version_hex: Option<String>,
52 #[serde(rename = "weight")]
53 weight: Option<i32>
54}
55
56impl GithubComSatstreamSsUtilsRpcBlock {
57 pub fn new() -> GithubComSatstreamSsUtilsRpcBlock {
58 GithubComSatstreamSsUtilsRpcBlock {
59 bits: None,
60 chainwork: None,
61 confirmations: None,
62 difficulty: None,
63 hash: None,
64 height: None,
65 mediantime: None,
66 merkleroot: None,
67 n_tx: None,
68 nonce: None,
69 previousblockhash: None,
70 size: None,
71 stripped_size: None,
72 time: None,
73 tx: None,
74 version: None,
75 version_hex: None,
76 weight: None
77 }
78 }
79
80 pub fn set_bits(&mut self, bits: String) {
81 self.bits = Some(bits);
82 }
83
84 pub fn with_bits(mut self, bits: String) -> GithubComSatstreamSsUtilsRpcBlock {
85 self.bits = Some(bits);
86 self
87 }
88
89 pub fn bits(&self) -> Option<&String> {
90 self.bits.as_ref()
91 }
92
93 pub fn reset_bits(&mut self) {
94 self.bits = None;
95 }
96
97 pub fn set_chainwork(&mut self, chainwork: String) {
98 self.chainwork = Some(chainwork);
99 }
100
101 pub fn with_chainwork(mut self, chainwork: String) -> GithubComSatstreamSsUtilsRpcBlock {
102 self.chainwork = Some(chainwork);
103 self
104 }
105
106 pub fn chainwork(&self) -> Option<&String> {
107 self.chainwork.as_ref()
108 }
109
110 pub fn reset_chainwork(&mut self) {
111 self.chainwork = None;
112 }
113
114 pub fn set_confirmations(&mut self, confirmations: i32) {
115 self.confirmations = Some(confirmations);
116 }
117
118 pub fn with_confirmations(mut self, confirmations: i32) -> GithubComSatstreamSsUtilsRpcBlock {
119 self.confirmations = Some(confirmations);
120 self
121 }
122
123 pub fn confirmations(&self) -> Option<&i32> {
124 self.confirmations.as_ref()
125 }
126
127 pub fn reset_confirmations(&mut self) {
128 self.confirmations = None;
129 }
130
131 pub fn set_difficulty(&mut self, difficulty: f32) {
132 self.difficulty = Some(difficulty);
133 }
134
135 pub fn with_difficulty(mut self, difficulty: f32) -> GithubComSatstreamSsUtilsRpcBlock {
136 self.difficulty = Some(difficulty);
137 self
138 }
139
140 pub fn difficulty(&self) -> Option<&f32> {
141 self.difficulty.as_ref()
142 }
143
144 pub fn reset_difficulty(&mut self) {
145 self.difficulty = None;
146 }
147
148 pub fn set_hash(&mut self, hash: String) {
149 self.hash = Some(hash);
150 }
151
152 pub fn with_hash(mut self, hash: String) -> GithubComSatstreamSsUtilsRpcBlock {
153 self.hash = Some(hash);
154 self
155 }
156
157 pub fn hash(&self) -> Option<&String> {
158 self.hash.as_ref()
159 }
160
161 pub fn reset_hash(&mut self) {
162 self.hash = None;
163 }
164
165 pub fn set_height(&mut self, height: i32) {
166 self.height = Some(height);
167 }
168
169 pub fn with_height(mut self, height: i32) -> GithubComSatstreamSsUtilsRpcBlock {
170 self.height = Some(height);
171 self
172 }
173
174 pub fn height(&self) -> Option<&i32> {
175 self.height.as_ref()
176 }
177
178 pub fn reset_height(&mut self) {
179 self.height = None;
180 }
181
182 pub fn set_mediantime(&mut self, mediantime: i32) {
183 self.mediantime = Some(mediantime);
184 }
185
186 pub fn with_mediantime(mut self, mediantime: i32) -> GithubComSatstreamSsUtilsRpcBlock {
187 self.mediantime = Some(mediantime);
188 self
189 }
190
191 pub fn mediantime(&self) -> Option<&i32> {
192 self.mediantime.as_ref()
193 }
194
195 pub fn reset_mediantime(&mut self) {
196 self.mediantime = None;
197 }
198
199 pub fn set_merkleroot(&mut self, merkleroot: String) {
200 self.merkleroot = Some(merkleroot);
201 }
202
203 pub fn with_merkleroot(mut self, merkleroot: String) -> GithubComSatstreamSsUtilsRpcBlock {
204 self.merkleroot = Some(merkleroot);
205 self
206 }
207
208 pub fn merkleroot(&self) -> Option<&String> {
209 self.merkleroot.as_ref()
210 }
211
212 pub fn reset_merkleroot(&mut self) {
213 self.merkleroot = None;
214 }
215
216 pub fn set_n_tx(&mut self, n_tx: i32) {
217 self.n_tx = Some(n_tx);
218 }
219
220 pub fn with_n_tx(mut self, n_tx: i32) -> GithubComSatstreamSsUtilsRpcBlock {
221 self.n_tx = Some(n_tx);
222 self
223 }
224
225 pub fn n_tx(&self) -> Option<&i32> {
226 self.n_tx.as_ref()
227 }
228
229 pub fn reset_n_tx(&mut self) {
230 self.n_tx = None;
231 }
232
233 pub fn set_nonce(&mut self, nonce: i32) {
234 self.nonce = Some(nonce);
235 }
236
237 pub fn with_nonce(mut self, nonce: i32) -> GithubComSatstreamSsUtilsRpcBlock {
238 self.nonce = Some(nonce);
239 self
240 }
241
242 pub fn nonce(&self) -> Option<&i32> {
243 self.nonce.as_ref()
244 }
245
246 pub fn reset_nonce(&mut self) {
247 self.nonce = None;
248 }
249
250 pub fn set_previousblockhash(&mut self, previousblockhash: String) {
251 self.previousblockhash = Some(previousblockhash);
252 }
253
254 pub fn with_previousblockhash(mut self, previousblockhash: String) -> GithubComSatstreamSsUtilsRpcBlock {
255 self.previousblockhash = Some(previousblockhash);
256 self
257 }
258
259 pub fn previousblockhash(&self) -> Option<&String> {
260 self.previousblockhash.as_ref()
261 }
262
263 pub fn reset_previousblockhash(&mut self) {
264 self.previousblockhash = None;
265 }
266
267 pub fn set_size(&mut self, size: i32) {
268 self.size = Some(size);
269 }
270
271 pub fn with_size(mut self, size: i32) -> GithubComSatstreamSsUtilsRpcBlock {
272 self.size = Some(size);
273 self
274 }
275
276 pub fn size(&self) -> Option<&i32> {
277 self.size.as_ref()
278 }
279
280 pub fn reset_size(&mut self) {
281 self.size = None;
282 }
283
284 pub fn set_stripped_size(&mut self, stripped_size: i32) {
285 self.stripped_size = Some(stripped_size);
286 }
287
288 pub fn with_stripped_size(mut self, stripped_size: i32) -> GithubComSatstreamSsUtilsRpcBlock {
289 self.stripped_size = Some(stripped_size);
290 self
291 }
292
293 pub fn stripped_size(&self) -> Option<&i32> {
294 self.stripped_size.as_ref()
295 }
296
297 pub fn reset_stripped_size(&mut self) {
298 self.stripped_size = None;
299 }
300
301 pub fn set_time(&mut self, time: i32) {
302 self.time = Some(time);
303 }
304
305 pub fn with_time(mut self, time: i32) -> GithubComSatstreamSsUtilsRpcBlock {
306 self.time = Some(time);
307 self
308 }
309
310 pub fn time(&self) -> Option<&i32> {
311 self.time.as_ref()
312 }
313
314 pub fn reset_time(&mut self) {
315 self.time = None;
316 }
317
318 pub fn set_tx(&mut self, tx: Vec<::models::GithubComSatstreamSsUtilsRpcBtcTx>) {
319 self.tx = Some(tx);
320 }
321
322 pub fn with_tx(mut self, tx: Vec<::models::GithubComSatstreamSsUtilsRpcBtcTx>) -> GithubComSatstreamSsUtilsRpcBlock {
323 self.tx = Some(tx);
324 self
325 }
326
327 pub fn tx(&self) -> Option<&Vec<::models::GithubComSatstreamSsUtilsRpcBtcTx>> {
328 self.tx.as_ref()
329 }
330
331 pub fn reset_tx(&mut self) {
332 self.tx = None;
333 }
334
335 pub fn set_version(&mut self, version: i32) {
336 self.version = Some(version);
337 }
338
339 pub fn with_version(mut self, version: i32) -> GithubComSatstreamSsUtilsRpcBlock {
340 self.version = Some(version);
341 self
342 }
343
344 pub fn version(&self) -> Option<&i32> {
345 self.version.as_ref()
346 }
347
348 pub fn reset_version(&mut self) {
349 self.version = None;
350 }
351
352 pub fn set_version_hex(&mut self, version_hex: String) {
353 self.version_hex = Some(version_hex);
354 }
355
356 pub fn with_version_hex(mut self, version_hex: String) -> GithubComSatstreamSsUtilsRpcBlock {
357 self.version_hex = Some(version_hex);
358 self
359 }
360
361 pub fn version_hex(&self) -> Option<&String> {
362 self.version_hex.as_ref()
363 }
364
365 pub fn reset_version_hex(&mut self) {
366 self.version_hex = None;
367 }
368
369 pub fn set_weight(&mut self, weight: i32) {
370 self.weight = Some(weight);
371 }
372
373 pub fn with_weight(mut self, weight: i32) -> GithubComSatstreamSsUtilsRpcBlock {
374 self.weight = Some(weight);
375 self
376 }
377
378 pub fn weight(&self) -> Option<&i32> {
379 self.weight.as_ref()
380 }
381
382 pub fn reset_weight(&mut self) {
383 self.weight = None;
384 }
385
386}
387
388
389