1use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum CreateChartError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum CreateShipShipScanError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum CreateShipSystemScanError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum CreateShipWaypointScanError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum CreateSurveyError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum DockShipError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum ExtractResourcesError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum ExtractResourcesWithSurveyError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetMountsError {
78 UnknownValue(serde_json::Value),
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetMyShipError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetMyShipCargoError {
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetMyShipsError {
99 UnknownValue(serde_json::Value),
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetRepairShipError {
106 UnknownValue(serde_json::Value),
107}
108
109#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetScrapShipError {
113 UnknownValue(serde_json::Value),
114}
115
116#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetShipCooldownError {
120 UnknownValue(serde_json::Value),
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetShipModulesError {
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetShipNavError {
134 UnknownValue(serde_json::Value),
135}
136
137#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum InstallMountError {
141 UnknownValue(serde_json::Value),
142}
143
144#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum InstallShipModuleError {
148 UnknownValue(serde_json::Value),
149}
150
151#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum JettisonError {
155 UnknownValue(serde_json::Value),
156}
157
158#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum JumpShipError {
162 UnknownValue(serde_json::Value),
163}
164
165#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum NavigateShipError {
169 UnknownValue(serde_json::Value),
170}
171
172#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum NegotiateContractError {
176 UnknownValue(serde_json::Value),
177}
178
179#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum OrbitShipError {
183 UnknownValue(serde_json::Value),
184}
185
186#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum PatchShipNavError {
190 UnknownValue(serde_json::Value),
191}
192
193#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum PurchaseCargoError {
197 UnknownValue(serde_json::Value),
198}
199
200#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum PurchaseShipError {
204 UnknownValue(serde_json::Value),
205}
206
207#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum RefuelShipError {
211 UnknownValue(serde_json::Value),
212}
213
214#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum RemoveMountError {
218 UnknownValue(serde_json::Value),
219}
220
221#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum RemoveShipModuleError {
225 UnknownValue(serde_json::Value),
226}
227
228#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum RepairShipError {
232 UnknownValue(serde_json::Value),
233}
234
235#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum ScrapShipError {
239 UnknownValue(serde_json::Value),
240}
241
242#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum SellCargoError {
246 UnknownValue(serde_json::Value),
247}
248
249#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum ShipRefineError {
253 UnknownValue(serde_json::Value),
254}
255
256#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum SiphonResourcesError {
260 UnknownValue(serde_json::Value),
261}
262
263#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum TransferCargoError {
267 UnknownValue(serde_json::Value),
268}
269
270#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum WarpShipError {
274 UnknownValue(serde_json::Value),
275}
276
277
278pub async fn create_chart(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::CreateChart201Response, Error<CreateChartError>> {
280 let p_ship_symbol = ship_symbol;
282
283 let uri_str = format!("{}/my/ships/{shipSymbol}/chart", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
284 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
285
286 if let Some(ref user_agent) = configuration.user_agent {
287 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
288 }
289 if let Some(ref token) = configuration.bearer_access_token {
290 req_builder = req_builder.bearer_auth(token.to_owned());
291 };
292
293 let req = req_builder.build()?;
294 let resp = configuration.client.execute(req).await?;
295
296 let status = resp.status();
297 let content_type = resp
298 .headers()
299 .get("content-type")
300 .and_then(|v| v.to_str().ok())
301 .unwrap_or("application/octet-stream");
302 let content_type = super::ContentType::from(content_type);
303
304 if !status.is_client_error() && !status.is_server_error() {
305 let content = resp.text().await?;
306 match content_type {
307 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
308 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateChart201Response`"))),
309 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateChart201Response`")))),
310 }
311 } else {
312 let content = resp.text().await?;
313 let entity: Option<CreateChartError> = serde_json::from_str(&content).ok();
314 Err(Error::ResponseError(ResponseContent { status, content, entity }))
315 }
316}
317
318pub async fn create_ship_ship_scan(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::CreateShipShipScan201Response, Error<CreateShipShipScanError>> {
320 let p_ship_symbol = ship_symbol;
322
323 let uri_str = format!("{}/my/ships/{shipSymbol}/scan/ships", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
324 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
325
326 if let Some(ref user_agent) = configuration.user_agent {
327 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
328 }
329 if let Some(ref token) = configuration.bearer_access_token {
330 req_builder = req_builder.bearer_auth(token.to_owned());
331 };
332
333 let req = req_builder.build()?;
334 let resp = configuration.client.execute(req).await?;
335
336 let status = resp.status();
337 let content_type = resp
338 .headers()
339 .get("content-type")
340 .and_then(|v| v.to_str().ok())
341 .unwrap_or("application/octet-stream");
342 let content_type = super::ContentType::from(content_type);
343
344 if !status.is_client_error() && !status.is_server_error() {
345 let content = resp.text().await?;
346 match content_type {
347 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
348 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateShipShipScan201Response`"))),
349 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateShipShipScan201Response`")))),
350 }
351 } else {
352 let content = resp.text().await?;
353 let entity: Option<CreateShipShipScanError> = serde_json::from_str(&content).ok();
354 Err(Error::ResponseError(ResponseContent { status, content, entity }))
355 }
356}
357
358pub async fn create_ship_system_scan(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::CreateShipSystemScan201Response, Error<CreateShipSystemScanError>> {
360 let p_ship_symbol = ship_symbol;
362
363 let uri_str = format!("{}/my/ships/{shipSymbol}/scan/systems", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
364 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
365
366 if let Some(ref user_agent) = configuration.user_agent {
367 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
368 }
369 if let Some(ref token) = configuration.bearer_access_token {
370 req_builder = req_builder.bearer_auth(token.to_owned());
371 };
372
373 let req = req_builder.build()?;
374 let resp = configuration.client.execute(req).await?;
375
376 let status = resp.status();
377 let content_type = resp
378 .headers()
379 .get("content-type")
380 .and_then(|v| v.to_str().ok())
381 .unwrap_or("application/octet-stream");
382 let content_type = super::ContentType::from(content_type);
383
384 if !status.is_client_error() && !status.is_server_error() {
385 let content = resp.text().await?;
386 match content_type {
387 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
388 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateShipSystemScan201Response`"))),
389 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateShipSystemScan201Response`")))),
390 }
391 } else {
392 let content = resp.text().await?;
393 let entity: Option<CreateShipSystemScanError> = serde_json::from_str(&content).ok();
394 Err(Error::ResponseError(ResponseContent { status, content, entity }))
395 }
396}
397
398pub async fn create_ship_waypoint_scan(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::CreateShipWaypointScan201Response, Error<CreateShipWaypointScanError>> {
400 let p_ship_symbol = ship_symbol;
402
403 let uri_str = format!("{}/my/ships/{shipSymbol}/scan/waypoints", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
404 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
405
406 if let Some(ref user_agent) = configuration.user_agent {
407 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
408 }
409 if let Some(ref token) = configuration.bearer_access_token {
410 req_builder = req_builder.bearer_auth(token.to_owned());
411 };
412
413 let req = req_builder.build()?;
414 let resp = configuration.client.execute(req).await?;
415
416 let status = resp.status();
417 let content_type = resp
418 .headers()
419 .get("content-type")
420 .and_then(|v| v.to_str().ok())
421 .unwrap_or("application/octet-stream");
422 let content_type = super::ContentType::from(content_type);
423
424 if !status.is_client_error() && !status.is_server_error() {
425 let content = resp.text().await?;
426 match content_type {
427 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
428 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateShipWaypointScan201Response`"))),
429 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateShipWaypointScan201Response`")))),
430 }
431 } else {
432 let content = resp.text().await?;
433 let entity: Option<CreateShipWaypointScanError> = serde_json::from_str(&content).ok();
434 Err(Error::ResponseError(ResponseContent { status, content, entity }))
435 }
436}
437
438pub async fn create_survey(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::CreateSurvey201Response, Error<CreateSurveyError>> {
440 let p_ship_symbol = ship_symbol;
442
443 let uri_str = format!("{}/my/ships/{shipSymbol}/survey", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
444 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
445
446 if let Some(ref user_agent) = configuration.user_agent {
447 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
448 }
449 if let Some(ref token) = configuration.bearer_access_token {
450 req_builder = req_builder.bearer_auth(token.to_owned());
451 };
452
453 let req = req_builder.build()?;
454 let resp = configuration.client.execute(req).await?;
455
456 let status = resp.status();
457 let content_type = resp
458 .headers()
459 .get("content-type")
460 .and_then(|v| v.to_str().ok())
461 .unwrap_or("application/octet-stream");
462 let content_type = super::ContentType::from(content_type);
463
464 if !status.is_client_error() && !status.is_server_error() {
465 let content = resp.text().await?;
466 match content_type {
467 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
468 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateSurvey201Response`"))),
469 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateSurvey201Response`")))),
470 }
471 } else {
472 let content = resp.text().await?;
473 let entity: Option<CreateSurveyError> = serde_json::from_str(&content).ok();
474 Err(Error::ResponseError(ResponseContent { status, content, entity }))
475 }
476}
477
478pub async fn dock_ship(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::DockShip200Response, Error<DockShipError>> {
480 let p_ship_symbol = ship_symbol;
482
483 let uri_str = format!("{}/my/ships/{shipSymbol}/dock", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
484 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
485
486 if let Some(ref user_agent) = configuration.user_agent {
487 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
488 }
489 if let Some(ref token) = configuration.bearer_access_token {
490 req_builder = req_builder.bearer_auth(token.to_owned());
491 };
492
493 let req = req_builder.build()?;
494 let resp = configuration.client.execute(req).await?;
495
496 let status = resp.status();
497 let content_type = resp
498 .headers()
499 .get("content-type")
500 .and_then(|v| v.to_str().ok())
501 .unwrap_or("application/octet-stream");
502 let content_type = super::ContentType::from(content_type);
503
504 if !status.is_client_error() && !status.is_server_error() {
505 let content = resp.text().await?;
506 match content_type {
507 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
508 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DockShip200Response`"))),
509 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DockShip200Response`")))),
510 }
511 } else {
512 let content = resp.text().await?;
513 let entity: Option<DockShipError> = serde_json::from_str(&content).ok();
514 Err(Error::ResponseError(ResponseContent { status, content, entity }))
515 }
516}
517
518pub async fn extract_resources(configuration: &configuration::Configuration, ship_symbol: &str, extract_resources_request: Option<models::ExtractResourcesRequest>) -> Result<models::ExtractResources201Response, Error<ExtractResourcesError>> {
520 let p_ship_symbol = ship_symbol;
522 let p_extract_resources_request = extract_resources_request;
523
524 let uri_str = format!("{}/my/ships/{shipSymbol}/extract", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
525 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
526
527 if let Some(ref user_agent) = configuration.user_agent {
528 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
529 }
530 if let Some(ref token) = configuration.bearer_access_token {
531 req_builder = req_builder.bearer_auth(token.to_owned());
532 };
533 req_builder = req_builder.json(&p_extract_resources_request);
534
535 let req = req_builder.build()?;
536 let resp = configuration.client.execute(req).await?;
537
538 let status = resp.status();
539 let content_type = resp
540 .headers()
541 .get("content-type")
542 .and_then(|v| v.to_str().ok())
543 .unwrap_or("application/octet-stream");
544 let content_type = super::ContentType::from(content_type);
545
546 if !status.is_client_error() && !status.is_server_error() {
547 let content = resp.text().await?;
548 match content_type {
549 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
550 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ExtractResources201Response`"))),
551 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ExtractResources201Response`")))),
552 }
553 } else {
554 let content = resp.text().await?;
555 let entity: Option<ExtractResourcesError> = serde_json::from_str(&content).ok();
556 Err(Error::ResponseError(ResponseContent { status, content, entity }))
557 }
558}
559
560pub async fn extract_resources_with_survey(configuration: &configuration::Configuration, ship_symbol: &str, survey: Option<models::Survey>) -> Result<models::ExtractResourcesWithSurvey201Response, Error<ExtractResourcesWithSurveyError>> {
562 let p_ship_symbol = ship_symbol;
564 let p_survey = survey;
565
566 let uri_str = format!("{}/my/ships/{shipSymbol}/extract/survey", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
567 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
568
569 if let Some(ref user_agent) = configuration.user_agent {
570 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
571 }
572 if let Some(ref token) = configuration.bearer_access_token {
573 req_builder = req_builder.bearer_auth(token.to_owned());
574 };
575 req_builder = req_builder.json(&p_survey);
576
577 let req = req_builder.build()?;
578 let resp = configuration.client.execute(req).await?;
579
580 let status = resp.status();
581 let content_type = resp
582 .headers()
583 .get("content-type")
584 .and_then(|v| v.to_str().ok())
585 .unwrap_or("application/octet-stream");
586 let content_type = super::ContentType::from(content_type);
587
588 if !status.is_client_error() && !status.is_server_error() {
589 let content = resp.text().await?;
590 match content_type {
591 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
592 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ExtractResourcesWithSurvey201Response`"))),
593 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ExtractResourcesWithSurvey201Response`")))),
594 }
595 } else {
596 let content = resp.text().await?;
597 let entity: Option<ExtractResourcesWithSurveyError> = serde_json::from_str(&content).ok();
598 Err(Error::ResponseError(ResponseContent { status, content, entity }))
599 }
600}
601
602pub async fn get_mounts(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::GetMounts200Response, Error<GetMountsError>> {
604 let p_ship_symbol = ship_symbol;
606
607 let uri_str = format!("{}/my/ships/{shipSymbol}/mounts", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
608 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
609
610 if let Some(ref user_agent) = configuration.user_agent {
611 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
612 }
613 if let Some(ref token) = configuration.bearer_access_token {
614 req_builder = req_builder.bearer_auth(token.to_owned());
615 };
616
617 let req = req_builder.build()?;
618 let resp = configuration.client.execute(req).await?;
619
620 let status = resp.status();
621 let content_type = resp
622 .headers()
623 .get("content-type")
624 .and_then(|v| v.to_str().ok())
625 .unwrap_or("application/octet-stream");
626 let content_type = super::ContentType::from(content_type);
627
628 if !status.is_client_error() && !status.is_server_error() {
629 let content = resp.text().await?;
630 match content_type {
631 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
632 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMounts200Response`"))),
633 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetMounts200Response`")))),
634 }
635 } else {
636 let content = resp.text().await?;
637 let entity: Option<GetMountsError> = serde_json::from_str(&content).ok();
638 Err(Error::ResponseError(ResponseContent { status, content, entity }))
639 }
640}
641
642pub async fn get_my_ship(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::GetMyShip200Response, Error<GetMyShipError>> {
644 let p_ship_symbol = ship_symbol;
646
647 let uri_str = format!("{}/my/ships/{shipSymbol}", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
648 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
649
650 if let Some(ref user_agent) = configuration.user_agent {
651 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
652 }
653 if let Some(ref token) = configuration.bearer_access_token {
654 req_builder = req_builder.bearer_auth(token.to_owned());
655 };
656
657 let req = req_builder.build()?;
658 let resp = configuration.client.execute(req).await?;
659
660 let status = resp.status();
661 let content_type = resp
662 .headers()
663 .get("content-type")
664 .and_then(|v| v.to_str().ok())
665 .unwrap_or("application/octet-stream");
666 let content_type = super::ContentType::from(content_type);
667
668 if !status.is_client_error() && !status.is_server_error() {
669 let content = resp.text().await?;
670 match content_type {
671 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
672 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMyShip200Response`"))),
673 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetMyShip200Response`")))),
674 }
675 } else {
676 let content = resp.text().await?;
677 let entity: Option<GetMyShipError> = serde_json::from_str(&content).ok();
678 Err(Error::ResponseError(ResponseContent { status, content, entity }))
679 }
680}
681
682pub async fn get_my_ship_cargo(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::GetMyShipCargo200Response, Error<GetMyShipCargoError>> {
684 let p_ship_symbol = ship_symbol;
686
687 let uri_str = format!("{}/my/ships/{shipSymbol}/cargo", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
688 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
689
690 if let Some(ref user_agent) = configuration.user_agent {
691 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
692 }
693 if let Some(ref token) = configuration.bearer_access_token {
694 req_builder = req_builder.bearer_auth(token.to_owned());
695 };
696
697 let req = req_builder.build()?;
698 let resp = configuration.client.execute(req).await?;
699
700 let status = resp.status();
701 let content_type = resp
702 .headers()
703 .get("content-type")
704 .and_then(|v| v.to_str().ok())
705 .unwrap_or("application/octet-stream");
706 let content_type = super::ContentType::from(content_type);
707
708 if !status.is_client_error() && !status.is_server_error() {
709 let content = resp.text().await?;
710 match content_type {
711 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
712 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMyShipCargo200Response`"))),
713 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetMyShipCargo200Response`")))),
714 }
715 } else {
716 let content = resp.text().await?;
717 let entity: Option<GetMyShipCargoError> = serde_json::from_str(&content).ok();
718 Err(Error::ResponseError(ResponseContent { status, content, entity }))
719 }
720}
721
722pub async fn get_my_ships(configuration: &configuration::Configuration, page: Option<i32>, limit: Option<i32>) -> Result<models::GetMyShips200Response, Error<GetMyShipsError>> {
724 let p_page = page;
726 let p_limit = limit;
727
728 let uri_str = format!("{}/my/ships", configuration.base_path);
729 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
730
731 if let Some(ref param_value) = p_page {
732 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
733 }
734 if let Some(ref param_value) = p_limit {
735 req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
736 }
737 if let Some(ref user_agent) = configuration.user_agent {
738 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
739 }
740 if let Some(ref token) = configuration.bearer_access_token {
741 req_builder = req_builder.bearer_auth(token.to_owned());
742 };
743
744 let req = req_builder.build()?;
745 let resp = configuration.client.execute(req).await?;
746
747 let status = resp.status();
748 let content_type = resp
749 .headers()
750 .get("content-type")
751 .and_then(|v| v.to_str().ok())
752 .unwrap_or("application/octet-stream");
753 let content_type = super::ContentType::from(content_type);
754
755 if !status.is_client_error() && !status.is_server_error() {
756 let content = resp.text().await?;
757 match content_type {
758 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
759 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetMyShips200Response`"))),
760 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetMyShips200Response`")))),
761 }
762 } else {
763 let content = resp.text().await?;
764 let entity: Option<GetMyShipsError> = serde_json::from_str(&content).ok();
765 Err(Error::ResponseError(ResponseContent { status, content, entity }))
766 }
767}
768
769pub async fn get_repair_ship(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::GetRepairShip200Response, Error<GetRepairShipError>> {
771 let p_ship_symbol = ship_symbol;
773
774 let uri_str = format!("{}/my/ships/{shipSymbol}/repair", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
775 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
776
777 if let Some(ref user_agent) = configuration.user_agent {
778 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
779 }
780 if let Some(ref token) = configuration.bearer_access_token {
781 req_builder = req_builder.bearer_auth(token.to_owned());
782 };
783
784 let req = req_builder.build()?;
785 let resp = configuration.client.execute(req).await?;
786
787 let status = resp.status();
788 let content_type = resp
789 .headers()
790 .get("content-type")
791 .and_then(|v| v.to_str().ok())
792 .unwrap_or("application/octet-stream");
793 let content_type = super::ContentType::from(content_type);
794
795 if !status.is_client_error() && !status.is_server_error() {
796 let content = resp.text().await?;
797 match content_type {
798 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
799 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetRepairShip200Response`"))),
800 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetRepairShip200Response`")))),
801 }
802 } else {
803 let content = resp.text().await?;
804 let entity: Option<GetRepairShipError> = serde_json::from_str(&content).ok();
805 Err(Error::ResponseError(ResponseContent { status, content, entity }))
806 }
807}
808
809pub async fn get_scrap_ship(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::GetScrapShip200Response, Error<GetScrapShipError>> {
811 let p_ship_symbol = ship_symbol;
813
814 let uri_str = format!("{}/my/ships/{shipSymbol}/scrap", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
815 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
816
817 if let Some(ref user_agent) = configuration.user_agent {
818 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
819 }
820 if let Some(ref token) = configuration.bearer_access_token {
821 req_builder = req_builder.bearer_auth(token.to_owned());
822 };
823
824 let req = req_builder.build()?;
825 let resp = configuration.client.execute(req).await?;
826
827 let status = resp.status();
828 let content_type = resp
829 .headers()
830 .get("content-type")
831 .and_then(|v| v.to_str().ok())
832 .unwrap_or("application/octet-stream");
833 let content_type = super::ContentType::from(content_type);
834
835 if !status.is_client_error() && !status.is_server_error() {
836 let content = resp.text().await?;
837 match content_type {
838 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
839 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetScrapShip200Response`"))),
840 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetScrapShip200Response`")))),
841 }
842 } else {
843 let content = resp.text().await?;
844 let entity: Option<GetScrapShipError> = serde_json::from_str(&content).ok();
845 Err(Error::ResponseError(ResponseContent { status, content, entity }))
846 }
847}
848
849pub async fn get_ship_cooldown(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::GetShipCooldown200Response, Error<GetShipCooldownError>> {
851 let p_ship_symbol = ship_symbol;
853
854 let uri_str = format!("{}/my/ships/{shipSymbol}/cooldown", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
855 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
856
857 if let Some(ref user_agent) = configuration.user_agent {
858 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
859 }
860 if let Some(ref token) = configuration.bearer_access_token {
861 req_builder = req_builder.bearer_auth(token.to_owned());
862 };
863
864 let req = req_builder.build()?;
865 let resp = configuration.client.execute(req).await?;
866
867 let status = resp.status();
868 let content_type = resp
869 .headers()
870 .get("content-type")
871 .and_then(|v| v.to_str().ok())
872 .unwrap_or("application/octet-stream");
873 let content_type = super::ContentType::from(content_type);
874
875 if !status.is_client_error() && !status.is_server_error() {
876 let content = resp.text().await?;
877 match content_type {
878 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
879 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetShipCooldown200Response`"))),
880 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetShipCooldown200Response`")))),
881 }
882 } else {
883 let content = resp.text().await?;
884 let entity: Option<GetShipCooldownError> = serde_json::from_str(&content).ok();
885 Err(Error::ResponseError(ResponseContent { status, content, entity }))
886 }
887}
888
889pub async fn get_ship_modules(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::GetShipModules200Response, Error<GetShipModulesError>> {
891 let p_ship_symbol = ship_symbol;
893
894 let uri_str = format!("{}/my/ships/{shipSymbol}/modules", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
895 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
896
897 if let Some(ref user_agent) = configuration.user_agent {
898 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
899 }
900 if let Some(ref token) = configuration.bearer_access_token {
901 req_builder = req_builder.bearer_auth(token.to_owned());
902 };
903 if let Some(ref token) = configuration.bearer_access_token {
904 req_builder = req_builder.bearer_auth(token.to_owned());
905 };
906
907 let req = req_builder.build()?;
908 let resp = configuration.client.execute(req).await?;
909
910 let status = resp.status();
911 let content_type = resp
912 .headers()
913 .get("content-type")
914 .and_then(|v| v.to_str().ok())
915 .unwrap_or("application/octet-stream");
916 let content_type = super::ContentType::from(content_type);
917
918 if !status.is_client_error() && !status.is_server_error() {
919 let content = resp.text().await?;
920 match content_type {
921 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
922 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetShipModules200Response`"))),
923 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetShipModules200Response`")))),
924 }
925 } else {
926 let content = resp.text().await?;
927 let entity: Option<GetShipModulesError> = serde_json::from_str(&content).ok();
928 Err(Error::ResponseError(ResponseContent { status, content, entity }))
929 }
930}
931
932pub async fn get_ship_nav(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::GetShipNav200Response, Error<GetShipNavError>> {
934 let p_ship_symbol = ship_symbol;
936
937 let uri_str = format!("{}/my/ships/{shipSymbol}/nav", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
938 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
939
940 if let Some(ref user_agent) = configuration.user_agent {
941 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
942 }
943 if let Some(ref token) = configuration.bearer_access_token {
944 req_builder = req_builder.bearer_auth(token.to_owned());
945 };
946
947 let req = req_builder.build()?;
948 let resp = configuration.client.execute(req).await?;
949
950 let status = resp.status();
951 let content_type = resp
952 .headers()
953 .get("content-type")
954 .and_then(|v| v.to_str().ok())
955 .unwrap_or("application/octet-stream");
956 let content_type = super::ContentType::from(content_type);
957
958 if !status.is_client_error() && !status.is_server_error() {
959 let content = resp.text().await?;
960 match content_type {
961 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
962 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetShipNav200Response`"))),
963 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetShipNav200Response`")))),
964 }
965 } else {
966 let content = resp.text().await?;
967 let entity: Option<GetShipNavError> = serde_json::from_str(&content).ok();
968 Err(Error::ResponseError(ResponseContent { status, content, entity }))
969 }
970}
971
972pub async fn install_mount(configuration: &configuration::Configuration, ship_symbol: &str, install_mount_request: Option<models::InstallMountRequest>) -> Result<models::InstallMount201Response, Error<InstallMountError>> {
974 let p_ship_symbol = ship_symbol;
976 let p_install_mount_request = install_mount_request;
977
978 let uri_str = format!("{}/my/ships/{shipSymbol}/mounts/install", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
979 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
980
981 if let Some(ref user_agent) = configuration.user_agent {
982 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
983 }
984 if let Some(ref token) = configuration.bearer_access_token {
985 req_builder = req_builder.bearer_auth(token.to_owned());
986 };
987 req_builder = req_builder.json(&p_install_mount_request);
988
989 let req = req_builder.build()?;
990 let resp = configuration.client.execute(req).await?;
991
992 let status = resp.status();
993 let content_type = resp
994 .headers()
995 .get("content-type")
996 .and_then(|v| v.to_str().ok())
997 .unwrap_or("application/octet-stream");
998 let content_type = super::ContentType::from(content_type);
999
1000 if !status.is_client_error() && !status.is_server_error() {
1001 let content = resp.text().await?;
1002 match content_type {
1003 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1004 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::InstallMount201Response`"))),
1005 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::InstallMount201Response`")))),
1006 }
1007 } else {
1008 let content = resp.text().await?;
1009 let entity: Option<InstallMountError> = serde_json::from_str(&content).ok();
1010 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1011 }
1012}
1013
1014pub async fn install_ship_module(configuration: &configuration::Configuration, ship_symbol: &str, install_ship_module_request: Option<models::InstallShipModuleRequest>) -> Result<models::InstallShipModule201Response, Error<InstallShipModuleError>> {
1016 let p_ship_symbol = ship_symbol;
1018 let p_install_ship_module_request = install_ship_module_request;
1019
1020 let uri_str = format!("{}/my/ships/{shipSymbol}/modules/install", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1021 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1022
1023 if let Some(ref user_agent) = configuration.user_agent {
1024 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1025 }
1026 if let Some(ref token) = configuration.bearer_access_token {
1027 req_builder = req_builder.bearer_auth(token.to_owned());
1028 };
1029 if let Some(ref token) = configuration.bearer_access_token {
1030 req_builder = req_builder.bearer_auth(token.to_owned());
1031 };
1032 req_builder = req_builder.json(&p_install_ship_module_request);
1033
1034 let req = req_builder.build()?;
1035 let resp = configuration.client.execute(req).await?;
1036
1037 let status = resp.status();
1038 let content_type = resp
1039 .headers()
1040 .get("content-type")
1041 .and_then(|v| v.to_str().ok())
1042 .unwrap_or("application/octet-stream");
1043 let content_type = super::ContentType::from(content_type);
1044
1045 if !status.is_client_error() && !status.is_server_error() {
1046 let content = resp.text().await?;
1047 match content_type {
1048 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1049 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::InstallShipModule201Response`"))),
1050 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::InstallShipModule201Response`")))),
1051 }
1052 } else {
1053 let content = resp.text().await?;
1054 let entity: Option<InstallShipModuleError> = serde_json::from_str(&content).ok();
1055 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1056 }
1057}
1058
1059pub async fn jettison(configuration: &configuration::Configuration, ship_symbol: &str, jettison_request: Option<models::JettisonRequest>) -> Result<models::Jettison200Response, Error<JettisonError>> {
1061 let p_ship_symbol = ship_symbol;
1063 let p_jettison_request = jettison_request;
1064
1065 let uri_str = format!("{}/my/ships/{shipSymbol}/jettison", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1066 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1067
1068 if let Some(ref user_agent) = configuration.user_agent {
1069 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1070 }
1071 if let Some(ref token) = configuration.bearer_access_token {
1072 req_builder = req_builder.bearer_auth(token.to_owned());
1073 };
1074 req_builder = req_builder.json(&p_jettison_request);
1075
1076 let req = req_builder.build()?;
1077 let resp = configuration.client.execute(req).await?;
1078
1079 let status = resp.status();
1080 let content_type = resp
1081 .headers()
1082 .get("content-type")
1083 .and_then(|v| v.to_str().ok())
1084 .unwrap_or("application/octet-stream");
1085 let content_type = super::ContentType::from(content_type);
1086
1087 if !status.is_client_error() && !status.is_server_error() {
1088 let content = resp.text().await?;
1089 match content_type {
1090 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1091 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Jettison200Response`"))),
1092 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Jettison200Response`")))),
1093 }
1094 } else {
1095 let content = resp.text().await?;
1096 let entity: Option<JettisonError> = serde_json::from_str(&content).ok();
1097 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1098 }
1099}
1100
1101pub async fn jump_ship(configuration: &configuration::Configuration, ship_symbol: &str, jump_ship_request: Option<models::JumpShipRequest>) -> Result<models::JumpShip200Response, Error<JumpShipError>> {
1103 let p_ship_symbol = ship_symbol;
1105 let p_jump_ship_request = jump_ship_request;
1106
1107 let uri_str = format!("{}/my/ships/{shipSymbol}/jump", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1108 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1109
1110 if let Some(ref user_agent) = configuration.user_agent {
1111 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1112 }
1113 if let Some(ref token) = configuration.bearer_access_token {
1114 req_builder = req_builder.bearer_auth(token.to_owned());
1115 };
1116 req_builder = req_builder.json(&p_jump_ship_request);
1117
1118 let req = req_builder.build()?;
1119 let resp = configuration.client.execute(req).await?;
1120
1121 let status = resp.status();
1122 let content_type = resp
1123 .headers()
1124 .get("content-type")
1125 .and_then(|v| v.to_str().ok())
1126 .unwrap_or("application/octet-stream");
1127 let content_type = super::ContentType::from(content_type);
1128
1129 if !status.is_client_error() && !status.is_server_error() {
1130 let content = resp.text().await?;
1131 match content_type {
1132 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1133 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::JumpShip200Response`"))),
1134 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::JumpShip200Response`")))),
1135 }
1136 } else {
1137 let content = resp.text().await?;
1138 let entity: Option<JumpShipError> = serde_json::from_str(&content).ok();
1139 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1140 }
1141}
1142
1143pub async fn navigate_ship(configuration: &configuration::Configuration, ship_symbol: &str, navigate_ship_request: Option<models::NavigateShipRequest>) -> Result<models::NavigateShip200Response, Error<NavigateShipError>> {
1145 let p_ship_symbol = ship_symbol;
1147 let p_navigate_ship_request = navigate_ship_request;
1148
1149 let uri_str = format!("{}/my/ships/{shipSymbol}/navigate", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1150 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1151
1152 if let Some(ref user_agent) = configuration.user_agent {
1153 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1154 }
1155 if let Some(ref token) = configuration.bearer_access_token {
1156 req_builder = req_builder.bearer_auth(token.to_owned());
1157 };
1158 req_builder = req_builder.json(&p_navigate_ship_request);
1159
1160 let req = req_builder.build()?;
1161 let resp = configuration.client.execute(req).await?;
1162
1163 let status = resp.status();
1164 let content_type = resp
1165 .headers()
1166 .get("content-type")
1167 .and_then(|v| v.to_str().ok())
1168 .unwrap_or("application/octet-stream");
1169 let content_type = super::ContentType::from(content_type);
1170
1171 if !status.is_client_error() && !status.is_server_error() {
1172 let content = resp.text().await?;
1173 match content_type {
1174 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1175 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NavigateShip200Response`"))),
1176 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NavigateShip200Response`")))),
1177 }
1178 } else {
1179 let content = resp.text().await?;
1180 let entity: Option<NavigateShipError> = serde_json::from_str(&content).ok();
1181 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1182 }
1183}
1184
1185pub async fn negotiate_contract(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::NegotiateContract200Response, Error<NegotiateContractError>> {
1187 let p_ship_symbol = ship_symbol;
1189
1190 let uri_str = format!("{}/my/ships/{shipSymbol}/negotiate/contract", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1191 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1192
1193 if let Some(ref user_agent) = configuration.user_agent {
1194 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1195 }
1196 if let Some(ref token) = configuration.bearer_access_token {
1197 req_builder = req_builder.bearer_auth(token.to_owned());
1198 };
1199
1200 let req = req_builder.build()?;
1201 let resp = configuration.client.execute(req).await?;
1202
1203 let status = resp.status();
1204 let content_type = resp
1205 .headers()
1206 .get("content-type")
1207 .and_then(|v| v.to_str().ok())
1208 .unwrap_or("application/octet-stream");
1209 let content_type = super::ContentType::from(content_type);
1210
1211 if !status.is_client_error() && !status.is_server_error() {
1212 let content = resp.text().await?;
1213 match content_type {
1214 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1215 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NegotiateContract200Response`"))),
1216 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NegotiateContract200Response`")))),
1217 }
1218 } else {
1219 let content = resp.text().await?;
1220 let entity: Option<NegotiateContractError> = serde_json::from_str(&content).ok();
1221 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1222 }
1223}
1224
1225pub async fn orbit_ship(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::OrbitShip200Response, Error<OrbitShipError>> {
1227 let p_ship_symbol = ship_symbol;
1229
1230 let uri_str = format!("{}/my/ships/{shipSymbol}/orbit", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1231 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1232
1233 if let Some(ref user_agent) = configuration.user_agent {
1234 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1235 }
1236 if let Some(ref token) = configuration.bearer_access_token {
1237 req_builder = req_builder.bearer_auth(token.to_owned());
1238 };
1239
1240 let req = req_builder.build()?;
1241 let resp = configuration.client.execute(req).await?;
1242
1243 let status = resp.status();
1244 let content_type = resp
1245 .headers()
1246 .get("content-type")
1247 .and_then(|v| v.to_str().ok())
1248 .unwrap_or("application/octet-stream");
1249 let content_type = super::ContentType::from(content_type);
1250
1251 if !status.is_client_error() && !status.is_server_error() {
1252 let content = resp.text().await?;
1253 match content_type {
1254 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1255 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrbitShip200Response`"))),
1256 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrbitShip200Response`")))),
1257 }
1258 } else {
1259 let content = resp.text().await?;
1260 let entity: Option<OrbitShipError> = serde_json::from_str(&content).ok();
1261 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1262 }
1263}
1264
1265pub async fn patch_ship_nav(configuration: &configuration::Configuration, ship_symbol: &str, patch_ship_nav_request: Option<models::PatchShipNavRequest>) -> Result<models::PatchShipNav200Response, Error<PatchShipNavError>> {
1267 let p_ship_symbol = ship_symbol;
1269 let p_patch_ship_nav_request = patch_ship_nav_request;
1270
1271 let uri_str = format!("{}/my/ships/{shipSymbol}/nav", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1272 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
1273
1274 if let Some(ref user_agent) = configuration.user_agent {
1275 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1276 }
1277 if let Some(ref token) = configuration.bearer_access_token {
1278 req_builder = req_builder.bearer_auth(token.to_owned());
1279 };
1280 req_builder = req_builder.json(&p_patch_ship_nav_request);
1281
1282 let req = req_builder.build()?;
1283 let resp = configuration.client.execute(req).await?;
1284
1285 let status = resp.status();
1286 let content_type = resp
1287 .headers()
1288 .get("content-type")
1289 .and_then(|v| v.to_str().ok())
1290 .unwrap_or("application/octet-stream");
1291 let content_type = super::ContentType::from(content_type);
1292
1293 if !status.is_client_error() && !status.is_server_error() {
1294 let content = resp.text().await?;
1295 match content_type {
1296 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1297 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PatchShipNav200Response`"))),
1298 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PatchShipNav200Response`")))),
1299 }
1300 } else {
1301 let content = resp.text().await?;
1302 let entity: Option<PatchShipNavError> = serde_json::from_str(&content).ok();
1303 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1304 }
1305}
1306
1307pub async fn purchase_cargo(configuration: &configuration::Configuration, ship_symbol: &str, purchase_cargo_request: Option<models::PurchaseCargoRequest>) -> Result<models::PurchaseCargo201Response, Error<PurchaseCargoError>> {
1309 let p_ship_symbol = ship_symbol;
1311 let p_purchase_cargo_request = purchase_cargo_request;
1312
1313 let uri_str = format!("{}/my/ships/{shipSymbol}/purchase", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1314 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1315
1316 if let Some(ref user_agent) = configuration.user_agent {
1317 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1318 }
1319 if let Some(ref token) = configuration.bearer_access_token {
1320 req_builder = req_builder.bearer_auth(token.to_owned());
1321 };
1322 req_builder = req_builder.json(&p_purchase_cargo_request);
1323
1324 let req = req_builder.build()?;
1325 let resp = configuration.client.execute(req).await?;
1326
1327 let status = resp.status();
1328 let content_type = resp
1329 .headers()
1330 .get("content-type")
1331 .and_then(|v| v.to_str().ok())
1332 .unwrap_or("application/octet-stream");
1333 let content_type = super::ContentType::from(content_type);
1334
1335 if !status.is_client_error() && !status.is_server_error() {
1336 let content = resp.text().await?;
1337 match content_type {
1338 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1339 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PurchaseCargo201Response`"))),
1340 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PurchaseCargo201Response`")))),
1341 }
1342 } else {
1343 let content = resp.text().await?;
1344 let entity: Option<PurchaseCargoError> = serde_json::from_str(&content).ok();
1345 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1346 }
1347}
1348
1349pub async fn purchase_ship(configuration: &configuration::Configuration, purchase_ship_request: Option<models::PurchaseShipRequest>) -> Result<models::PurchaseShip201Response, Error<PurchaseShipError>> {
1351 let p_purchase_ship_request = purchase_ship_request;
1353
1354 let uri_str = format!("{}/my/ships", configuration.base_path);
1355 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1356
1357 if let Some(ref user_agent) = configuration.user_agent {
1358 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1359 }
1360 if let Some(ref token) = configuration.bearer_access_token {
1361 req_builder = req_builder.bearer_auth(token.to_owned());
1362 };
1363 req_builder = req_builder.json(&p_purchase_ship_request);
1364
1365 let req = req_builder.build()?;
1366 let resp = configuration.client.execute(req).await?;
1367
1368 let status = resp.status();
1369 let content_type = resp
1370 .headers()
1371 .get("content-type")
1372 .and_then(|v| v.to_str().ok())
1373 .unwrap_or("application/octet-stream");
1374 let content_type = super::ContentType::from(content_type);
1375
1376 if !status.is_client_error() && !status.is_server_error() {
1377 let content = resp.text().await?;
1378 match content_type {
1379 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1380 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PurchaseShip201Response`"))),
1381 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PurchaseShip201Response`")))),
1382 }
1383 } else {
1384 let content = resp.text().await?;
1385 let entity: Option<PurchaseShipError> = serde_json::from_str(&content).ok();
1386 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1387 }
1388}
1389
1390pub async fn refuel_ship(configuration: &configuration::Configuration, ship_symbol: &str, refuel_ship_request: Option<models::RefuelShipRequest>) -> Result<models::RefuelShip200Response, Error<RefuelShipError>> {
1392 let p_ship_symbol = ship_symbol;
1394 let p_refuel_ship_request = refuel_ship_request;
1395
1396 let uri_str = format!("{}/my/ships/{shipSymbol}/refuel", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1397 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1398
1399 if let Some(ref user_agent) = configuration.user_agent {
1400 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1401 }
1402 if let Some(ref token) = configuration.bearer_access_token {
1403 req_builder = req_builder.bearer_auth(token.to_owned());
1404 };
1405 req_builder = req_builder.json(&p_refuel_ship_request);
1406
1407 let req = req_builder.build()?;
1408 let resp = configuration.client.execute(req).await?;
1409
1410 let status = resp.status();
1411 let content_type = resp
1412 .headers()
1413 .get("content-type")
1414 .and_then(|v| v.to_str().ok())
1415 .unwrap_or("application/octet-stream");
1416 let content_type = super::ContentType::from(content_type);
1417
1418 if !status.is_client_error() && !status.is_server_error() {
1419 let content = resp.text().await?;
1420 match content_type {
1421 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1422 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RefuelShip200Response`"))),
1423 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RefuelShip200Response`")))),
1424 }
1425 } else {
1426 let content = resp.text().await?;
1427 let entity: Option<RefuelShipError> = serde_json::from_str(&content).ok();
1428 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1429 }
1430}
1431
1432pub async fn remove_mount(configuration: &configuration::Configuration, ship_symbol: &str, remove_mount_request: Option<models::RemoveMountRequest>) -> Result<models::RemoveMount201Response, Error<RemoveMountError>> {
1434 let p_ship_symbol = ship_symbol;
1436 let p_remove_mount_request = remove_mount_request;
1437
1438 let uri_str = format!("{}/my/ships/{shipSymbol}/mounts/remove", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1439 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1440
1441 if let Some(ref user_agent) = configuration.user_agent {
1442 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1443 }
1444 if let Some(ref token) = configuration.bearer_access_token {
1445 req_builder = req_builder.bearer_auth(token.to_owned());
1446 };
1447 req_builder = req_builder.json(&p_remove_mount_request);
1448
1449 let req = req_builder.build()?;
1450 let resp = configuration.client.execute(req).await?;
1451
1452 let status = resp.status();
1453 let content_type = resp
1454 .headers()
1455 .get("content-type")
1456 .and_then(|v| v.to_str().ok())
1457 .unwrap_or("application/octet-stream");
1458 let content_type = super::ContentType::from(content_type);
1459
1460 if !status.is_client_error() && !status.is_server_error() {
1461 let content = resp.text().await?;
1462 match content_type {
1463 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1464 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RemoveMount201Response`"))),
1465 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RemoveMount201Response`")))),
1466 }
1467 } else {
1468 let content = resp.text().await?;
1469 let entity: Option<RemoveMountError> = serde_json::from_str(&content).ok();
1470 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1471 }
1472}
1473
1474pub async fn remove_ship_module(configuration: &configuration::Configuration, ship_symbol: &str, remove_ship_module_request: Option<models::RemoveShipModuleRequest>) -> Result<models::RemoveModule201Response, Error<RemoveShipModuleError>> {
1476 let p_ship_symbol = ship_symbol;
1478 let p_remove_ship_module_request = remove_ship_module_request;
1479
1480 let uri_str = format!("{}/my/ships/{shipSymbol}/modules/remove", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1481 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1482
1483 if let Some(ref user_agent) = configuration.user_agent {
1484 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1485 }
1486 if let Some(ref token) = configuration.bearer_access_token {
1487 req_builder = req_builder.bearer_auth(token.to_owned());
1488 };
1489 if let Some(ref token) = configuration.bearer_access_token {
1490 req_builder = req_builder.bearer_auth(token.to_owned());
1491 };
1492 req_builder = req_builder.json(&p_remove_ship_module_request);
1493
1494 let req = req_builder.build()?;
1495 let resp = configuration.client.execute(req).await?;
1496
1497 let status = resp.status();
1498 let content_type = resp
1499 .headers()
1500 .get("content-type")
1501 .and_then(|v| v.to_str().ok())
1502 .unwrap_or("application/octet-stream");
1503 let content_type = super::ContentType::from(content_type);
1504
1505 if !status.is_client_error() && !status.is_server_error() {
1506 let content = resp.text().await?;
1507 match content_type {
1508 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1509 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RemoveModule201Response`"))),
1510 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RemoveModule201Response`")))),
1511 }
1512 } else {
1513 let content = resp.text().await?;
1514 let entity: Option<RemoveShipModuleError> = serde_json::from_str(&content).ok();
1515 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1516 }
1517}
1518
1519pub async fn repair_ship(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::RepairShip200Response, Error<RepairShipError>> {
1521 let p_ship_symbol = ship_symbol;
1523
1524 let uri_str = format!("{}/my/ships/{shipSymbol}/repair", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1525 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1526
1527 if let Some(ref user_agent) = configuration.user_agent {
1528 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1529 }
1530 if let Some(ref token) = configuration.bearer_access_token {
1531 req_builder = req_builder.bearer_auth(token.to_owned());
1532 };
1533
1534 let req = req_builder.build()?;
1535 let resp = configuration.client.execute(req).await?;
1536
1537 let status = resp.status();
1538 let content_type = resp
1539 .headers()
1540 .get("content-type")
1541 .and_then(|v| v.to_str().ok())
1542 .unwrap_or("application/octet-stream");
1543 let content_type = super::ContentType::from(content_type);
1544
1545 if !status.is_client_error() && !status.is_server_error() {
1546 let content = resp.text().await?;
1547 match content_type {
1548 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1549 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepairShip200Response`"))),
1550 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepairShip200Response`")))),
1551 }
1552 } else {
1553 let content = resp.text().await?;
1554 let entity: Option<RepairShipError> = serde_json::from_str(&content).ok();
1555 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1556 }
1557}
1558
1559pub async fn scrap_ship(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::ScrapShip200Response, Error<ScrapShipError>> {
1561 let p_ship_symbol = ship_symbol;
1563
1564 let uri_str = format!("{}/my/ships/{shipSymbol}/scrap", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1565 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1566
1567 if let Some(ref user_agent) = configuration.user_agent {
1568 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1569 }
1570 if let Some(ref token) = configuration.bearer_access_token {
1571 req_builder = req_builder.bearer_auth(token.to_owned());
1572 };
1573
1574 let req = req_builder.build()?;
1575 let resp = configuration.client.execute(req).await?;
1576
1577 let status = resp.status();
1578 let content_type = resp
1579 .headers()
1580 .get("content-type")
1581 .and_then(|v| v.to_str().ok())
1582 .unwrap_or("application/octet-stream");
1583 let content_type = super::ContentType::from(content_type);
1584
1585 if !status.is_client_error() && !status.is_server_error() {
1586 let content = resp.text().await?;
1587 match content_type {
1588 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1589 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ScrapShip200Response`"))),
1590 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ScrapShip200Response`")))),
1591 }
1592 } else {
1593 let content = resp.text().await?;
1594 let entity: Option<ScrapShipError> = serde_json::from_str(&content).ok();
1595 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1596 }
1597}
1598
1599pub async fn sell_cargo(configuration: &configuration::Configuration, ship_symbol: &str, sell_cargo_request: Option<models::SellCargoRequest>) -> Result<models::SellCargo201Response, Error<SellCargoError>> {
1601 let p_ship_symbol = ship_symbol;
1603 let p_sell_cargo_request = sell_cargo_request;
1604
1605 let uri_str = format!("{}/my/ships/{shipSymbol}/sell", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1606 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1607
1608 if let Some(ref user_agent) = configuration.user_agent {
1609 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1610 }
1611 if let Some(ref token) = configuration.bearer_access_token {
1612 req_builder = req_builder.bearer_auth(token.to_owned());
1613 };
1614 req_builder = req_builder.json(&p_sell_cargo_request);
1615
1616 let req = req_builder.build()?;
1617 let resp = configuration.client.execute(req).await?;
1618
1619 let status = resp.status();
1620 let content_type = resp
1621 .headers()
1622 .get("content-type")
1623 .and_then(|v| v.to_str().ok())
1624 .unwrap_or("application/octet-stream");
1625 let content_type = super::ContentType::from(content_type);
1626
1627 if !status.is_client_error() && !status.is_server_error() {
1628 let content = resp.text().await?;
1629 match content_type {
1630 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1631 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SellCargo201Response`"))),
1632 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SellCargo201Response`")))),
1633 }
1634 } else {
1635 let content = resp.text().await?;
1636 let entity: Option<SellCargoError> = serde_json::from_str(&content).ok();
1637 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1638 }
1639}
1640
1641pub async fn ship_refine(configuration: &configuration::Configuration, ship_symbol: &str, ship_refine_request: Option<models::ShipRefineRequest>) -> Result<models::ShipRefine201Response, Error<ShipRefineError>> {
1643 let p_ship_symbol = ship_symbol;
1645 let p_ship_refine_request = ship_refine_request;
1646
1647 let uri_str = format!("{}/my/ships/{shipSymbol}/refine", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1648 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1649
1650 if let Some(ref user_agent) = configuration.user_agent {
1651 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1652 }
1653 if let Some(ref token) = configuration.bearer_access_token {
1654 req_builder = req_builder.bearer_auth(token.to_owned());
1655 };
1656 req_builder = req_builder.json(&p_ship_refine_request);
1657
1658 let req = req_builder.build()?;
1659 let resp = configuration.client.execute(req).await?;
1660
1661 let status = resp.status();
1662 let content_type = resp
1663 .headers()
1664 .get("content-type")
1665 .and_then(|v| v.to_str().ok())
1666 .unwrap_or("application/octet-stream");
1667 let content_type = super::ContentType::from(content_type);
1668
1669 if !status.is_client_error() && !status.is_server_error() {
1670 let content = resp.text().await?;
1671 match content_type {
1672 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1673 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ShipRefine201Response`"))),
1674 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ShipRefine201Response`")))),
1675 }
1676 } else {
1677 let content = resp.text().await?;
1678 let entity: Option<ShipRefineError> = serde_json::from_str(&content).ok();
1679 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1680 }
1681}
1682
1683pub async fn siphon_resources(configuration: &configuration::Configuration, ship_symbol: &str) -> Result<models::SiphonResources201Response, Error<SiphonResourcesError>> {
1685 let p_ship_symbol = ship_symbol;
1687
1688 let uri_str = format!("{}/my/ships/{shipSymbol}/siphon", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1689 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1690
1691 if let Some(ref user_agent) = configuration.user_agent {
1692 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1693 }
1694 if let Some(ref token) = configuration.bearer_access_token {
1695 req_builder = req_builder.bearer_auth(token.to_owned());
1696 };
1697
1698 let req = req_builder.build()?;
1699 let resp = configuration.client.execute(req).await?;
1700
1701 let status = resp.status();
1702 let content_type = resp
1703 .headers()
1704 .get("content-type")
1705 .and_then(|v| v.to_str().ok())
1706 .unwrap_or("application/octet-stream");
1707 let content_type = super::ContentType::from(content_type);
1708
1709 if !status.is_client_error() && !status.is_server_error() {
1710 let content = resp.text().await?;
1711 match content_type {
1712 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1713 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SiphonResources201Response`"))),
1714 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SiphonResources201Response`")))),
1715 }
1716 } else {
1717 let content = resp.text().await?;
1718 let entity: Option<SiphonResourcesError> = serde_json::from_str(&content).ok();
1719 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1720 }
1721}
1722
1723pub async fn transfer_cargo(configuration: &configuration::Configuration, ship_symbol: &str, transfer_cargo_request: Option<models::TransferCargoRequest>) -> Result<models::TransferCargo200Response, Error<TransferCargoError>> {
1725 let p_ship_symbol = ship_symbol;
1727 let p_transfer_cargo_request = transfer_cargo_request;
1728
1729 let uri_str = format!("{}/my/ships/{shipSymbol}/transfer", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1730 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1731
1732 if let Some(ref user_agent) = configuration.user_agent {
1733 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1734 }
1735 if let Some(ref token) = configuration.bearer_access_token {
1736 req_builder = req_builder.bearer_auth(token.to_owned());
1737 };
1738 req_builder = req_builder.json(&p_transfer_cargo_request);
1739
1740 let req = req_builder.build()?;
1741 let resp = configuration.client.execute(req).await?;
1742
1743 let status = resp.status();
1744 let content_type = resp
1745 .headers()
1746 .get("content-type")
1747 .and_then(|v| v.to_str().ok())
1748 .unwrap_or("application/octet-stream");
1749 let content_type = super::ContentType::from(content_type);
1750
1751 if !status.is_client_error() && !status.is_server_error() {
1752 let content = resp.text().await?;
1753 match content_type {
1754 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1755 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TransferCargo200Response`"))),
1756 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TransferCargo200Response`")))),
1757 }
1758 } else {
1759 let content = resp.text().await?;
1760 let entity: Option<TransferCargoError> = serde_json::from_str(&content).ok();
1761 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1762 }
1763}
1764
1765pub async fn warp_ship(configuration: &configuration::Configuration, ship_symbol: &str, navigate_ship_request: Option<models::NavigateShipRequest>) -> Result<models::WarpShip200Response, Error<WarpShipError>> {
1767 let p_ship_symbol = ship_symbol;
1769 let p_navigate_ship_request = navigate_ship_request;
1770
1771 let uri_str = format!("{}/my/ships/{shipSymbol}/warp", configuration.base_path, shipSymbol=crate::apis::urlencode(p_ship_symbol));
1772 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1773
1774 if let Some(ref user_agent) = configuration.user_agent {
1775 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1776 }
1777 if let Some(ref token) = configuration.bearer_access_token {
1778 req_builder = req_builder.bearer_auth(token.to_owned());
1779 };
1780 req_builder = req_builder.json(&p_navigate_ship_request);
1781
1782 let req = req_builder.build()?;
1783 let resp = configuration.client.execute(req).await?;
1784
1785 let status = resp.status();
1786 let content_type = resp
1787 .headers()
1788 .get("content-type")
1789 .and_then(|v| v.to_str().ok())
1790 .unwrap_or("application/octet-stream");
1791 let content_type = super::ContentType::from(content_type);
1792
1793 if !status.is_client_error() && !status.is_server_error() {
1794 let content = resp.text().await?;
1795 match content_type {
1796 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1797 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WarpShip200Response`"))),
1798 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WarpShip200Response`")))),
1799 }
1800 } else {
1801 let content = resp.text().await?;
1802 let entity: Option<WarpShipError> = serde_json::from_str(&content).ok();
1803 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1804 }
1805}
1806