azure_storage_blob 0.11.0

Microsoft Azure Blob Storage client library for Rust
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
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT.

use super::{
    models_serde,
    xml_helpers::{
        Blob_tag_setTag, BlobsBlob, Committed_blocksBlock, Container_itemsContainer, CorsCorsRule,
        Uncommitted_blocksBlock,
    },
    AccessTier, ArchiveStatus, BlobType, CopyStatus, GeoReplicationStatusType,
    ImmutabilityPolicyMode, LeaseDuration, LeaseState, LeaseStatus, PublicAccessType,
    RehydratePriority, StorageErrorCode,
};
use azure_core::{base64, fmt::SafeDebug, http::Etag, time::OffsetDateTime};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

/// Represents an access policy.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
pub struct AccessPolicy {
    /// The date-time the policy expires.
    #[serde(
        default,
        rename = "Expiry",
        skip_serializing_if = "Option::is_none",
        with = "models_serde::option_offset_date_time_rfc3339_fixed_width"
    )]
    pub expiry: Option<OffsetDateTime>,

    /// The permissions for acl the policy.
    #[serde(rename = "Permission", skip_serializing_if = "Option::is_none")]
    pub permission: Option<String>,

    /// The date-time the policy is active.
    #[serde(
        default,
        rename = "Start",
        skip_serializing_if = "Option::is_none",
        with = "models_serde::option_offset_date_time_rfc3339_fixed_width"
    )]
    pub start: Option<OffsetDateTime>,
}

/// Contains results for `AppendBlobClient::append_block_from_url()`
#[derive(SafeDebug)]
pub struct AppendBlobClientAppendBlockFromUrlResult;

/// Contains results for `AppendBlobClient::append_block()`
#[derive(SafeDebug)]
pub struct AppendBlobClientAppendBlockResult;

/// Contains results for `AppendBlobClient::create()`
#[derive(SafeDebug)]
pub struct AppendBlobClientCreateResult;

/// Contains results for `AppendBlobClient::seal()`
#[derive(SafeDebug)]
pub struct AppendBlobClientSealResult;

/// Contains results for `BlobClient::acquire_lease()`
#[derive(SafeDebug)]
pub struct BlobClientAcquireLeaseResult;

/// Contains results for `BlobClient::break_lease()`
#[derive(SafeDebug)]
pub struct BlobClientBreakLeaseResult;

/// Contains results for `BlobClient::change_lease()`
#[derive(SafeDebug)]
pub struct BlobClientChangeLeaseResult;

/// Contains results for `BlobClient::create_snapshot()`
#[derive(SafeDebug)]
pub struct BlobClientCreateSnapshotResult;

/// Contains results for `BlobClient::download_internal()`
#[derive(SafeDebug)]
pub struct BlobClientDownloadInternalResult;

/// Contains results for `BlobClient::get_account_info()`
#[derive(SafeDebug)]
pub struct BlobClientGetAccountInfoResult;

/// Contains results for `BlobClient::get_properties()`
#[derive(SafeDebug)]
pub struct BlobClientGetPropertiesResult;

/// Contains results for `BlobClient::release_lease()`
#[derive(SafeDebug)]
pub struct BlobClientReleaseLeaseResult;

/// Contains results for `BlobClient::renew_lease()`
#[derive(SafeDebug)]
pub struct BlobClientRenewLeaseResult;

/// Contains results for `BlobContainerClient::acquire_lease()`
#[derive(SafeDebug)]
pub struct BlobContainerClientAcquireLeaseResult;

/// Contains results for `BlobContainerClient::break_lease()`
#[derive(SafeDebug)]
pub struct BlobContainerClientBreakLeaseResult;

/// Contains results for `BlobContainerClient::change_lease()`
#[derive(SafeDebug)]
pub struct BlobContainerClientChangeLeaseResult;

/// Contains results for `BlobContainerClient::get_account_info()`
#[derive(SafeDebug)]
pub struct BlobContainerClientGetAccountInfoResult;

/// Contains results for `BlobContainerClient::get_properties()`
#[derive(SafeDebug)]
pub struct BlobContainerClientGetPropertiesResult;

/// Contains results for `BlobContainerClient::release_lease()`
#[derive(SafeDebug)]
pub struct BlobContainerClientReleaseLeaseResult;

/// Contains results for `BlobContainerClient::renew_lease()`
#[derive(SafeDebug)]
pub struct BlobContainerClientRenewLeaseResult;

/// The blob flat list segment.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
pub struct BlobFlatListSegment {
    /// The blob items.
    #[serde(default, rename = "Blob")]
    pub blob_items: Vec<BlobItem>,
}

