-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.rs
More file actions
3089 lines (3088 loc) · 125 KB
/
types.rs
File metadata and controls
3089 lines (3088 loc) · 125 KB
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
// @generated by oas3-gen
#![allow(clippy::all)]
#![allow(dead_code)]
#![allow(clippy::doc_markdown)]
#![allow(clippy::large_enum_variant)]
#![allow(clippy::missing_panics_doc)]
#![allow(clippy::result_large_err)]
//!
//! AUTO-GENERATED CODE - DO NOT EDIT!
//!
//! FirecREST
//! Source: /tmp/.tmppwtkBD.json
//! Version: 2.4.1
//! Generated by `oas3-gen v0.21.1`
//!
//! No description provided
use serde::{Deserialize, Serialize};
static REGEX_ATTACH_COMPUTE_SYSTEM_NAME_JOBS_JOB_ID_ATTACH_PUT_REQUEST_JOB_ID: std::sync::LazyLock<regex::Regex> =
std::sync::LazyLock::new(|| regex::Regex::new("^[a-zA-Z0-9]+$").expect("invalid regex"));
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum ApResponseErrorType {
#[serde(rename = "error")]
#[default]
Error,
#[serde(rename = "validation")]
Validation,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ApiResponseError {
pub data: Option<serde_json::Value>,
#[serde(rename = "errorType")]
pub error_type: Option<String>,
pub message: String,
pub user: Option<String>,
}
impl std::fmt::Display for ApiResponseError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.message)
}
}
impl std::error::Error for ApiResponseError {}
///Attach a procces to a job by `{job_id}`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct AttachComputeSystemNameJobsJobIdAttachPutRequest {
///Job id
/// - Location: `Path`
#[validate(
length(min = 1u64),
regex(path = "REGEX_ATTACH_COMPUTE_SYSTEM_NAME_JOBS_JOB_ID_ATTACH_PUT_REQUEST_JOB_ID")
)]
pub job_id: String,
/// - Location: `Path`
#[validate(length(min = 1u64))]
pub system_name: String,
pub body: AttachComputeSystemNameJobsJobIdAttachPutRequestBody,
}
impl AttachComputeSystemNameJobsJobIdAttachPutRequest {
///Render the request path with parameters.
pub fn render_path(&self) -> anyhow::Result<String> {
Ok(format!(
"compute/{}/jobs/{}/attach",
oas3_gen_support::percent_encode_path_segment(&oas3_gen_support::serialize_query_param(&self.system_name)?),
oas3_gen_support::percent_encode_path_segment(&oas3_gen_support::serialize_query_param(&self.job_id)?)
))
}
///Parse the HTTP response into the response enum.
pub async fn parse_response(
req: reqwest::Response,
) -> anyhow::Result<DeleteRmFilesystemSystemNameOpsRmDeleteResponse> {
let status = req.status();
if status.is_success() {
let _ = req.bytes().await?;
return Ok(DeleteRmFilesystemSystemNameOpsRmDeleteResponse::NoContent);
}
if status.is_client_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(DeleteRmFilesystemSystemNameOpsRmDeleteResponse::ClientError(data));
}
if status.is_server_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(DeleteRmFilesystemSystemNameOpsRmDeleteResponse::ServerError(data));
}
let _ = req.bytes().await?;
Ok(DeleteRmFilesystemSystemNameOpsRmDeleteResponse::Unknown)
}
}
pub type AttachComputeSystemNameJobsJobIdAttachPutRequestBody = PostJobAttachRequest;
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct BodyPostUploadFilesystemSystemNameOpsUploadPost {
///File to be uploaded as `multipart/form-data`
pub file: Vec<u8>,
}
///Configuration for automatic object lifecycle in storage buckets.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct BucketLifecycleConfiguration {
///Number of days after which objects will expire automatically.
#[default(Some(10i64))]
pub days: Option<i64>,
}
///Create compress file or directory operation (`tar`) (for files larger than 5242880 Bytes)
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct CompressFilesystemSystemNameTransferCompressPostRequest {
/// - Location: `Path`
#[validate(length(min = 1u64))]
pub system_name: String,
pub body: CompressFilesystemSystemNameTransferCompressPostRequestBody,
}
impl CompressFilesystemSystemNameTransferCompressPostRequest {
///Render the request path with parameters.
pub fn render_path(&self) -> anyhow::Result<String> {
Ok(format!(
"filesystem/{}/transfer/compress",
oas3_gen_support::percent_encode_path_segment(&oas3_gen_support::serialize_query_param(&self.system_name)?)
))
}
///Parse the HTTP response into the response enum.
pub async fn parse_response(
req: reqwest::Response,
) -> anyhow::Result<CompressFilesystemSystemNameTransferCompressPostResponse> {
let status = req.status();
if status.is_success() {
let data = oas3_gen_support::Diagnostics::<CompressResponse>::json_with_diagnostics(req).await?;
return Ok(CompressFilesystemSystemNameTransferCompressPostResponse::Created(data));
}
if status.is_client_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(CompressFilesystemSystemNameTransferCompressPostResponse::ClientError(
data,
));
}
if status.is_server_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(CompressFilesystemSystemNameTransferCompressPostResponse::ServerError(
data,
));
}
let _ = req.bytes().await?;
Ok(CompressFilesystemSystemNameTransferCompressPostResponse::Unknown)
}
}
pub type CompressFilesystemSystemNameTransferCompressPostRequestBody = CompressRequest;
///Response types for compress_filesystem__system_name__transfer_compress_post
#[derive(Clone, Debug)]
pub enum CompressFilesystemSystemNameTransferCompressPostResponse {
///201: Compress file or directory operation created successfully
Created(CompressResponse),
///4XX: Client Error
ClientError(ApiResponseError),
///5XX: Server Error
ServerError(ApiResponseError),
///default: Unknown response
Unknown,
}
#[oas3_gen_support::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct CompressRequest {
///Name of the account in the scheduler
pub account: Option<String>,
///Defines the type of compression to be used. By default gzip is used.
#[default(Some(Default::default()))]
pub compression: Option<CompressionType>,
///If set to `true`, it follows symbolic links and archive the files they point to instead of the links
/// themselves.
#[default(Some(false))]
pub dereference: Option<bool>,
///Regex pattern to filter files to compress
#[serde(rename = "matchPattern")]
pub match_pattern: Option<String>,
#[serde(rename = "sourcePath")]
pub source_path: Option<String>,
///Target path of the compress operation
#[serde(rename = "targetPath")]
#[validate(length(min = 1u64))]
pub target_path: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct CompressResponse {
#[serde(rename = "transferJob")]
pub transfer_job: FirecrestFilesystemTransferModelsTransferJob,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum CompressionType {
#[serde(rename = "none")]
#[default]
None,
#[serde(rename = "bzip2")]
Bzip2,
#[serde(rename = "gzip")]
Gzip,
#[serde(rename = "xz")]
Xz,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum ContentUnit {
#[serde(rename = "lines")]
#[default]
Lines,
#[serde(rename = "bytes")]
Bytes,
}
#[oas3_gen_support::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct CopyRequest {
///Name of the account in the scheduler
pub account: Option<String>,
///If set to `true`, it follows symbolic links and copies the files they point to instead of the links themselves.
#[default(Some(false))]
pub dereference: Option<bool>,
#[serde(rename = "sourcePath")]
pub source_path: Option<String>,
///Target path of the copy operation
#[serde(rename = "targetPath")]
#[validate(length(min = 1u64))]
pub target_path: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct CopyResponse {
#[serde(rename = "transferJob")]
pub transfer_job: FirecrestFilesystemTransferModelsTransferJob,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct DataOperation {
///Data transfer service configuration
pub data_transfer: Option<S3DataTransfer>,
///Maximum file size (in bytes) allowed for direct upload and download. Larger files will go through the staging
/// area.
#[default(Some(5242880i64))]
pub max_ops_file_size: Option<i64>,
}
///Cancel a job
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct DeleteJobCancelComputeSystemNameJobsJobIdDeleteRequest {
///Job id
/// - Location: `Path`
#[validate(
length(min = 1u64),
regex(path = "REGEX_ATTACH_COMPUTE_SYSTEM_NAME_JOBS_JOB_ID_ATTACH_PUT_REQUEST_JOB_ID")
)]
pub job_id: String,
/// - Location: `Path`
#[validate(length(min = 1u64))]
pub system_name: String,
}
impl DeleteJobCancelComputeSystemNameJobsJobIdDeleteRequest {
///Render the request path with parameters.
pub fn render_path(&self) -> anyhow::Result<String> {
Ok(format!(
"compute/{}/jobs/{}",
oas3_gen_support::percent_encode_path_segment(&oas3_gen_support::serialize_query_param(&self.system_name)?),
oas3_gen_support::percent_encode_path_segment(&oas3_gen_support::serialize_query_param(&self.job_id)?)
))
}
///Parse the HTTP response into the response enum.
pub async fn parse_response(
req: reqwest::Response,
) -> anyhow::Result<DeleteRmFilesystemSystemNameOpsRmDeleteResponse> {
let status = req.status();
if status.is_success() {
let _ = req.bytes().await?;
return Ok(DeleteRmFilesystemSystemNameOpsRmDeleteResponse::NoContent);
}
if status.is_client_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(DeleteRmFilesystemSystemNameOpsRmDeleteResponse::ClientError(data));
}
if status.is_server_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(DeleteRmFilesystemSystemNameOpsRmDeleteResponse::ServerError(data));
}
let _ = req.bytes().await?;
Ok(DeleteRmFilesystemSystemNameOpsRmDeleteResponse::Unknown)
}
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct DeleteResponse {
#[serde(rename = "transferJob")]
pub transfer_job: FirecrestFilesystemTransferModelsTransferJob,
}
///Delete file or directory operation (`rm`)
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct DeleteRmFilesystemSystemNameOpsRmDeleteRequest {
/// - Location: `Path`
#[validate(length(min = 1u64))]
pub system_name: String,
///The path to delete
/// - Location: `Query`
#[validate(length(min = 1u64))]
pub path: String,
}
impl DeleteRmFilesystemSystemNameOpsRmDeleteRequest {
///Render the request path with parameters.
pub fn render_path(&self) -> anyhow::Result<String> {
use std::fmt::Write as _;
let mut path = format!(
"filesystem/{}/ops/rm",
oas3_gen_support::percent_encode_path_segment(&oas3_gen_support::serialize_query_param(&self.system_name)?)
);
let mut prefix = '\0';
prefix = if prefix == '\0' { '?' } else { '&' };
write!(
&mut path,
"{prefix}path={}",
oas3_gen_support::percent_encode_query_component(&oas3_gen_support::serialize_query_param(&self.path)?)
)
.unwrap();
Ok(path)
}
///Parse the HTTP response into the response enum.
pub async fn parse_response(
req: reqwest::Response,
) -> anyhow::Result<DeleteRmFilesystemSystemNameOpsRmDeleteResponse> {
let status = req.status();
if status.is_success() {
let _ = req.bytes().await?;
return Ok(DeleteRmFilesystemSystemNameOpsRmDeleteResponse::NoContent);
}
if status.is_client_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(DeleteRmFilesystemSystemNameOpsRmDeleteResponse::ClientError(data));
}
if status.is_server_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(DeleteRmFilesystemSystemNameOpsRmDeleteResponse::ServerError(data));
}
let _ = req.bytes().await?;
Ok(DeleteRmFilesystemSystemNameOpsRmDeleteResponse::Unknown)
}
}
///Response types for delete_rm_filesystem__system_name__ops_rm_delete
#[derive(Clone, Debug)]
pub enum DeleteRmFilesystemSystemNameOpsRmDeleteResponse {
///204: File or directory deleted successfully
NoContent,
///4XX: Client Error
ClientError(ApiResponseError),
///5XX: Server Error
ServerError(ApiResponseError),
///default: Unknown response
Unknown,
}
///Create remove file or directory operation (`rm`) (for files larger than 5242880 Bytes)
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct DeleteRmFilesystemSystemNameTransferRmDeleteRequest {
/// - Location: `Path`
#[validate(length(min = 1u64))]
pub system_name: String,
///The path to delete
/// - Location: `Query`
#[validate(length(min = 1u64))]
pub path: String,
/// - Location: `Query`
pub account: Option<String>,
}
impl DeleteRmFilesystemSystemNameTransferRmDeleteRequest {
///Render the request path with parameters.
pub fn render_path(&self) -> anyhow::Result<String> {
use std::fmt::Write as _;
let mut path = format!(
"filesystem/{}/transfer/rm",
oas3_gen_support::percent_encode_path_segment(&oas3_gen_support::serialize_query_param(&self.system_name)?)
);
let mut prefix = '\0';
prefix = if prefix == '\0' { '?' } else { '&' };
write!(
&mut path,
"{prefix}path={}",
oas3_gen_support::percent_encode_query_component(&oas3_gen_support::serialize_query_param(&self.path)?)
)
.unwrap();
if let Some(value) = &self.account {
prefix = if prefix == '\0' { '?' } else { '&' };
write!(
&mut path,
"{prefix}account={}",
oas3_gen_support::percent_encode_query_component(&oas3_gen_support::serialize_query_param(value)?)
)
.unwrap();
}
Ok(path)
}
///Parse the HTTP response into the response enum.
pub async fn parse_response(
req: reqwest::Response,
) -> anyhow::Result<DeleteRmFilesystemSystemNameTransferRmDeleteResponse> {
let status = req.status();
if status.is_success() {
let data = oas3_gen_support::Diagnostics::<DeleteResponse>::json_with_diagnostics(req).await?;
return Ok(DeleteRmFilesystemSystemNameTransferRmDeleteResponse::Ok(data));
}
if status.is_client_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(DeleteRmFilesystemSystemNameTransferRmDeleteResponse::ClientError(data));
}
if status.is_server_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(DeleteRmFilesystemSystemNameTransferRmDeleteResponse::ServerError(data));
}
let _ = req.bytes().await?;
Ok(DeleteRmFilesystemSystemNameTransferRmDeleteResponse::Unknown)
}
}
///Response types for delete_rm_filesystem__system_name__transfer_rm_delete
#[derive(Clone, Debug)]
pub enum DeleteRmFilesystemSystemNameTransferRmDeleteResponse {
///200: Remove file or directory operation created successfully
Ok(DeleteResponse),
///4XX: Client Error
ClientError(ApiResponseError),
///5XX: Server Error
ServerError(ApiResponseError),
///default: Unknown response
Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct DownloadFileResponse {
///Data transfer parameters specific to the transfer method
#[serde(rename = "transferDirectives")]
pub transfer_directives: DownloadFileResponseTransferDirectives,
#[serde(rename = "transferJob")]
pub transfer_job: FirecrestFilesystemTransferModelsTransferJob,
}
///Data transfer parameters specific to the transfer method
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum DownloadFileResponseTransferDirectives {
#[default]
Wormhole(WormholeTransferResponse),
S3(S3TransferResponse),
Streamer(StreamerTransferResponse),
}
impl DownloadFileResponseTransferDirectives {
///Creates a `Wormhole` variant with default values.
pub fn wormhole() -> Self {
Self::Wormhole(WormholeTransferResponse::default())
}
///Creates a `S3` variant with default values.
pub fn s3() -> Self {
Self::S3(S3TransferResponse::default())
}
///Creates a `Streamer` variant with default values.
pub fn streamer() -> Self {
Self::Streamer(StreamerTransferResponse::default())
}
}
///Create extract file operation (`tar`) (for files larger than 5242880 Bytes)
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ExtractFilesystemSystemNameTransferExtractPostRequest {
/// - Location: `Path`
#[validate(length(min = 1u64))]
pub system_name: String,
pub body: ExtractFilesystemSystemNameTransferExtractPostRequestBody,
}
impl ExtractFilesystemSystemNameTransferExtractPostRequest {
///Render the request path with parameters.
pub fn render_path(&self) -> anyhow::Result<String> {
Ok(format!(
"filesystem/{}/transfer/extract",
oas3_gen_support::percent_encode_path_segment(&oas3_gen_support::serialize_query_param(&self.system_name)?)
))
}
///Parse the HTTP response into the response enum.
pub async fn parse_response(
req: reqwest::Response,
) -> anyhow::Result<ExtractFilesystemSystemNameTransferExtractPostResponse> {
let status = req.status();
if status.is_success() {
let data = oas3_gen_support::Diagnostics::<ExtractResponse>::json_with_diagnostics(req).await?;
return Ok(ExtractFilesystemSystemNameTransferExtractPostResponse::Created(data));
}
if status.is_client_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(ExtractFilesystemSystemNameTransferExtractPostResponse::ClientError(
data,
));
}
if status.is_server_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(ExtractFilesystemSystemNameTransferExtractPostResponse::ServerError(
data,
));
}
let _ = req.bytes().await?;
Ok(ExtractFilesystemSystemNameTransferExtractPostResponse::Unknown)
}
}
pub type ExtractFilesystemSystemNameTransferExtractPostRequestBody = ExtractRequest;
///Response types for extract_filesystem__system_name__transfer_extract_post
#[derive(Clone, Debug)]
pub enum ExtractFilesystemSystemNameTransferExtractPostResponse {
///201: Extract file or directory operation created successfully
Created(ExtractResponse),
///4XX: Client Error
ClientError(ApiResponseError),
///5XX: Server Error
ServerError(ApiResponseError),
///default: Unknown response
Unknown,
}
#[oas3_gen_support::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct ExtractRequest {
///Name of the account in the scheduler
pub account: Option<String>,
///Defines the type of compression to be used. By default gzip is used.
#[default(Some(Default::default()))]
pub compression: Option<CompressionType>,
#[serde(rename = "sourcePath")]
pub source_path: Option<String>,
///Path to the directory where to extract the compressed file
#[serde(rename = "targetPath")]
#[validate(length(min = 1u64))]
pub target_path: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ExtractResponse {
#[serde(rename = "transferJob")]
pub transfer_job: FirecrestFilesystemTransferModelsTransferJob,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct File {
pub group: String,
#[serde(rename = "lastModified")]
pub last_modified: String,
#[serde(rename = "linkTarget")]
pub link_target: Option<String>,
pub name: String,
pub permissions: String,
pub size: String,
#[serde(rename = "type")]
pub r#type: String,
pub user: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct FileChecksum {
#[default(Some("SHA-256".to_string()))]
pub algorithm: Option<String>,
pub checksum: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct FileContent {
pub content: String,
#[serde(rename = "contentType")]
pub content_type: String,
#[serde(rename = "endPosition")]
pub end_position: i64,
#[serde(rename = "startPosition")]
pub start_position: i64,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct FileStat {
pub atime: i64,
pub ctime: i64,
pub dev: i64,
pub gid: i64,
pub ino: i64,
pub mode: i64,
pub mtime: i64,
pub nlink: i64,
pub size: i64,
pub uid: i64,
}
///Defines a cluster file system and its type.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct FileSystem {
///Data types for cluster file systems.
#[serde(rename = "dataType")]
pub data_type: String,
///Mark this as the default working directory.
#[serde(rename = "defaultWorkDir")]
#[default(Some(false))]
pub default_work_dir: Option<bool>,
///Mount path for the file system.
pub path: String,
}
///Data types for cluster file systems.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum FileSystemDataType {
#[serde(rename = "users")]
#[default]
Users,
#[serde(rename = "store")]
Store,
#[serde(rename = "archive")]
Archive,
#[serde(rename = "apps")]
Apps,
#[serde(rename = "scratch")]
Scratch,
#[serde(rename = "project")]
Project,
}
///Health check for a mounted file system.
#[oas3_gen_support::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct FilesystemServiceHealth {
///True if the service is healthy.
#[default(Some(false))]
pub healthy: Option<bool>,
///Timestamp of the last health check.
#[serde(rename = "lastChecked")]
pub last_checked: Option<chrono::DateTime<chrono::Utc>>,
///Service response latency in seconds.
pub latency: Option<f64>,
///Optional status message.
pub message: Option<String>,
///Path of the monitored file system.
pub path: Option<String>,
///Types of services that can be health-checked.
#[serde(rename = "serviceType")]
pub service_type: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct FirecrestFilesystemTransferModelsTransferJob {
#[serde(rename = "jobId")]
pub job_id: i64,
pub logs: FirecrestFilesystemTransferModelsTransferJobLogs,
pub system: String,
#[serde(rename = "workingDirectory")]
pub working_directory: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct FirecrestFilesystemTransferModelsTransferJobLogs {
#[serde(rename = "errorLog")]
pub error_log: String,
#[serde(rename = "outputLog")]
pub output_log: String,
}
///Output the checksum of a file (using SHA-256 algotithm)
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetChecksumFilesystemSystemNameOpsChecksumGetRequest {
/// - Location: `Path`
#[validate(length(min = 1u64))]
pub system_name: String,
///Target system
/// - Location: `Query`
#[validate(length(min = 1u64))]
pub path: String,
}
impl GetChecksumFilesystemSystemNameOpsChecksumGetRequest {
///Render the request path with parameters.
pub fn render_path(&self) -> anyhow::Result<String> {
use std::fmt::Write as _;
let mut path = format!(
"filesystem/{}/ops/checksum",
oas3_gen_support::percent_encode_path_segment(&oas3_gen_support::serialize_query_param(&self.system_name)?)
);
let mut prefix = '\0';
prefix = if prefix == '\0' { '?' } else { '&' };
write!(
&mut path,
"{prefix}path={}",
oas3_gen_support::percent_encode_query_component(&oas3_gen_support::serialize_query_param(&self.path)?)
)
.unwrap();
Ok(path)
}
///Parse the HTTP response into the response enum.
pub async fn parse_response(
req: reqwest::Response,
) -> anyhow::Result<GetChecksumFilesystemSystemNameOpsChecksumGetResponse> {
let status = req.status();
if status.is_success() {
let data = oas3_gen_support::Diagnostics::<GetFileChecksumResponse>::json_with_diagnostics(req).await?;
return Ok(GetChecksumFilesystemSystemNameOpsChecksumGetResponse::Ok(data));
}
if status.is_client_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(GetChecksumFilesystemSystemNameOpsChecksumGetResponse::ClientError(data));
}
if status.is_server_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(GetChecksumFilesystemSystemNameOpsChecksumGetResponse::ServerError(data));
}
let _ = req.bytes().await?;
Ok(GetChecksumFilesystemSystemNameOpsChecksumGetResponse::Unknown)
}
}
///Response types for get_checksum_filesystem__system_name__ops_checksum_get
#[derive(Clone, Debug)]
pub enum GetChecksumFilesystemSystemNameOpsChecksumGetResponse {
///200: Checksum returned successfully
Ok(GetFileChecksumResponse),
///4XX: Client Error
ClientError(ApiResponseError),
///5XX: Server Error
ServerError(ApiResponseError),
///default: Unknown response
Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetDirectoryLsResponse {
pub output: Option<Vec<File>>,
}
///Download a small file (max 5242880 Bytes)
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetDownloadFilesystemSystemNameOpsDownloadGetRequest {
/// - Location: `Path`
#[validate(length(min = 1u64))]
pub system_name: String,
///A file to download
/// - Location: `Query`
#[validate(length(min = 1u64))]
pub path: String,
}
impl GetDownloadFilesystemSystemNameOpsDownloadGetRequest {
///Render the request path with parameters.
pub fn render_path(&self) -> anyhow::Result<String> {
use std::fmt::Write as _;
let mut path = format!(
"filesystem/{}/ops/download",
oas3_gen_support::percent_encode_path_segment(&oas3_gen_support::serialize_query_param(&self.system_name)?)
);
let mut prefix = '\0';
prefix = if prefix == '\0' { '?' } else { '&' };
write!(
&mut path,
"{prefix}path={}",
oas3_gen_support::percent_encode_query_component(&oas3_gen_support::serialize_query_param(&self.path)?)
)
.unwrap();
Ok(path)
}
///Parse the HTTP response into the response enum.
pub async fn parse_response(
req: reqwest::Response,
) -> anyhow::Result<GetDownloadFilesystemSystemNameOpsDownloadGetResponse> {
let status = req.status();
if status.is_success() {
let _ = req.bytes().await?;
return Ok(GetDownloadFilesystemSystemNameOpsDownloadGetResponse::Ok);
}
if status.is_client_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(GetDownloadFilesystemSystemNameOpsDownloadGetResponse::ClientError(data));
}
if status.is_server_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(GetDownloadFilesystemSystemNameOpsDownloadGetResponse::ServerError(data));
}
let _ = req.bytes().await?;
Ok(GetDownloadFilesystemSystemNameOpsDownloadGetResponse::Unknown)
}
}
///Response types for get_download_filesystem__system_name__ops_download_get
#[derive(Clone, Debug)]
pub enum GetDownloadFilesystemSystemNameOpsDownloadGetResponse {
///200: File downloaded successfully
Ok,
///4XX: Client Error
ClientError(ApiResponseError),
///5XX: Server Error
ServerError(ApiResponseError),
///default: Unknown response
Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetFileChecksumResponse {
pub output: Option<FileChecksum>,
}
///Output the type of a file or directory
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetFileFilesystemSystemNameOpsFileGetRequest {
/// - Location: `Path`
#[validate(length(min = 1u64))]
pub system_name: String,
///A file or folder path
/// - Location: `Query`
#[validate(length(min = 1u64))]
pub path: String,
}
impl GetFileFilesystemSystemNameOpsFileGetRequest {
///Render the request path with parameters.
pub fn render_path(&self) -> anyhow::Result<String> {
use std::fmt::Write as _;
let mut path = format!(
"filesystem/{}/ops/file",
oas3_gen_support::percent_encode_path_segment(&oas3_gen_support::serialize_query_param(&self.system_name)?)
);
let mut prefix = '\0';
prefix = if prefix == '\0' { '?' } else { '&' };
write!(
&mut path,
"{prefix}path={}",
oas3_gen_support::percent_encode_query_component(&oas3_gen_support::serialize_query_param(&self.path)?)
)
.unwrap();
Ok(path)
}
///Parse the HTTP response into the response enum.
pub async fn parse_response(
req: reqwest::Response,
) -> anyhow::Result<GetFileFilesystemSystemNameOpsFileGetResponse> {
let status = req.status();
if status.is_success() {
let data = oas3_gen_support::Diagnostics::<GetFileTypeResponse>::json_with_diagnostics(req).await?;
return Ok(GetFileFilesystemSystemNameOpsFileGetResponse::Ok(data));
}
if status.is_client_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(GetFileFilesystemSystemNameOpsFileGetResponse::ClientError(data));
}
if status.is_server_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(GetFileFilesystemSystemNameOpsFileGetResponse::ServerError(data));
}
let _ = req.bytes().await?;
Ok(GetFileFilesystemSystemNameOpsFileGetResponse::Unknown)
}
}
///Response types for get_file_filesystem__system_name__ops_file_get
#[derive(Clone, Debug)]
pub enum GetFileFilesystemSystemNameOpsFileGetResponse {
///200: Type returned successfully
Ok(GetFileTypeResponse),
///4XX: Client Error
ClientError(ApiResponseError),
///5XX: Server Error
ServerError(ApiResponseError),
///default: Unknown response
Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetFileHeadResponse {
pub output: Option<FileContent>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetFileStatResponse {
pub output: Option<FileStat>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetFileTailResponse {
pub output: Option<FileContent>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetFileTypeResponse {
pub output: Option<String>,
}
///Output the first part of file/s (`head`)
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetHeadFilesystemSystemNameOpsHeadGetRequest {
/// - Location: `Path`
#[validate(length(min = 1u64))]
pub system_name: String,
///File path
/// - Location: `Query`
#[validate(length(min = 1u64))]
pub path: String,
///The output will be the first NUM bytes of each file.
/// - Location: `Query`
pub bytes: Option<i64>,
///The output will be the first NUM lines of each file.
/// - Location: `Query`
pub lines: Option<i64>,
///The output will be the whole file, without the last NUM bytes/lines of each file. NUM should be specified in
/// the respective argument through `bytes` or `lines`.
/// - Location: `Query`
#[default(Some(false))]
pub skip_trailing: Option<bool>,
}
impl GetHeadFilesystemSystemNameOpsHeadGetRequest {
///Render the request path with parameters.
pub fn render_path(&self) -> anyhow::Result<String> {
use std::fmt::Write as _;
let mut path = format!(
"filesystem/{}/ops/head",
oas3_gen_support::percent_encode_path_segment(&oas3_gen_support::serialize_query_param(&self.system_name)?)
);
let mut prefix = '\0';
prefix = if prefix == '\0' { '?' } else { '&' };
write!(
&mut path,
"{prefix}path={}",
oas3_gen_support::percent_encode_query_component(&oas3_gen_support::serialize_query_param(&self.path)?)
)
.unwrap();
if let Some(value) = &self.bytes {
prefix = if prefix == '\0' { '?' } else { '&' };
write!(
&mut path,
"{prefix}bytes={}",
oas3_gen_support::percent_encode_query_component(&oas3_gen_support::serialize_query_param(value)?)
)
.unwrap();
}
if let Some(value) = &self.lines {
prefix = if prefix == '\0' { '?' } else { '&' };
write!(
&mut path,
"{prefix}lines={}",
oas3_gen_support::percent_encode_query_component(&oas3_gen_support::serialize_query_param(value)?)
)
.unwrap();
}
if let Some(value) = &self.skip_trailing {
prefix = if prefix == '\0' { '?' } else { '&' };
write!(
&mut path,
"{prefix}skipTrailing={}",
oas3_gen_support::percent_encode_query_component(&oas3_gen_support::serialize_query_param(value)?)
)
.unwrap();
}
Ok(path)
}
///Parse the HTTP response into the response enum.
pub async fn parse_response(
req: reqwest::Response,
) -> anyhow::Result<GetHeadFilesystemSystemNameOpsHeadGetResponse> {
let status = req.status();
if status.is_success() {
let data = oas3_gen_support::Diagnostics::<GetFileHeadResponse>::json_with_diagnostics(req).await?;
return Ok(GetHeadFilesystemSystemNameOpsHeadGetResponse::Ok(data));
}
if status.is_client_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(GetHeadFilesystemSystemNameOpsHeadGetResponse::ClientError(data));
}
if status.is_server_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(GetHeadFilesystemSystemNameOpsHeadGetResponse::ServerError(data));
}
let _ = req.bytes().await?;
Ok(GetHeadFilesystemSystemNameOpsHeadGetResponse::Unknown)
}
}
///Response types for get_head_filesystem__system_name__ops_head_get
#[derive(Clone, Debug)]
pub enum GetHeadFilesystemSystemNameOpsHeadGetResponse {
///200: Head operation finished successfully
Ok(GetFileHeadResponse),
///4XX: Client Error
ClientError(ApiResponseError),
///5XX: Server Error
ServerError(ApiResponseError),
///default: Unknown response
Unknown,
}
///Get status of a job by `{job_id}`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetJobComputeSystemNameJobsJobIdGetRequest {
///Job id
/// - Location: `Path`
#[validate(
length(min = 1u64),
regex(path = "REGEX_ATTACH_COMPUTE_SYSTEM_NAME_JOBS_JOB_ID_ATTACH_PUT_REQUEST_JOB_ID")
)]
pub job_id: String,
/// - Location: `Path`
#[validate(length(min = 1u64))]
pub system_name: String,
}
impl GetJobComputeSystemNameJobsJobIdGetRequest {
///Render the request path with parameters.
pub fn render_path(&self) -> anyhow::Result<String> {
Ok(format!(
"compute/{}/jobs/{}",
oas3_gen_support::percent_encode_path_segment(&oas3_gen_support::serialize_query_param(&self.system_name)?),
oas3_gen_support::percent_encode_path_segment(&oas3_gen_support::serialize_query_param(&self.job_id)?)
))
}
///Parse the HTTP response into the response enum.
pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetJobsComputeSystemNameJobsGetResponse> {
let status = req.status();
if status.is_success() {
let data = oas3_gen_support::Diagnostics::<GetJobResponse>::json_with_diagnostics(req).await?;
return Ok(GetJobsComputeSystemNameJobsGetResponse::Ok(data));
}
if status.is_client_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(GetJobsComputeSystemNameJobsGetResponse::ClientError(data));
}
if status.is_server_error() {
let data = oas3_gen_support::Diagnostics::<ApiResponseError>::json_with_diagnostics(req).await?;
return Ok(GetJobsComputeSystemNameJobsGetResponse::ServerError(data));
}
let _ = req.bytes().await?;
Ok(GetJobsComputeSystemNameJobsGetResponse::Unknown)
}
}
///Get metadata of a job by `{job_id}`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetJobMetadataComputeSystemNameJobsJobIdMetadataGetRequest {
///Job id
/// - Location: `Path`
#[validate(
length(min = 1u64),
regex(path = "REGEX_ATTACH_COMPUTE_SYSTEM_NAME_JOBS_JOB_ID_ATTACH_PUT_REQUEST_JOB_ID")
)]
pub job_id: String,
/// - Location: `Path`
#[validate(length(min = 1u64))]