space_traders/apis/
systems_api.rs

1//!
2//!
3//! Generated by: <https://openapi-generator.tech>
4//!
5//! Version of specification: `2.0.0`
6
7use reqwest::StatusCode;
8
9use super::{configuration, Error};
10use crate::apis::ResponseContent;
11
12/// Enum for successes of method [`get_jump_gate`].
13#[derive(Debug, Clone)]
14pub enum GetJumpGateSuccess {
15    /// Response for status code 200.
16    Status200(crate::models::GetJumpGate200Response),
17}
18
19impl GetJumpGateSuccess {
20    fn from_body(status: StatusCode, body: &str) -> Option<serde_json::Result<Self>> {
21        // Attempt to deserialize the response for the given status code.
22        match status.as_u16() {
23            200 => Some(match serde_json::from_str(body) {
24                Ok(data) => Ok(Self::Status200(data)),
25                Err(err) => Err(err),
26            }),
27            _ => None,
28        }
29    }
30}
31
32/// Enum for successes of method [`get_market`].
33#[derive(Debug, Clone)]
34pub enum GetMarketSuccess {
35    /// Response for status code 200.
36    Status200(crate::models::GetMarket200Response),
37}
38
39impl GetMarketSuccess {
40    fn from_body(status: StatusCode, body: &str) -> Option<serde_json::Result<Self>> {
41        // Attempt to deserialize the response for the given status code.
42        match status.as_u16() {
43            200 => Some(match serde_json::from_str(body) {
44                Ok(data) => Ok(Self::Status200(data)),
45                Err(err) => Err(err),
46            }),
47            _ => None,
48        }
49    }
50}
51
52/// Enum for successes of method [`get_shipyard`].
53#[derive(Debug, Clone)]
54pub enum GetShipyardSuccess {
55    /// Response for status code 200.
56    Status200(crate::models::GetShipyard200Response),
57}
58
59impl GetShipyardSuccess {
60    fn from_body(status: StatusCode, body: &str) -> Option<serde_json::Result<Self>> {
61        // Attempt to deserialize the response for the given status code.
62        match status.as_u16() {
63            200 => Some(match serde_json::from_str(body) {
64                Ok(data) => Ok(Self::Status200(data)),
65                Err(err) => Err(err),
66            }),
67            _ => None,
68        }
69    }
70}
71
72/// Enum for successes of method [`get_system`].
73#[derive(Debug, Clone)]
74pub enum GetSystemSuccess {
75    /// Response for status code 200.
76    Status200(crate::models::GetSystem200Response),
77}
78
79impl GetSystemSuccess {
80    fn from_body(status: StatusCode, body: &str) -> Option<serde_json::Result<Self>> {
81        // Attempt to deserialize the response for the given status code.
82        match status.as_u16() {
83            200 => Some(match serde_json::from_str(body) {
84                Ok(data) => Ok(Self::Status200(data)),
85                Err(err) => Err(err),
86            }),
87            _ => None,
88        }
89    }
90}
91
92/// Enum for successes of method [`get_system_waypoints`].
93#[derive(Debug, Clone)]
94pub enum GetSystemWaypointsSuccess {
95    /// Response for status code 200.
96    Status200(crate::models::GetSystemWaypoints200Response),
97}
98
99impl GetSystemWaypointsSuccess {
100    fn from_body(status: StatusCode, body: &str) -> Option<serde_json::Result<Self>> {
101        // Attempt to deserialize the response for the given status code.
102        match status.as_u16() {
103            200 => Some(match serde_json::from_str(body) {
104                Ok(data) => Ok(Self::Status200(data)),
105                Err(err) => Err(err),
106            }),
107            _ => None,
108        }
109    }
110}
111
112/// Enum for successes of method [`get_systems`].
113#[derive(Debug, Clone)]
114pub enum GetSystemsSuccess {
115    /// Response for status code 200.
116    Status200(crate::models::GetSystems200Response),
117}
118
119impl GetSystemsSuccess {
120    fn from_body(status: StatusCode, body: &str) -> Option<serde_json::Result<Self>> {
121        // Attempt to deserialize the response for the given status code.
122        match status.as_u16() {
123            200 => Some(match serde_json::from_str(body) {
124                Ok(data) => Ok(Self::Status200(data)),
125                Err(err) => Err(err),
126            }),
127            _ => None,
128        }
129    }
130}
131
132/// Enum for successes of method [`get_waypoint`].
133#[derive(Debug, Clone)]
134pub enum GetWaypointSuccess {
135    /// Response for status code 200.
136    Status200(crate::models::GetWaypoint200Response),
137}
138
139impl GetWaypointSuccess {
140    fn from_body(status: StatusCode, body: &str) -> Option<serde_json::Result<Self>> {
141        // Attempt to deserialize the response for the given status code.
142        match status.as_u16() {
143            200 => Some(match serde_json::from_str(body) {
144                Ok(data) => Ok(Self::Status200(data)),
145                Err(err) => Err(err),
146            }),
147            _ => None,
148        }
149    }
150}
151
152/// Enum for known errors of method [`get_jump_gate`].
153#[derive(Debug, Clone)]
154pub enum GetJumpGateError {}
155
156impl GetJumpGateError {
157    #[allow(unused_variables, clippy::match_single_binding)]
158    fn from_body(status: StatusCode, body: &str) -> Option<serde_json::Result<Self>> {
159        // Attempt to deserialize the response for the given status code.
160        match status.as_u16() {
161            _ => None,
162        }
163    }
164}
165
166/// Enum for known errors of method [`get_market`].
167#[derive(Debug, Clone)]
168pub enum GetMarketError {}
169
170impl GetMarketError {
171    #[allow(unused_variables, clippy::match_single_binding)]
172    fn from_body(status: StatusCode, body: &str) -> Option<serde_json::Result<Self>> {
173        // Attempt to deserialize the response for the given status code.
174        match status.as_u16() {
175            _ => None,
176        }
177    }
178}
179
180/// Enum for known errors of method [`get_shipyard`].
181#[derive(Debug, Clone)]
182pub enum GetShipyardError {}
183
184impl GetShipyardError {
185    #[allow(unused_variables, clippy::match_single_binding)]
186    fn from_body(status: StatusCode, body: &str) -> Option<serde_json::Result<Self>> {
187        // Attempt to deserialize the response for the given status code.
188        match status.as_u16() {
189            _ => None,
190        }
191    }
192}
193
194/// Enum for known errors of method [`get_system`].
195#[derive(Debug, Clone)]
196pub enum GetSystemError {}
197
198impl GetSystemError {
199    #[allow(unused_variables, clippy::match_single_binding)]
200    fn from_body(status: StatusCode, body: &str) -> Option<serde_json::Result<Self>> {
201        // Attempt to deserialize the response for the given status code.
202        match status.as_u16() {
203            _ => None,
204        }
205    }
206}
207
208/// Enum for known errors of method [`get_system_waypoints`].
209#[derive(Debug, Clone)]
210pub enum GetSystemWaypointsError {}
211
212impl GetSystemWaypointsError {
213    #[allow(unused_variables, clippy::match_single_binding)]
214    fn from_body(status: StatusCode, body: &str) -> Option<serde_json::Result<Self>> {
215        // Attempt to deserialize the response for the given status code.
216        match status.as_u16() {
217            _ => None,
218        }
219    }
220}
221
222/// Enum for known errors of method [`get_systems`].
223#[derive(Debug, Clone)]
224pub enum GetSystemsError {}
225
226impl GetSystemsError {
227    #[allow(unused_variables, clippy::match_single_binding)]
228    fn from_body(status: StatusCode, body: &str) -> Option<serde_json::Result<Self>> {
229        // Attempt to deserialize the response for the given status code.
230        match status.as_u16() {
231            _ => None,
232        }
233    }
234}
235
236/// Enum for known errors of method [`get_waypoint`].
237#[derive(Debug, Clone)]
238pub enum GetWaypointError {}
239
240impl GetWaypointError {
241    #[allow(unused_variables, clippy::match_single_binding)]
242    fn from_body(status: StatusCode, body: &str) -> Option<serde_json::Result<Self>> {
243        // Attempt to deserialize the response for the given status code.
244        match status.as_u16() {
245            _ => None,
246        }
247    }
248}
249
250/// Get jump gate details for a waypoint. Requires a waypoint of type `JUMP_GATE` to use.  The response will return all systems that are have a Jump Gate in range of this Jump Gate. Those systems can be jumped to from this Jump Gate.
251pub async fn get_jump_gate(
252    configuration: &configuration::Configuration,
253    system_symbol: &str,
254    waypoint_symbol: &str,
255) -> Result<ResponseContent<GetJumpGateSuccess>, Error<GetJumpGateError>> {
256    let client = &configuration.client;
257
258    // Create the request from a path.
259    // Make sure to url encode any user given text.
260    let uri_str = format!(
261        "{}/systems/{systemSymbol}/waypoints/{waypointSymbol}/jump-gate",
262        configuration.base_path,
263        systemSymbol = crate::apis::urlencode(system_symbol),
264        waypointSymbol = crate::apis::urlencode(waypoint_symbol)
265    );
266    let mut req_builder = client.request(reqwest::Method::GET, &uri_str);
267
268    // === Add headers to request ===
269
270    // Set the user agent string if given.
271    if let Some(user_agent) = &configuration.user_agent {
272        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
273    }
274
275    // === Add auth to request ===
276
277    if let Some(token) = &configuration.bearer_access_token {
278        req_builder = req_builder.bearer_auth(token.to_owned());
279    };
280
281    // === Request is built.
282
283    // Execute the request.
284    let req = req_builder.build()?;
285    let resp = client.execute(req).await?;
286
287    // Get the response.
288    let status = resp.status();
289    let response_body = resp.text().await?;
290
291    if !status.is_client_error() && !status.is_server_error() {
292        // Try to parse the OK response.
293        match GetJumpGateSuccess::from_body(status, &response_body) {
294            Some(Ok(content)) => Ok(ResponseContent {
295                status,
296                response_body,
297                content,
298            }),
299            Some(Err(err)) => Err(err.into()),
300            None => Err(Error::UnknownResponse {
301                status,
302                is_error: false,
303                response_body,
304            }),
305        }
306    } else {
307        // Try to parse the Err response.
308        match GetJumpGateError::from_body(status, &response_body) {
309            Some(Ok(content)) => Err(Error::ResponseError(ResponseContent {
310                status,
311                response_body,
312                content,
313            })),
314            Some(Err(err)) => Err(err.into()),
315            None => Err(Error::UnknownResponse {
316                status,
317                is_error: true,
318                response_body,
319            }),
320        }
321    }
322}
323
324/// Retrieve imports, exports and exchange data from a marketplace. Requires a waypoint that has the `Marketplace` trait to use.  Send a ship to the waypoint to access trade good prices and recent transactions. Refer to the [Market Overview page](https://docs.spacetraders.io/game-concepts/markets) to gain better a understanding of the market in the game.
325pub async fn get_market(
326    configuration: &configuration::Configuration,
327    system_symbol: &str,
328    waypoint_symbol: &str,
329) -> Result<ResponseContent<GetMarketSuccess>, Error<GetMarketError>> {
330    let client = &configuration.client;
331
332    // Create the request from a path.
333    // Make sure to url encode any user given text.
334    let uri_str = format!(
335        "{}/systems/{systemSymbol}/waypoints/{waypointSymbol}/market",
336        configuration.base_path,
337        systemSymbol = crate::apis::urlencode(system_symbol),
338        waypointSymbol = crate::apis::urlencode(waypoint_symbol)
339    );
340    let mut req_builder = client.request(reqwest::Method::GET, &uri_str);
341
342    // === Add headers to request ===
343
344    // Set the user agent string if given.
345    if let Some(user_agent) = &configuration.user_agent {
346        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
347    }
348
349    // === Add auth to request ===
350
351    if let Some(token) = &configuration.bearer_access_token {
352        req_builder = req_builder.bearer_auth(token.to_owned());
353    };
354
355    // === Request is built.
356
357    // Execute the request.
358    let req = req_builder.build()?;
359    let resp = client.execute(req).await?;
360
361    // Get the response.
362    let status = resp.status();
363    let response_body = resp.text().await?;
364
365    if !status.is_client_error() && !status.is_server_error() {
366        // Try to parse the OK response.
367        match GetMarketSuccess::from_body(status, &response_body) {
368            Some(Ok(content)) => Ok(ResponseContent {
369                status,
370                response_body,
371                content,
372            }),
373            Some(Err(err)) => Err(err.into()),
374            None => Err(Error::UnknownResponse {
375                status,
376                is_error: false,
377                response_body,
378            }),
379        }
380    } else {
381        // Try to parse the Err response.
382        match GetMarketError::from_body(status, &response_body) {
383            Some(Ok(content)) => Err(Error::ResponseError(ResponseContent {
384                status,
385                response_body,
386                content,
387            })),
388            Some(Err(err)) => Err(err.into()),
389            None => Err(Error::UnknownResponse {
390                status,
391                is_error: true,
392                response_body,
393            }),
394        }
395    }
396}
397
398/// Get the shipyard for a waypoint. Requires a waypoint that has the `Shipyard` trait to use. Send a ship to the waypoint to access data on ships that are currently available for purchase and recent transactions.
399pub async fn get_shipyard(
400    configuration: &configuration::Configuration,
401    system_symbol: &str,
402    waypoint_symbol: &str,
403) -> Result<ResponseContent<GetShipyardSuccess>, Error<GetShipyardError>> {
404    let client = &configuration.client;
405
406    // Create the request from a path.
407    // Make sure to url encode any user given text.
408    let uri_str = format!(
409        "{}/systems/{systemSymbol}/waypoints/{waypointSymbol}/shipyard",
410        configuration.base_path,
411        systemSymbol = crate::apis::urlencode(system_symbol),
412        waypointSymbol = crate::apis::urlencode(waypoint_symbol)
413    );
414    let mut req_builder = client.request(reqwest::Method::GET, &uri_str);
415
416    // === Add headers to request ===
417
418    // Set the user agent string if given.
419    if let Some(user_agent) = &configuration.user_agent {
420        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
421    }
422
423    // === Add auth to request ===
424
425    if let Some(token) = &configuration.bearer_access_token {
426        req_builder = req_builder.bearer_auth(token.to_owned());
427    };
428
429    // === Request is built.
430
431    // Execute the request.
432    let req = req_builder.build()?;
433    let resp = client.execute(req).await?;
434
435    // Get the response.
436    let status = resp.status();
437    let response_body = resp.text().await?;
438
439    if !status.is_client_error() && !status.is_server_error() {
440        // Try to parse the OK response.
441        match GetShipyardSuccess::from_body(status, &response_body) {
442            Some(Ok(content)) => Ok(ResponseContent {
443                status,
444                response_body,
445                content,
446            }),
447            Some(Err(err)) => Err(err.into()),
448            None => Err(Error::UnknownResponse {
449                status,
450                is_error: false,
451                response_body,
452            }),
453        }
454    } else {
455        // Try to parse the Err response.
456        match GetShipyardError::from_body(status, &response_body) {
457            Some(Ok(content)) => Err(Error::ResponseError(ResponseContent {
458                status,
459                response_body,
460                content,
461            })),
462            Some(Err(err)) => Err(err.into()),
463            None => Err(Error::UnknownResponse {
464                status,
465                is_error: true,
466                response_body,
467            }),
468        }
469    }
470}
471
472/// Get the details of a system.
473pub async fn get_system(
474    configuration: &configuration::Configuration,
475    system_symbol: &str,
476) -> Result<ResponseContent<GetSystemSuccess>, Error<GetSystemError>> {
477    let client = &configuration.client;
478
479    // Create the request from a path.
480    // Make sure to url encode any user given text.
481    let uri_str = format!(
482        "{}/systems/{systemSymbol}",
483        configuration.base_path,
484        systemSymbol = crate::apis::urlencode(system_symbol)
485    );
486    let mut req_builder = client.request(reqwest::Method::GET, &uri_str);
487
488    // === Add headers to request ===
489
490    // Set the user agent string if given.
491    if let Some(user_agent) = &configuration.user_agent {
492        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
493    }
494
495    // === Add auth to request ===
496
497    if let Some(token) = &configuration.bearer_access_token {
498        req_builder = req_builder.bearer_auth(token.to_owned());
499    };
500
501    // === Request is built.
502
503    // Execute the request.
504    let req = req_builder.build()?;
505    let resp = client.execute(req).await?;
506
507    // Get the response.
508    let status = resp.status();
509    let response_body = resp.text().await?;
510
511    if !status.is_client_error() && !status.is_server_error() {
512        // Try to parse the OK response.
513        match GetSystemSuccess::from_body(status, &response_body) {
514            Some(Ok(content)) => Ok(ResponseContent {
515                status,
516                response_body,
517                content,
518            }),
519            Some(Err(err)) => Err(err.into()),
520            None => Err(Error::UnknownResponse {
521                status,
522                is_error: false,
523                response_body,
524            }),
525        }
526    } else {
527        // Try to parse the Err response.
528        match GetSystemError::from_body(status, &response_body) {
529            Some(Ok(content)) => Err(Error::ResponseError(ResponseContent {
530                status,
531                response_body,
532                content,
533            })),
534            Some(Err(err)) => Err(err.into()),
535            None => Err(Error::UnknownResponse {
536                status,
537                is_error: true,
538                response_body,
539            }),
540        }
541    }
542}
543
544/// Return a paginated list of all of the waypoints for a given system.  If a waypoint is uncharted, it will return the `Uncharted` trait instead of its actual traits.
545pub async fn get_system_waypoints(
546    configuration: &configuration::Configuration,
547    system_symbol: &str,
548    page: Option<u32>,
549    limit: Option<u32>,
550) -> Result<ResponseContent<GetSystemWaypointsSuccess>, Error<GetSystemWaypointsError>> {
551    let client = &configuration.client;
552
553    // Create the request from a path.
554    // Make sure to url encode any user given text.
555    let uri_str = format!(
556        "{}/systems/{systemSymbol}/waypoints",
557        configuration.base_path,
558        systemSymbol = crate::apis::urlencode(system_symbol)
559    );
560    let mut req_builder = client.request(reqwest::Method::GET, &uri_str);
561
562    // === Add queries to request ===
563
564    if let Some(s) = &page {
565        req_builder = req_builder.query(&[("page", &s.to_string())]);
566    }
567    // === Add queries to request ===
568
569    if let Some(s) = &limit {
570        req_builder = req_builder.query(&[("limit", &s.to_string())]);
571    }
572
573    // === Add headers to request ===
574
575    // Set the user agent string if given.
576    if let Some(user_agent) = &configuration.user_agent {
577        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
578    }
579
580    // === Add auth to request ===
581
582    if let Some(token) = &configuration.bearer_access_token {
583        req_builder = req_builder.bearer_auth(token.to_owned());
584    };
585
586    // === Request is built.
587
588    // Execute the request.
589    let req = req_builder.build()?;
590    let resp = client.execute(req).await?;
591
592    // Get the response.
593    let status = resp.status();
594    let response_body = resp.text().await?;
595
596    if !status.is_client_error() && !status.is_server_error() {
597        // Try to parse the OK response.
598        match GetSystemWaypointsSuccess::from_body(status, &response_body) {
599            Some(Ok(content)) => Ok(ResponseContent {
600                status,
601                response_body,
602                content,
603            }),
604            Some(Err(err)) => Err(err.into()),
605            None => Err(Error::UnknownResponse {
606                status,
607                is_error: false,
608                response_body,
609            }),
610        }
611    } else {
612        // Try to parse the Err response.
613        match GetSystemWaypointsError::from_body(status, &response_body) {
614            Some(Ok(content)) => Err(Error::ResponseError(ResponseContent {
615                status,
616                response_body,
617                content,
618            })),
619            Some(Err(err)) => Err(err.into()),
620            None => Err(Error::UnknownResponse {
621                status,
622                is_error: true,
623                response_body,
624            }),
625        }
626    }
627}
628
629/// Return a paginated list of all systems.
630pub async fn get_systems(
631    configuration: &configuration::Configuration,
632    page: Option<u32>,
633    limit: Option<u32>,
634) -> Result<ResponseContent<GetSystemsSuccess>, Error<GetSystemsError>> {
635    let client = &configuration.client;
636
637    // Create the request from a path.
638    // Make sure to url encode any user given text.
639    let uri_str = format!("{}/systems", configuration.base_path);
640    let mut req_builder = client.request(reqwest::Method::GET, &uri_str);
641
642    // === Add queries to request ===
643
644    if let Some(s) = &page {
645        req_builder = req_builder.query(&[("page", &s.to_string())]);
646    }
647    // === Add queries to request ===
648
649    if let Some(s) = &limit {
650        req_builder = req_builder.query(&[("limit", &s.to_string())]);
651    }
652
653    // === Add headers to request ===
654
655    // Set the user agent string if given.
656    if let Some(user_agent) = &configuration.user_agent {
657        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
658    }
659
660    // === Add auth to request ===
661
662    if let Some(token) = &configuration.bearer_access_token {
663        req_builder = req_builder.bearer_auth(token.to_owned());
664    };
665
666    // === Request is built.
667
668    // Execute the request.
669    let req = req_builder.build()?;
670    let resp = client.execute(req).await?;
671
672    // Get the response.
673    let status = resp.status();
674    let response_body = resp.text().await?;
675
676    if !status.is_client_error() && !status.is_server_error() {
677        // Try to parse the OK response.
678        match GetSystemsSuccess::from_body(status, &response_body) {
679            Some(Ok(content)) => Ok(ResponseContent {
680                status,
681                response_body,
682                content,
683            }),
684            Some(Err(err)) => Err(err.into()),
685            None => Err(Error::UnknownResponse {
686                status,
687                is_error: false,
688                response_body,
689            }),
690        }
691    } else {
692        // Try to parse the Err response.
693        match GetSystemsError::from_body(status, &response_body) {
694            Some(Ok(content)) => Err(Error::ResponseError(ResponseContent {
695                status,
696                response_body,
697                content,
698            })),
699            Some(Err(err)) => Err(err.into()),
700            None => Err(Error::UnknownResponse {
701                status,
702                is_error: true,
703                response_body,
704            }),
705        }
706    }
707}
708
709/// View the details of a waypoint.  If the waypoint is uncharted, it will return the 'Uncharted' trait instead of its actual traits.
710pub async fn get_waypoint(
711    configuration: &configuration::Configuration,
712    system_symbol: &str,
713    waypoint_symbol: &str,
714) -> Result<ResponseContent<GetWaypointSuccess>, Error<GetWaypointError>> {
715    let client = &configuration.client;
716
717    // Create the request from a path.
718    // Make sure to url encode any user given text.
719    let uri_str = format!(
720        "{}/systems/{systemSymbol}/waypoints/{waypointSymbol}",
721        configuration.base_path,
722        systemSymbol = crate::apis::urlencode(system_symbol),
723        waypointSymbol = crate::apis::urlencode(waypoint_symbol)
724    );
725    let mut req_builder = client.request(reqwest::Method::GET, &uri_str);
726
727    // === Add headers to request ===
728
729    // Set the user agent string if given.
730    if let Some(user_agent) = &configuration.user_agent {
731        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
732    }
733
734    // === Add auth to request ===
735
736    if let Some(token) = &configuration.bearer_access_token {
737        req_builder = req_builder.bearer_auth(token.to_owned());
738    };
739
740    // === Request is built.
741
742    // Execute the request.
743    let req = req_builder.build()?;
744    let resp = client.execute(req).await?;
745
746    // Get the response.
747    let status = resp.status();
748    let response_body = resp.text().await?;
749
750    if !status.is_client_error() && !status.is_server_error() {
751        // Try to parse the OK response.
752        match GetWaypointSuccess::from_body(status, &response_body) {
753            Some(Ok(content)) => Ok(ResponseContent {
754                status,
755                response_body,
756                content,
757            }),
758            Some(Err(err)) => Err(err.into()),
759            None => Err(Error::UnknownResponse {
760                status,
761                is_error: false,
762                response_body,
763            }),
764        }
765    } else {
766        // Try to parse the Err response.
767        match GetWaypointError::from_body(status, &response_body) {
768            Some(Ok(content)) => Err(Error::ResponseError(ResponseContent {
769                status,
770                response_body,
771                content,
772            })),
773            Some(Err(err)) => Err(err.into()),
774            None => Err(Error::UnknownResponse {
775                status,
776                is_error: true,
777                response_body,
778            }),
779        }
780    }
781}