/// An Azure Storage Blob
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
#[serde(rename = "Blob")]
pub struct BlobItem {
    /// The tags of the blob.
    #[serde(rename = "Tags", skip_serializing_if = "Option::is_none")]
    pub blob_tags: Option<BlobTags>,

    /// Whether the blob is deleted.
    #[serde(rename = "Deleted", skip_serializing_if = "Option::is_none")]
    pub deleted: Option<bool>,

    /// Whether the blob has versions only.
    #[serde(rename = "HasVersionsOnly", skip_serializing_if = "Option::is_none")]
    pub has_versions_only: Option<bool>,

    /// Whether the blob is the current version.
    #[serde(rename = "IsCurrentVersion", skip_serializing_if = "Option::is_none")]
    pub is_current_version: Option<bool>,

    /// The metadata of the blob.
    #[serde(rename = "Metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<BlobMetadata>,

    /// The name of the blob.
    #[serde(
        deserialize_with = "crate::models::blob_name::option::deserialize",
        rename = "Name",
        skip_serializing_if = "Option::is_none"
    )]
    pub name: Option<String>,

    /// The object replication metadata of the blob.
    #[serde(rename = "OrMetadata", skip_serializing_if = "Option::is_none")]
    pub object_replication_metadata: Option<ObjectReplicationMetadata>,

    /// The properties of the blob.
    #[serde(rename = "Properties", skip_serializing_if = "Option::is_none")]
    pub properties: Option<BlobProperties>,

    /// The snapshot of the blob.
    #[serde(rename = "Snapshot", skip_serializing_if = "Option::is_none")]
    pub snapshot: Option<String>,

    /// The version id of the blob.
    #[serde(rename = "VersionId", skip_serializing_if = "Option::is_none")]
    pub version_id: Option<String>,
}

/// The blob metadata.
#[derive(Clone, Default, SafeDebug)]
#[non_exhaustive]
pub struct BlobMetadata {
    /// Contains unnamed additional properties.
    pub additional_properties: Option<HashMap<String, String>>,

    /// Whether the blob metadata is encrypted.
    pub encrypted: Option<String>,
}

/// Represents a blob name.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
pub struct BlobName {
    /// The blob name.
    #[serde(rename = "$text", skip_serializing_if = "Option::is_none")]
    pub content: Option<String>,

    /// Whether the blob name is encoded.
    #[serde(rename = "@Encoded", skip_serializing_if = "Option::is_none")]
    pub encoded: Option<bool>,
}

/// The properties of a blob.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
#[serde(rename = "Properties")]
pub struct BlobProperties {
    /// The access tier of the blob.
    #[serde(rename = "AccessTier", skip_serializing_if = "Option::is_none")]
    pub access_tier: Option<AccessTier>,

