tapis-pods 0.3.1

The Pods Service is a web service and distributed computing platform providing pods-as-a-service (PaaS). The service implements a message broker and processor model that requests pods, alongside a health module to poll for pod data, including logs, status, and health. The primary use of this service is to have quick to deploy long-lived services based on Docker images that are exposed via HTTP or TCP endpoints listed by the API. **The Pods service provides functionality for two types of pod solutions:** * **Templated Pods** for run-as-is popular images. Neo4J is one example, the template manages TCP ports, user creation, and permissions. * **Custom Pods** for arbitrary docker images with less functionality. In this case we will expose port 5000 and do nothing else. The live-docs act as the most up-to-date API reference. Visit the [documentation for more information](https://tapis.readthedocs.io/en/latest/technical/pods.html).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
/*
 * Tapis Pods Service
 *
 *  The Pods Service is a web service and distributed computing platform providing pods-as-a-service (PaaS). The service  implements a message broker and processor model that requests pods, alongside a health module to poll for pod data, including logs, status, and health. The primary use of this service is to have quick to deploy long-lived services based on Docker images that are exposed via HTTP or TCP endpoints listed by the API.  **The Pods service provides functionality for two types of pod solutions:**  * **Templated Pods** for run-as-is popular images. Neo4J is one example, the template manages TCP ports, user creation, and permissions.  * **Custom Pods** for arbitrary docker images with less functionality. In this case we will expose port 5000 and do nothing else.   The live-docs act as the most up-to-date API reference. Visit the [documentation for more information](https://tapis.readthedocs.io/en/latest/technical/pods.html).
 *
 * The version of the OpenAPI document: 26Q1.1
 * Contact: cicsupport@tacc.utexas.edu
 * Generated by: https://openapi-generator.tech
 */

use super::{configuration, ContentType, Error};
use crate::{apis::ResponseContent, models};
use reqwest;
use serde::{de::Error as _, Deserialize, Serialize};

/// struct for typed errors of method [`create_pod`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreatePodError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`delete_pod`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeletePodError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`download_from_pod`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DownloadFromPodError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`exec_pod_commands`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ExecPodCommandsError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`get_derived_pod`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetDerivedPodError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`get_pod`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetPodError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`get_pod_credentials`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetPodCredentialsError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`get_pod_logs`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetPodLogsError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`list_files_in_pod`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListFilesInPodError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`list_pods`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListPodsError {
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`pod_auth`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PodAuthError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`pod_auth_callback`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PodAuthCallbackError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`restart_pod`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RestartPodError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`save_pod_as_template_tag`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SavePodAsTemplateTagError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`start_pod`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum StartPodError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`stop_pod`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum StopPodError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`update_pod`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdatePodError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`upload_to_pod`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UploadToPodError {
    Status422(models::HttpValidationError),
    UnknownValue(serde_json::Value),
}

/// Create a pod with inputted information.  Notes: - Author will be given ADMIN level permissions to the pod. - status_requested defaults to \"ON\". So pod will immediately begin creation.  Returns new pod object.
pub async fn create_pod(
    configuration: &configuration::Configuration,
    new_pod: models::NewPod,
) -> Result<models::PodResponse, Error<CreatePodError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_body_new_pod = new_pod;

    let uri_str = format!("{}/pods", configuration.base_path);
    let mut req_builder = configuration
        .client
        .request(reqwest::Method::POST, &uri_str);

    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }
    req_builder = req_builder.json(&p_body_new_pod);

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PodResponse`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PodResponse`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<CreatePodError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Delete a pod.  Returns \"\".
pub async fn delete_pod(
    configuration: &configuration::Configuration,
    pod_id: &str,
) -> Result<models::PodDeleteResponse, Error<DeletePodError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id = pod_id;

    let uri_str = format!(
        "{}/pods/{pod_id}",
        configuration.base_path,
        pod_id = p_path_pod_id
    );
    let mut req_builder = configuration
        .client
        .request(reqwest::Method::DELETE, &uri_str);

    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PodDeleteResponse`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PodDeleteResponse`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<DeletePodError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Download a file from a specific path inside the pod using Kubernetes exec.  Path options (use one, not both): - URL path: Relative paths only (e.g., /download_from_pod/myfile.txt -> \"myfile.txt\") - Query parameter: Absolute paths allowed (e.g., ?path=/tmp/myfile.txt -> \"/tmp/myfile.txt\")  Notes: - Pod must have /bin/sh and base64 available (most standard images include these) - Distroless or minimal images without a shell or base64 will not work with this endpoint.
pub async fn download_from_pod(
    configuration: &configuration::Configuration,
    pod_id: &str,
    url_path: &str,
    path: Option<&str>,
) -> Result<serde_json::Value, Error<DownloadFromPodError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id = pod_id;
    let p_path_url_path = url_path;
    let p_query_path = path;

    let uri_str = format!(
        "{}/pods/{pod_id}/download_from_pod{url_path}",
        configuration.base_path,
        pod_id = crate::apis::urlencode(p_path_pod_id),
        url_path = crate::apis::urlencode(p_path_url_path)
    );
    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

    if let Some(ref param_value) = p_query_path {
        req_builder = req_builder.query(&[("path", &param_value.to_string())]);
    }
    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<DownloadFromPodError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Execute one or more commands in a pod.  Accepts either: - Single command: [\"sleep\", \"5\"] - Multiple commands: [[\"sleep\", \"5\"], [\"echo\", \"hello\"]]  Executes commands synchronously in the pod: - Each command runs sequentially - Total request time = sum of all command execution times - Request remains open until all commands complete - Returns consolidated results for all commands  Response includes: - Individual command outputs - Success/failure status - Execution duration
pub async fn exec_pod_commands(
    configuration: &configuration::Configuration,
    pod_id: &str,
    execute_pod_commands: models::ExecutePodCommands,
) -> Result<serde_json::Value, Error<ExecPodCommandsError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id = pod_id;
    let p_body_execute_pod_commands = execute_pod_commands;

    let uri_str = format!(
        "{}/pods/{pod_id}/exec",
        configuration.base_path,
        pod_id = p_path_pod_id
    );
    let mut req_builder = configuration
        .client
        .request(reqwest::Method::POST, &uri_str);

    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }
    req_builder = req_builder.json(&p_body_execute_pod_commands);

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<ExecPodCommandsError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Derive a pod's final definition if templates are used.  Returns final pod definition to be used for pod creation.  Use resolve_secrets=true (admin only) to preview how secrets will be interpolated into environment_variables and config_content.
pub async fn get_derived_pod(
    configuration: &configuration::Configuration,
    pod_id: &str,
    include_configs: Option<bool>,
    resolve_secrets: Option<bool>,
) -> Result<models::PodResponse, Error<GetDerivedPodError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id = pod_id;
    let p_query_include_configs = include_configs;
    let p_query_resolve_secrets = resolve_secrets;

    let uri_str = format!(
        "{}/pods/{pod_id}/derived",
        configuration.base_path,
        pod_id = crate::apis::urlencode(p_path_pod_id)
    );
    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

    if let Some(ref param_value) = p_query_include_configs {
        req_builder = req_builder.query(&[("include_configs", &param_value.to_string())]);
    }
    if let Some(ref param_value) = p_query_resolve_secrets {
        req_builder = req_builder.query(&[("resolve_secrets", &param_value.to_string())]);
    }
    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PodResponse`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PodResponse`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<GetDerivedPodError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Get a pod.  Returns retrieved pod object.  Use check_unresolved=true to detect any ${...} patterns that haven't been resolved.
pub async fn get_pod(
    configuration: &configuration::Configuration,
    pod_id: &str,
    include_configs: Option<bool>,
    check_unresolved: Option<bool>,
) -> Result<models::PodResponse, Error<GetPodError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id = pod_id;
    let p_query_include_configs = include_configs;
    let p_query_check_unresolved = check_unresolved;

    let uri_str = format!(
        "{}/pods/{pod_id}",
        configuration.base_path,
        pod_id = crate::apis::urlencode(p_path_pod_id)
    );
    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

    if let Some(ref param_value) = p_query_include_configs {
        req_builder = req_builder.query(&[("include_configs", &param_value.to_string())]);
    }
    if let Some(ref param_value) = p_query_check_unresolved {
        req_builder = req_builder.query(&[("check_unresolved", &param_value.to_string())]);
    }
    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PodResponse`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PodResponse`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<GetPodError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Get the credentials created for a pod.  Note: - These credentials are used in the case of templated pods, but for custom pods they're not.  Returns user accessible credentials.
pub async fn get_pod_credentials(
    configuration: &configuration::Configuration,
    pod_id: &str,
) -> Result<models::PodCredentialsResponse, Error<GetPodCredentialsError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id = pod_id;

    let uri_str = format!(
        "{}/pods/{pod_id}/credentials",
        configuration.base_path,
        pod_id = p_path_pod_id
    );
    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PodCredentialsResponse`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PodCredentialsResponse`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<GetPodCredentialsError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Get a pods stdout logs and action_logs.  Note: - Pod logs are only retrieved while pod is running. - If a pod is restarted or turned off and then on, the logs will be reset. - Action logs are detailed logs of actions taken on the pod.  Returns pod stdout logs and action logs.
pub async fn get_pod_logs(
    configuration: &configuration::Configuration,
    pod_id: &str,
) -> Result<models::PodLogsResponse, Error<GetPodLogsError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id = pod_id;

    let uri_str = format!(
        "{}/pods/{pod_id}/logs",
        configuration.base_path,
        pod_id = p_path_pod_id
    );
    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PodLogsResponse`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PodLogsResponse`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<GetPodLogsError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// List files and directories at a specific path inside the pod using Kubernetes exec.  Path options (use one, not both): - URL path: Relative paths only (e.g., /list_files/mydir -> \"mydir\") - Query parameter: Absolute paths allowed (e.g., ?path=/tmp -> \"/tmp\")  Notes: - Pod must have /bin/sh and ls available (most standard images include these) - Distroless or minimal images without a shell will return a 500 error.
pub async fn list_files_in_pod(
    configuration: &configuration::Configuration,
    pod_id: &str,
    url_path: &str,
    path: Option<&str>,
) -> Result<serde_json::Value, Error<ListFilesInPodError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id = pod_id;
    let p_path_url_path = url_path;
    let p_query_path = path;

    let uri_str = format!(
        "{}/pods/{pod_id}/list_files{url_path}",
        configuration.base_path,
        pod_id = crate::apis::urlencode(p_path_pod_id),
        url_path = crate::apis::urlencode(p_path_url_path)
    );
    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

    if let Some(ref param_value) = p_query_path {
        req_builder = req_builder.query(&[("path", &param_value.to_string())]);
    }
    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<ListFilesInPodError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Get all pods in your respective tenant and site that you have READ or higher access to.  Returns a list of pods.
pub async fn list_pods(
    configuration: &configuration::Configuration,
) -> Result<models::PodsResponse, Error<ListPodsError>> {
    let uri_str = format!("{}/pods", configuration.base_path);
    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PodsResponse`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PodsResponse`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<ListPodsError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Auth endpoint for each pod. When a networking object defines tapis_auth=True, this endpoint manages auth.  Traefik has a forwardAuth middleware for http routes. This redirects users, auth happens, if traefik gets 200 then traefik allows user to endpoint. Auth flow for a user getting to \"fastapi hello world\" pod at https://fastapi.pods.tacc.tapis.io.   1) User navigates to https://fastapi.pods.tacc.tapis.io   2) Traefik redirects user to https://tacc.tapis.io/v3/pods/fastapi/auth   3) Check if logged in via cookies, if logged in, respond 200 + set user defined headers. Otherwise...   4) Pods service creates client in correct tenant for user or updates client if it already exists. (we expect only one client in use at a time)   5) With client the /auth endpoint redirects users to https://tacc.tapis.io/v3/oauth2/authorize?client_id={client_id}&redirect_uri={callback_url}&response_type=code   6) User logs in via browser, authorizes client, redirects to callback_url at https://tacc.tapis.io/v3/pods/fastapi/auth/callback?code=CodeHere   7) Callback url exchanges code for token, gets username from token, sets X-Tapis-Token cookies, sets response headers according to tapis_auth_response_headers   8) User gets redirected back to https://fastapi.pods.tacc.tapis.io/{tapis_auth_return_path}, Traefik starts forwardAuth, user at this point should be authenticated   9) Auth endpoint responds with 200, sets headers specified by networking stanza, and users gets to fastapi hello world response.  users can specify:  - tapis_auth=True/False - Turns on auth  - tapis_auth_response_headers - dict[str] - headers to set on response and their values  - tapis_auth_allowed_users - list[str] - list of tapis users or permission-based groups allowed to access pod.    Supports literal usernames, \"*\" (all authenticated users), and special group strings:      AUTHORIZED_READS  -> users with READ or higher permission on the pod      AUTHORIZED_USERS  -> users with USER or higher permission on the pod (default)      AUTHORIZED_ADMINS -> users with ADMIN or higher (including APPROVEDADMIN) permission on the pod    Groups resolve against the pod's permissions list at auth time.    Can mix groups with literal usernames, e.g. [\"AUTHORIZED_ADMINS\", \"guest_user\"].  - tapis_auth_return_path - str - uri to return to after auth, default is \"passthrough\", which we save in cookies(?) and return to. x-forwarded-host?   - response headers need to be slightly modifiable to allow for different application requirements  - for example we have to pass username, but many apps require @email.bit, so user must be able to append to user.  - tapis_auth_response_headers: {\"X-Tapis-Username\": \"<<tapisusername>>@tapis.io\", \"FROM\": \"pods auth endpoint from <<tenant>>.<<site>>\", \"OAUTH2_USERNAME_KEY\": \"username\"}
pub async fn pod_auth(
    configuration: &configuration::Configuration,
    pod_id_net: &str,
) -> Result<models::PodResponse, Error<PodAuthError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id_net = pod_id_net;

    let uri_str = format!(
        "{}/pods/{pod_id_net}/auth",
        configuration.base_path,
        pod_id_net = p_path_pod_id_net
    );
    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PodResponse`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PodResponse`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<PodAuthError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

pub async fn pod_auth_callback(
    configuration: &configuration::Configuration,
    pod_id_net: &str,
) -> Result<models::PodResponse, Error<PodAuthCallbackError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id_net = pod_id_net;

    let uri_str = format!(
        "{}/pods/{pod_id_net}/auth/callback",
        configuration.base_path,
        pod_id_net = p_path_pod_id_net
    );
    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PodResponse`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PodResponse`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<PodAuthCallbackError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Restart a pod.  Note: - Sets status_requested to RESTART. If pod status gets to STOPPED, status_requested will be flipped to ON. Health should then create new pod. - If grab_latest_template_tag is True, attempts to grab the latest version of the template tag if the pod has a template.  Returns updated pod object.
pub async fn restart_pod(
    configuration: &configuration::Configuration,
    pod_id: &str,
    grab_latest_template_tag: Option<bool>,
) -> Result<models::PodResponse, Error<RestartPodError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id = pod_id;
    let p_query_grab_latest_template_tag = grab_latest_template_tag;

    let uri_str = format!(
        "{}/pods/{pod_id}/restart",
        configuration.base_path,
        pod_id = p_path_pod_id
    );
    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

    if let Some(ref param_value) = p_query_grab_latest_template_tag {
        req_builder = req_builder.query(&[("grab_latest_template_tag", &param_value.to_string())]);
    }
    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PodResponse`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PodResponse`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<RestartPodError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Endpoint takes pod_id and derives a pod_definition to create a template tag from it. Allows users to save the configuration of a particular pod as a template tag.  POST data contains location to save the tag and tag creation data  Return the template tag object.
pub async fn save_pod_as_template_tag(
    configuration: &configuration::Configuration,
    pod_id_net: &str,
    new_template_tag_from_pod: models::NewTemplateTagFromPod,
) -> Result<models::TemplateTagResponse, Error<SavePodAsTemplateTagError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id_net = pod_id_net;
    let p_body_new_template_tag_from_pod = new_template_tag_from_pod;

    let uri_str = format!(
        "{}/pods/{pod_id_net}/save_pod_as_template_tag",
        configuration.base_path,
        pod_id_net = p_path_pod_id_net
    );
    let mut req_builder = configuration
        .client
        .request(reqwest::Method::POST, &uri_str);

    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }
    req_builder = req_builder.json(&p_body_new_template_tag_from_pod);

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TemplateTagResponse`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TemplateTagResponse`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<SavePodAsTemplateTagError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Start a pod.  Note: - Sets status_requested to ON. Pod will attempt to deploy.  Returns updated pod object.
pub async fn start_pod(
    configuration: &configuration::Configuration,
    pod_id: &str,
) -> Result<models::PodResponse, Error<StartPodError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id = pod_id;

    let uri_str = format!(
        "{}/pods/{pod_id}/start",
        configuration.base_path,
        pod_id = p_path_pod_id
    );
    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PodResponse`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PodResponse`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<StartPodError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Stop a pod.  Note: - Sets status_requested to OFF. Pod will attempt to get to STOPPED status unless start_pod is ran.  Returns updated pod object.
pub async fn stop_pod(
    configuration: &configuration::Configuration,
    pod_id: &str,
) -> Result<models::PodResponse, Error<StopPodError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id = pod_id;

    let uri_str = format!(
        "{}/pods/{pod_id}/stop",
        configuration.base_path,
        pod_id = p_path_pod_id
    );
    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PodResponse`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PodResponse`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<StopPodError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Update a pod.  Note: - Pod will not be restarted, you must restart the pod for any pod-related changes to proliferate.  Returns updated pod object.
pub async fn update_pod(
    configuration: &configuration::Configuration,
    pod_id: &str,
    update_pod: models::UpdatePod,
) -> Result<models::PodResponse, Error<UpdatePodError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id = pod_id;
    let p_body_update_pod = update_pod;

    let uri_str = format!(
        "{}/pods/{pod_id}",
        configuration.base_path,
        pod_id = p_path_pod_id
    );
    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);

    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }
    req_builder = req_builder.json(&p_body_update_pod);

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PodResponse`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PodResponse`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<UpdatePodError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}