    /// The access tier change time of the blob.
    #[serde(
        default,
        rename = "AccessTierChangeTime",
        skip_serializing_if = "Option::is_none",
        with = "azure_core::time::rfc7231::option"
    )]
    pub access_tier_change_time: Option<OffsetDateTime>,

    /// Whether the access tier is inferred.
    #[serde(rename = "AccessTierInferred", skip_serializing_if = "Option::is_none")]
    pub access_tier_inferred: Option<bool>,

    /// The archive status of the blob.
    #[serde(rename = "ArchiveStatus", skip_serializing_if = "Option::is_none")]
    pub archive_status: Option<ArchiveStatus>,

    /// The sequence number of the blob.
    #[serde(
        rename = "x-ms-blob-sequence-number",
        skip_serializing_if = "Option::is_none"
    )]
    pub blob_sequence_number: Option<i64>,

    /// The blob type.
    #[serde(rename = "BlobType", skip_serializing_if = "Option::is_none")]
    pub blob_type: Option<BlobType>,

    /// The cache control of the blob.
    #[serde(rename = "Cache-Control", skip_serializing_if = "Option::is_none")]
    pub cache_control: Option<String>,

    /// The content disposition of the blob.
    #[serde(
        rename = "Content-Disposition",
        skip_serializing_if = "Option::is_none"
    )]
    pub content_disposition: Option<String>,

    /// The content encoding of the blob.
    #[serde(rename = "Content-Encoding", skip_serializing_if = "Option::is_none")]
    pub content_encoding: Option<String>,

    /// The content language of the blob.
    #[serde(rename = "Content-Language", skip_serializing_if = "Option::is_none")]
    pub content_language: Option<String>,

    /// The content length of the blob.
    #[serde(rename = "Content-Length", skip_serializing_if = "Option::is_none")]
    pub content_length: Option<u64>,

    /// The content MD5 of the blob.
    #[serde(
        default,
        deserialize_with = "base64::option::deserialize",
        rename = "Content-MD5",
        serialize_with = "base64::option::serialize",
        skip_serializing_if = "Option::is_none"
    )]
    pub content_md5: Option<Vec<u8>>,

    /// The content type of the blob.
    #[serde(rename = "Content-Type", skip_serializing_if = "Option::is_none")]
    pub content_type: Option<String>,

    /// The copy completion time of the blob.
    #[serde(
        default,
        rename = "CopyCompletionTime",
        skip_serializing_if = "Option::is_none",
        with = "azure_core::time::rfc7231::option"
    )]
    pub copy_completion_time: Option<OffsetDateTime>,

    /// The copy ID of the blob.
    #[serde(rename = "CopyId", skip_serializing_if = "Option::is_none")]
    pub copy_id: Option<String>,

    /// The copy progress of the blob.
    #[serde(rename = "CopyProgress", skip_serializing_if = "Option::is_none")]
    pub copy_progress: Option<String>,

    /// The copy source of the blob.
    #[serde(rename = "CopySource", skip_serializing_if = "Option::is_none")]
    pub copy_source: Option<String>,

    /// The copy status of the blob.
    #[serde(rename = "CopyStatus", skip_serializing_if = "Option::is_none")]
    pub copy_status: Option<CopyStatus>,

    /// The copy status description of the blob.
    #[serde(
        rename = "CopyStatusDescription",
        skip_serializing_if = "Option::is_none"
    )]
    pub copy_status_description: Option<String>,

    /// The date-time the blob was created in RFC1123 format.
    #[serde(
        default,
        rename = "Creation-Time",
        skip_serializing_if = "Option::is_none",
        with = "azure_core::time::rfc7231::option"
    )]
    pub creation_time: Option<OffsetDateTime>,

    /// Customer provided key sha256
    #[serde(
        rename = "CustomerProvidedKeySha256",
        skip_serializing_if = "Option::is_none"
    )]
    pub customer_provided_key_sha256: Option<String>,

    /// The time the blob was deleted.
    #[serde(
        default,
        rename = "DeletedTime",
        skip_serializing_if = "Option::is_none",
        with = "azure_core::time::rfc7231::option"
    )]
    pub deleted_time: Option<OffsetDateTime>,

    /// The name of the destination snapshot.
    #[serde(
        rename = "DestinationSnapshot",
        skip_serializing_if = "Option::is_none"
    )]
    pub destination_snapshot: Option<String>,

    /// The encryption scope of the blob.
    #[serde(rename = "EncryptionScope", skip_serializing_if = "Option::is_none")]
    pub encryption_scope: Option<String>,

    /// The blob ETag.
    #[serde(rename = "Etag", skip_serializing_if = "Option::is_none")]
    pub etag: Option<Etag>,

    /// The expire time of the blob.
    #[serde(
        default,
        rename = "Expiry-Time",
        skip_serializing_if = "Option::is_none",
        with = "azure_core::time::rfc7231::option"
    )]
    pub expires_on: Option<OffsetDateTime>,

    /// The immutability policy until time of the blob.
    #[serde(
        default,
        rename = "ImmutabilityPolicyUntilDate",
        skip_serializing_if = "Option::is_none",
        with = "azure_core::time::rfc7231::option"
    )]
    pub immutability_policy_expires_on: Option<OffsetDateTime>,

    /// The immutability policy mode of the blob.
    #[serde(
        rename = "ImmutabilityPolicyMode",
        skip_serializing_if = "Option::is_none"
    )]
    pub immutability_policy_mode: Option<ImmutabilityPolicyMode>,

    /// Whether the blob is incremental copy.
    #[serde(rename = "IncrementalCopy", skip_serializing_if = "Option::is_none")]
    pub incremental_copy: Option<bool>,

    /// Whether the blob is sealed.
    #[serde(rename = "Sealed", skip_serializing_if = "Option::is_none")]
    pub is_sealed: Option<bool>,

    /// The last access time of the blob.
    #[serde(
        default,
        rename = "LastAccessTime",
        skip_serializing_if = "Option::is_none",
        with = "azure_core::time::rfc7231::option"
    )]
    pub last_accessed_on: Option<OffsetDateTime>,

    /// The date-time the blob was last modified in RFC1123 format.
    #[serde(
        default,
        rename = "Last-Modified",
        skip_serializing_if = "Option::is_none",
        with = "azure_core::time::rfc7231::option"
    )]
    pub last_modified: Option<OffsetDateTime>,

    /// The lease duration of the blob.
    #[serde(rename = "LeaseDuration", skip_serializing_if = "Option::is_none")]
    pub lease_duration: Option<LeaseDuration>,

    /// The lease state of the blob.
    #[serde(rename = "LeaseState", skip_serializing_if = "Option::is_none")]
    pub lease_state: Option<LeaseState>,

    /// The lease status of the blob.
    #[serde(rename = "LeaseStatus", skip_serializing_if = "Option::is_none")]
    pub lease_status: Option<LeaseStatus>,

    /// Whether the blob is under legal hold.
    #[serde(rename = "LegalHold", skip_serializing_if = "Option::is_none")]
    pub legal_hold: Option<bool>,

    /// The rehydrate priority of the blob.
    #[serde(rename = "RehydratePriority", skip_serializing_if = "Option::is_none")]
    pub rehydrate_priority: Option<RehydratePriority>,

    /// The remaining retention days of the blob.
    #[serde(
        rename = "RemainingRetentionDays",
        skip_serializing_if = "Option::is_none"
    )]
    pub remaining_retention_days: Option<i32>,

    /// Whether the blob is encrypted on the server.
    #[serde(rename = "ServerEncrypted", skip_serializing_if = "Option::is_none")]
    pub server_encrypted: Option<bool>,

    /// The number of tags for the blob.
    #[serde(rename = "TagCount", skip_serializing_if = "Option::is_none")]
    pub tag_count: Option<i32>,
}

/// Contains results for `BlobServiceClient::get_account_info()`
#[derive(SafeDebug)]
pub struct BlobServiceClientGetAccountInfoResult;

/// The service properties.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[serde(rename = "StorageServiceProperties")]
pub struct BlobServiceProperties {
    /// The CORS properties.
    #[serde(
        default,
        deserialize_with = "CorsCorsRule::unwrap",
        rename = "Cors",
        serialize_with = "CorsCorsRule::wrap",
        skip_serializing_if = "Option::is_none"
    )]
    pub cors: Option<Vec<CorsRule>>,

    /// The default service version.
    #[serde(
        rename = "DefaultServiceVersion",
        skip_serializing_if = "Option::is_none"
    )]
    pub default_service_version: Option<String>,

    /// The delete retention policy.
    #[serde(
        rename = "DeleteRetentionPolicy",
        skip_serializing_if = "Option::is_none"
    )]
    pub delete_retention_policy: Option<RetentionPolicy>,

    /// The hour metrics properties.
    #[serde(rename = "HourMetrics", skip_serializing_if = "Option::is_none")]
    pub hour_metrics: Option<Metrics>,

    /// The logging properties.
    #[serde(rename = "Logging", skip_serializing_if = "Option::is_none")]
    pub logging: Option<Logging>,

    /// The minute metrics properties.
    #[serde(rename = "MinuteMetrics", skip_serializing_if = "Option::is_none")]
    pub minute_metrics: Option<Metrics>,

    /// The static website properties.
    #[serde(rename = "StaticWebsite", skip_serializing_if = "Option::is_none")]
    pub static_website: Option<StaticWebsite>,
}

/// The blob tags.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[serde(rename = "Tag")]
pub struct BlobTag {
    /// The key of the tag.
    #[serde(rename = "Key", skip_serializing_if = "Option::is_none")]
    pub key: Option<String>,

    /// The value of the tag.
    #[serde(rename = "Value", skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
}

/// Represents blob tags.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[serde(rename = "Tags")]
pub struct BlobTags {
    /// Represents the blob tags.
    #[serde(
        default,
        deserialize_with = "Blob_tag_setTag::unwrap",
        rename = "TagSet",
        serialize_with = "Blob_tag_setTag::wrap",
        skip_serializing_if = "Option::is_none"
    )]
    pub blob_tag_set: Option<Vec<BlobTag>>,
}

/// Represents a single block in a block blob. It describes the block's ID and size.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
pub struct Block {
    /// The base64 encoded block ID.
    #[serde(
        default,
        deserialize_with = "base64::option::deserialize",
        rename = "Name",
        serialize_with = "base64::option::serialize",
        skip_serializing_if = "Option::is_none"
    )]
    pub name: Option<Vec<u8>>,

    /// The block size in bytes.
    #[serde(rename = "Size", skip_serializing_if = "Option::is_none")]
    pub size: Option<i64>,
}

/// Contains results for `BlockBlobClient::commit_block_list()`
#[derive(SafeDebug)]
pub struct BlockBlobClientCommitBlockListResult;

/// Contains results for `BlockBlobClient::stage_block_from_url()`
#[derive(SafeDebug)]
pub struct BlockBlobClientStageBlockFromUrlResult;