/// Upload a file to a specific path inside the pod using Kubernetes exec.  Notes: - Pod must have /bin/sh available (most standard images include this) - Distroless or minimal images without a shell will not work with this endpoint.
pub async fn upload_to_pod(
    configuration: &configuration::Configuration,
    pod_id: &str,
    file: std::path::PathBuf,
    dest_path: &str,
) -> Result<serde_json::Value, Error<UploadToPodError>> {
    // add a prefix to parameters to efficiently prevent name collisions
    let p_path_pod_id = pod_id;
    let p_form_file = file;
    let p_form_dest_path = dest_path;

    let uri_str = format!(
        "{}/pods/{pod_id}/upload_to_pod",
        configuration.base_path,
        pod_id = crate::apis::urlencode(p_path_pod_id)
    );
    let mut req_builder = configuration
        .client
        .request(reqwest::Method::POST, &uri_str);

    if let Some(ref user_agent) = configuration.user_agent {
        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
    }
    let mut multipart_form = reqwest::multipart::Form::new();
    multipart_form = multipart_form.file("file", p_form_file.as_os_str()).await?;
    multipart_form = multipart_form.text("dest_path", p_form_dest_path.to_string());
    req_builder = req_builder.multipart(multipart_form);

    let req = req_builder.build()?;
    let resp = configuration.client.execute(req).await?;

    let status = resp.status();
    let content_type = resp
        .headers()
        .get("content-type")
        .and_then(|v| v.to_str().ok())
        .unwrap_or("application/octet-stream");
    let content_type = super::ContentType::from(content_type);

    if !status.is_client_error() && !status.is_server_error() {
        let content = resp.text().await?;
        match content_type {
            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
        }
    } else {
        let content = resp.text().await?;
        let entity: Option<UploadToPodError> = serde_json::from_str(&content).ok();
        Err(Error::ResponseError(ResponseContent {
            status,
            content,
            entity,
        }))
    }
}