/// Contains results for `BlockBlobClient::stage_block()`
#[derive(SafeDebug)]
pub struct BlockBlobClientStageBlockResult;

/// Contains results for `BlockBlobClient::upload_blob_from_url()`
#[derive(SafeDebug)]
pub struct BlockBlobClientUploadBlobFromUrlResult;

/// Contains results for `BlockBlobClient::upload_internal()`
#[derive(SafeDebug)]
pub struct BlockBlobClientUploadInternalResult;

/// Contains the committed and uncommitted blocks in a block blob.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
pub struct BlockList {
    /// The list of committed blocks.
    #[serde(
        default,
        deserialize_with = "Committed_blocksBlock::unwrap",
        rename = "CommittedBlocks",
        serialize_with = "Committed_blocksBlock::wrap",
        skip_serializing_if = "Option::is_none"
    )]
    pub committed_blocks: Option<Vec<Block>>,

    /// The list of uncommitted blocks.
    #[serde(
        default,
        deserialize_with = "Uncommitted_blocksBlock::unwrap",
        rename = "UncommittedBlocks",
        serialize_with = "Uncommitted_blocksBlock::wrap",
        skip_serializing_if = "Option::is_none"
    )]
    pub uncommitted_blocks: Option<Vec<Block>>,
}

/// The Block lookup list.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[serde(rename = "BlockList")]
pub struct BlockLookupList {
    /// The committed blocks
    #[serde(
        default,
        rename = "Committed",
        skip_serializing_if = "Option::is_none",
        with = "models_serde::option_vec_encoded_bytes_std"
    )]
    pub committed: Option<Vec<Vec<u8>>>,

    /// The latest blocks
    #[serde(
        default,
        rename = "Latest",
        skip_serializing_if = "Option::is_none",
        with = "models_serde::option_vec_encoded_bytes_std"
    )]
    pub latest: Option<Vec<Vec<u8>>>,

    /// The uncommitted blocks
    #[serde(
        default,
        rename = "Uncommitted",
        skip_serializing_if = "Option::is_none",
        with = "models_serde::option_vec_encoded_bytes_std"
    )]
    pub uncommitted: Option<Vec<Vec<u8>>>,
}

/// The clear range.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
pub struct ClearRange {
    /// The end of the byte range.
    #[serde(rename = "End", skip_serializing_if = "Option::is_none")]
    pub end: Option<i64>,

    /// The start of the byte range.
    #[serde(rename = "Start", skip_serializing_if = "Option::is_none")]
    pub start: Option<i64>,
}

/// An Azure Storage container.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
#[serde(rename = "Container")]
pub struct ContainerItem {
    /// Whether the container is deleted.
    #[serde(rename = "Deleted", skip_serializing_if = "Option::is_none")]
    pub deleted: Option<bool>,

    /// The metadata of the container.
    #[serde(rename = "Metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<HashMap<String, String>>,

    /// The name of the container.
    #[serde(rename = "Name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// The properties of the container.
    #[serde(rename = "Properties", skip_serializing_if = "Option::is_none")]
    pub properties: Option<ContainerProperties>,

    /// The version of the container.
    #[serde(rename = "Version", skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

/// The properties of a container.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
pub struct ContainerProperties {
    /// The default encryption scope of the container.
    #[serde(
        rename = "DefaultEncryptionScope",
        skip_serializing_if = "Option::is_none"
    )]
    pub default_encryption_scope: Option<String>,

    /// The deleted time of the container.
    #[serde(
        default,
        rename = "DeletedTime",
        skip_serializing_if = "Option::is_none",
        with = "azure_core::time::rfc7231::option"
    )]
    pub deleted_time: Option<OffsetDateTime>,

    /// The ETag of the container.
    #[serde(rename = "Etag", skip_serializing_if = "Option::is_none")]
    pub etag: Option<Etag>,

    /// Whether it has an immutability policy.
    #[serde(
        rename = "HasImmutabilityPolicy",
        skip_serializing_if = "Option::is_none"
    )]
    pub has_immutability_policy: Option<bool>,

    /// The has legal hold status of the container.
    #[serde(rename = "HasLegalHold", skip_serializing_if = "Option::is_none")]
    pub has_legal_hold: Option<bool>,

    /// Whether immutable storage with versioning is enabled.
    #[serde(
        rename = "ImmutableStorageWithVersioningEnabled",
        skip_serializing_if = "Option::is_none"
    )]
    pub is_immutable_storage_with_versioning_enabled: Option<bool>,

    /// The date-time the container was last modified in RFC1123 format.
    #[serde(
        default,
        rename = "Last-Modified",
        skip_serializing_if = "Option::is_none",
        with = "azure_core::time::rfc7231::option"
    )]
    pub last_modified: Option<OffsetDateTime>,

    /// The lease duration of the container.
    #[serde(rename = "LeaseDuration", skip_serializing_if = "Option::is_none")]
    pub lease_duration: Option<LeaseDuration>,

    /// The lease state of the container.
    #[serde(rename = "LeaseState", skip_serializing_if = "Option::is_none")]
    pub lease_state: Option<LeaseState>,

    /// The lease status of the container.
    #[serde(rename = "LeaseStatus", skip_serializing_if = "Option::is_none")]
    pub lease_status: Option<LeaseStatus>,

    /// Whether to prevent encryption scope override.
    #[serde(
        rename = "DenyEncryptionScopeOverride",
        skip_serializing_if = "Option::is_none"
    )]
    pub prevent_encryption_scope_override: Option<bool>,

    /// The public access type of the container.
    #[serde(rename = "PublicAccess", skip_serializing_if = "Option::is_none")]
    pub public_access: Option<PublicAccessType>,

    /// The remaining retention days of the container.
    #[serde(
        rename = "RemainingRetentionDays",
        skip_serializing_if = "Option::is_none"
    )]
    pub remaining_retention_days: Option<i32>,
}

/// CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain.
/// Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in
/// a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[serde(rename = "CorsRule")]
pub struct CorsRule {
    /// The allowed headers.
    #[serde(rename = "AllowedHeaders", skip_serializing_if = "Option::is_none")]
    pub allowed_headers: Option<String>,

    /// The allowed methods.
    #[serde(rename = "AllowedMethods", skip_serializing_if = "Option::is_none")]
    pub allowed_methods: Option<String>,

    /// The allowed origins.
    #[serde(rename = "AllowedOrigins", skip_serializing_if = "Option::is_none")]
    pub allowed_origins: Option<String>,

    /// The exposed headers.
    #[serde(rename = "ExposedHeaders", skip_serializing_if = "Option::is_none")]
    pub exposed_headers: Option<String>,

    /// The maximum age in seconds.
    #[serde(rename = "MaxAgeInSeconds", skip_serializing_if = "Option::is_none")]
    pub max_age_in_seconds: Option<i32>,
}

/// The error response.
///
/// This defines the wire format only. Language SDKs wrap this in idiomatic error types.
#[derive(Clone, Deserialize, SafeDebug, Serialize)]
pub struct Error {
    /// The error code.
    #[serde(rename = "Code", skip_serializing_if = "Option::is_none")]
    pub code: Option<StorageErrorCode>,

    /// Copy source error code
    #[serde(
        rename = "CopySourceErrorCode",
        skip_serializing_if = "Option::is_none"
    )]
    pub copy_source_error_code: Option<String>,

    /// Copy source error message
    #[serde(
        rename = "CopySourceErrorMessage",
        skip_serializing_if = "Option::is_none"
    )]
    pub copy_source_error_message: Option<String>,

    /// Copy source status code
    #[serde(
        rename = "CopySourceStatusCode",
        skip_serializing_if = "Option::is_none"
    )]
    pub copy_source_status_code: Option<i32>,

    /// The error code.
    #[serde(rename = "errorCode", skip_serializing_if = "Option::is_none")]
    pub error_code: Option<String>,

    /// The error message.
    #[serde(rename = "Message", skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,

    /// The error code for the copy source.
    #[serde(
        rename = "xMsCopySourceErrorCode",
        skip_serializing_if = "Option::is_none"
    )]
    pub x_ms_copy_source_error_code: Option<String>,

    /// The status code for the copy source.
    #[serde(
        rename = "xMsCopySourceStatusCode",
        skip_serializing_if = "Option::is_none"
    )]
    pub x_ms_copy_source_status_code: Option<i32>,
}

/// The filter blob item.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
#[serde(rename = "Blob")]
pub struct FilterBlobItem {
    /// The properties of the blob.
    #[serde(rename = "ContainerName", skip_serializing_if = "Option::is_none")]
    pub container_name: Option<String>,

    /// Whether it is the current version of the blob
    #[serde(rename = "IsCurrentVersion", skip_serializing_if = "Option::is_none")]
    pub is_current_version: Option<bool>,

    /// The name of the blob.
    #[serde(rename = "Name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// The metadata of the blob.
    #[serde(rename = "Tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<BlobTags>,

    /// The version ID of the blob.
    #[serde(rename = "VersionId", skip_serializing_if = "Option::is_none")]
    pub version_id: Option<String>,
}

/// The result of a Filter Blobs API call
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
#[serde(rename = "EnumerationResults")]
pub struct FilterBlobSegment {
    /// The blob segment.
    #[serde(
        default,
        deserialize_with = "BlobsBlob::unwrap",
        rename = "Blobs",
        serialize_with = "BlobsBlob::wrap",
        skip_serializing_if = "Option::is_none"
    )]
    pub blobs: Option<Vec<FilterBlobItem>>,

    /// The next marker of the blobs.
    #[serde(rename = "NextMarker", skip_serializing_if = "Option::is_none")]
    pub next_marker: Option<String>,

    /// The service endpoint.
    #[serde(rename = "@ServiceEndpoint", skip_serializing_if = "Option::is_none")]
    pub service_endpoint: Option<String>,

    /// The filter for the blobs.
    #[serde(rename = "Where", skip_serializing_if = "Option::is_none")]
    pub where_prop: Option<String>,
}

/// Geo-Replication information for the Secondary Storage Service
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
pub struct GeoReplication {
    /// A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read
    /// operations at the secondary. Primary writes after this point in time may or may not be available for reads.
    #[serde(
        default,
        rename = "LastSyncTime",
        skip_serializing_if = "Option::is_none",
        with = "azure_core::time::rfc7231::option"
    )]
    pub last_sync_time: Option<OffsetDateTime>,

    /// The status of the secondary location
    #[serde(rename = "Status", skip_serializing_if = "Option::is_none")]
    pub status: Option<GeoReplicationStatusType>,
}

/// An enumeration of blobs.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
#[serde(rename = "EnumerationResults")]
pub struct ListBlobsResponse {
    /// The container name.
    #[serde(rename = "@ContainerName", skip_serializing_if = "Option::is_none")]
    pub container_name: Option<String>,

    /// The marker of the blobs.
    #[serde(rename = "Marker", skip_serializing_if = "Option::is_none")]
    pub marker: Option<String>,

    /// The max results of the blobs.
    #[serde(rename = "MaxResults", skip_serializing_if = "Option::is_none")]
    pub max_results: Option<i32>,

    /// The next marker of the blobs.
    #[serde(rename = "NextMarker", skip_serializing_if = "Option::is_none")]
    pub next_marker: Option<String>,

    /// The prefix of the blobs.
    #[serde(rename = "Prefix", skip_serializing_if = "Option::is_none")]
    pub prefix: Option<String>,

    /// The blob segment.
    #[serde(default, rename = "Blobs")]
    pub segment: BlobFlatListSegment,

    /// The service endpoint.
    #[serde(rename = "@ServiceEndpoint", skip_serializing_if = "Option::is_none")]
    pub service_endpoint: Option<String>,
}

/// The list container segment response
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
#[serde(rename = "EnumerationResults")]
pub struct ListContainersSegmentResponse {
    /// The container segment.
    #[serde(
        default,
        deserialize_with = "Container_itemsContainer::unwrap",
        rename = "Containers",
        serialize_with = "Container_itemsContainer::wrap"
    )]
    pub container_items: Vec<ContainerItem>,

    /// The marker of the containers.
    #[serde(rename = "Marker", skip_serializing_if = "Option::is_none")]
    pub marker: Option<String>,

    /// The max results of the containers.
    #[serde(rename = "MaxResults", skip_serializing_if = "Option::is_none")]
    pub max_results: Option<i32>,

    /// The next marker of the containers.
    #[serde(rename = "NextMarker", skip_serializing_if = "Option::is_none")]
    pub next_marker: Option<String>,

    /// The prefix of the containers.
    #[serde(rename = "Prefix", skip_serializing_if = "Option::is_none")]
    pub prefix: Option<String>,

    /// The service endpoint.
    #[serde(rename = "@ServiceEndpoint", skip_serializing_if = "Option::is_none")]
    pub service_endpoint: Option<String>,
}

/// Azure Analytics Logging settings.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
pub struct Logging {
    /// Whether delete operation is logged.
    #[serde(rename = "Delete", skip_serializing_if = "Option::is_none")]
    pub delete: Option<bool>,

    /// Whether read operation is logged.
    #[serde(rename = "Read", skip_serializing_if = "Option::is_none")]
    pub read: Option<bool>,

    /// The retention policy of the logs.
    #[serde(rename = "RetentionPolicy", skip_serializing_if = "Option::is_none")]
    pub retention_policy: Option<RetentionPolicy>,

    /// The version of the logging properties.
    #[serde(rename = "Version", skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,

    /// Whether write operation is logged.
    #[serde(rename = "Write", skip_serializing_if = "Option::is_none")]
    pub write: Option<bool>,
}

/// The metrics properties.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
pub struct Metrics {
    /// Whether it is enabled.
    #[serde(rename = "Enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,

    /// Whether to include API in the metrics.
    #[serde(rename = "IncludeAPIs", skip_serializing_if = "Option::is_none")]
    pub include_apis: Option<bool>,

    /// The retention policy of the metrics.
    #[serde(rename = "RetentionPolicy", skip_serializing_if = "Option::is_none")]
    pub retention_policy: Option<RetentionPolicy>,

    /// The version of the metrics properties.
    #[serde(rename = "Version", skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

/// The object replication metadata.
#[derive(Clone, Default, SafeDebug)]
#[non_exhaustive]
pub struct ObjectReplicationMetadata {
    /// Contains unnamed additional properties.
    pub additional_properties: Option<HashMap<String, String>>,
}

/// Contains results for `PageBlobClient::clear_pages()`
#[derive(SafeDebug)]
pub struct PageBlobClientClearPagesResult;

/// Contains results for `PageBlobClient::create()`
#[derive(SafeDebug)]
pub struct PageBlobClientCreateResult;

/// Contains results for `PageBlobClient::resize()`
#[derive(SafeDebug)]
pub struct PageBlobClientResizeResult;

/// Contains results for `PageBlobClient::set_sequence_number()`
#[derive(SafeDebug)]
pub struct PageBlobClientSetSequenceNumberResult;

/// Contains results for `PageBlobClient::upload_pages_from_url()`
#[derive(SafeDebug)]
pub struct PageBlobClientUploadPagesFromUrlResult;

/// Contains results for `PageBlobClient::upload_pages()`
#[derive(SafeDebug)]
pub struct PageBlobClientUploadPagesResult;

/// Represents a page list.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
pub struct PageList {
    /// The clear ranges.
    #[serde(rename = "ClearRange", skip_serializing_if = "Option::is_none")]
    pub clear_range: Option<Vec<ClearRange>>,

    /// The next marker.
    #[serde(rename = "NextMarker", skip_serializing_if = "Option::is_none")]
    pub next_marker: Option<String>,

    /// The page ranges.
    #[serde(rename = "PageRange", skip_serializing_if = "Option::is_none")]
    pub page_range: Option<Vec<PageRange>>,
}

/// The page range.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
pub struct PageRange {
    /// The end of the byte range.
    #[serde(rename = "End", skip_serializing_if = "Option::is_none")]
    pub end: Option<i64>,

    /// The start of the byte range.
    #[serde(rename = "Start", skip_serializing_if = "Option::is_none")]
    pub start: Option<i64>,
}

/// The retention policy.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
pub struct RetentionPolicy {
    /// Whether to allow permanent delete.
    #[serde(
        rename = "AllowPermanentDelete",
        skip_serializing_if = "Option::is_none"
    )]
    pub allow_permanent_delete: Option<bool>,

    /// The number of days to retain the logs.
    #[serde(rename = "Days", skip_serializing_if = "Option::is_none")]
    pub days: Option<i32>,

    /// Whether to enable the retention policy.
    #[serde(rename = "Enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
}

/// The signed identifier.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[serde(rename = "SignedIdentifier")]
pub struct SignedIdentifier {
    /// The access policy for the signed identifier.
    #[serde(rename = "AccessPolicy", skip_serializing_if = "Option::is_none")]
    pub access_policy: Option<AccessPolicy>,

    /// The unique ID for the signed identifier.
    #[serde(rename = "Id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
}

/// Represents an array of signed identifiers
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
pub struct SignedIdentifiers {
    /// The array of signed identifiers.
    #[serde(rename = "SignedIdentifier", skip_serializing_if = "Option::is_none")]
    pub items: Option<Vec<SignedIdentifier>>,
}

/// The properties that enable an account to host a static website
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
pub struct StaticWebsite {
    /// Absolute path of the default index page
    #[serde(
        rename = "DefaultIndexDocumentPath",
        skip_serializing_if = "Option::is_none"
    )]
    pub default_index_document_path: Option<String>,

    /// Indicates whether this account is hosting a static website
    #[serde(rename = "Enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,

    /// The error document.
    #[serde(
        rename = "ErrorDocument404Path",
        skip_serializing_if = "Option::is_none"
    )]
    pub error_document404_path: Option<String>,

    /// The index document.
    #[serde(rename = "IndexDocument", skip_serializing_if = "Option::is_none")]
    pub index_document: Option<String>,
}

/// Stats for the storage service.
#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)]
#[non_exhaustive]
pub struct StorageServiceStats {
    /// The geo replication stats.
    #[serde(rename = "GeoReplication", skip_serializing_if = "Option::is_none")]
    pub geo_replication: Option<GeoReplication>,
}