1use super::{configuration, ContentType, Error};
12use crate::{apis::ResponseContent, models};
13use reqwest;
14use serde::{de::Error as _, Deserialize, Serialize};
15use tokio::fs::File as TokioFile;
16use tokio_util::codec::{BytesCodec, FramedRead};
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum AppendBlobAppendBlockError {
22 DefaultResponse(models::StorageError),
23 UnknownValue(serde_json::Value),
24}
25
26#[derive(Debug, Clone, Serialize, Deserialize)]
28#[serde(untagged)]
29pub enum AppendBlobAppendBlockFromUrlError {
30 DefaultResponse(models::StorageError),
31 UnknownValue(serde_json::Value),
32}
33
34#[derive(Debug, Clone, Serialize, Deserialize)]
36#[serde(untagged)]
37pub enum AppendBlobCreateError {
38 DefaultResponse(models::StorageError),
39 UnknownValue(serde_json::Value),
40}
41
42#[derive(Debug, Clone, Serialize, Deserialize)]
44#[serde(untagged)]
45pub enum AppendBlobSealError {
46 DefaultResponse(models::StorageError),
47 UnknownValue(serde_json::Value),
48}
49
50#[derive(Debug, Clone, Serialize, Deserialize)]
52#[serde(untagged)]
53pub enum BlobAbortCopyFromUrlError {
54 DefaultResponse(models::StorageError),
55 UnknownValue(serde_json::Value),
56}
57
58#[derive(Debug, Clone, Serialize, Deserialize)]
60#[serde(untagged)]
61pub enum BlobAcquireLeaseError {
62 DefaultResponse(models::StorageError),
63 UnknownValue(serde_json::Value),
64}
65
66#[derive(Debug, Clone, Serialize, Deserialize)]
68#[serde(untagged)]
69pub enum BlobBreakLeaseError {
70 DefaultResponse(models::StorageError),
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum BlobChangeLeaseError {
78 DefaultResponse(models::StorageError),
79 UnknownValue(serde_json::Value),
80}
81
82#[derive(Debug, Clone, Serialize, Deserialize)]
84#[serde(untagged)]
85pub enum BlobCopyFromUrlError {
86 DefaultResponse(models::StorageError),
87 UnknownValue(serde_json::Value),
88}
89
90#[derive(Debug, Clone, Serialize, Deserialize)]
92#[serde(untagged)]
93pub enum BlobCreateSnapshotError {
94 DefaultResponse(models::StorageError),
95 UnknownValue(serde_json::Value),
96}
97
98#[derive(Debug, Clone, Serialize, Deserialize)]
100#[serde(untagged)]
101pub enum BlobDeleteError {
102 DefaultResponse(models::StorageError),
103 UnknownValue(serde_json::Value),
104}
105
106#[derive(Debug, Clone, Serialize, Deserialize)]
108#[serde(untagged)]
109pub enum BlobDeleteImmutabilityPolicyError {
110 DefaultResponse(models::StorageError),
111 UnknownValue(serde_json::Value),
112}
113
114#[derive(Debug, Clone, Serialize, Deserialize)]
116#[serde(untagged)]
117pub enum BlobDownloadError {
118 DefaultResponse(models::StorageError),
119 UnknownValue(serde_json::Value),
120}
121
122#[derive(Debug, Clone, Serialize, Deserialize)]
124#[serde(untagged)]
125pub enum BlobGetAccountInfoError {
126 DefaultResponse(models::StorageError),
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum BlobGetPropertiesError {
134 DefaultResponse(models::StorageError),
135 UnknownValue(serde_json::Value),
136}
137
138#[derive(Debug, Clone, Serialize, Deserialize)]
140#[serde(untagged)]
141pub enum BlobGetTagsError {
142 DefaultResponse(models::StorageError),
143 UnknownValue(serde_json::Value),
144}
145
146#[derive(Debug, Clone, Serialize, Deserialize)]
148#[serde(untagged)]
149pub enum BlobReleaseLeaseError {
150 DefaultResponse(models::StorageError),
151 UnknownValue(serde_json::Value),
152}
153
154#[derive(Debug, Clone, Serialize, Deserialize)]
156#[serde(untagged)]
157pub enum BlobRenewLeaseError {
158 DefaultResponse(models::StorageError),
159 UnknownValue(serde_json::Value),
160}
161
162#[derive(Debug, Clone, Serialize, Deserialize)]
164#[serde(untagged)]
165pub enum BlobSetExpiryError {
166 DefaultResponse(models::StorageError),
167 UnknownValue(serde_json::Value),
168}
169
170#[derive(Debug, Clone, Serialize, Deserialize)]
172#[serde(untagged)]
173pub enum BlobSetImmutabilityPolicyError {
174 DefaultResponse(models::StorageError),
175 UnknownValue(serde_json::Value),
176}
177
178#[derive(Debug, Clone, Serialize, Deserialize)]
180#[serde(untagged)]
181pub enum BlobSetLegalHoldError {
182 DefaultResponse(models::StorageError),
183 UnknownValue(serde_json::Value),
184}
185
186#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum BlobSetMetadataError {
190 DefaultResponse(models::StorageError),
191 UnknownValue(serde_json::Value),
192}
193
194#[derive(Debug, Clone, Serialize, Deserialize)]
196#[serde(untagged)]
197pub enum BlobSetPropertiesError {
198 DefaultResponse(models::StorageError),
199 UnknownValue(serde_json::Value),
200}
201
202#[derive(Debug, Clone, Serialize, Deserialize)]
204#[serde(untagged)]
205pub enum BlobSetTagsError {
206 DefaultResponse(models::StorageError),
207 UnknownValue(serde_json::Value),
208}
209
210#[derive(Debug, Clone, Serialize, Deserialize)]
212#[serde(untagged)]
213pub enum BlobSetTierError {
214 DefaultResponse(models::StorageError),
215 UnknownValue(serde_json::Value),
216}
217
218#[derive(Debug, Clone, Serialize, Deserialize)]
220#[serde(untagged)]
221pub enum BlobStartCopyFromUrlError {
222 DefaultResponse(models::StorageError),
223 UnknownValue(serde_json::Value),
224}
225
226#[derive(Debug, Clone, Serialize, Deserialize)]
228#[serde(untagged)]
229pub enum BlobUndeleteError {
230 DefaultResponse(models::StorageError),
231 UnknownValue(serde_json::Value),
232}
233
234#[derive(Debug, Clone, Serialize, Deserialize)]
236#[serde(untagged)]
237pub enum BlockBlobCommitBlockListError {
238 DefaultResponse(models::StorageError),
239 UnknownValue(serde_json::Value),
240}
241
242#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum BlockBlobGetBlockListError {
246 DefaultResponse(models::StorageError),
247 UnknownValue(serde_json::Value),
248}
249
250#[derive(Debug, Clone, Serialize, Deserialize)]
252#[serde(untagged)]
253pub enum BlockBlobPutBlobFromUrlError {
254 DefaultResponse(models::StorageError),
255 UnknownValue(serde_json::Value),
256}
257
258#[derive(Debug, Clone, Serialize, Deserialize)]
260#[serde(untagged)]
261pub enum BlockBlobQueryError {
262 DefaultResponse(models::StorageError),
263 UnknownValue(serde_json::Value),
264}
265
266#[derive(Debug, Clone, Serialize, Deserialize)]
268#[serde(untagged)]
269pub enum BlockBlobStageBlockError {
270 DefaultResponse(models::StorageError),
271 UnknownValue(serde_json::Value),
272}
273
274#[derive(Debug, Clone, Serialize, Deserialize)]
276#[serde(untagged)]
277pub enum BlockBlobStageBlockFromUrlError {
278 DefaultResponse(models::StorageError),
279 UnknownValue(serde_json::Value),
280}
281
282#[derive(Debug, Clone, Serialize, Deserialize)]
284#[serde(untagged)]
285pub enum BlockBlobUploadError {
286 DefaultResponse(models::StorageError),
287 UnknownValue(serde_json::Value),
288}
289
290#[derive(Debug, Clone, Serialize, Deserialize)]
292#[serde(untagged)]
293pub enum ContainerAcquireLeaseError {
294 DefaultResponse(models::StorageError),
295 UnknownValue(serde_json::Value),
296}
297
298#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum ContainerBreakLeaseError {
302 DefaultResponse(models::StorageError),
303 UnknownValue(serde_json::Value),
304}
305
306#[derive(Debug, Clone, Serialize, Deserialize)]
308#[serde(untagged)]
309pub enum ContainerChangeLeaseError {
310 DefaultResponse(models::StorageError),
311 UnknownValue(serde_json::Value),
312}
313
314#[derive(Debug, Clone, Serialize, Deserialize)]
316#[serde(untagged)]
317pub enum ContainerCreateError {
318 DefaultResponse(models::StorageError),
319 UnknownValue(serde_json::Value),
320}
321
322#[derive(Debug, Clone, Serialize, Deserialize)]
324#[serde(untagged)]
325pub enum ContainerDeleteError {
326 DefaultResponse(models::StorageError),
327 UnknownValue(serde_json::Value),
328}
329
330#[derive(Debug, Clone, Serialize, Deserialize)]
332#[serde(untagged)]
333pub enum ContainerFilterBlobsError {
334 DefaultResponse(models::StorageError),
335 UnknownValue(serde_json::Value),
336}
337
338#[derive(Debug, Clone, Serialize, Deserialize)]
340#[serde(untagged)]
341pub enum ContainerGetAccessPolicyError {
342 DefaultResponse(models::StorageError),
343 UnknownValue(serde_json::Value),
344}
345
346#[derive(Debug, Clone, Serialize, Deserialize)]
348#[serde(untagged)]
349pub enum ContainerGetAccountInfoError {
350 DefaultResponse(models::StorageError),
351 UnknownValue(serde_json::Value),
352}
353
354#[derive(Debug, Clone, Serialize, Deserialize)]
356#[serde(untagged)]
357pub enum ContainerGetPropertiesError {
358 DefaultResponse(models::StorageError),
359 UnknownValue(serde_json::Value),
360}
361
362#[derive(Debug, Clone, Serialize, Deserialize)]
364#[serde(untagged)]
365pub enum ContainerListBlobFlatSegmentError {
366 DefaultResponse(models::StorageError),
367 UnknownValue(serde_json::Value),
368}
369
370#[derive(Debug, Clone, Serialize, Deserialize)]
372#[serde(untagged)]
373pub enum ContainerListBlobHierarchySegmentError {
374 DefaultResponse(models::StorageError),
375 UnknownValue(serde_json::Value),
376}
377
378#[derive(Debug, Clone, Serialize, Deserialize)]
380#[serde(untagged)]
381pub enum ContainerReleaseLeaseError {
382 DefaultResponse(models::StorageError),
383 UnknownValue(serde_json::Value),
384}
385
386#[derive(Debug, Clone, Serialize, Deserialize)]
388#[serde(untagged)]
389pub enum ContainerRenameError {
390 DefaultResponse(models::StorageError),
391 UnknownValue(serde_json::Value),
392}
393
394#[derive(Debug, Clone, Serialize, Deserialize)]
396#[serde(untagged)]
397pub enum ContainerRenewLeaseError {
398 DefaultResponse(models::StorageError),
399 UnknownValue(serde_json::Value),
400}
401
402#[derive(Debug, Clone, Serialize, Deserialize)]
404#[serde(untagged)]
405pub enum ContainerRestoreError {
406 DefaultResponse(models::StorageError),
407 UnknownValue(serde_json::Value),
408}
409
410#[derive(Debug, Clone, Serialize, Deserialize)]
412#[serde(untagged)]
413pub enum ContainerSetAccessPolicyError {
414 DefaultResponse(models::StorageError),
415 UnknownValue(serde_json::Value),
416}
417
418#[derive(Debug, Clone, Serialize, Deserialize)]
420#[serde(untagged)]
421pub enum ContainerSetMetadataError {
422 DefaultResponse(models::StorageError),
423 UnknownValue(serde_json::Value),
424}
425
426#[derive(Debug, Clone, Serialize, Deserialize)]
428#[serde(untagged)]
429pub enum ContainerSubmitBatchError {
430 DefaultResponse(models::StorageError),
431 UnknownValue(serde_json::Value),
432}
433
434#[derive(Debug, Clone, Serialize, Deserialize)]
436#[serde(untagged)]
437pub enum FilterBlobsError {
438 DefaultResponse(models::StorageError),
439 UnknownValue(serde_json::Value),
440}
441
442#[derive(Debug, Clone, Serialize, Deserialize)]
444#[serde(untagged)]
445pub enum GetAccountInfoError {
446 DefaultResponse(models::StorageError),
447 UnknownValue(serde_json::Value),
448}
449
450#[derive(Debug, Clone, Serialize, Deserialize)]
452#[serde(untagged)]
453pub enum GetPropertiesError {
454 DefaultResponse(models::StorageError),
455 UnknownValue(serde_json::Value),
456}
457
458#[derive(Debug, Clone, Serialize, Deserialize)]
460#[serde(untagged)]
461pub enum GetStatisticsError {
462 DefaultResponse(models::StorageError),
463 UnknownValue(serde_json::Value),
464}
465
466#[derive(Debug, Clone, Serialize, Deserialize)]
468#[serde(untagged)]
469pub enum GetUserDelegationKeyError {
470 DefaultResponse(models::StorageError),
471 UnknownValue(serde_json::Value),
472}
473
474#[derive(Debug, Clone, Serialize, Deserialize)]
476#[serde(untagged)]
477pub enum ListContainersSegmentError {
478 DefaultResponse(models::StorageError),
479 UnknownValue(serde_json::Value),
480}
481
482#[derive(Debug, Clone, Serialize, Deserialize)]
484#[serde(untagged)]
485pub enum PageBlobClearPagesError {
486 DefaultResponse(models::StorageError),
487 UnknownValue(serde_json::Value),
488}
489
490#[derive(Debug, Clone, Serialize, Deserialize)]
492#[serde(untagged)]
493pub enum PageBlobCopyIncrementalError {
494 DefaultResponse(models::StorageError),
495 UnknownValue(serde_json::Value),
496}
497
498#[derive(Debug, Clone, Serialize, Deserialize)]
500#[serde(untagged)]
501pub enum PageBlobGetPageRangesError {
502 DefaultResponse(models::StorageError),
503 UnknownValue(serde_json::Value),
504}
505
506#[derive(Debug, Clone, Serialize, Deserialize)]
508#[serde(untagged)]
509pub enum PageBlobGetPageRangesDiffError {
510 DefaultResponse(models::StorageError),
511 UnknownValue(serde_json::Value),
512}
513
514#[derive(Debug, Clone, Serialize, Deserialize)]
516#[serde(untagged)]
517pub enum PageBlobResizeError {
518 DefaultResponse(models::StorageError),
519 UnknownValue(serde_json::Value),
520}
521
522#[derive(Debug, Clone, Serialize, Deserialize)]
524#[serde(untagged)]
525pub enum PageBlobSetSequenceNumberError {
526 DefaultResponse(models::StorageError),
527 UnknownValue(serde_json::Value),
528}
529
530#[derive(Debug, Clone, Serialize, Deserialize)]
532#[serde(untagged)]
533pub enum PageBlobUploadPagesError {
534 DefaultResponse(models::StorageError),
535 UnknownValue(serde_json::Value),
536}
537
538#[derive(Debug, Clone, Serialize, Deserialize)]
540#[serde(untagged)]
541pub enum PageBlobUploadPagesFromUrlError {
542 DefaultResponse(models::StorageError),
543 UnknownValue(serde_json::Value),
544}
545
546#[derive(Debug, Clone, Serialize, Deserialize)]
548#[serde(untagged)]
549pub enum SetPropertiesError {
550 DefaultResponse(models::StorageError),
551 UnknownValue(serde_json::Value),
552}
553
554#[derive(Debug, Clone, Serialize, Deserialize)]
556#[serde(untagged)]
557pub enum SubmitBatchError {
558 DefaultResponse(models::StorageError),
559 UnknownValue(serde_json::Value),
560}
561
562pub async fn append_blob_append_block(
564 configuration: &configuration::Configuration,
565 x_ms_version: &str,
566 container_name: &str,
567 blob_name: &str,
568 content_length: i64,
569 body: std::path::PathBuf,
570 timeout: Option<i32>,
571 content_md5: Option<String>,
572 x_ms_content_crc64: Option<String>,
573 x_ms_lease_id: Option<&str>,
574 x_ms_blob_condition_maxsize: Option<i64>,
575 x_ms_blob_condition_appendpos: Option<i64>,
576 x_ms_encryption_key: Option<&str>,
577 x_ms_encryption_key_sha256: Option<&str>,
578 x_ms_encryption_algorithm: Option<&str>,
579 x_ms_encryption_scope: Option<&str>,
580 if_modified_since: Option<&str>,
581 if_unmodified_since: Option<&str>,
582 if_none_match: Option<&str>,
583 if_match: Option<&str>,
584 x_ms_if_tags: Option<&str>,
585 x_ms_structured_body: Option<&str>,
586 x_ms_structured_content_length: Option<i64>,
587 x_ms_client_request_id: Option<&str>,
588) -> Result<(), Error<AppendBlobAppendBlockError>> {
589 let p_header_x_ms_version = x_ms_version;
591 let p_path_container_name = container_name;
592 let p_path_blob_name = blob_name;
593 let p_header_content_length = content_length;
594 let p_body_body = body;
595 let p_query_timeout = timeout;
596 let p_header_content_md5 = content_md5;
597 let p_header_x_ms_content_crc64 = x_ms_content_crc64;
598 let p_header_x_ms_lease_id = x_ms_lease_id;
599 let p_header_x_ms_blob_condition_maxsize = x_ms_blob_condition_maxsize;
600 let p_header_x_ms_blob_condition_appendpos = x_ms_blob_condition_appendpos;
601 let p_header_x_ms_encryption_key = x_ms_encryption_key;
602 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
603 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
604 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
605 let p_header_if_modified_since = if_modified_since;
606 let p_header_if_unmodified_since = if_unmodified_since;
607 let p_header_if_none_match = if_none_match;
608 let p_header_if_match = if_match;
609 let p_header_x_ms_if_tags = x_ms_if_tags;
610 let p_header_x_ms_structured_body = x_ms_structured_body;
611 let p_header_x_ms_structured_content_length = x_ms_structured_content_length;
612 let p_header_x_ms_client_request_id = x_ms_client_request_id;
613
614 let uri_str = format!(
615 "{}/{containerName}/{blobName}?comp=appendblock",
616 configuration.base_path,
617 containerName = crate::apis::urlencode(p_path_container_name),
618 blobName = crate::apis::urlencode(p_path_blob_name)
619 );
620 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
621
622 if let Some(ref param_value) = p_query_timeout {
623 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
624 }
625 if let Some(ref user_agent) = configuration.user_agent {
626 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
627 }
628 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
629 req_builder = req_builder.header("Content-Length", p_header_content_length.to_string());
630 if let Some(param_value) = p_header_content_md5 {
631 req_builder = req_builder.header("Content-MD5", param_value.to_string());
632 }
633 if let Some(param_value) = p_header_x_ms_content_crc64 {
634 req_builder = req_builder.header("x-ms-content-crc64", param_value.to_string());
635 }
636 if let Some(param_value) = p_header_x_ms_lease_id {
637 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
638 }
639 if let Some(param_value) = p_header_x_ms_blob_condition_maxsize {
640 req_builder = req_builder.header("x-ms-blob-condition-maxsize", param_value.to_string());
641 }
642 if let Some(param_value) = p_header_x_ms_blob_condition_appendpos {
643 req_builder = req_builder.header("x-ms-blob-condition-appendpos", param_value.to_string());
644 }
645 if let Some(param_value) = p_header_x_ms_encryption_key {
646 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
647 }
648 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
649 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
650 }
651 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
652 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
653 }
654 if let Some(param_value) = p_header_x_ms_encryption_scope {
655 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
656 }
657 if let Some(param_value) = p_header_if_modified_since {
658 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
659 }
660 if let Some(param_value) = p_header_if_unmodified_since {
661 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
662 }
663 if let Some(param_value) = p_header_if_none_match {
664 req_builder = req_builder.header("If-None-Match", param_value.to_string());
665 }
666 if let Some(param_value) = p_header_if_match {
667 req_builder = req_builder.header("If-Match", param_value.to_string());
668 }
669 if let Some(param_value) = p_header_x_ms_if_tags {
670 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
671 }
672 if let Some(param_value) = p_header_x_ms_structured_body {
673 req_builder = req_builder.header("x-ms-structured-body", param_value.to_string());
674 }
675 if let Some(param_value) = p_header_x_ms_structured_content_length {
676 req_builder = req_builder.header("x-ms-structured-content-length", param_value.to_string());
677 }
678 if let Some(param_value) = p_header_x_ms_client_request_id {
679 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
680 }
681 if let Some(ref token) = configuration.oauth_access_token {
682 req_builder = req_builder.bearer_auth(token.to_owned());
683 };
684 let file = TokioFile::open(p_body_body).await?;
685 let stream = FramedRead::new(file, BytesCodec::new());
686 req_builder = req_builder.body(reqwest::Body::wrap_stream(stream));
687
688 let req = req_builder.build()?;
689 let resp = configuration.client.execute(req).await?;
690
691 let status = resp.status();
692
693 if !status.is_client_error() && !status.is_server_error() {
694 Ok(())
695 } else {
696 let content = resp.text().await?;
697 let entity: Option<AppendBlobAppendBlockError> = serde_json::from_str(&content).ok();
698 Err(Error::ResponseError(ResponseContent {
699 status,
700 content,
701 entity,
702 }))
703 }
704}
705
706pub async fn append_blob_append_block_from_url(
708 configuration: &configuration::Configuration,
709 x_ms_version: &str,
710 container_name: &str,
711 blob_name: &str,
712 x_ms_copy_source: &str,
713 content_length: i64,
714 x_ms_source_range: Option<&str>,
715 x_ms_source_content_md5: Option<String>,
716 x_ms_source_content_crc64: Option<String>,
717 timeout: Option<i32>,
718 content_md5: Option<String>,
719 x_ms_encryption_key: Option<&str>,
720 x_ms_encryption_key_sha256: Option<&str>,
721 x_ms_encryption_algorithm: Option<&str>,
722 x_ms_encryption_scope: Option<&str>,
723 x_ms_lease_id: Option<&str>,
724 x_ms_blob_condition_maxsize: Option<i64>,
725 x_ms_blob_condition_appendpos: Option<i64>,
726 if_modified_since: Option<&str>,
727 if_unmodified_since: Option<&str>,
728 if_none_match: Option<&str>,
729 if_match: Option<&str>,
730 x_ms_if_tags: Option<&str>,
731 x_ms_source_if_modified_since: Option<&str>,
732 x_ms_source_if_unmodified_since: Option<&str>,
733 x_ms_source_if_match: Option<&str>,
734 x_ms_source_if_none_match: Option<&str>,
735 x_ms_copy_source_authorization: Option<&str>,
736 x_ms_file_request_intent: Option<&str>,
737 x_ms_client_request_id: Option<&str>,
738) -> Result<(), Error<AppendBlobAppendBlockFromUrlError>> {
739 let p_header_x_ms_version = x_ms_version;
741 let p_path_container_name = container_name;
742 let p_path_blob_name = blob_name;
743 let p_header_x_ms_copy_source = x_ms_copy_source;
744 let p_header_content_length = content_length;
745 let p_header_x_ms_source_range = x_ms_source_range;
746 let p_header_x_ms_source_content_md5 = x_ms_source_content_md5;
747 let p_header_x_ms_source_content_crc64 = x_ms_source_content_crc64;
748 let p_query_timeout = timeout;
749 let p_header_content_md5 = content_md5;
750 let p_header_x_ms_encryption_key = x_ms_encryption_key;
751 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
752 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
753 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
754 let p_header_x_ms_lease_id = x_ms_lease_id;
755 let p_header_x_ms_blob_condition_maxsize = x_ms_blob_condition_maxsize;
756 let p_header_x_ms_blob_condition_appendpos = x_ms_blob_condition_appendpos;
757 let p_header_if_modified_since = if_modified_since;
758 let p_header_if_unmodified_since = if_unmodified_since;
759 let p_header_if_none_match = if_none_match;
760 let p_header_if_match = if_match;
761 let p_header_x_ms_if_tags = x_ms_if_tags;
762 let p_header_x_ms_source_if_modified_since = x_ms_source_if_modified_since;
763 let p_header_x_ms_source_if_unmodified_since = x_ms_source_if_unmodified_since;
764 let p_header_x_ms_source_if_match = x_ms_source_if_match;
765 let p_header_x_ms_source_if_none_match = x_ms_source_if_none_match;
766 let p_header_x_ms_copy_source_authorization = x_ms_copy_source_authorization;
767 let p_header_x_ms_file_request_intent = x_ms_file_request_intent;
768 let p_header_x_ms_client_request_id = x_ms_client_request_id;
769
770 let uri_str = format!(
771 "{}/{containerName}/{blobName}?comp=appendblock&fromUrl",
772 configuration.base_path,
773 containerName = crate::apis::urlencode(p_path_container_name),
774 blobName = crate::apis::urlencode(p_path_blob_name)
775 );
776 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
777
778 if let Some(ref param_value) = p_query_timeout {
779 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
780 }
781 if let Some(ref user_agent) = configuration.user_agent {
782 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
783 }
784 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
785 req_builder = req_builder.header("x-ms-copy-source", p_header_x_ms_copy_source.to_string());
786 if let Some(param_value) = p_header_x_ms_source_range {
787 req_builder = req_builder.header("x-ms-source-range", param_value.to_string());
788 }
789 if let Some(param_value) = p_header_x_ms_source_content_md5 {
790 req_builder = req_builder.header("x-ms-source-content-md5", param_value.to_string());
791 }
792 if let Some(param_value) = p_header_x_ms_source_content_crc64 {
793 req_builder = req_builder.header("x-ms-source-content-crc64", param_value.to_string());
794 }
795 req_builder = req_builder.header("Content-Length", p_header_content_length.to_string());
796 if let Some(param_value) = p_header_content_md5 {
797 req_builder = req_builder.header("Content-MD5", param_value.to_string());
798 }
799 if let Some(param_value) = p_header_x_ms_encryption_key {
800 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
801 }
802 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
803 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
804 }
805 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
806 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
807 }
808 if let Some(param_value) = p_header_x_ms_encryption_scope {
809 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
810 }
811 if let Some(param_value) = p_header_x_ms_lease_id {
812 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
813 }
814 if let Some(param_value) = p_header_x_ms_blob_condition_maxsize {
815 req_builder = req_builder.header("x-ms-blob-condition-maxsize", param_value.to_string());
816 }
817 if let Some(param_value) = p_header_x_ms_blob_condition_appendpos {
818 req_builder = req_builder.header("x-ms-blob-condition-appendpos", param_value.to_string());
819 }
820 if let Some(param_value) = p_header_if_modified_since {
821 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
822 }
823 if let Some(param_value) = p_header_if_unmodified_since {
824 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
825 }
826 if let Some(param_value) = p_header_if_none_match {
827 req_builder = req_builder.header("If-None-Match", param_value.to_string());
828 }
829 if let Some(param_value) = p_header_if_match {
830 req_builder = req_builder.header("If-Match", param_value.to_string());
831 }
832 if let Some(param_value) = p_header_x_ms_if_tags {
833 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
834 }
835 if let Some(param_value) = p_header_x_ms_source_if_modified_since {
836 req_builder = req_builder.header("x-ms-source-if-modified-since", param_value.to_string());
837 }
838 if let Some(param_value) = p_header_x_ms_source_if_unmodified_since {
839 req_builder =
840 req_builder.header("x-ms-source-if-unmodified-since", param_value.to_string());
841 }
842 if let Some(param_value) = p_header_x_ms_source_if_match {
843 req_builder = req_builder.header("x-ms-source-if-match", param_value.to_string());
844 }
845 if let Some(param_value) = p_header_x_ms_source_if_none_match {
846 req_builder = req_builder.header("x-ms-source-if-none-match", param_value.to_string());
847 }
848 if let Some(param_value) = p_header_x_ms_copy_source_authorization {
849 req_builder = req_builder.header("x-ms-copy-source-authorization", param_value.to_string());
850 }
851 if let Some(param_value) = p_header_x_ms_file_request_intent {
852 req_builder = req_builder.header("x-ms-file-request-intent", param_value.to_string());
853 }
854 if let Some(param_value) = p_header_x_ms_client_request_id {
855 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
856 }
857 if let Some(ref token) = configuration.oauth_access_token {
858 req_builder = req_builder.bearer_auth(token.to_owned());
859 };
860
861 let req = req_builder.build()?;
862 let resp = configuration.client.execute(req).await?;
863
864 let status = resp.status();
865
866 if !status.is_client_error() && !status.is_server_error() {
867 Ok(())
868 } else {
869 let content = resp.text().await?;
870 let entity: Option<AppendBlobAppendBlockFromUrlError> = serde_json::from_str(&content).ok();
871 Err(Error::ResponseError(ResponseContent {
872 status,
873 content,
874 entity,
875 }))
876 }
877}
878
879pub async fn append_blob_create(
881 configuration: &configuration::Configuration,
882 x_ms_version: &str,
883 container_name: &str,
884 blob_name: &str,
885 content_length: f64,
886 x_ms_blob_type: &str,
887 x_ms_meta: Option<&str>,
888 timeout: Option<i32>,
889 x_ms_blob_content_type: Option<&str>,
890 x_ms_blob_content_encoding: Option<&str>,
891 x_ms_blob_content_language: Option<&str>,
892 x_ms_blob_content_md5: Option<String>,
893 x_ms_blob_cache_control: Option<&str>,
894 x_ms_lease_id: Option<&str>,
895 x_ms_blob_content_disposition: Option<&str>,
896 x_ms_encryption_key: Option<&str>,
897 x_ms_encryption_key_sha256: Option<&str>,
898 x_ms_encryption_algorithm: Option<&str>,
899 x_ms_encryption_scope: Option<&str>,
900 if_modified_since: Option<&str>,
901 if_unmodified_since: Option<&str>,
902 if_none_match: Option<&str>,
903 if_match: Option<&str>,
904 x_ms_if_tags: Option<&str>,
905 x_ms_tags: Option<&str>,
906 x_ms_immutability_policy_until_date: Option<&str>,
907 x_ms_immutability_policy_mode: Option<&str>,
908 x_ms_legal_hold: Option<bool>,
909 x_ms_client_request_id: Option<&str>,
910) -> Result<(), Error<AppendBlobCreateError>> {
911 let p_header_x_ms_version = x_ms_version;
913 let p_path_container_name = container_name;
914 let p_path_blob_name = blob_name;
915 let p_header_content_length = content_length;
916 let p_header_x_ms_blob_type = x_ms_blob_type;
917 let p_header_x_ms_meta = x_ms_meta;
918 let p_query_timeout = timeout;
919 let p_header_x_ms_blob_content_type = x_ms_blob_content_type;
920 let p_header_x_ms_blob_content_encoding = x_ms_blob_content_encoding;
921 let p_header_x_ms_blob_content_language = x_ms_blob_content_language;
922 let p_header_x_ms_blob_content_md5 = x_ms_blob_content_md5;
923 let p_header_x_ms_blob_cache_control = x_ms_blob_cache_control;
924 let p_header_x_ms_lease_id = x_ms_lease_id;
925 let p_header_x_ms_blob_content_disposition = x_ms_blob_content_disposition;
926 let p_header_x_ms_encryption_key = x_ms_encryption_key;
927 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
928 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
929 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
930 let p_header_if_modified_since = if_modified_since;
931 let p_header_if_unmodified_since = if_unmodified_since;
932 let p_header_if_none_match = if_none_match;
933 let p_header_if_match = if_match;
934 let p_header_x_ms_if_tags = x_ms_if_tags;
935 let p_header_x_ms_tags = x_ms_tags;
936 let p_header_x_ms_immutability_policy_until_date = x_ms_immutability_policy_until_date;
937 let p_header_x_ms_immutability_policy_mode = x_ms_immutability_policy_mode;
938 let p_header_x_ms_legal_hold = x_ms_legal_hold;
939 let p_header_x_ms_client_request_id = x_ms_client_request_id;
940
941 let uri_str = format!(
942 "{}/{containerName}/{blobName}?_overload=create",
943 configuration.base_path,
944 containerName = crate::apis::urlencode(p_path_container_name),
945 blobName = crate::apis::urlencode(p_path_blob_name)
946 );
947 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
948
949 if let Some(ref param_value) = p_query_timeout {
950 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
951 }
952 if let Some(ref user_agent) = configuration.user_agent {
953 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
954 }
955 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
956 if let Some(param_value) = p_header_x_ms_meta {
957 req_builder = req_builder.header("x-ms-meta", param_value.to_string());
958 }
959 if let Some(param_value) = p_header_x_ms_blob_content_type {
960 req_builder = req_builder.header("x-ms-blob-content-type", param_value.to_string());
961 }
962 if let Some(param_value) = p_header_x_ms_blob_content_encoding {
963 req_builder = req_builder.header("x-ms-blob-content-encoding", param_value.to_string());
964 }
965 if let Some(param_value) = p_header_x_ms_blob_content_language {
966 req_builder = req_builder.header("x-ms-blob-content-language", param_value.to_string());
967 }
968 if let Some(param_value) = p_header_x_ms_blob_content_md5 {
969 req_builder = req_builder.header("x-ms-blob-content-md5", param_value.to_string());
970 }
971 if let Some(param_value) = p_header_x_ms_blob_cache_control {
972 req_builder = req_builder.header("x-ms-blob-cache-control", param_value.to_string());
973 }
974 if let Some(param_value) = p_header_x_ms_lease_id {
975 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
976 }
977 if let Some(param_value) = p_header_x_ms_blob_content_disposition {
978 req_builder = req_builder.header("x-ms-blob-content-disposition", param_value.to_string());
979 }
980 if let Some(param_value) = p_header_x_ms_encryption_key {
981 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
982 }
983 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
984 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
985 }
986 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
987 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
988 }
989 if let Some(param_value) = p_header_x_ms_encryption_scope {
990 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
991 }
992 if let Some(param_value) = p_header_if_modified_since {
993 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
994 }
995 if let Some(param_value) = p_header_if_unmodified_since {
996 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
997 }
998 if let Some(param_value) = p_header_if_none_match {
999 req_builder = req_builder.header("If-None-Match", param_value.to_string());
1000 }
1001 if let Some(param_value) = p_header_if_match {
1002 req_builder = req_builder.header("If-Match", param_value.to_string());
1003 }
1004 if let Some(param_value) = p_header_x_ms_if_tags {
1005 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
1006 }
1007 if let Some(param_value) = p_header_x_ms_tags {
1008 req_builder = req_builder.header("x-ms-tags", param_value.to_string());
1009 }
1010 if let Some(param_value) = p_header_x_ms_immutability_policy_until_date {
1011 req_builder = req_builder.header(
1012 "x-ms-immutability-policy-until-date",
1013 param_value.to_string(),
1014 );
1015 }
1016 if let Some(param_value) = p_header_x_ms_immutability_policy_mode {
1017 req_builder = req_builder.header("x-ms-immutability-policy-mode", param_value.to_string());
1018 }
1019 if let Some(param_value) = p_header_x_ms_legal_hold {
1020 req_builder = req_builder.header("x-ms-legal-hold", param_value.to_string());
1021 }
1022 req_builder = req_builder.header("Content-Length", p_header_content_length.to_string());
1023 req_builder = req_builder.header("x-ms-blob-type", p_header_x_ms_blob_type.to_string());
1024 if let Some(param_value) = p_header_x_ms_client_request_id {
1025 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
1026 }
1027 if let Some(ref token) = configuration.oauth_access_token {
1028 req_builder = req_builder.bearer_auth(token.to_owned());
1029 };
1030
1031 let req = req_builder.build()?;
1032 let resp = configuration.client.execute(req).await?;
1033
1034 let status = resp.status();
1035
1036 if !status.is_client_error() && !status.is_server_error() {
1037 Ok(())
1038 } else {
1039 let content = resp.text().await?;
1040 let entity: Option<AppendBlobCreateError> = serde_json::from_str(&content).ok();
1041 Err(Error::ResponseError(ResponseContent {
1042 status,
1043 content,
1044 entity,
1045 }))
1046 }
1047}
1048
1049pub async fn append_blob_seal(
1051 configuration: &configuration::Configuration,
1052 x_ms_version: &str,
1053 container_name: &str,
1054 blob_name: &str,
1055 timeout: Option<i32>,
1056 x_ms_lease_id: Option<&str>,
1057 if_modified_since: Option<&str>,
1058 if_unmodified_since: Option<&str>,
1059 if_none_match: Option<&str>,
1060 if_match: Option<&str>,
1061 x_ms_blob_condition_appendpos: Option<i64>,
1062 x_ms_client_request_id: Option<&str>,
1063) -> Result<(), Error<AppendBlobSealError>> {
1064 let p_header_x_ms_version = x_ms_version;
1066 let p_path_container_name = container_name;
1067 let p_path_blob_name = blob_name;
1068 let p_query_timeout = timeout;
1069 let p_header_x_ms_lease_id = x_ms_lease_id;
1070 let p_header_if_modified_since = if_modified_since;
1071 let p_header_if_unmodified_since = if_unmodified_since;
1072 let p_header_if_none_match = if_none_match;
1073 let p_header_if_match = if_match;
1074 let p_header_x_ms_blob_condition_appendpos = x_ms_blob_condition_appendpos;
1075 let p_header_x_ms_client_request_id = x_ms_client_request_id;
1076
1077 let uri_str = format!(
1078 "{}/{containerName}/{blobName}?comp=seal",
1079 configuration.base_path,
1080 containerName = crate::apis::urlencode(p_path_container_name),
1081 blobName = crate::apis::urlencode(p_path_blob_name)
1082 );
1083 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1084
1085 if let Some(ref param_value) = p_query_timeout {
1086 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
1087 }
1088 if let Some(ref user_agent) = configuration.user_agent {
1089 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1090 }
1091 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
1092 if let Some(param_value) = p_header_x_ms_lease_id {
1093 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
1094 }
1095 if let Some(param_value) = p_header_if_modified_since {
1096 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
1097 }
1098 if let Some(param_value) = p_header_if_unmodified_since {
1099 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
1100 }
1101 if let Some(param_value) = p_header_if_none_match {
1102 req_builder = req_builder.header("If-None-Match", param_value.to_string());
1103 }
1104 if let Some(param_value) = p_header_if_match {
1105 req_builder = req_builder.header("If-Match", param_value.to_string());
1106 }
1107 if let Some(param_value) = p_header_x_ms_blob_condition_appendpos {
1108 req_builder = req_builder.header("x-ms-blob-condition-appendpos", param_value.to_string());
1109 }
1110 if let Some(param_value) = p_header_x_ms_client_request_id {
1111 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
1112 }
1113 if let Some(ref token) = configuration.oauth_access_token {
1114 req_builder = req_builder.bearer_auth(token.to_owned());
1115 };
1116
1117 let req = req_builder.build()?;
1118 let resp = configuration.client.execute(req).await?;
1119
1120 let status = resp.status();
1121
1122 if !status.is_client_error() && !status.is_server_error() {
1123 Ok(())
1124 } else {
1125 let content = resp.text().await?;
1126 let entity: Option<AppendBlobSealError> = serde_json::from_str(&content).ok();
1127 Err(Error::ResponseError(ResponseContent {
1128 status,
1129 content,
1130 entity,
1131 }))
1132 }
1133}
1134
1135pub async fn blob_abort_copy_from_url(
1137 configuration: &configuration::Configuration,
1138 x_ms_version: &str,
1139 container_name: &str,
1140 blob_name: &str,
1141 copyid: &str,
1142 x_ms_copy_action: &str,
1143 timeout: Option<i32>,
1144 x_ms_lease_id: Option<&str>,
1145 x_ms_client_request_id: Option<&str>,
1146) -> Result<(), Error<BlobAbortCopyFromUrlError>> {
1147 let p_header_x_ms_version = x_ms_version;
1149 let p_path_container_name = container_name;
1150 let p_path_blob_name = blob_name;
1151 let p_query_copyid = copyid;
1152 let p_header_x_ms_copy_action = x_ms_copy_action;
1153 let p_query_timeout = timeout;
1154 let p_header_x_ms_lease_id = x_ms_lease_id;
1155 let p_header_x_ms_client_request_id = x_ms_client_request_id;
1156
1157 let uri_str = format!(
1158 "{}/{containerName}/{blobName}?comp=copy©id",
1159 configuration.base_path,
1160 containerName = crate::apis::urlencode(p_path_container_name),
1161 blobName = crate::apis::urlencode(p_path_blob_name)
1162 );
1163 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1164
1165 if let Some(ref param_value) = p_query_timeout {
1166 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
1167 }
1168 req_builder = req_builder.query(&[("copyid", &p_query_copyid.to_string())]);
1169 if let Some(ref user_agent) = configuration.user_agent {
1170 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1171 }
1172 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
1173 if let Some(param_value) = p_header_x_ms_lease_id {
1174 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
1175 }
1176 req_builder = req_builder.header("x-ms-copy-action", p_header_x_ms_copy_action.to_string());
1177 if let Some(param_value) = p_header_x_ms_client_request_id {
1178 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
1179 }
1180 if let Some(ref token) = configuration.oauth_access_token {
1181 req_builder = req_builder.bearer_auth(token.to_owned());
1182 };
1183
1184 let req = req_builder.build()?;
1185 let resp = configuration.client.execute(req).await?;
1186
1187 let status = resp.status();
1188
1189 if !status.is_client_error() && !status.is_server_error() {
1190 Ok(())
1191 } else {
1192 let content = resp.text().await?;
1193 let entity: Option<BlobAbortCopyFromUrlError> = serde_json::from_str(&content).ok();
1194 Err(Error::ResponseError(ResponseContent {
1195 status,
1196 content,
1197 entity,
1198 }))
1199 }
1200}
1201
1202pub async fn blob_acquire_lease(
1204 configuration: &configuration::Configuration,
1205 x_ms_version: &str,
1206 container_name: &str,
1207 blob_name: &str,
1208 x_ms_lease_duration: i32,
1209 x_ms_lease_action: &str,
1210 timeout: Option<i32>,
1211 x_ms_proposed_lease_id: Option<&str>,
1212 if_modified_since: Option<&str>,
1213 if_unmodified_since: Option<&str>,
1214 if_none_match: Option<&str>,
1215 if_match: Option<&str>,
1216 x_ms_if_tags: Option<&str>,
1217 x_ms_client_request_id: Option<&str>,
1218) -> Result<(), Error<BlobAcquireLeaseError>> {
1219 let p_header_x_ms_version = x_ms_version;
1221 let p_path_container_name = container_name;
1222 let p_path_blob_name = blob_name;
1223 let p_header_x_ms_lease_duration = x_ms_lease_duration;
1224 let p_header_x_ms_lease_action = x_ms_lease_action;
1225 let p_query_timeout = timeout;
1226 let p_header_x_ms_proposed_lease_id = x_ms_proposed_lease_id;
1227 let p_header_if_modified_since = if_modified_since;
1228 let p_header_if_unmodified_since = if_unmodified_since;
1229 let p_header_if_none_match = if_none_match;
1230 let p_header_if_match = if_match;
1231 let p_header_x_ms_if_tags = x_ms_if_tags;
1232 let p_header_x_ms_client_request_id = x_ms_client_request_id;
1233
1234 let uri_str = format!(
1235 "{}/{containerName}/{blobName}?comp=lease&acquire",
1236 configuration.base_path,
1237 containerName = crate::apis::urlencode(p_path_container_name),
1238 blobName = crate::apis::urlencode(p_path_blob_name)
1239 );
1240 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1241
1242 if let Some(ref param_value) = p_query_timeout {
1243 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
1244 }
1245 if let Some(ref user_agent) = configuration.user_agent {
1246 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1247 }
1248 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
1249 req_builder = req_builder.header(
1250 "x-ms-lease-duration",
1251 p_header_x_ms_lease_duration.to_string(),
1252 );
1253 if let Some(param_value) = p_header_x_ms_proposed_lease_id {
1254 req_builder = req_builder.header("x-ms-proposed-lease-id", param_value.to_string());
1255 }
1256 if let Some(param_value) = p_header_if_modified_since {
1257 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
1258 }
1259 if let Some(param_value) = p_header_if_unmodified_since {
1260 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
1261 }
1262 if let Some(param_value) = p_header_if_none_match {
1263 req_builder = req_builder.header("If-None-Match", param_value.to_string());
1264 }
1265 if let Some(param_value) = p_header_if_match {
1266 req_builder = req_builder.header("If-Match", param_value.to_string());
1267 }
1268 if let Some(param_value) = p_header_x_ms_if_tags {
1269 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
1270 }
1271 req_builder = req_builder.header("x-ms-lease-action", p_header_x_ms_lease_action.to_string());
1272 if let Some(param_value) = p_header_x_ms_client_request_id {
1273 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
1274 }
1275 if let Some(ref token) = configuration.oauth_access_token {
1276 req_builder = req_builder.bearer_auth(token.to_owned());
1277 };
1278
1279 let req = req_builder.build()?;
1280 let resp = configuration.client.execute(req).await?;
1281
1282 let status = resp.status();
1283
1284 if !status.is_client_error() && !status.is_server_error() {
1285 Ok(())
1286 } else {
1287 let content = resp.text().await?;
1288 let entity: Option<BlobAcquireLeaseError> = serde_json::from_str(&content).ok();
1289 Err(Error::ResponseError(ResponseContent {
1290 status,
1291 content,
1292 entity,
1293 }))
1294 }
1295}
1296
1297pub async fn blob_break_lease(
1299 configuration: &configuration::Configuration,
1300 x_ms_version: &str,
1301 container_name: &str,
1302 blob_name: &str,
1303 x_ms_lease_action: &str,
1304 timeout: Option<i32>,
1305 x_ms_lease_break_period: Option<i32>,
1306 if_modified_since: Option<&str>,
1307 if_unmodified_since: Option<&str>,
1308 if_none_match: Option<&str>,
1309 if_match: Option<&str>,
1310 x_ms_if_tags: Option<&str>,
1311 x_ms_client_request_id: Option<&str>,
1312) -> Result<(), Error<BlobBreakLeaseError>> {
1313 let p_header_x_ms_version = x_ms_version;
1315 let p_path_container_name = container_name;
1316 let p_path_blob_name = blob_name;
1317 let p_header_x_ms_lease_action = x_ms_lease_action;
1318 let p_query_timeout = timeout;
1319 let p_header_x_ms_lease_break_period = x_ms_lease_break_period;
1320 let p_header_if_modified_since = if_modified_since;
1321 let p_header_if_unmodified_since = if_unmodified_since;
1322 let p_header_if_none_match = if_none_match;
1323 let p_header_if_match = if_match;
1324 let p_header_x_ms_if_tags = x_ms_if_tags;
1325 let p_header_x_ms_client_request_id = x_ms_client_request_id;
1326
1327 let uri_str = format!(
1328 "{}/{containerName}/{blobName}?comp=lease&break",
1329 configuration.base_path,
1330 containerName = crate::apis::urlencode(p_path_container_name),
1331 blobName = crate::apis::urlencode(p_path_blob_name)
1332 );
1333 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1334
1335 if let Some(ref param_value) = p_query_timeout {
1336 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
1337 }
1338 if let Some(ref user_agent) = configuration.user_agent {
1339 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1340 }
1341 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
1342 if let Some(param_value) = p_header_x_ms_lease_break_period {
1343 req_builder = req_builder.header("x-ms-lease-break-period", param_value.to_string());
1344 }
1345 if let Some(param_value) = p_header_if_modified_since {
1346 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
1347 }
1348 if let Some(param_value) = p_header_if_unmodified_since {
1349 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
1350 }
1351 if let Some(param_value) = p_header_if_none_match {
1352 req_builder = req_builder.header("If-None-Match", param_value.to_string());
1353 }
1354 if let Some(param_value) = p_header_if_match {
1355 req_builder = req_builder.header("If-Match", param_value.to_string());
1356 }
1357 if let Some(param_value) = p_header_x_ms_if_tags {
1358 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
1359 }
1360 req_builder = req_builder.header("x-ms-lease-action", p_header_x_ms_lease_action.to_string());
1361 if let Some(param_value) = p_header_x_ms_client_request_id {
1362 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
1363 }
1364 if let Some(ref token) = configuration.oauth_access_token {
1365 req_builder = req_builder.bearer_auth(token.to_owned());
1366 };
1367
1368 let req = req_builder.build()?;
1369 let resp = configuration.client.execute(req).await?;
1370
1371 let status = resp.status();
1372
1373 if !status.is_client_error() && !status.is_server_error() {
1374 Ok(())
1375 } else {
1376 let content = resp.text().await?;
1377 let entity: Option<BlobBreakLeaseError> = serde_json::from_str(&content).ok();
1378 Err(Error::ResponseError(ResponseContent {
1379 status,
1380 content,
1381 entity,
1382 }))
1383 }
1384}
1385
1386pub async fn blob_change_lease(
1388 configuration: &configuration::Configuration,
1389 x_ms_version: &str,
1390 container_name: &str,
1391 blob_name: &str,
1392 x_ms_lease_id: &str,
1393 x_ms_proposed_lease_id: &str,
1394 x_ms_lease_action: &str,
1395 timeout: Option<i32>,
1396 if_modified_since: Option<&str>,
1397 if_unmodified_since: Option<&str>,
1398 if_none_match: Option<&str>,
1399 if_match: Option<&str>,
1400 x_ms_if_tags: Option<&str>,
1401 x_ms_client_request_id: Option<&str>,
1402) -> Result<(), Error<BlobChangeLeaseError>> {
1403 let p_header_x_ms_version = x_ms_version;
1405 let p_path_container_name = container_name;
1406 let p_path_blob_name = blob_name;
1407 let p_header_x_ms_lease_id = x_ms_lease_id;
1408 let p_header_x_ms_proposed_lease_id = x_ms_proposed_lease_id;
1409 let p_header_x_ms_lease_action = x_ms_lease_action;
1410 let p_query_timeout = timeout;
1411 let p_header_if_modified_since = if_modified_since;
1412 let p_header_if_unmodified_since = if_unmodified_since;
1413 let p_header_if_none_match = if_none_match;
1414 let p_header_if_match = if_match;
1415 let p_header_x_ms_if_tags = x_ms_if_tags;
1416 let p_header_x_ms_client_request_id = x_ms_client_request_id;
1417
1418 let uri_str = format!(
1419 "{}/{containerName}/{blobName}?comp=lease&change",
1420 configuration.base_path,
1421 containerName = crate::apis::urlencode(p_path_container_name),
1422 blobName = crate::apis::urlencode(p_path_blob_name)
1423 );
1424 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1425
1426 if let Some(ref param_value) = p_query_timeout {
1427 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
1428 }
1429 if let Some(ref user_agent) = configuration.user_agent {
1430 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1431 }
1432 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
1433 req_builder = req_builder.header("x-ms-lease-id", p_header_x_ms_lease_id.to_string());
1434 req_builder = req_builder.header(
1435 "x-ms-proposed-lease-id",
1436 p_header_x_ms_proposed_lease_id.to_string(),
1437 );
1438 if let Some(param_value) = p_header_if_modified_since {
1439 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
1440 }
1441 if let Some(param_value) = p_header_if_unmodified_since {
1442 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
1443 }
1444 if let Some(param_value) = p_header_if_none_match {
1445 req_builder = req_builder.header("If-None-Match", param_value.to_string());
1446 }
1447 if let Some(param_value) = p_header_if_match {
1448 req_builder = req_builder.header("If-Match", param_value.to_string());
1449 }
1450 if let Some(param_value) = p_header_x_ms_if_tags {
1451 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
1452 }
1453 req_builder = req_builder.header("x-ms-lease-action", p_header_x_ms_lease_action.to_string());
1454 if let Some(param_value) = p_header_x_ms_client_request_id {
1455 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
1456 }
1457 if let Some(ref token) = configuration.oauth_access_token {
1458 req_builder = req_builder.bearer_auth(token.to_owned());
1459 };
1460
1461 let req = req_builder.build()?;
1462 let resp = configuration.client.execute(req).await?;
1463
1464 let status = resp.status();
1465
1466 if !status.is_client_error() && !status.is_server_error() {
1467 Ok(())
1468 } else {
1469 let content = resp.text().await?;
1470 let entity: Option<BlobChangeLeaseError> = serde_json::from_str(&content).ok();
1471 Err(Error::ResponseError(ResponseContent {
1472 status,
1473 content,
1474 entity,
1475 }))
1476 }
1477}
1478
1479pub async fn blob_copy_from_url(
1481 configuration: &configuration::Configuration,
1482 x_ms_version: &str,
1483 container_name: &str,
1484 blob_name: &str,
1485 x_ms_copy_source: &str,
1486 x_ms_requires_sync: &str,
1487 timeout: Option<i32>,
1488 x_ms_meta: Option<&str>,
1489 x_ms_access_tier: Option<&str>,
1490 x_ms_source_if_modified_since: Option<&str>,
1491 x_ms_source_if_unmodified_since: Option<&str>,
1492 x_ms_source_if_match: Option<&str>,
1493 x_ms_source_if_none_match: Option<&str>,
1494 if_modified_since: Option<&str>,
1495 if_unmodified_since: Option<&str>,
1496 if_none_match: Option<&str>,
1497 if_match: Option<&str>,
1498 x_ms_if_tags: Option<&str>,
1499 x_ms_lease_id: Option<&str>,
1500 x_ms_source_content_md5: Option<String>,
1501 x_ms_tags: Option<&str>,
1502 x_ms_immutability_policy_until_date: Option<&str>,
1503 x_ms_immutability_policy_mode: Option<&str>,
1504 x_ms_legal_hold: Option<bool>,
1505 x_ms_copy_source_authorization: Option<&str>,
1506 x_ms_encryption_scope: Option<&str>,
1507 x_ms_copy_source_tag_option: Option<&str>,
1508 x_ms_file_request_intent: Option<&str>,
1509 x_ms_client_request_id: Option<&str>,
1510) -> Result<(), Error<BlobCopyFromUrlError>> {
1511 let p_header_x_ms_version = x_ms_version;
1513 let p_path_container_name = container_name;
1514 let p_path_blob_name = blob_name;
1515 let p_header_x_ms_copy_source = x_ms_copy_source;
1516 let p_header_x_ms_requires_sync = x_ms_requires_sync;
1517 let p_query_timeout = timeout;
1518 let p_header_x_ms_meta = x_ms_meta;
1519 let p_header_x_ms_access_tier = x_ms_access_tier;
1520 let p_header_x_ms_source_if_modified_since = x_ms_source_if_modified_since;
1521 let p_header_x_ms_source_if_unmodified_since = x_ms_source_if_unmodified_since;
1522 let p_header_x_ms_source_if_match = x_ms_source_if_match;
1523 let p_header_x_ms_source_if_none_match = x_ms_source_if_none_match;
1524 let p_header_if_modified_since = if_modified_since;
1525 let p_header_if_unmodified_since = if_unmodified_since;
1526 let p_header_if_none_match = if_none_match;
1527 let p_header_if_match = if_match;
1528 let p_header_x_ms_if_tags = x_ms_if_tags;
1529 let p_header_x_ms_lease_id = x_ms_lease_id;
1530 let p_header_x_ms_source_content_md5 = x_ms_source_content_md5;
1531 let p_header_x_ms_tags = x_ms_tags;
1532 let p_header_x_ms_immutability_policy_until_date = x_ms_immutability_policy_until_date;
1533 let p_header_x_ms_immutability_policy_mode = x_ms_immutability_policy_mode;
1534 let p_header_x_ms_legal_hold = x_ms_legal_hold;
1535 let p_header_x_ms_copy_source_authorization = x_ms_copy_source_authorization;
1536 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
1537 let p_header_x_ms_copy_source_tag_option = x_ms_copy_source_tag_option;
1538 let p_header_x_ms_file_request_intent = x_ms_file_request_intent;
1539 let p_header_x_ms_client_request_id = x_ms_client_request_id;
1540
1541 let uri_str = format!(
1542 "{}/{containerName}/{blobName}?comp=copy&sync",
1543 configuration.base_path,
1544 containerName = crate::apis::urlencode(p_path_container_name),
1545 blobName = crate::apis::urlencode(p_path_blob_name)
1546 );
1547 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1548
1549 if let Some(ref param_value) = p_query_timeout {
1550 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
1551 }
1552 if let Some(ref user_agent) = configuration.user_agent {
1553 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1554 }
1555 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
1556 if let Some(param_value) = p_header_x_ms_meta {
1557 req_builder = req_builder.header("x-ms-meta", param_value.to_string());
1558 }
1559 if let Some(param_value) = p_header_x_ms_access_tier {
1560 req_builder = req_builder.header("x-ms-access-tier", param_value.to_string());
1561 }
1562 if let Some(param_value) = p_header_x_ms_source_if_modified_since {
1563 req_builder = req_builder.header("x-ms-source-if-modified-since", param_value.to_string());
1564 }
1565 if let Some(param_value) = p_header_x_ms_source_if_unmodified_since {
1566 req_builder =
1567 req_builder.header("x-ms-source-if-unmodified-since", param_value.to_string());
1568 }
1569 if let Some(param_value) = p_header_x_ms_source_if_match {
1570 req_builder = req_builder.header("x-ms-source-if-match", param_value.to_string());
1571 }
1572 if let Some(param_value) = p_header_x_ms_source_if_none_match {
1573 req_builder = req_builder.header("x-ms-source-if-none-match", param_value.to_string());
1574 }
1575 if let Some(param_value) = p_header_if_modified_since {
1576 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
1577 }
1578 if let Some(param_value) = p_header_if_unmodified_since {
1579 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
1580 }
1581 if let Some(param_value) = p_header_if_none_match {
1582 req_builder = req_builder.header("If-None-Match", param_value.to_string());
1583 }
1584 if let Some(param_value) = p_header_if_match {
1585 req_builder = req_builder.header("If-Match", param_value.to_string());
1586 }
1587 if let Some(param_value) = p_header_x_ms_if_tags {
1588 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
1589 }
1590 req_builder = req_builder.header("x-ms-copy-source", p_header_x_ms_copy_source.to_string());
1591 if let Some(param_value) = p_header_x_ms_lease_id {
1592 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
1593 }
1594 if let Some(param_value) = p_header_x_ms_source_content_md5 {
1595 req_builder = req_builder.header("x-ms-source-content-md5", param_value.to_string());
1596 }
1597 if let Some(param_value) = p_header_x_ms_tags {
1598 req_builder = req_builder.header("x-ms-tags", param_value.to_string());
1599 }
1600 if let Some(param_value) = p_header_x_ms_immutability_policy_until_date {
1601 req_builder = req_builder.header(
1602 "x-ms-immutability-policy-until-date",
1603 param_value.to_string(),
1604 );
1605 }
1606 if let Some(param_value) = p_header_x_ms_immutability_policy_mode {
1607 req_builder = req_builder.header("x-ms-immutability-policy-mode", param_value.to_string());
1608 }
1609 if let Some(param_value) = p_header_x_ms_legal_hold {
1610 req_builder = req_builder.header("x-ms-legal-hold", param_value.to_string());
1611 }
1612 if let Some(param_value) = p_header_x_ms_copy_source_authorization {
1613 req_builder = req_builder.header("x-ms-copy-source-authorization", param_value.to_string());
1614 }
1615 if let Some(param_value) = p_header_x_ms_encryption_scope {
1616 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
1617 }
1618 if let Some(param_value) = p_header_x_ms_copy_source_tag_option {
1619 req_builder = req_builder.header("x-ms-copy-source-tag-option", param_value.to_string());
1620 }
1621 if let Some(param_value) = p_header_x_ms_file_request_intent {
1622 req_builder = req_builder.header("x-ms-file-request-intent", param_value.to_string());
1623 }
1624 req_builder = req_builder.header(
1625 "x-ms-requires-sync",
1626 p_header_x_ms_requires_sync.to_string(),
1627 );
1628 if let Some(param_value) = p_header_x_ms_client_request_id {
1629 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
1630 }
1631 if let Some(ref token) = configuration.oauth_access_token {
1632 req_builder = req_builder.bearer_auth(token.to_owned());
1633 };
1634
1635 let req = req_builder.build()?;
1636 let resp = configuration.client.execute(req).await?;
1637
1638 let status = resp.status();
1639
1640 if !status.is_client_error() && !status.is_server_error() {
1641 Ok(())
1642 } else {
1643 let content = resp.text().await?;
1644 let entity: Option<BlobCopyFromUrlError> = serde_json::from_str(&content).ok();
1645 Err(Error::ResponseError(ResponseContent {
1646 status,
1647 content,
1648 entity,
1649 }))
1650 }
1651}
1652
1653pub async fn blob_create_snapshot(
1655 configuration: &configuration::Configuration,
1656 x_ms_version: &str,
1657 container_name: &str,
1658 blob_name: &str,
1659 timeout: Option<i32>,
1660 x_ms_meta: Option<&str>,
1661 x_ms_encryption_key: Option<&str>,
1662 x_ms_encryption_key_sha256: Option<&str>,
1663 x_ms_encryption_algorithm: Option<&str>,
1664 x_ms_encryption_scope: Option<&str>,
1665 if_modified_since: Option<&str>,
1666 if_unmodified_since: Option<&str>,
1667 if_none_match: Option<&str>,
1668 if_match: Option<&str>,
1669 x_ms_if_tags: Option<&str>,
1670 x_ms_lease_id: Option<&str>,
1671 x_ms_client_request_id: Option<&str>,
1672) -> Result<(), Error<BlobCreateSnapshotError>> {
1673 let p_header_x_ms_version = x_ms_version;
1675 let p_path_container_name = container_name;
1676 let p_path_blob_name = blob_name;
1677 let p_query_timeout = timeout;
1678 let p_header_x_ms_meta = x_ms_meta;
1679 let p_header_x_ms_encryption_key = x_ms_encryption_key;
1680 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
1681 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
1682 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
1683 let p_header_if_modified_since = if_modified_since;
1684 let p_header_if_unmodified_since = if_unmodified_since;
1685 let p_header_if_none_match = if_none_match;
1686 let p_header_if_match = if_match;
1687 let p_header_x_ms_if_tags = x_ms_if_tags;
1688 let p_header_x_ms_lease_id = x_ms_lease_id;
1689 let p_header_x_ms_client_request_id = x_ms_client_request_id;
1690
1691 let uri_str = format!(
1692 "{}/{containerName}/{blobName}?comp=snapshot",
1693 configuration.base_path,
1694 containerName = crate::apis::urlencode(p_path_container_name),
1695 blobName = crate::apis::urlencode(p_path_blob_name)
1696 );
1697 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1698
1699 if let Some(ref param_value) = p_query_timeout {
1700 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
1701 }
1702 if let Some(ref user_agent) = configuration.user_agent {
1703 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1704 }
1705 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
1706 if let Some(param_value) = p_header_x_ms_meta {
1707 req_builder = req_builder.header("x-ms-meta", param_value.to_string());
1708 }
1709 if let Some(param_value) = p_header_x_ms_encryption_key {
1710 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
1711 }
1712 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
1713 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
1714 }
1715 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
1716 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
1717 }
1718 if let Some(param_value) = p_header_x_ms_encryption_scope {
1719 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
1720 }
1721 if let Some(param_value) = p_header_if_modified_since {
1722 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
1723 }
1724 if let Some(param_value) = p_header_if_unmodified_since {
1725 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
1726 }
1727 if let Some(param_value) = p_header_if_none_match {
1728 req_builder = req_builder.header("If-None-Match", param_value.to_string());
1729 }
1730 if let Some(param_value) = p_header_if_match {
1731 req_builder = req_builder.header("If-Match", param_value.to_string());
1732 }
1733 if let Some(param_value) = p_header_x_ms_if_tags {
1734 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
1735 }
1736 if let Some(param_value) = p_header_x_ms_lease_id {
1737 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
1738 }
1739 if let Some(param_value) = p_header_x_ms_client_request_id {
1740 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
1741 }
1742 if let Some(ref token) = configuration.oauth_access_token {
1743 req_builder = req_builder.bearer_auth(token.to_owned());
1744 };
1745
1746 let req = req_builder.build()?;
1747 let resp = configuration.client.execute(req).await?;
1748
1749 let status = resp.status();
1750
1751 if !status.is_client_error() && !status.is_server_error() {
1752 Ok(())
1753 } else {
1754 let content = resp.text().await?;
1755 let entity: Option<BlobCreateSnapshotError> = serde_json::from_str(&content).ok();
1756 Err(Error::ResponseError(ResponseContent {
1757 status,
1758 content,
1759 entity,
1760 }))
1761 }
1762}
1763
1764pub async fn blob_delete(
1766 configuration: &configuration::Configuration,
1767 x_ms_version: &str,
1768 container_name: &str,
1769 blob_name: &str,
1770 snapshot: Option<&str>,
1771 versionid: Option<&str>,
1772 timeout: Option<i32>,
1773 x_ms_lease_id: Option<&str>,
1774 x_ms_delete_snapshots: Option<&str>,
1775 if_modified_since: Option<&str>,
1776 if_unmodified_since: Option<&str>,
1777 if_none_match: Option<&str>,
1778 if_match: Option<&str>,
1779 x_ms_if_tags: Option<&str>,
1780 deletetype: Option<&str>,
1781 x_ms_client_request_id: Option<&str>,
1782) -> Result<(), Error<BlobDeleteError>> {
1783 let p_header_x_ms_version = x_ms_version;
1785 let p_path_container_name = container_name;
1786 let p_path_blob_name = blob_name;
1787 let p_query_snapshot = snapshot;
1788 let p_query_versionid = versionid;
1789 let p_query_timeout = timeout;
1790 let p_header_x_ms_lease_id = x_ms_lease_id;
1791 let p_header_x_ms_delete_snapshots = x_ms_delete_snapshots;
1792 let p_header_if_modified_since = if_modified_since;
1793 let p_header_if_unmodified_since = if_unmodified_since;
1794 let p_header_if_none_match = if_none_match;
1795 let p_header_if_match = if_match;
1796 let p_header_x_ms_if_tags = x_ms_if_tags;
1797 let p_query_deletetype = deletetype;
1798 let p_header_x_ms_client_request_id = x_ms_client_request_id;
1799
1800 let uri_str = format!(
1801 "{}/{containerName}/{blobName}",
1802 configuration.base_path,
1803 containerName = crate::apis::urlencode(p_path_container_name),
1804 blobName = crate::apis::urlencode(p_path_blob_name)
1805 );
1806 let mut req_builder = configuration
1807 .client
1808 .request(reqwest::Method::DELETE, &uri_str);
1809
1810 if let Some(ref param_value) = p_query_snapshot {
1811 req_builder = req_builder.query(&[("snapshot", ¶m_value.to_string())]);
1812 }
1813 if let Some(ref param_value) = p_query_versionid {
1814 req_builder = req_builder.query(&[("versionid", ¶m_value.to_string())]);
1815 }
1816 if let Some(ref param_value) = p_query_timeout {
1817 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
1818 }
1819 if let Some(ref param_value) = p_query_deletetype {
1820 req_builder = req_builder.query(&[("deletetype", ¶m_value.to_string())]);
1821 }
1822 if let Some(ref user_agent) = configuration.user_agent {
1823 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1824 }
1825 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
1826 if let Some(param_value) = p_header_x_ms_lease_id {
1827 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
1828 }
1829 if let Some(param_value) = p_header_x_ms_delete_snapshots {
1830 req_builder = req_builder.header("x-ms-delete-snapshots", param_value.to_string());
1831 }
1832 if let Some(param_value) = p_header_if_modified_since {
1833 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
1834 }
1835 if let Some(param_value) = p_header_if_unmodified_since {
1836 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
1837 }
1838 if let Some(param_value) = p_header_if_none_match {
1839 req_builder = req_builder.header("If-None-Match", param_value.to_string());
1840 }
1841 if let Some(param_value) = p_header_if_match {
1842 req_builder = req_builder.header("If-Match", param_value.to_string());
1843 }
1844 if let Some(param_value) = p_header_x_ms_if_tags {
1845 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
1846 }
1847 if let Some(param_value) = p_header_x_ms_client_request_id {
1848 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
1849 }
1850 if let Some(ref token) = configuration.oauth_access_token {
1851 req_builder = req_builder.bearer_auth(token.to_owned());
1852 };
1853
1854 let req = req_builder.build()?;
1855 let resp = configuration.client.execute(req).await?;
1856
1857 let status = resp.status();
1858
1859 if !status.is_client_error() && !status.is_server_error() {
1860 Ok(())
1861 } else {
1862 let content = resp.text().await?;
1863 let entity: Option<BlobDeleteError> = serde_json::from_str(&content).ok();
1864 Err(Error::ResponseError(ResponseContent {
1865 status,
1866 content,
1867 entity,
1868 }))
1869 }
1870}
1871
1872pub async fn blob_delete_immutability_policy(
1874 configuration: &configuration::Configuration,
1875 x_ms_version: &str,
1876 container_name: &str,
1877 blob_name: &str,
1878 timeout: Option<i32>,
1879 snapshot: Option<&str>,
1880 versionid: Option<&str>,
1881 x_ms_client_request_id: Option<&str>,
1882) -> Result<(), Error<BlobDeleteImmutabilityPolicyError>> {
1883 let p_header_x_ms_version = x_ms_version;
1885 let p_path_container_name = container_name;
1886 let p_path_blob_name = blob_name;
1887 let p_query_timeout = timeout;
1888 let p_query_snapshot = snapshot;
1889 let p_query_versionid = versionid;
1890 let p_header_x_ms_client_request_id = x_ms_client_request_id;
1891
1892 let uri_str = format!("{}/{containerName}/{blobName}?comp=immutabilityPolicies&_overload=deleteImmutabilityPolicy", configuration.base_path, containerName=crate::apis::urlencode(p_path_container_name), blobName=crate::apis::urlencode(p_path_blob_name));
1893 let mut req_builder = configuration
1894 .client
1895 .request(reqwest::Method::DELETE, &uri_str);
1896
1897 if let Some(ref param_value) = p_query_timeout {
1898 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
1899 }
1900 if let Some(ref param_value) = p_query_snapshot {
1901 req_builder = req_builder.query(&[("snapshot", ¶m_value.to_string())]);
1902 }
1903 if let Some(ref param_value) = p_query_versionid {
1904 req_builder = req_builder.query(&[("versionid", ¶m_value.to_string())]);
1905 }
1906 if let Some(ref user_agent) = configuration.user_agent {
1907 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1908 }
1909 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
1910 if let Some(param_value) = p_header_x_ms_client_request_id {
1911 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
1912 }
1913 if let Some(ref token) = configuration.oauth_access_token {
1914 req_builder = req_builder.bearer_auth(token.to_owned());
1915 };
1916
1917 let req = req_builder.build()?;
1918 let resp = configuration.client.execute(req).await?;
1919
1920 let status = resp.status();
1921
1922 if !status.is_client_error() && !status.is_server_error() {
1923 Ok(())
1924 } else {
1925 let content = resp.text().await?;
1926 let entity: Option<BlobDeleteImmutabilityPolicyError> = serde_json::from_str(&content).ok();
1927 Err(Error::ResponseError(ResponseContent {
1928 status,
1929 content,
1930 entity,
1931 }))
1932 }
1933}
1934
1935pub async fn blob_download(
1937 configuration: &configuration::Configuration,
1938 x_ms_version: &str,
1939 container_name: &str,
1940 blob_name: &str,
1941 x_ms_client_request_id: Option<&str>,
1942 snapshot: Option<&str>,
1943 versionid: Option<&str>,
1944 timeout: Option<i32>,
1945 range: Option<&str>,
1946 x_ms_lease_id: Option<&str>,
1947 x_ms_range_get_content_md5: Option<bool>,
1948 x_ms_range_get_content_crc64: Option<bool>,
1949 x_ms_structured_body: Option<&str>,
1950 x_ms_encryption_key: Option<&str>,
1951 x_ms_encryption_key_sha256: Option<&str>,
1952 x_ms_encryption_algorithm: Option<&str>,
1953 x_ms_if_tags: Option<&str>,
1954 if_match: Option<&str>,
1955 if_none_match: Option<&str>,
1956 if_unmodified_since: Option<String>,
1957 if_modified_since: Option<String>,
1958) -> Result<reqwest::Response, Error<BlobDownloadError>> {
1959 let p_header_x_ms_version = x_ms_version;
1961 let p_path_container_name = container_name;
1962 let p_path_blob_name = blob_name;
1963 let p_header_x_ms_client_request_id = x_ms_client_request_id;
1964 let p_query_snapshot = snapshot;
1965 let p_query_versionid = versionid;
1966 let p_query_timeout = timeout;
1967 let p_header_range = range;
1968 let p_header_x_ms_lease_id = x_ms_lease_id;
1969 let p_header_x_ms_range_get_content_md5 = x_ms_range_get_content_md5;
1970 let p_header_x_ms_range_get_content_crc64 = x_ms_range_get_content_crc64;
1971 let p_header_x_ms_structured_body = x_ms_structured_body;
1972 let p_header_x_ms_encryption_key = x_ms_encryption_key;
1973 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
1974 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
1975 let p_header_x_ms_if_tags = x_ms_if_tags;
1976 let p_header_if_match = if_match;
1977 let p_header_if_none_match = if_none_match;
1978 let p_header_if_unmodified_since = if_unmodified_since;
1979 let p_header_if_modified_since = if_modified_since;
1980
1981 let uri_str = format!(
1982 "{}/{containerName}/{blobName}",
1983 configuration.base_path,
1984 containerName = crate::apis::urlencode(p_path_container_name),
1985 blobName = crate::apis::urlencode(p_path_blob_name)
1986 );
1987 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1988
1989 if let Some(ref param_value) = p_query_snapshot {
1990 req_builder = req_builder.query(&[("snapshot", ¶m_value.to_string())]);
1991 }
1992 if let Some(ref param_value) = p_query_versionid {
1993 req_builder = req_builder.query(&[("versionid", ¶m_value.to_string())]);
1994 }
1995 if let Some(ref param_value) = p_query_timeout {
1996 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
1997 }
1998 if let Some(ref user_agent) = configuration.user_agent {
1999 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2000 }
2001 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
2002 if let Some(param_value) = p_header_x_ms_client_request_id {
2003 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
2004 }
2005 if let Some(param_value) = p_header_range {
2006 req_builder = req_builder.header("Range", param_value.to_string());
2007 }
2008 if let Some(param_value) = p_header_x_ms_lease_id {
2009 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
2010 }
2011 if let Some(param_value) = p_header_x_ms_range_get_content_md5 {
2012 req_builder = req_builder.header("x-ms-range-get-content-md5", param_value.to_string());
2013 }
2014 if let Some(param_value) = p_header_x_ms_range_get_content_crc64 {
2015 req_builder = req_builder.header("x-ms-range-get-content-crc64", param_value.to_string());
2016 }
2017 if let Some(param_value) = p_header_x_ms_structured_body {
2018 req_builder = req_builder.header("x-ms-structured-body", param_value.to_string());
2019 }
2020 if let Some(param_value) = p_header_x_ms_encryption_key {
2021 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
2022 }
2023 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
2024 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
2025 }
2026 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
2027 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
2028 }
2029 if let Some(param_value) = p_header_x_ms_if_tags {
2030 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
2031 }
2032 if let Some(param_value) = p_header_if_match {
2033 req_builder = req_builder.header("If-Match", param_value.to_string());
2034 }
2035 if let Some(param_value) = p_header_if_none_match {
2036 req_builder = req_builder.header("If-None-Match", param_value.to_string());
2037 }
2038 if let Some(param_value) = p_header_if_unmodified_since {
2039 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
2040 }
2041 if let Some(param_value) = p_header_if_modified_since {
2042 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
2043 }
2044 if let Some(ref token) = configuration.oauth_access_token {
2045 req_builder = req_builder.bearer_auth(token.to_owned());
2046 };
2047
2048 let req = req_builder.build()?;
2049 let resp = configuration.client.execute(req).await?;
2050
2051 let status = resp.status();
2052
2053 if !status.is_client_error() && !status.is_server_error() {
2054 Ok(resp)
2055 } else {
2056 let content = resp.text().await?;
2057 let entity: Option<BlobDownloadError> = serde_json::from_str(&content).ok();
2058 Err(Error::ResponseError(ResponseContent {
2059 status,
2060 content,
2061 entity,
2062 }))
2063 }
2064}
2065
2066pub async fn blob_get_account_info(
2068 configuration: &configuration::Configuration,
2069 x_ms_version: &str,
2070 container_name: &str,
2071 blob_name: &str,
2072 timeout: Option<i32>,
2073 x_ms_client_request_id: Option<&str>,
2074) -> Result<(), Error<BlobGetAccountInfoError>> {
2075 let p_header_x_ms_version = x_ms_version;
2077 let p_path_container_name = container_name;
2078 let p_path_blob_name = blob_name;
2079 let p_query_timeout = timeout;
2080 let p_header_x_ms_client_request_id = x_ms_client_request_id;
2081
2082 let uri_str = format!(
2083 "{}/{containerName}/{blobName}?restype=account&comp=properties&blob",
2084 configuration.base_path,
2085 containerName = crate::apis::urlencode(p_path_container_name),
2086 blobName = crate::apis::urlencode(p_path_blob_name)
2087 );
2088 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2089
2090 if let Some(ref param_value) = p_query_timeout {
2091 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
2092 }
2093 if let Some(ref user_agent) = configuration.user_agent {
2094 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2095 }
2096 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
2097 if let Some(param_value) = p_header_x_ms_client_request_id {
2098 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
2099 }
2100 if let Some(ref token) = configuration.oauth_access_token {
2101 req_builder = req_builder.bearer_auth(token.to_owned());
2102 };
2103
2104 let req = req_builder.build()?;
2105 let resp = configuration.client.execute(req).await?;
2106
2107 let status = resp.status();
2108
2109 if !status.is_client_error() && !status.is_server_error() {
2110 Ok(())
2111 } else {
2112 let content = resp.text().await?;
2113 let entity: Option<BlobGetAccountInfoError> = serde_json::from_str(&content).ok();
2114 Err(Error::ResponseError(ResponseContent {
2115 status,
2116 content,
2117 entity,
2118 }))
2119 }
2120}
2121
2122pub async fn blob_get_properties(
2124 configuration: &configuration::Configuration,
2125 x_ms_version: &str,
2126 container_name: &str,
2127 blob_name: &str,
2128 snapshot: Option<&str>,
2129 versionid: Option<&str>,
2130 timeout: Option<i32>,
2131 x_ms_lease_id: Option<&str>,
2132 x_ms_encryption_key: Option<&str>,
2133 x_ms_encryption_key_sha256: Option<&str>,
2134 x_ms_encryption_algorithm: Option<&str>,
2135 if_modified_since: Option<&str>,
2136 if_unmodified_since: Option<&str>,
2137 if_none_match: Option<&str>,
2138 if_match: Option<&str>,
2139 x_ms_if_tags: Option<&str>,
2140 x_ms_client_request_id: Option<&str>,
2141) -> Result<(), Error<BlobGetPropertiesError>> {
2142 let p_header_x_ms_version = x_ms_version;
2144 let p_path_container_name = container_name;
2145 let p_path_blob_name = blob_name;
2146 let p_query_snapshot = snapshot;
2147 let p_query_versionid = versionid;
2148 let p_query_timeout = timeout;
2149 let p_header_x_ms_lease_id = x_ms_lease_id;
2150 let p_header_x_ms_encryption_key = x_ms_encryption_key;
2151 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
2152 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
2153 let p_header_if_modified_since = if_modified_since;
2154 let p_header_if_unmodified_since = if_unmodified_since;
2155 let p_header_if_none_match = if_none_match;
2156 let p_header_if_match = if_match;
2157 let p_header_x_ms_if_tags = x_ms_if_tags;
2158 let p_header_x_ms_client_request_id = x_ms_client_request_id;
2159
2160 let uri_str = format!(
2161 "{}/{containerName}/{blobName}",
2162 configuration.base_path,
2163 containerName = crate::apis::urlencode(p_path_container_name),
2164 blobName = crate::apis::urlencode(p_path_blob_name)
2165 );
2166 let mut req_builder = configuration
2167 .client
2168 .request(reqwest::Method::HEAD, &uri_str);
2169
2170 if let Some(ref param_value) = p_query_snapshot {
2171 req_builder = req_builder.query(&[("snapshot", ¶m_value.to_string())]);
2172 }
2173 if let Some(ref param_value) = p_query_versionid {
2174 req_builder = req_builder.query(&[("versionid", ¶m_value.to_string())]);
2175 }
2176 if let Some(ref param_value) = p_query_timeout {
2177 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
2178 }
2179 if let Some(ref user_agent) = configuration.user_agent {
2180 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2181 }
2182 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
2183 if let Some(param_value) = p_header_x_ms_lease_id {
2184 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
2185 }
2186 if let Some(param_value) = p_header_x_ms_encryption_key {
2187 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
2188 }
2189 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
2190 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
2191 }
2192 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
2193 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
2194 }
2195 if let Some(param_value) = p_header_if_modified_since {
2196 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
2197 }
2198 if let Some(param_value) = p_header_if_unmodified_since {
2199 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
2200 }
2201 if let Some(param_value) = p_header_if_none_match {
2202 req_builder = req_builder.header("If-None-Match", param_value.to_string());
2203 }
2204 if let Some(param_value) = p_header_if_match {
2205 req_builder = req_builder.header("If-Match", param_value.to_string());
2206 }
2207 if let Some(param_value) = p_header_x_ms_if_tags {
2208 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
2209 }
2210 if let Some(param_value) = p_header_x_ms_client_request_id {
2211 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
2212 }
2213 if let Some(ref token) = configuration.oauth_access_token {
2214 req_builder = req_builder.bearer_auth(token.to_owned());
2215 };
2216
2217 let req = req_builder.build()?;
2218 let resp = configuration.client.execute(req).await?;
2219
2220 let status = resp.status();
2221
2222 if !status.is_client_error() && !status.is_server_error() {
2223 Ok(())
2224 } else {
2225 let content = resp.text().await?;
2226 let entity: Option<BlobGetPropertiesError> = serde_json::from_str(&content).ok();
2227 Err(Error::ResponseError(ResponseContent {
2228 status,
2229 content,
2230 entity,
2231 }))
2232 }
2233}
2234
2235pub async fn blob_get_tags(
2237 configuration: &configuration::Configuration,
2238 x_ms_version: &str,
2239 container_name: &str,
2240 blob_name: &str,
2241 timeout: Option<i32>,
2242 snapshot: Option<&str>,
2243 versionid: Option<&str>,
2244 x_ms_lease_id: Option<&str>,
2245 x_ms_if_tags: Option<&str>,
2246 x_ms_blob_if_modified_since: Option<&str>,
2247 x_ms_blob_if_unmodified_since: Option<&str>,
2248 x_ms_blob_if_match: Option<&str>,
2249 x_ms_blob_if_none_match: Option<&str>,
2250 x_ms_client_request_id: Option<&str>,
2251) -> Result<models::BlobTags, Error<BlobGetTagsError>> {
2252 let p_header_x_ms_version = x_ms_version;
2254 let p_path_container_name = container_name;
2255 let p_path_blob_name = blob_name;
2256 let p_query_timeout = timeout;
2257 let p_query_snapshot = snapshot;
2258 let p_query_versionid = versionid;
2259 let p_header_x_ms_lease_id = x_ms_lease_id;
2260 let p_header_x_ms_if_tags = x_ms_if_tags;
2261 let p_header_x_ms_blob_if_modified_since = x_ms_blob_if_modified_since;
2262 let p_header_x_ms_blob_if_unmodified_since = x_ms_blob_if_unmodified_since;
2263 let p_header_x_ms_blob_if_match = x_ms_blob_if_match;
2264 let p_header_x_ms_blob_if_none_match = x_ms_blob_if_none_match;
2265 let p_header_x_ms_client_request_id = x_ms_client_request_id;
2266
2267 let uri_str = format!(
2268 "{}/{containerName}/{blobName}?comp=tags",
2269 configuration.base_path,
2270 containerName = crate::apis::urlencode(p_path_container_name),
2271 blobName = crate::apis::urlencode(p_path_blob_name)
2272 );
2273 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2274
2275 if let Some(ref param_value) = p_query_timeout {
2276 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
2277 }
2278 if let Some(ref param_value) = p_query_snapshot {
2279 req_builder = req_builder.query(&[("snapshot", ¶m_value.to_string())]);
2280 }
2281 if let Some(ref param_value) = p_query_versionid {
2282 req_builder = req_builder.query(&[("versionid", ¶m_value.to_string())]);
2283 }
2284 if let Some(ref user_agent) = configuration.user_agent {
2285 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2286 }
2287 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
2288 if let Some(param_value) = p_header_x_ms_lease_id {
2289 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
2290 }
2291 if let Some(param_value) = p_header_x_ms_if_tags {
2292 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
2293 }
2294 if let Some(param_value) = p_header_x_ms_blob_if_modified_since {
2295 req_builder = req_builder.header("x-ms-blob-if-modified-since", param_value.to_string());
2296 }
2297 if let Some(param_value) = p_header_x_ms_blob_if_unmodified_since {
2298 req_builder = req_builder.header("x-ms-blob-if-unmodified-since", param_value.to_string());
2299 }
2300 if let Some(param_value) = p_header_x_ms_blob_if_match {
2301 req_builder = req_builder.header("x-ms-blob-if-match", param_value.to_string());
2302 }
2303 if let Some(param_value) = p_header_x_ms_blob_if_none_match {
2304 req_builder = req_builder.header("x-ms-blob-if-none-match", param_value.to_string());
2305 }
2306 if let Some(param_value) = p_header_x_ms_client_request_id {
2307 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
2308 }
2309 if let Some(ref token) = configuration.oauth_access_token {
2310 req_builder = req_builder.bearer_auth(token.to_owned());
2311 };
2312
2313 let req = req_builder.build()?;
2314 let resp = configuration.client.execute(req).await?;
2315
2316 let status = resp.status();
2317 let content_type = resp
2318 .headers()
2319 .get("content-type")
2320 .and_then(|v| v.to_str().ok())
2321 .unwrap_or("application/octet-stream");
2322 let content_type = super::ContentType::from(content_type);
2323
2324 if !status.is_client_error() && !status.is_server_error() {
2325 let content = resp.text().await?;
2326 match content_type {
2327 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2328 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BlobTags`"))),
2329 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BlobTags`")))),
2330 }
2331 } else {
2332 let content = resp.text().await?;
2333 let entity: Option<BlobGetTagsError> = serde_json::from_str(&content).ok();
2334 Err(Error::ResponseError(ResponseContent {
2335 status,
2336 content,
2337 entity,
2338 }))
2339 }
2340}
2341
2342pub async fn blob_release_lease(
2344 configuration: &configuration::Configuration,
2345 x_ms_version: &str,
2346 container_name: &str,
2347 blob_name: &str,
2348 x_ms_lease_id: &str,
2349 x_ms_lease_action: &str,
2350 timeout: Option<i32>,
2351 if_modified_since: Option<&str>,
2352 if_unmodified_since: Option<&str>,
2353 if_none_match: Option<&str>,
2354 if_match: Option<&str>,
2355 x_ms_if_tags: Option<&str>,
2356 x_ms_client_request_id: Option<&str>,
2357) -> Result<(), Error<BlobReleaseLeaseError>> {
2358 let p_header_x_ms_version = x_ms_version;
2360 let p_path_container_name = container_name;
2361 let p_path_blob_name = blob_name;
2362 let p_header_x_ms_lease_id = x_ms_lease_id;
2363 let p_header_x_ms_lease_action = x_ms_lease_action;
2364 let p_query_timeout = timeout;
2365 let p_header_if_modified_since = if_modified_since;
2366 let p_header_if_unmodified_since = if_unmodified_since;
2367 let p_header_if_none_match = if_none_match;
2368 let p_header_if_match = if_match;
2369 let p_header_x_ms_if_tags = x_ms_if_tags;
2370 let p_header_x_ms_client_request_id = x_ms_client_request_id;
2371
2372 let uri_str = format!(
2373 "{}/{containerName}/{blobName}?comp=lease&release",
2374 configuration.base_path,
2375 containerName = crate::apis::urlencode(p_path_container_name),
2376 blobName = crate::apis::urlencode(p_path_blob_name)
2377 );
2378 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2379
2380 if let Some(ref param_value) = p_query_timeout {
2381 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
2382 }
2383 if let Some(ref user_agent) = configuration.user_agent {
2384 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2385 }
2386 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
2387 req_builder = req_builder.header("x-ms-lease-id", p_header_x_ms_lease_id.to_string());
2388 if let Some(param_value) = p_header_if_modified_since {
2389 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
2390 }
2391 if let Some(param_value) = p_header_if_unmodified_since {
2392 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
2393 }
2394 if let Some(param_value) = p_header_if_none_match {
2395 req_builder = req_builder.header("If-None-Match", param_value.to_string());
2396 }
2397 if let Some(param_value) = p_header_if_match {
2398 req_builder = req_builder.header("If-Match", param_value.to_string());
2399 }
2400 if let Some(param_value) = p_header_x_ms_if_tags {
2401 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
2402 }
2403 req_builder = req_builder.header("x-ms-lease-action", p_header_x_ms_lease_action.to_string());
2404 if let Some(param_value) = p_header_x_ms_client_request_id {
2405 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
2406 }
2407 if let Some(ref token) = configuration.oauth_access_token {
2408 req_builder = req_builder.bearer_auth(token.to_owned());
2409 };
2410
2411 let req = req_builder.build()?;
2412 let resp = configuration.client.execute(req).await?;
2413
2414 let status = resp.status();
2415
2416 if !status.is_client_error() && !status.is_server_error() {
2417 Ok(())
2418 } else {
2419 let content = resp.text().await?;
2420 let entity: Option<BlobReleaseLeaseError> = serde_json::from_str(&content).ok();
2421 Err(Error::ResponseError(ResponseContent {
2422 status,
2423 content,
2424 entity,
2425 }))
2426 }
2427}
2428
2429pub async fn blob_renew_lease(
2431 configuration: &configuration::Configuration,
2432 x_ms_version: &str,
2433 container_name: &str,
2434 blob_name: &str,
2435 x_ms_lease_id: &str,
2436 x_ms_lease_action: &str,
2437 timeout: Option<i32>,
2438 if_modified_since: Option<&str>,
2439 if_unmodified_since: Option<&str>,
2440 if_none_match: Option<&str>,
2441 if_match: Option<&str>,
2442 x_ms_if_tags: Option<&str>,
2443 x_ms_client_request_id: Option<&str>,
2444) -> Result<(), Error<BlobRenewLeaseError>> {
2445 let p_header_x_ms_version = x_ms_version;
2447 let p_path_container_name = container_name;
2448 let p_path_blob_name = blob_name;
2449 let p_header_x_ms_lease_id = x_ms_lease_id;
2450 let p_header_x_ms_lease_action = x_ms_lease_action;
2451 let p_query_timeout = timeout;
2452 let p_header_if_modified_since = if_modified_since;
2453 let p_header_if_unmodified_since = if_unmodified_since;
2454 let p_header_if_none_match = if_none_match;
2455 let p_header_if_match = if_match;
2456 let p_header_x_ms_if_tags = x_ms_if_tags;
2457 let p_header_x_ms_client_request_id = x_ms_client_request_id;
2458
2459 let uri_str = format!(
2460 "{}/{containerName}/{blobName}?comp=lease&renew",
2461 configuration.base_path,
2462 containerName = crate::apis::urlencode(p_path_container_name),
2463 blobName = crate::apis::urlencode(p_path_blob_name)
2464 );
2465 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2466
2467 if let Some(ref param_value) = p_query_timeout {
2468 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
2469 }
2470 if let Some(ref user_agent) = configuration.user_agent {
2471 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2472 }
2473 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
2474 req_builder = req_builder.header("x-ms-lease-id", p_header_x_ms_lease_id.to_string());
2475 if let Some(param_value) = p_header_if_modified_since {
2476 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
2477 }
2478 if let Some(param_value) = p_header_if_unmodified_since {
2479 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
2480 }
2481 if let Some(param_value) = p_header_if_none_match {
2482 req_builder = req_builder.header("If-None-Match", param_value.to_string());
2483 }
2484 if let Some(param_value) = p_header_if_match {
2485 req_builder = req_builder.header("If-Match", param_value.to_string());
2486 }
2487 if let Some(param_value) = p_header_x_ms_if_tags {
2488 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
2489 }
2490 req_builder = req_builder.header("x-ms-lease-action", p_header_x_ms_lease_action.to_string());
2491 if let Some(param_value) = p_header_x_ms_client_request_id {
2492 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
2493 }
2494 if let Some(ref token) = configuration.oauth_access_token {
2495 req_builder = req_builder.bearer_auth(token.to_owned());
2496 };
2497
2498 let req = req_builder.build()?;
2499 let resp = configuration.client.execute(req).await?;
2500
2501 let status = resp.status();
2502
2503 if !status.is_client_error() && !status.is_server_error() {
2504 Ok(())
2505 } else {
2506 let content = resp.text().await?;
2507 let entity: Option<BlobRenewLeaseError> = serde_json::from_str(&content).ok();
2508 Err(Error::ResponseError(ResponseContent {
2509 status,
2510 content,
2511 entity,
2512 }))
2513 }
2514}
2515
2516pub async fn blob_set_expiry(
2518 configuration: &configuration::Configuration,
2519 x_ms_version: &str,
2520 container_name: &str,
2521 blob_name: &str,
2522 x_ms_expiry_option: &str,
2523 timeout: Option<i32>,
2524 x_ms_expiry_time: Option<&str>,
2525 x_ms_client_request_id: Option<&str>,
2526) -> Result<(), Error<BlobSetExpiryError>> {
2527 let p_header_x_ms_version = x_ms_version;
2529 let p_path_container_name = container_name;
2530 let p_path_blob_name = blob_name;
2531 let p_header_x_ms_expiry_option = x_ms_expiry_option;
2532 let p_query_timeout = timeout;
2533 let p_header_x_ms_expiry_time = x_ms_expiry_time;
2534 let p_header_x_ms_client_request_id = x_ms_client_request_id;
2535
2536 let uri_str = format!(
2537 "{}/{containerName}/{blobName}?comp=expiry",
2538 configuration.base_path,
2539 containerName = crate::apis::urlencode(p_path_container_name),
2540 blobName = crate::apis::urlencode(p_path_blob_name)
2541 );
2542 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2543
2544 if let Some(ref param_value) = p_query_timeout {
2545 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
2546 }
2547 if let Some(ref user_agent) = configuration.user_agent {
2548 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2549 }
2550 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
2551 req_builder = req_builder.header(
2552 "x-ms-expiry-option",
2553 p_header_x_ms_expiry_option.to_string(),
2554 );
2555 if let Some(param_value) = p_header_x_ms_expiry_time {
2556 req_builder = req_builder.header("x-ms-expiry-time", param_value.to_string());
2557 }
2558 if let Some(param_value) = p_header_x_ms_client_request_id {
2559 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
2560 }
2561 if let Some(ref token) = configuration.oauth_access_token {
2562 req_builder = req_builder.bearer_auth(token.to_owned());
2563 };
2564
2565 let req = req_builder.build()?;
2566 let resp = configuration.client.execute(req).await?;
2567
2568 let status = resp.status();
2569
2570 if !status.is_client_error() && !status.is_server_error() {
2571 Ok(())
2572 } else {
2573 let content = resp.text().await?;
2574 let entity: Option<BlobSetExpiryError> = serde_json::from_str(&content).ok();
2575 Err(Error::ResponseError(ResponseContent {
2576 status,
2577 content,
2578 entity,
2579 }))
2580 }
2581}
2582
2583pub async fn blob_set_immutability_policy(
2585 configuration: &configuration::Configuration,
2586 x_ms_version: &str,
2587 container_name: &str,
2588 blob_name: &str,
2589 timeout: Option<i32>,
2590 if_unmodified_since: Option<&str>,
2591 x_ms_immutability_policy_until_date: Option<&str>,
2592 x_ms_immutability_policy_mode: Option<&str>,
2593 snapshot: Option<&str>,
2594 versionid: Option<&str>,
2595 x_ms_client_request_id: Option<&str>,
2596) -> Result<(), Error<BlobSetImmutabilityPolicyError>> {
2597 let p_header_x_ms_version = x_ms_version;
2599 let p_path_container_name = container_name;
2600 let p_path_blob_name = blob_name;
2601 let p_query_timeout = timeout;
2602 let p_header_if_unmodified_since = if_unmodified_since;
2603 let p_header_x_ms_immutability_policy_until_date = x_ms_immutability_policy_until_date;
2604 let p_header_x_ms_immutability_policy_mode = x_ms_immutability_policy_mode;
2605 let p_query_snapshot = snapshot;
2606 let p_query_versionid = versionid;
2607 let p_header_x_ms_client_request_id = x_ms_client_request_id;
2608
2609 let uri_str = format!(
2610 "{}/{containerName}/{blobName}?comp=immutabilityPolicies",
2611 configuration.base_path,
2612 containerName = crate::apis::urlencode(p_path_container_name),
2613 blobName = crate::apis::urlencode(p_path_blob_name)
2614 );
2615 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2616
2617 if let Some(ref param_value) = p_query_timeout {
2618 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
2619 }
2620 if let Some(ref param_value) = p_query_snapshot {
2621 req_builder = req_builder.query(&[("snapshot", ¶m_value.to_string())]);
2622 }
2623 if let Some(ref param_value) = p_query_versionid {
2624 req_builder = req_builder.query(&[("versionid", ¶m_value.to_string())]);
2625 }
2626 if let Some(ref user_agent) = configuration.user_agent {
2627 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2628 }
2629 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
2630 if let Some(param_value) = p_header_if_unmodified_since {
2631 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
2632 }
2633 if let Some(param_value) = p_header_x_ms_immutability_policy_until_date {
2634 req_builder = req_builder.header(
2635 "x-ms-immutability-policy-until-date",
2636 param_value.to_string(),
2637 );
2638 }
2639 if let Some(param_value) = p_header_x_ms_immutability_policy_mode {
2640 req_builder = req_builder.header("x-ms-immutability-policy-mode", param_value.to_string());
2641 }
2642 if let Some(param_value) = p_header_x_ms_client_request_id {
2643 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
2644 }
2645 if let Some(ref token) = configuration.oauth_access_token {
2646 req_builder = req_builder.bearer_auth(token.to_owned());
2647 };
2648
2649 let req = req_builder.build()?;
2650 let resp = configuration.client.execute(req).await?;
2651
2652 let status = resp.status();
2653
2654 if !status.is_client_error() && !status.is_server_error() {
2655 Ok(())
2656 } else {
2657 let content = resp.text().await?;
2658 let entity: Option<BlobSetImmutabilityPolicyError> = serde_json::from_str(&content).ok();
2659 Err(Error::ResponseError(ResponseContent {
2660 status,
2661 content,
2662 entity,
2663 }))
2664 }
2665}
2666
2667pub async fn blob_set_legal_hold(
2669 configuration: &configuration::Configuration,
2670 x_ms_version: &str,
2671 container_name: &str,
2672 blob_name: &str,
2673 x_ms_legal_hold: bool,
2674 timeout: Option<i32>,
2675 snapshot: Option<&str>,
2676 versionid: Option<&str>,
2677 x_ms_client_request_id: Option<&str>,
2678) -> Result<(), Error<BlobSetLegalHoldError>> {
2679 let p_header_x_ms_version = x_ms_version;
2681 let p_path_container_name = container_name;
2682 let p_path_blob_name = blob_name;
2683 let p_header_x_ms_legal_hold = x_ms_legal_hold;
2684 let p_query_timeout = timeout;
2685 let p_query_snapshot = snapshot;
2686 let p_query_versionid = versionid;
2687 let p_header_x_ms_client_request_id = x_ms_client_request_id;
2688
2689 let uri_str = format!(
2690 "{}/{containerName}/{blobName}?comp=legalhold",
2691 configuration.base_path,
2692 containerName = crate::apis::urlencode(p_path_container_name),
2693 blobName = crate::apis::urlencode(p_path_blob_name)
2694 );
2695 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2696
2697 if let Some(ref param_value) = p_query_timeout {
2698 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
2699 }
2700 if let Some(ref param_value) = p_query_snapshot {
2701 req_builder = req_builder.query(&[("snapshot", ¶m_value.to_string())]);
2702 }
2703 if let Some(ref param_value) = p_query_versionid {
2704 req_builder = req_builder.query(&[("versionid", ¶m_value.to_string())]);
2705 }
2706 if let Some(ref user_agent) = configuration.user_agent {
2707 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2708 }
2709 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
2710 req_builder = req_builder.header("x-ms-legal-hold", p_header_x_ms_legal_hold.to_string());
2711 if let Some(param_value) = p_header_x_ms_client_request_id {
2712 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
2713 }
2714 if let Some(ref token) = configuration.oauth_access_token {
2715 req_builder = req_builder.bearer_auth(token.to_owned());
2716 };
2717
2718 let req = req_builder.build()?;
2719 let resp = configuration.client.execute(req).await?;
2720
2721 let status = resp.status();
2722
2723 if !status.is_client_error() && !status.is_server_error() {
2724 Ok(())
2725 } else {
2726 let content = resp.text().await?;
2727 let entity: Option<BlobSetLegalHoldError> = serde_json::from_str(&content).ok();
2728 Err(Error::ResponseError(ResponseContent {
2729 status,
2730 content,
2731 entity,
2732 }))
2733 }
2734}
2735
2736pub async fn blob_set_metadata(
2738 configuration: &configuration::Configuration,
2739 x_ms_version: &str,
2740 container_name: &str,
2741 blob_name: &str,
2742 timeout: Option<i32>,
2743 x_ms_meta: Option<&str>,
2744 x_ms_lease_id: Option<&str>,
2745 x_ms_encryption_key: Option<&str>,
2746 x_ms_encryption_key_sha256: Option<&str>,
2747 x_ms_encryption_algorithm: Option<&str>,
2748 x_ms_encryption_scope: Option<&str>,
2749 if_modified_since: Option<&str>,
2750 if_unmodified_since: Option<&str>,
2751 if_none_match: Option<&str>,
2752 if_match: Option<&str>,
2753 x_ms_if_tags: Option<&str>,
2754 x_ms_client_request_id: Option<&str>,
2755) -> Result<(), Error<BlobSetMetadataError>> {
2756 let p_header_x_ms_version = x_ms_version;
2758 let p_path_container_name = container_name;
2759 let p_path_blob_name = blob_name;
2760 let p_query_timeout = timeout;
2761 let p_header_x_ms_meta = x_ms_meta;
2762 let p_header_x_ms_lease_id = x_ms_lease_id;
2763 let p_header_x_ms_encryption_key = x_ms_encryption_key;
2764 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
2765 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
2766 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
2767 let p_header_if_modified_since = if_modified_since;
2768 let p_header_if_unmodified_since = if_unmodified_since;
2769 let p_header_if_none_match = if_none_match;
2770 let p_header_if_match = if_match;
2771 let p_header_x_ms_if_tags = x_ms_if_tags;
2772 let p_header_x_ms_client_request_id = x_ms_client_request_id;
2773
2774 let uri_str = format!(
2775 "{}/{containerName}/{blobName}?comp=metadata",
2776 configuration.base_path,
2777 containerName = crate::apis::urlencode(p_path_container_name),
2778 blobName = crate::apis::urlencode(p_path_blob_name)
2779 );
2780 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2781
2782 if let Some(ref param_value) = p_query_timeout {
2783 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
2784 }
2785 if let Some(ref user_agent) = configuration.user_agent {
2786 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2787 }
2788 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
2789 if let Some(param_value) = p_header_x_ms_meta {
2790 req_builder = req_builder.header("x-ms-meta", param_value.to_string());
2791 }
2792 if let Some(param_value) = p_header_x_ms_lease_id {
2793 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
2794 }
2795 if let Some(param_value) = p_header_x_ms_encryption_key {
2796 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
2797 }
2798 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
2799 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
2800 }
2801 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
2802 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
2803 }
2804 if let Some(param_value) = p_header_x_ms_encryption_scope {
2805 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
2806 }
2807 if let Some(param_value) = p_header_if_modified_since {
2808 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
2809 }
2810 if let Some(param_value) = p_header_if_unmodified_since {
2811 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
2812 }
2813 if let Some(param_value) = p_header_if_none_match {
2814 req_builder = req_builder.header("If-None-Match", param_value.to_string());
2815 }
2816 if let Some(param_value) = p_header_if_match {
2817 req_builder = req_builder.header("If-Match", param_value.to_string());
2818 }
2819 if let Some(param_value) = p_header_x_ms_if_tags {
2820 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
2821 }
2822 if let Some(param_value) = p_header_x_ms_client_request_id {
2823 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
2824 }
2825 if let Some(ref token) = configuration.oauth_access_token {
2826 req_builder = req_builder.bearer_auth(token.to_owned());
2827 };
2828
2829 let req = req_builder.build()?;
2830 let resp = configuration.client.execute(req).await?;
2831
2832 let status = resp.status();
2833
2834 if !status.is_client_error() && !status.is_server_error() {
2835 Ok(())
2836 } else {
2837 let content = resp.text().await?;
2838 let entity: Option<BlobSetMetadataError> = serde_json::from_str(&content).ok();
2839 Err(Error::ResponseError(ResponseContent {
2840 status,
2841 content,
2842 entity,
2843 }))
2844 }
2845}
2846
2847pub async fn blob_set_properties(
2849 configuration: &configuration::Configuration,
2850 x_ms_version: &str,
2851 container_name: &str,
2852 blob_name: &str,
2853 timeout: Option<i32>,
2854 x_ms_blob_cache_control: Option<&str>,
2855 x_ms_blob_content_type: Option<&str>,
2856 x_ms_blob_content_md5: Option<String>,
2857 x_ms_blob_content_encoding: Option<&str>,
2858 x_ms_blob_content_language: Option<&str>,
2859 x_ms_lease_id: Option<&str>,
2860 x_ms_blob_content_disposition: Option<&str>,
2861 if_modified_since: Option<&str>,
2862 if_unmodified_since: Option<&str>,
2863 if_none_match: Option<&str>,
2864 if_match: Option<&str>,
2865 x_ms_if_tags: Option<&str>,
2866 x_ms_client_request_id: Option<&str>,
2867) -> Result<(), Error<BlobSetPropertiesError>> {
2868 let p_header_x_ms_version = x_ms_version;
2870 let p_path_container_name = container_name;
2871 let p_path_blob_name = blob_name;
2872 let p_query_timeout = timeout;
2873 let p_header_x_ms_blob_cache_control = x_ms_blob_cache_control;
2874 let p_header_x_ms_blob_content_type = x_ms_blob_content_type;
2875 let p_header_x_ms_blob_content_md5 = x_ms_blob_content_md5;
2876 let p_header_x_ms_blob_content_encoding = x_ms_blob_content_encoding;
2877 let p_header_x_ms_blob_content_language = x_ms_blob_content_language;
2878 let p_header_x_ms_lease_id = x_ms_lease_id;
2879 let p_header_x_ms_blob_content_disposition = x_ms_blob_content_disposition;
2880 let p_header_if_modified_since = if_modified_since;
2881 let p_header_if_unmodified_since = if_unmodified_since;
2882 let p_header_if_none_match = if_none_match;
2883 let p_header_if_match = if_match;
2884 let p_header_x_ms_if_tags = x_ms_if_tags;
2885 let p_header_x_ms_client_request_id = x_ms_client_request_id;
2886
2887 let uri_str = format!(
2888 "{}/{containerName}/{blobName}?comp=properties&SetHTTPHeaders",
2889 configuration.base_path,
2890 containerName = crate::apis::urlencode(p_path_container_name),
2891 blobName = crate::apis::urlencode(p_path_blob_name)
2892 );
2893 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2894
2895 if let Some(ref param_value) = p_query_timeout {
2896 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
2897 }
2898 if let Some(ref user_agent) = configuration.user_agent {
2899 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2900 }
2901 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
2902 if let Some(param_value) = p_header_x_ms_blob_cache_control {
2903 req_builder = req_builder.header("x-ms-blob-cache-control", param_value.to_string());
2904 }
2905 if let Some(param_value) = p_header_x_ms_blob_content_type {
2906 req_builder = req_builder.header("x-ms-blob-content-type", param_value.to_string());
2907 }
2908 if let Some(param_value) = p_header_x_ms_blob_content_md5 {
2909 req_builder = req_builder.header("x-ms-blob-content-md5", param_value.to_string());
2910 }
2911 if let Some(param_value) = p_header_x_ms_blob_content_encoding {
2912 req_builder = req_builder.header("x-ms-blob-content-encoding", param_value.to_string());
2913 }
2914 if let Some(param_value) = p_header_x_ms_blob_content_language {
2915 req_builder = req_builder.header("x-ms-blob-content-language", param_value.to_string());
2916 }
2917 if let Some(param_value) = p_header_x_ms_lease_id {
2918 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
2919 }
2920 if let Some(param_value) = p_header_x_ms_blob_content_disposition {
2921 req_builder = req_builder.header("x-ms-blob-content-disposition", param_value.to_string());
2922 }
2923 if let Some(param_value) = p_header_if_modified_since {
2924 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
2925 }
2926 if let Some(param_value) = p_header_if_unmodified_since {
2927 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
2928 }
2929 if let Some(param_value) = p_header_if_none_match {
2930 req_builder = req_builder.header("If-None-Match", param_value.to_string());
2931 }
2932 if let Some(param_value) = p_header_if_match {
2933 req_builder = req_builder.header("If-Match", param_value.to_string());
2934 }
2935 if let Some(param_value) = p_header_x_ms_if_tags {
2936 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
2937 }
2938 if let Some(param_value) = p_header_x_ms_client_request_id {
2939 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
2940 }
2941 if let Some(ref token) = configuration.oauth_access_token {
2942 req_builder = req_builder.bearer_auth(token.to_owned());
2943 };
2944
2945 let req = req_builder.build()?;
2946 let resp = configuration.client.execute(req).await?;
2947
2948 let status = resp.status();
2949
2950 if !status.is_client_error() && !status.is_server_error() {
2951 Ok(())
2952 } else {
2953 let content = resp.text().await?;
2954 let entity: Option<BlobSetPropertiesError> = serde_json::from_str(&content).ok();
2955 Err(Error::ResponseError(ResponseContent {
2956 status,
2957 content,
2958 entity,
2959 }))
2960 }
2961}
2962
2963pub async fn blob_set_tags(
2965 configuration: &configuration::Configuration,
2966 x_ms_version: &str,
2967 container_name: &str,
2968 blob_name: &str,
2969 tags: models::BlobTags,
2970 timeout: Option<i32>,
2971 versionid: Option<&str>,
2972 content_md5: Option<String>,
2973 x_ms_content_crc64: Option<String>,
2974 x_ms_if_tags: Option<&str>,
2975 x_ms_lease_id: Option<&str>,
2976 x_ms_blob_if_modified_since: Option<&str>,
2977 x_ms_blob_if_unmodified_since: Option<&str>,
2978 x_ms_blob_if_match: Option<&str>,
2979 x_ms_blob_if_none_match: Option<&str>,
2980 x_ms_client_request_id: Option<&str>,
2981) -> Result<(), Error<BlobSetTagsError>> {
2982 let p_header_x_ms_version = x_ms_version;
2984 let p_path_container_name = container_name;
2985 let p_path_blob_name = blob_name;
2986 let p_body_tags = tags;
2987 let p_query_timeout = timeout;
2988 let p_query_versionid = versionid;
2989 let p_header_content_md5 = content_md5;
2990 let p_header_x_ms_content_crc64 = x_ms_content_crc64;
2991 let p_header_x_ms_if_tags = x_ms_if_tags;
2992 let p_header_x_ms_lease_id = x_ms_lease_id;
2993 let p_header_x_ms_blob_if_modified_since = x_ms_blob_if_modified_since;
2994 let p_header_x_ms_blob_if_unmodified_since = x_ms_blob_if_unmodified_since;
2995 let p_header_x_ms_blob_if_match = x_ms_blob_if_match;
2996 let p_header_x_ms_blob_if_none_match = x_ms_blob_if_none_match;
2997 let p_header_x_ms_client_request_id = x_ms_client_request_id;
2998
2999 let uri_str = format!(
3000 "{}/{containerName}/{blobName}?comp=tags&_overload=setTags",
3001 configuration.base_path,
3002 containerName = crate::apis::urlencode(p_path_container_name),
3003 blobName = crate::apis::urlencode(p_path_blob_name)
3004 );
3005 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3006
3007 if let Some(ref param_value) = p_query_timeout {
3008 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
3009 }
3010 if let Some(ref param_value) = p_query_versionid {
3011 req_builder = req_builder.query(&[("versionid", ¶m_value.to_string())]);
3012 }
3013 if let Some(ref user_agent) = configuration.user_agent {
3014 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3015 }
3016 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
3017 if let Some(param_value) = p_header_content_md5 {
3018 req_builder = req_builder.header("Content-MD5", param_value.to_string());
3019 }
3020 if let Some(param_value) = p_header_x_ms_content_crc64 {
3021 req_builder = req_builder.header("x-ms-content-crc64", param_value.to_string());
3022 }
3023 if let Some(param_value) = p_header_x_ms_if_tags {
3024 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
3025 }
3026 if let Some(param_value) = p_header_x_ms_lease_id {
3027 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
3028 }
3029 if let Some(param_value) = p_header_x_ms_blob_if_modified_since {
3030 req_builder = req_builder.header("x-ms-blob-if-modified-since", param_value.to_string());
3031 }
3032 if let Some(param_value) = p_header_x_ms_blob_if_unmodified_since {
3033 req_builder = req_builder.header("x-ms-blob-if-unmodified-since", param_value.to_string());
3034 }
3035 if let Some(param_value) = p_header_x_ms_blob_if_match {
3036 req_builder = req_builder.header("x-ms-blob-if-match", param_value.to_string());
3037 }
3038 if let Some(param_value) = p_header_x_ms_blob_if_none_match {
3039 req_builder = req_builder.header("x-ms-blob-if-none-match", param_value.to_string());
3040 }
3041 if let Some(param_value) = p_header_x_ms_client_request_id {
3042 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
3043 }
3044 if let Some(ref token) = configuration.oauth_access_token {
3045 req_builder = req_builder.bearer_auth(token.to_owned());
3046 };
3047 req_builder = req_builder.json(&p_body_tags);
3048
3049 let req = req_builder.build()?;
3050 let resp = configuration.client.execute(req).await?;
3051
3052 let status = resp.status();
3053
3054 if !status.is_client_error() && !status.is_server_error() {
3055 Ok(())
3056 } else {
3057 let content = resp.text().await?;
3058 let entity: Option<BlobSetTagsError> = serde_json::from_str(&content).ok();
3059 Err(Error::ResponseError(ResponseContent {
3060 status,
3061 content,
3062 entity,
3063 }))
3064 }
3065}
3066
3067pub async fn blob_set_tier(
3069 configuration: &configuration::Configuration,
3070 x_ms_version: &str,
3071 container_name: &str,
3072 blob_name: &str,
3073 x_ms_access_tier: &str,
3074 snapshot: Option<&str>,
3075 versionid: Option<&str>,
3076 timeout: Option<i32>,
3077 x_ms_rehydrate_priority: Option<&str>,
3078 x_ms_lease_id: Option<&str>,
3079 x_ms_if_tags: Option<&str>,
3080 x_ms_client_request_id: Option<&str>,
3081) -> Result<(), Error<BlobSetTierError>> {
3082 let p_header_x_ms_version = x_ms_version;
3084 let p_path_container_name = container_name;
3085 let p_path_blob_name = blob_name;
3086 let p_header_x_ms_access_tier = x_ms_access_tier;
3087 let p_query_snapshot = snapshot;
3088 let p_query_versionid = versionid;
3089 let p_query_timeout = timeout;
3090 let p_header_x_ms_rehydrate_priority = x_ms_rehydrate_priority;
3091 let p_header_x_ms_lease_id = x_ms_lease_id;
3092 let p_header_x_ms_if_tags = x_ms_if_tags;
3093 let p_header_x_ms_client_request_id = x_ms_client_request_id;
3094
3095 let uri_str = format!(
3096 "{}/{containerName}/{blobName}?comp=tier",
3097 configuration.base_path,
3098 containerName = crate::apis::urlencode(p_path_container_name),
3099 blobName = crate::apis::urlencode(p_path_blob_name)
3100 );
3101 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3102
3103 if let Some(ref param_value) = p_query_snapshot {
3104 req_builder = req_builder.query(&[("snapshot", ¶m_value.to_string())]);
3105 }
3106 if let Some(ref param_value) = p_query_versionid {
3107 req_builder = req_builder.query(&[("versionid", ¶m_value.to_string())]);
3108 }
3109 if let Some(ref param_value) = p_query_timeout {
3110 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
3111 }
3112 if let Some(ref user_agent) = configuration.user_agent {
3113 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3114 }
3115 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
3116 req_builder = req_builder.header("x-ms-access-tier", p_header_x_ms_access_tier.to_string());
3117 if let Some(param_value) = p_header_x_ms_rehydrate_priority {
3118 req_builder = req_builder.header("x-ms-rehydrate-priority", param_value.to_string());
3119 }
3120 if let Some(param_value) = p_header_x_ms_lease_id {
3121 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
3122 }
3123 if let Some(param_value) = p_header_x_ms_if_tags {
3124 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
3125 }
3126 if let Some(param_value) = p_header_x_ms_client_request_id {
3127 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
3128 }
3129 if let Some(ref token) = configuration.oauth_access_token {
3130 req_builder = req_builder.bearer_auth(token.to_owned());
3131 };
3132
3133 let req = req_builder.build()?;
3134 let resp = configuration.client.execute(req).await?;
3135
3136 let status = resp.status();
3137
3138 if !status.is_client_error() && !status.is_server_error() {
3139 Ok(())
3140 } else {
3141 let content = resp.text().await?;
3142 let entity: Option<BlobSetTierError> = serde_json::from_str(&content).ok();
3143 Err(Error::ResponseError(ResponseContent {
3144 status,
3145 content,
3146 entity,
3147 }))
3148 }
3149}
3150
3151pub async fn blob_start_copy_from_url(
3153 configuration: &configuration::Configuration,
3154 x_ms_version: &str,
3155 container_name: &str,
3156 blob_name: &str,
3157 x_ms_copy_source: &str,
3158 x_ms_requires_sync: bool,
3159 timeout: Option<i32>,
3160 x_ms_meta: Option<&str>,
3161 x_ms_access_tier: Option<&str>,
3162 x_ms_rehydrate_priority: Option<&str>,
3163 x_ms_source_if_modified_since: Option<&str>,
3164 x_ms_source_if_unmodified_since: Option<&str>,
3165 x_ms_source_if_match: Option<&str>,
3166 x_ms_source_if_none_match: Option<&str>,
3167 x_ms_source_if_tags: Option<&str>,
3168 if_modified_since: Option<&str>,
3169 if_unmodified_since: Option<&str>,
3170 if_none_match: Option<&str>,
3171 if_match: Option<&str>,
3172 x_ms_if_tags: Option<&str>,
3173 x_ms_lease_id: Option<&str>,
3174 x_ms_tags: Option<&str>,
3175 x_ms_seal_blob: Option<bool>,
3176 x_ms_immutability_policy_until_date: Option<&str>,
3177 x_ms_immutability_policy_mode: Option<&str>,
3178 x_ms_legal_hold: Option<bool>,
3179 x_ms_client_request_id: Option<&str>,
3180) -> Result<(), Error<BlobStartCopyFromUrlError>> {
3181 let p_header_x_ms_version = x_ms_version;
3183 let p_path_container_name = container_name;
3184 let p_path_blob_name = blob_name;
3185 let p_header_x_ms_copy_source = x_ms_copy_source;
3186 let p_header_x_ms_requires_sync = x_ms_requires_sync;
3187 let p_query_timeout = timeout;
3188 let p_header_x_ms_meta = x_ms_meta;
3189 let p_header_x_ms_access_tier = x_ms_access_tier;
3190 let p_header_x_ms_rehydrate_priority = x_ms_rehydrate_priority;
3191 let p_header_x_ms_source_if_modified_since = x_ms_source_if_modified_since;
3192 let p_header_x_ms_source_if_unmodified_since = x_ms_source_if_unmodified_since;
3193 let p_header_x_ms_source_if_match = x_ms_source_if_match;
3194 let p_header_x_ms_source_if_none_match = x_ms_source_if_none_match;
3195 let p_header_x_ms_source_if_tags = x_ms_source_if_tags;
3196 let p_header_if_modified_since = if_modified_since;
3197 let p_header_if_unmodified_since = if_unmodified_since;
3198 let p_header_if_none_match = if_none_match;
3199 let p_header_if_match = if_match;
3200 let p_header_x_ms_if_tags = x_ms_if_tags;
3201 let p_header_x_ms_lease_id = x_ms_lease_id;
3202 let p_header_x_ms_tags = x_ms_tags;
3203 let p_header_x_ms_seal_blob = x_ms_seal_blob;
3204 let p_header_x_ms_immutability_policy_until_date = x_ms_immutability_policy_until_date;
3205 let p_header_x_ms_immutability_policy_mode = x_ms_immutability_policy_mode;
3206 let p_header_x_ms_legal_hold = x_ms_legal_hold;
3207 let p_header_x_ms_client_request_id = x_ms_client_request_id;
3208
3209 let uri_str = format!(
3210 "{}/{containerName}/{blobName}",
3211 configuration.base_path,
3212 containerName = crate::apis::urlencode(p_path_container_name),
3213 blobName = crate::apis::urlencode(p_path_blob_name)
3214 );
3215 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3216
3217 if let Some(ref param_value) = p_query_timeout {
3218 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
3219 }
3220 if let Some(ref user_agent) = configuration.user_agent {
3221 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3222 }
3223 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
3224 if let Some(param_value) = p_header_x_ms_meta {
3225 req_builder = req_builder.header("x-ms-meta", param_value.to_string());
3226 }
3227 if let Some(param_value) = p_header_x_ms_access_tier {
3228 req_builder = req_builder.header("x-ms-access-tier", param_value.to_string());
3229 }
3230 if let Some(param_value) = p_header_x_ms_rehydrate_priority {
3231 req_builder = req_builder.header("x-ms-rehydrate-priority", param_value.to_string());
3232 }
3233 if let Some(param_value) = p_header_x_ms_source_if_modified_since {
3234 req_builder = req_builder.header("x-ms-source-if-modified-since", param_value.to_string());
3235 }
3236 if let Some(param_value) = p_header_x_ms_source_if_unmodified_since {
3237 req_builder =
3238 req_builder.header("x-ms-source-if-unmodified-since", param_value.to_string());
3239 }
3240 if let Some(param_value) = p_header_x_ms_source_if_match {
3241 req_builder = req_builder.header("x-ms-source-if-match", param_value.to_string());
3242 }
3243 if let Some(param_value) = p_header_x_ms_source_if_none_match {
3244 req_builder = req_builder.header("x-ms-source-if-none-match", param_value.to_string());
3245 }
3246 if let Some(param_value) = p_header_x_ms_source_if_tags {
3247 req_builder = req_builder.header("x-ms-source-if-tags", param_value.to_string());
3248 }
3249 if let Some(param_value) = p_header_if_modified_since {
3250 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
3251 }
3252 if let Some(param_value) = p_header_if_unmodified_since {
3253 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
3254 }
3255 if let Some(param_value) = p_header_if_none_match {
3256 req_builder = req_builder.header("If-None-Match", param_value.to_string());
3257 }
3258 if let Some(param_value) = p_header_if_match {
3259 req_builder = req_builder.header("If-Match", param_value.to_string());
3260 }
3261 if let Some(param_value) = p_header_x_ms_if_tags {
3262 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
3263 }
3264 req_builder = req_builder.header("x-ms-copy-source", p_header_x_ms_copy_source.to_string());
3265 if let Some(param_value) = p_header_x_ms_lease_id {
3266 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
3267 }
3268 if let Some(param_value) = p_header_x_ms_tags {
3269 req_builder = req_builder.header("x-ms-tags", param_value.to_string());
3270 }
3271 if let Some(param_value) = p_header_x_ms_seal_blob {
3272 req_builder = req_builder.header("x-ms-seal-blob", param_value.to_string());
3273 }
3274 if let Some(param_value) = p_header_x_ms_immutability_policy_until_date {
3275 req_builder = req_builder.header(
3276 "x-ms-immutability-policy-until-date",
3277 param_value.to_string(),
3278 );
3279 }
3280 if let Some(param_value) = p_header_x_ms_immutability_policy_mode {
3281 req_builder = req_builder.header("x-ms-immutability-policy-mode", param_value.to_string());
3282 }
3283 if let Some(param_value) = p_header_x_ms_legal_hold {
3284 req_builder = req_builder.header("x-ms-legal-hold", param_value.to_string());
3285 }
3286 req_builder = req_builder.header(
3287 "x-ms-requires-sync",
3288 p_header_x_ms_requires_sync.to_string(),
3289 );
3290 if let Some(param_value) = p_header_x_ms_client_request_id {
3291 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
3292 }
3293 if let Some(ref token) = configuration.oauth_access_token {
3294 req_builder = req_builder.bearer_auth(token.to_owned());
3295 };
3296
3297 let req = req_builder.build()?;
3298 let resp = configuration.client.execute(req).await?;
3299
3300 let status = resp.status();
3301
3302 if !status.is_client_error() && !status.is_server_error() {
3303 Ok(())
3304 } else {
3305 let content = resp.text().await?;
3306 let entity: Option<BlobStartCopyFromUrlError> = serde_json::from_str(&content).ok();
3307 Err(Error::ResponseError(ResponseContent {
3308 status,
3309 content,
3310 entity,
3311 }))
3312 }
3313}
3314
3315pub async fn blob_undelete(
3317 configuration: &configuration::Configuration,
3318 x_ms_version: &str,
3319 container_name: &str,
3320 blob_name: &str,
3321 timeout: Option<i32>,
3322 x_ms_client_request_id: Option<&str>,
3323) -> Result<(), Error<BlobUndeleteError>> {
3324 let p_header_x_ms_version = x_ms_version;
3326 let p_path_container_name = container_name;
3327 let p_path_blob_name = blob_name;
3328 let p_query_timeout = timeout;
3329 let p_header_x_ms_client_request_id = x_ms_client_request_id;
3330
3331 let uri_str = format!(
3332 "{}/{containerName}/{blobName}?comp=undelete",
3333 configuration.base_path,
3334 containerName = crate::apis::urlencode(p_path_container_name),
3335 blobName = crate::apis::urlencode(p_path_blob_name)
3336 );
3337 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3338
3339 if let Some(ref param_value) = p_query_timeout {
3340 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
3341 }
3342 if let Some(ref user_agent) = configuration.user_agent {
3343 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3344 }
3345 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
3346 if let Some(param_value) = p_header_x_ms_client_request_id {
3347 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
3348 }
3349 if let Some(ref token) = configuration.oauth_access_token {
3350 req_builder = req_builder.bearer_auth(token.to_owned());
3351 };
3352
3353 let req = req_builder.build()?;
3354 let resp = configuration.client.execute(req).await?;
3355
3356 let status = resp.status();
3357
3358 if !status.is_client_error() && !status.is_server_error() {
3359 Ok(())
3360 } else {
3361 let content = resp.text().await?;
3362 let entity: Option<BlobUndeleteError> = serde_json::from_str(&content).ok();
3363 Err(Error::ResponseError(ResponseContent {
3364 status,
3365 content,
3366 entity,
3367 }))
3368 }
3369}
3370
3371pub async fn block_blob_commit_block_list(
3373 configuration: &configuration::Configuration,
3374 x_ms_version: &str,
3375 container_name: &str,
3376 blob_name: &str,
3377 blocks: models::BlockLookupList,
3378 timeout: Option<i32>,
3379 x_ms_blob_cache_control: Option<&str>,
3380 x_ms_blob_content_type: Option<&str>,
3381 x_ms_blob_content_encoding: Option<&str>,
3382 x_ms_blob_content_language: Option<&str>,
3383 x_ms_blob_content_md5: Option<String>,
3384 content_md5: Option<String>,
3385 x_ms_content_crc64: Option<String>,
3386 x_ms_meta: Option<&str>,
3387 x_ms_lease_id: Option<&str>,
3388 x_ms_blob_content_disposition: Option<&str>,
3389 x_ms_encryption_key: Option<&str>,
3390 x_ms_encryption_key_sha256: Option<&str>,
3391 x_ms_encryption_algorithm: Option<&str>,
3392 x_ms_encryption_scope: Option<&str>,
3393 x_ms_access_tier: Option<&str>,
3394 if_modified_since: Option<&str>,
3395 if_unmodified_since: Option<&str>,
3396 if_none_match: Option<&str>,
3397 if_match: Option<&str>,
3398 x_ms_if_tags: Option<&str>,
3399 x_ms_tags: Option<&str>,
3400 x_ms_immutability_policy_until_date: Option<&str>,
3401 x_ms_immutability_policy_mode: Option<&str>,
3402 x_ms_legal_hold: Option<bool>,
3403 x_ms_client_request_id: Option<&str>,
3404) -> Result<(), Error<BlockBlobCommitBlockListError>> {
3405 let p_header_x_ms_version = x_ms_version;
3407 let p_path_container_name = container_name;
3408 let p_path_blob_name = blob_name;
3409 let p_body_blocks = blocks;
3410 let p_query_timeout = timeout;
3411 let p_header_x_ms_blob_cache_control = x_ms_blob_cache_control;
3412 let p_header_x_ms_blob_content_type = x_ms_blob_content_type;
3413 let p_header_x_ms_blob_content_encoding = x_ms_blob_content_encoding;
3414 let p_header_x_ms_blob_content_language = x_ms_blob_content_language;
3415 let p_header_x_ms_blob_content_md5 = x_ms_blob_content_md5;
3416 let p_header_content_md5 = content_md5;
3417 let p_header_x_ms_content_crc64 = x_ms_content_crc64;
3418 let p_header_x_ms_meta = x_ms_meta;
3419 let p_header_x_ms_lease_id = x_ms_lease_id;
3420 let p_header_x_ms_blob_content_disposition = x_ms_blob_content_disposition;
3421 let p_header_x_ms_encryption_key = x_ms_encryption_key;
3422 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
3423 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
3424 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
3425 let p_header_x_ms_access_tier = x_ms_access_tier;
3426 let p_header_if_modified_since = if_modified_since;
3427 let p_header_if_unmodified_since = if_unmodified_since;
3428 let p_header_if_none_match = if_none_match;
3429 let p_header_if_match = if_match;
3430 let p_header_x_ms_if_tags = x_ms_if_tags;
3431 let p_header_x_ms_tags = x_ms_tags;
3432 let p_header_x_ms_immutability_policy_until_date = x_ms_immutability_policy_until_date;
3433 let p_header_x_ms_immutability_policy_mode = x_ms_immutability_policy_mode;
3434 let p_header_x_ms_legal_hold = x_ms_legal_hold;
3435 let p_header_x_ms_client_request_id = x_ms_client_request_id;
3436
3437 let uri_str = format!(
3438 "{}/{containerName}/{blobName}?comp=blocklist",
3439 configuration.base_path,
3440 containerName = crate::apis::urlencode(p_path_container_name),
3441 blobName = crate::apis::urlencode(p_path_blob_name)
3442 );
3443 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3444
3445 if let Some(ref param_value) = p_query_timeout {
3446 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
3447 }
3448 if let Some(ref user_agent) = configuration.user_agent {
3449 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3450 }
3451 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
3452 if let Some(param_value) = p_header_x_ms_blob_cache_control {
3453 req_builder = req_builder.header("x-ms-blob-cache-control", param_value.to_string());
3454 }
3455 if let Some(param_value) = p_header_x_ms_blob_content_type {
3456 req_builder = req_builder.header("x-ms-blob-content-type", param_value.to_string());
3457 }
3458 if let Some(param_value) = p_header_x_ms_blob_content_encoding {
3459 req_builder = req_builder.header("x-ms-blob-content-encoding", param_value.to_string());
3460 }
3461 if let Some(param_value) = p_header_x_ms_blob_content_language {
3462 req_builder = req_builder.header("x-ms-blob-content-language", param_value.to_string());
3463 }
3464 if let Some(param_value) = p_header_x_ms_blob_content_md5 {
3465 req_builder = req_builder.header("x-ms-blob-content-md5", param_value.to_string());
3466 }
3467 if let Some(param_value) = p_header_content_md5 {
3468 req_builder = req_builder.header("Content-MD5", param_value.to_string());
3469 }
3470 if let Some(param_value) = p_header_x_ms_content_crc64 {
3471 req_builder = req_builder.header("x-ms-content-crc64", param_value.to_string());
3472 }
3473 if let Some(param_value) = p_header_x_ms_meta {
3474 req_builder = req_builder.header("x-ms-meta", param_value.to_string());
3475 }
3476 if let Some(param_value) = p_header_x_ms_lease_id {
3477 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
3478 }
3479 if let Some(param_value) = p_header_x_ms_blob_content_disposition {
3480 req_builder = req_builder.header("x-ms-blob-content-disposition", param_value.to_string());
3481 }
3482 if let Some(param_value) = p_header_x_ms_encryption_key {
3483 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
3484 }
3485 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
3486 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
3487 }
3488 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
3489 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
3490 }
3491 if let Some(param_value) = p_header_x_ms_encryption_scope {
3492 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
3493 }
3494 if let Some(param_value) = p_header_x_ms_access_tier {
3495 req_builder = req_builder.header("x-ms-access-tier", param_value.to_string());
3496 }
3497 if let Some(param_value) = p_header_if_modified_since {
3498 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
3499 }
3500 if let Some(param_value) = p_header_if_unmodified_since {
3501 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
3502 }
3503 if let Some(param_value) = p_header_if_none_match {
3504 req_builder = req_builder.header("If-None-Match", param_value.to_string());
3505 }
3506 if let Some(param_value) = p_header_if_match {
3507 req_builder = req_builder.header("If-Match", param_value.to_string());
3508 }
3509 if let Some(param_value) = p_header_x_ms_if_tags {
3510 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
3511 }
3512 if let Some(param_value) = p_header_x_ms_tags {
3513 req_builder = req_builder.header("x-ms-tags", param_value.to_string());
3514 }
3515 if let Some(param_value) = p_header_x_ms_immutability_policy_until_date {
3516 req_builder = req_builder.header(
3517 "x-ms-immutability-policy-until-date",
3518 param_value.to_string(),
3519 );
3520 }
3521 if let Some(param_value) = p_header_x_ms_immutability_policy_mode {
3522 req_builder = req_builder.header("x-ms-immutability-policy-mode", param_value.to_string());
3523 }
3524 if let Some(param_value) = p_header_x_ms_legal_hold {
3525 req_builder = req_builder.header("x-ms-legal-hold", param_value.to_string());
3526 }
3527 if let Some(param_value) = p_header_x_ms_client_request_id {
3528 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
3529 }
3530 if let Some(ref token) = configuration.oauth_access_token {
3531 req_builder = req_builder.bearer_auth(token.to_owned());
3532 };
3533 req_builder = req_builder.json(&p_body_blocks);
3534
3535 let req = req_builder.build()?;
3536 let resp = configuration.client.execute(req).await?;
3537
3538 let status = resp.status();
3539
3540 if !status.is_client_error() && !status.is_server_error() {
3541 Ok(())
3542 } else {
3543 let content = resp.text().await?;
3544 let entity: Option<BlockBlobCommitBlockListError> = serde_json::from_str(&content).ok();
3545 Err(Error::ResponseError(ResponseContent {
3546 status,
3547 content,
3548 entity,
3549 }))
3550 }
3551}
3552
3553pub async fn block_blob_get_block_list(
3555 configuration: &configuration::Configuration,
3556 x_ms_version: &str,
3557 container_name: &str,
3558 blob_name: &str,
3559 blocklisttype: &str,
3560 snapshot: Option<&str>,
3561 timeout: Option<i32>,
3562 x_ms_lease_id: Option<&str>,
3563 x_ms_if_tags: Option<&str>,
3564 x_ms_client_request_id: Option<&str>,
3565) -> Result<models::BlockList, Error<BlockBlobGetBlockListError>> {
3566 let p_header_x_ms_version = x_ms_version;
3568 let p_path_container_name = container_name;
3569 let p_path_blob_name = blob_name;
3570 let p_query_blocklisttype = blocklisttype;
3571 let p_query_snapshot = snapshot;
3572 let p_query_timeout = timeout;
3573 let p_header_x_ms_lease_id = x_ms_lease_id;
3574 let p_header_x_ms_if_tags = x_ms_if_tags;
3575 let p_header_x_ms_client_request_id = x_ms_client_request_id;
3576
3577 let uri_str = format!(
3578 "{}/{containerName}/{blobName}?comp=blocklist&_overload=getBlockList",
3579 configuration.base_path,
3580 containerName = crate::apis::urlencode(p_path_container_name),
3581 blobName = crate::apis::urlencode(p_path_blob_name)
3582 );
3583 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3584
3585 if let Some(ref param_value) = p_query_snapshot {
3586 req_builder = req_builder.query(&[("snapshot", ¶m_value.to_string())]);
3587 }
3588 req_builder = req_builder.query(&[("blocklisttype", &p_query_blocklisttype.to_string())]);
3589 if let Some(ref param_value) = p_query_timeout {
3590 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
3591 }
3592 if let Some(ref user_agent) = configuration.user_agent {
3593 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3594 }
3595 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
3596 if let Some(param_value) = p_header_x_ms_lease_id {
3597 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
3598 }
3599 if let Some(param_value) = p_header_x_ms_if_tags {
3600 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
3601 }
3602 if let Some(param_value) = p_header_x_ms_client_request_id {
3603 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
3604 }
3605 if let Some(ref token) = configuration.oauth_access_token {
3606 req_builder = req_builder.bearer_auth(token.to_owned());
3607 };
3608
3609 let req = req_builder.build()?;
3610 let resp = configuration.client.execute(req).await?;
3611
3612 let status = resp.status();
3613 let content_type = resp
3614 .headers()
3615 .get("content-type")
3616 .and_then(|v| v.to_str().ok())
3617 .unwrap_or("application/octet-stream");
3618 let content_type = super::ContentType::from(content_type);
3619
3620 if !status.is_client_error() && !status.is_server_error() {
3621 let content = resp.text().await?;
3622 match content_type {
3623 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3624 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BlockList`"))),
3625 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BlockList`")))),
3626 }
3627 } else {
3628 let content = resp.text().await?;
3629 let entity: Option<BlockBlobGetBlockListError> = serde_json::from_str(&content).ok();
3630 Err(Error::ResponseError(ResponseContent {
3631 status,
3632 content,
3633 entity,
3634 }))
3635 }
3636}
3637
3638pub async fn block_blob_put_blob_from_url(
3640 configuration: &configuration::Configuration,
3641 x_ms_version: &str,
3642 container_name: &str,
3643 blob_name: &str,
3644 content_length: i64,
3645 x_ms_copy_source: &str,
3646 x_ms_blob_type: &str,
3647 x_ms_meta: Option<&str>,
3648 timeout: Option<i32>,
3649 content_md5: Option<String>,
3650 x_ms_blob_content_type: Option<&str>,
3651 x_ms_blob_content_encoding: Option<&str>,
3652 x_ms_blob_content_language: Option<&str>,
3653 x_ms_blob_content_md5: Option<String>,
3654 x_ms_blob_cache_control: Option<&str>,
3655 x_ms_lease_id: Option<&str>,
3656 x_ms_blob_content_disposition: Option<&str>,
3657 x_ms_encryption_key: Option<&str>,
3658 x_ms_encryption_key_sha256: Option<&str>,
3659 x_ms_encryption_algorithm: Option<&str>,
3660 x_ms_encryption_scope: Option<&str>,
3661 x_ms_access_tier: Option<&str>,
3662 if_modified_since: Option<&str>,
3663 if_unmodified_since: Option<&str>,
3664 if_none_match: Option<&str>,
3665 if_match: Option<&str>,
3666 x_ms_if_tags: Option<&str>,
3667 x_ms_source_if_modified_since: Option<&str>,
3668 x_ms_source_if_unmodified_since: Option<&str>,
3669 x_ms_source_if_match: Option<&str>,
3670 x_ms_source_if_none_match: Option<&str>,
3671 x_ms_source_if_tags: Option<&str>,
3672 x_ms_source_content_md5: Option<String>,
3673 x_ms_tags: Option<&str>,
3674 x_ms_copy_source_blob_properties: Option<bool>,
3675 x_ms_copy_source_authorization: Option<&str>,
3676 x_ms_copy_source_tag_option: Option<&str>,
3677 x_ms_file_request_intent: Option<&str>,
3678 x_ms_client_request_id: Option<&str>,
3679) -> Result<(), Error<BlockBlobPutBlobFromUrlError>> {
3680 let p_header_x_ms_version = x_ms_version;
3682 let p_path_container_name = container_name;
3683 let p_path_blob_name = blob_name;
3684 let p_header_content_length = content_length;
3685 let p_header_x_ms_copy_source = x_ms_copy_source;
3686 let p_header_x_ms_blob_type = x_ms_blob_type;
3687 let p_header_x_ms_meta = x_ms_meta;
3688 let p_query_timeout = timeout;
3689 let p_header_content_md5 = content_md5;
3690 let p_header_x_ms_blob_content_type = x_ms_blob_content_type;
3691 let p_header_x_ms_blob_content_encoding = x_ms_blob_content_encoding;
3692 let p_header_x_ms_blob_content_language = x_ms_blob_content_language;
3693 let p_header_x_ms_blob_content_md5 = x_ms_blob_content_md5;
3694 let p_header_x_ms_blob_cache_control = x_ms_blob_cache_control;
3695 let p_header_x_ms_lease_id = x_ms_lease_id;
3696 let p_header_x_ms_blob_content_disposition = x_ms_blob_content_disposition;
3697 let p_header_x_ms_encryption_key = x_ms_encryption_key;
3698 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
3699 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
3700 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
3701 let p_header_x_ms_access_tier = x_ms_access_tier;
3702 let p_header_if_modified_since = if_modified_since;
3703 let p_header_if_unmodified_since = if_unmodified_since;
3704 let p_header_if_none_match = if_none_match;
3705 let p_header_if_match = if_match;
3706 let p_header_x_ms_if_tags = x_ms_if_tags;
3707 let p_header_x_ms_source_if_modified_since = x_ms_source_if_modified_since;
3708 let p_header_x_ms_source_if_unmodified_since = x_ms_source_if_unmodified_since;
3709 let p_header_x_ms_source_if_match = x_ms_source_if_match;
3710 let p_header_x_ms_source_if_none_match = x_ms_source_if_none_match;
3711 let p_header_x_ms_source_if_tags = x_ms_source_if_tags;
3712 let p_header_x_ms_source_content_md5 = x_ms_source_content_md5;
3713 let p_header_x_ms_tags = x_ms_tags;
3714 let p_header_x_ms_copy_source_blob_properties = x_ms_copy_source_blob_properties;
3715 let p_header_x_ms_copy_source_authorization = x_ms_copy_source_authorization;
3716 let p_header_x_ms_copy_source_tag_option = x_ms_copy_source_tag_option;
3717 let p_header_x_ms_file_request_intent = x_ms_file_request_intent;
3718 let p_header_x_ms_client_request_id = x_ms_client_request_id;
3719
3720 let uri_str = format!(
3721 "{}/{containerName}/{blobName}?BlockBlob&fromUrl",
3722 configuration.base_path,
3723 containerName = crate::apis::urlencode(p_path_container_name),
3724 blobName = crate::apis::urlencode(p_path_blob_name)
3725 );
3726 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3727
3728 if let Some(ref param_value) = p_query_timeout {
3729 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
3730 }
3731 if let Some(ref user_agent) = configuration.user_agent {
3732 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3733 }
3734 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
3735 if let Some(param_value) = p_header_x_ms_meta {
3736 req_builder = req_builder.header("x-ms-meta", param_value.to_string());
3737 }
3738 if let Some(param_value) = p_header_content_md5 {
3739 req_builder = req_builder.header("Content-MD5", param_value.to_string());
3740 }
3741 req_builder = req_builder.header("Content-Length", p_header_content_length.to_string());
3742 if let Some(param_value) = p_header_x_ms_blob_content_type {
3743 req_builder = req_builder.header("x-ms-blob-content-type", param_value.to_string());
3744 }
3745 if let Some(param_value) = p_header_x_ms_blob_content_encoding {
3746 req_builder = req_builder.header("x-ms-blob-content-encoding", param_value.to_string());
3747 }
3748 if let Some(param_value) = p_header_x_ms_blob_content_language {
3749 req_builder = req_builder.header("x-ms-blob-content-language", param_value.to_string());
3750 }
3751 if let Some(param_value) = p_header_x_ms_blob_content_md5 {
3752 req_builder = req_builder.header("x-ms-blob-content-md5", param_value.to_string());
3753 }
3754 if let Some(param_value) = p_header_x_ms_blob_cache_control {
3755 req_builder = req_builder.header("x-ms-blob-cache-control", param_value.to_string());
3756 }
3757 if let Some(param_value) = p_header_x_ms_lease_id {
3758 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
3759 }
3760 if let Some(param_value) = p_header_x_ms_blob_content_disposition {
3761 req_builder = req_builder.header("x-ms-blob-content-disposition", param_value.to_string());
3762 }
3763 if let Some(param_value) = p_header_x_ms_encryption_key {
3764 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
3765 }
3766 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
3767 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
3768 }
3769 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
3770 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
3771 }
3772 if let Some(param_value) = p_header_x_ms_encryption_scope {
3773 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
3774 }
3775 if let Some(param_value) = p_header_x_ms_access_tier {
3776 req_builder = req_builder.header("x-ms-access-tier", param_value.to_string());
3777 }
3778 if let Some(param_value) = p_header_if_modified_since {
3779 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
3780 }
3781 if let Some(param_value) = p_header_if_unmodified_since {
3782 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
3783 }
3784 if let Some(param_value) = p_header_if_none_match {
3785 req_builder = req_builder.header("If-None-Match", param_value.to_string());
3786 }
3787 if let Some(param_value) = p_header_if_match {
3788 req_builder = req_builder.header("If-Match", param_value.to_string());
3789 }
3790 if let Some(param_value) = p_header_x_ms_if_tags {
3791 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
3792 }
3793 if let Some(param_value) = p_header_x_ms_source_if_modified_since {
3794 req_builder = req_builder.header("x-ms-source-if-modified-since", param_value.to_string());
3795 }
3796 if let Some(param_value) = p_header_x_ms_source_if_unmodified_since {
3797 req_builder =
3798 req_builder.header("x-ms-source-if-unmodified-since", param_value.to_string());
3799 }
3800 if let Some(param_value) = p_header_x_ms_source_if_match {
3801 req_builder = req_builder.header("x-ms-source-if-match", param_value.to_string());
3802 }
3803 if let Some(param_value) = p_header_x_ms_source_if_none_match {
3804 req_builder = req_builder.header("x-ms-source-if-none-match", param_value.to_string());
3805 }
3806 if let Some(param_value) = p_header_x_ms_source_if_tags {
3807 req_builder = req_builder.header("x-ms-source-if-tags", param_value.to_string());
3808 }
3809 if let Some(param_value) = p_header_x_ms_source_content_md5 {
3810 req_builder = req_builder.header("x-ms-source-content-md5", param_value.to_string());
3811 }
3812 if let Some(param_value) = p_header_x_ms_tags {
3813 req_builder = req_builder.header("x-ms-tags", param_value.to_string());
3814 }
3815 req_builder = req_builder.header("x-ms-copy-source", p_header_x_ms_copy_source.to_string());
3816 if let Some(param_value) = p_header_x_ms_copy_source_blob_properties {
3817 req_builder =
3818 req_builder.header("x-ms-copy-source-blob-properties", param_value.to_string());
3819 }
3820 if let Some(param_value) = p_header_x_ms_copy_source_authorization {
3821 req_builder = req_builder.header("x-ms-copy-source-authorization", param_value.to_string());
3822 }
3823 if let Some(param_value) = p_header_x_ms_copy_source_tag_option {
3824 req_builder = req_builder.header("x-ms-copy-source-tag-option", param_value.to_string());
3825 }
3826 req_builder = req_builder.header("x-ms-blob-type", p_header_x_ms_blob_type.to_string());
3827 if let Some(param_value) = p_header_x_ms_file_request_intent {
3828 req_builder = req_builder.header("x-ms-file-request-intent", param_value.to_string());
3829 }
3830 if let Some(param_value) = p_header_x_ms_client_request_id {
3831 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
3832 }
3833 if let Some(ref token) = configuration.oauth_access_token {
3834 req_builder = req_builder.bearer_auth(token.to_owned());
3835 };
3836
3837 let req = req_builder.build()?;
3838 let resp = configuration.client.execute(req).await?;
3839
3840 let status = resp.status();
3841
3842 if !status.is_client_error() && !status.is_server_error() {
3843 Ok(())
3844 } else {
3845 let content = resp.text().await?;
3846 let entity: Option<BlockBlobPutBlobFromUrlError> = serde_json::from_str(&content).ok();
3847 Err(Error::ResponseError(ResponseContent {
3848 status,
3849 content,
3850 entity,
3851 }))
3852 }
3853}
3854
3855pub async fn block_blob_query(
3857 configuration: &configuration::Configuration,
3858 x_ms_version: &str,
3859 container_name: &str,
3860 blob_name: &str,
3861 query_request: models::QueryRequest,
3862 snapshot: Option<&str>,
3863 timeout: Option<i32>,
3864 x_ms_lease_id: Option<&str>,
3865 x_ms_encryption_key: Option<&str>,
3866 x_ms_encryption_key_sha256: Option<&str>,
3867 x_ms_encryption_algorithm: Option<&str>,
3868 if_modified_since: Option<&str>,
3869 if_unmodified_since: Option<&str>,
3870 if_none_match: Option<&str>,
3871 if_match: Option<&str>,
3872 x_ms_if_tags: Option<&str>,
3873 x_ms_client_request_id: Option<&str>,
3874) -> Result<reqwest::Response, Error<BlockBlobQueryError>> {
3875 let p_header_x_ms_version = x_ms_version;
3877 let p_path_container_name = container_name;
3878 let p_path_blob_name = blob_name;
3879 let p_body_query_request = query_request;
3880 let p_query_snapshot = snapshot;
3881 let p_query_timeout = timeout;
3882 let p_header_x_ms_lease_id = x_ms_lease_id;
3883 let p_header_x_ms_encryption_key = x_ms_encryption_key;
3884 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
3885 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
3886 let p_header_if_modified_since = if_modified_since;
3887 let p_header_if_unmodified_since = if_unmodified_since;
3888 let p_header_if_none_match = if_none_match;
3889 let p_header_if_match = if_match;
3890 let p_header_x_ms_if_tags = x_ms_if_tags;
3891 let p_header_x_ms_client_request_id = x_ms_client_request_id;
3892
3893 let uri_str = format!(
3894 "{}/{containerName}/{blobName}?comp=query",
3895 configuration.base_path,
3896 containerName = crate::apis::urlencode(p_path_container_name),
3897 blobName = crate::apis::urlencode(p_path_blob_name)
3898 );
3899 let mut req_builder = configuration
3900 .client
3901 .request(reqwest::Method::POST, &uri_str);
3902
3903 if let Some(ref param_value) = p_query_snapshot {
3904 req_builder = req_builder.query(&[("snapshot", ¶m_value.to_string())]);
3905 }
3906 if let Some(ref param_value) = p_query_timeout {
3907 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
3908 }
3909 if let Some(ref user_agent) = configuration.user_agent {
3910 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3911 }
3912 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
3913 if let Some(param_value) = p_header_x_ms_lease_id {
3914 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
3915 }
3916 if let Some(param_value) = p_header_x_ms_encryption_key {
3917 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
3918 }
3919 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
3920 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
3921 }
3922 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
3923 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
3924 }
3925 if let Some(param_value) = p_header_if_modified_since {
3926 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
3927 }
3928 if let Some(param_value) = p_header_if_unmodified_since {
3929 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
3930 }
3931 if let Some(param_value) = p_header_if_none_match {
3932 req_builder = req_builder.header("If-None-Match", param_value.to_string());
3933 }
3934 if let Some(param_value) = p_header_if_match {
3935 req_builder = req_builder.header("If-Match", param_value.to_string());
3936 }
3937 if let Some(param_value) = p_header_x_ms_if_tags {
3938 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
3939 }
3940 if let Some(param_value) = p_header_x_ms_client_request_id {
3941 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
3942 }
3943 if let Some(ref token) = configuration.oauth_access_token {
3944 req_builder = req_builder.bearer_auth(token.to_owned());
3945 };
3946 req_builder = req_builder.json(&p_body_query_request);
3947
3948 let req = req_builder.build()?;
3949 let resp = configuration.client.execute(req).await?;
3950
3951 let status = resp.status();
3952
3953 if !status.is_client_error() && !status.is_server_error() {
3954 Ok(resp)
3955 } else {
3956 let content = resp.text().await?;
3957 let entity: Option<BlockBlobQueryError> = serde_json::from_str(&content).ok();
3958 Err(Error::ResponseError(ResponseContent {
3959 status,
3960 content,
3961 entity,
3962 }))
3963 }
3964}
3965
3966pub async fn block_blob_stage_block(
3968 configuration: &configuration::Configuration,
3969 x_ms_version: &str,
3970 container_name: &str,
3971 blob_name: &str,
3972 blockid: &str,
3973 content_length: i64,
3974 body: std::path::PathBuf,
3975 content_md5: Option<String>,
3976 x_ms_content_crc64: Option<String>,
3977 timeout: Option<i32>,
3978 x_ms_lease_id: Option<&str>,
3979 x_ms_encryption_key: Option<&str>,
3980 x_ms_encryption_key_sha256: Option<&str>,
3981 x_ms_encryption_algorithm: Option<&str>,
3982 x_ms_encryption_scope: Option<&str>,
3983 x_ms_structured_body: Option<&str>,
3984 x_ms_structured_content_length: Option<i64>,
3985 x_ms_client_request_id: Option<&str>,
3986) -> Result<(), Error<BlockBlobStageBlockError>> {
3987 let p_header_x_ms_version = x_ms_version;
3989 let p_path_container_name = container_name;
3990 let p_path_blob_name = blob_name;
3991 let p_query_blockid = blockid;
3992 let p_header_content_length = content_length;
3993 let p_body_body = body;
3994 let p_header_content_md5 = content_md5;
3995 let p_header_x_ms_content_crc64 = x_ms_content_crc64;
3996 let p_query_timeout = timeout;
3997 let p_header_x_ms_lease_id = x_ms_lease_id;
3998 let p_header_x_ms_encryption_key = x_ms_encryption_key;
3999 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
4000 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
4001 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
4002 let p_header_x_ms_structured_body = x_ms_structured_body;
4003 let p_header_x_ms_structured_content_length = x_ms_structured_content_length;
4004 let p_header_x_ms_client_request_id = x_ms_client_request_id;
4005
4006 let uri_str = format!(
4007 "{}/{containerName}/{blobName}?comp=block",
4008 configuration.base_path,
4009 containerName = crate::apis::urlencode(p_path_container_name),
4010 blobName = crate::apis::urlencode(p_path_blob_name)
4011 );
4012 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4013
4014 req_builder = req_builder.query(&[("blockid", &p_query_blockid.to_string())]);
4015 if let Some(ref param_value) = p_query_timeout {
4016 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
4017 }
4018 if let Some(ref user_agent) = configuration.user_agent {
4019 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4020 }
4021 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
4022 req_builder = req_builder.header("Content-Length", p_header_content_length.to_string());
4023 if let Some(param_value) = p_header_content_md5 {
4024 req_builder = req_builder.header("Content-MD5", param_value.to_string());
4025 }
4026 if let Some(param_value) = p_header_x_ms_content_crc64 {
4027 req_builder = req_builder.header("x-ms-content-crc64", param_value.to_string());
4028 }
4029 if let Some(param_value) = p_header_x_ms_lease_id {
4030 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
4031 }
4032 if let Some(param_value) = p_header_x_ms_encryption_key {
4033 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
4034 }
4035 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
4036 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
4037 }
4038 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
4039 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
4040 }
4041 if let Some(param_value) = p_header_x_ms_encryption_scope {
4042 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
4043 }
4044 if let Some(param_value) = p_header_x_ms_structured_body {
4045 req_builder = req_builder.header("x-ms-structured-body", param_value.to_string());
4046 }
4047 if let Some(param_value) = p_header_x_ms_structured_content_length {
4048 req_builder = req_builder.header("x-ms-structured-content-length", param_value.to_string());
4049 }
4050 if let Some(param_value) = p_header_x_ms_client_request_id {
4051 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
4052 }
4053 if let Some(ref token) = configuration.oauth_access_token {
4054 req_builder = req_builder.bearer_auth(token.to_owned());
4055 };
4056 let file = TokioFile::open(p_body_body).await?;
4057 let stream = FramedRead::new(file, BytesCodec::new());
4058 req_builder = req_builder.body(reqwest::Body::wrap_stream(stream));
4059
4060 let req = req_builder.build()?;
4061 let resp = configuration.client.execute(req).await?;
4062
4063 let status = resp.status();
4064
4065 if !status.is_client_error() && !status.is_server_error() {
4066 Ok(())
4067 } else {
4068 let content = resp.text().await?;
4069 let entity: Option<BlockBlobStageBlockError> = serde_json::from_str(&content).ok();
4070 Err(Error::ResponseError(ResponseContent {
4071 status,
4072 content,
4073 entity,
4074 }))
4075 }
4076}
4077
4078pub async fn block_blob_stage_block_from_url(
4080 configuration: &configuration::Configuration,
4081 x_ms_version: &str,
4082 container_name: &str,
4083 blob_name: &str,
4084 blockid: &str,
4085 content_length: i64,
4086 x_ms_copy_source: &str,
4087 x_ms_source_range: Option<&str>,
4088 x_ms_source_content_md5: Option<String>,
4089 x_ms_source_content_crc64: Option<String>,
4090 timeout: Option<i32>,
4091 x_ms_encryption_key: Option<&str>,
4092 x_ms_encryption_key_sha256: Option<&str>,
4093 x_ms_encryption_algorithm: Option<&str>,
4094 x_ms_encryption_scope: Option<&str>,
4095 x_ms_lease_id: Option<&str>,
4096 x_ms_source_if_modified_since: Option<&str>,
4097 x_ms_source_if_unmodified_since: Option<&str>,
4098 x_ms_source_if_match: Option<&str>,
4099 x_ms_source_if_none_match: Option<&str>,
4100 x_ms_copy_source_authorization: Option<&str>,
4101 x_ms_file_request_intent: Option<&str>,
4102 x_ms_client_request_id: Option<&str>,
4103) -> Result<(), Error<BlockBlobStageBlockFromUrlError>> {
4104 let p_header_x_ms_version = x_ms_version;
4106 let p_path_container_name = container_name;
4107 let p_path_blob_name = blob_name;
4108 let p_query_blockid = blockid;
4109 let p_header_content_length = content_length;
4110 let p_header_x_ms_copy_source = x_ms_copy_source;
4111 let p_header_x_ms_source_range = x_ms_source_range;
4112 let p_header_x_ms_source_content_md5 = x_ms_source_content_md5;
4113 let p_header_x_ms_source_content_crc64 = x_ms_source_content_crc64;
4114 let p_query_timeout = timeout;
4115 let p_header_x_ms_encryption_key = x_ms_encryption_key;
4116 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
4117 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
4118 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
4119 let p_header_x_ms_lease_id = x_ms_lease_id;
4120 let p_header_x_ms_source_if_modified_since = x_ms_source_if_modified_since;
4121 let p_header_x_ms_source_if_unmodified_since = x_ms_source_if_unmodified_since;
4122 let p_header_x_ms_source_if_match = x_ms_source_if_match;
4123 let p_header_x_ms_source_if_none_match = x_ms_source_if_none_match;
4124 let p_header_x_ms_copy_source_authorization = x_ms_copy_source_authorization;
4125 let p_header_x_ms_file_request_intent = x_ms_file_request_intent;
4126 let p_header_x_ms_client_request_id = x_ms_client_request_id;
4127
4128 let uri_str = format!(
4129 "{}/{containerName}/{blobName}?comp=block&fromURL",
4130 configuration.base_path,
4131 containerName = crate::apis::urlencode(p_path_container_name),
4132 blobName = crate::apis::urlencode(p_path_blob_name)
4133 );
4134 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4135
4136 req_builder = req_builder.query(&[("blockid", &p_query_blockid.to_string())]);
4137 if let Some(ref param_value) = p_query_timeout {
4138 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
4139 }
4140 if let Some(ref user_agent) = configuration.user_agent {
4141 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4142 }
4143 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
4144 req_builder = req_builder.header("Content-Length", p_header_content_length.to_string());
4145 req_builder = req_builder.header("x-ms-copy-source", p_header_x_ms_copy_source.to_string());
4146 if let Some(param_value) = p_header_x_ms_source_range {
4147 req_builder = req_builder.header("x-ms-source-range", param_value.to_string());
4148 }
4149 if let Some(param_value) = p_header_x_ms_source_content_md5 {
4150 req_builder = req_builder.header("x-ms-source-content-md5", param_value.to_string());
4151 }
4152 if let Some(param_value) = p_header_x_ms_source_content_crc64 {
4153 req_builder = req_builder.header("x-ms-source-content-crc64", param_value.to_string());
4154 }
4155 if let Some(param_value) = p_header_x_ms_encryption_key {
4156 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
4157 }
4158 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
4159 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
4160 }
4161 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
4162 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
4163 }
4164 if let Some(param_value) = p_header_x_ms_encryption_scope {
4165 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
4166 }
4167 if let Some(param_value) = p_header_x_ms_lease_id {
4168 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
4169 }
4170 if let Some(param_value) = p_header_x_ms_source_if_modified_since {
4171 req_builder = req_builder.header("x-ms-source-if-modified-since", param_value.to_string());
4172 }
4173 if let Some(param_value) = p_header_x_ms_source_if_unmodified_since {
4174 req_builder =
4175 req_builder.header("x-ms-source-if-unmodified-since", param_value.to_string());
4176 }
4177 if let Some(param_value) = p_header_x_ms_source_if_match {
4178 req_builder = req_builder.header("x-ms-source-if-match", param_value.to_string());
4179 }
4180 if let Some(param_value) = p_header_x_ms_source_if_none_match {
4181 req_builder = req_builder.header("x-ms-source-if-none-match", param_value.to_string());
4182 }
4183 if let Some(param_value) = p_header_x_ms_copy_source_authorization {
4184 req_builder = req_builder.header("x-ms-copy-source-authorization", param_value.to_string());
4185 }
4186 if let Some(param_value) = p_header_x_ms_file_request_intent {
4187 req_builder = req_builder.header("x-ms-file-request-intent", param_value.to_string());
4188 }
4189 if let Some(param_value) = p_header_x_ms_client_request_id {
4190 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
4191 }
4192 if let Some(ref token) = configuration.oauth_access_token {
4193 req_builder = req_builder.bearer_auth(token.to_owned());
4194 };
4195
4196 let req = req_builder.build()?;
4197 let resp = configuration.client.execute(req).await?;
4198
4199 let status = resp.status();
4200
4201 if !status.is_client_error() && !status.is_server_error() {
4202 Ok(())
4203 } else {
4204 let content = resp.text().await?;
4205 let entity: Option<BlockBlobStageBlockFromUrlError> = serde_json::from_str(&content).ok();
4206 Err(Error::ResponseError(ResponseContent {
4207 status,
4208 content,
4209 entity,
4210 }))
4211 }
4212}
4213
4214pub async fn block_blob_upload(
4216 configuration: &configuration::Configuration,
4217 x_ms_version: &str,
4218 container_name: &str,
4219 blob_name: &str,
4220 content_length: i64,
4221 x_ms_blob_type: &str,
4222 body: std::path::PathBuf,
4223 x_ms_meta: Option<&str>,
4224 timeout: Option<i32>,
4225 content_md5: Option<String>,
4226 x_ms_blob_content_type: Option<&str>,
4227 x_ms_blob_content_encoding: Option<&str>,
4228 x_ms_blob_content_language: Option<&str>,
4229 x_ms_blob_content_md5: Option<String>,
4230 x_ms_blob_cache_control: Option<&str>,
4231 x_ms_lease_id: Option<&str>,
4232 x_ms_blob_content_disposition: Option<&str>,
4233 x_ms_encryption_key: Option<&str>,
4234 x_ms_encryption_key_sha256: Option<&str>,
4235 x_ms_encryption_algorithm: Option<&str>,
4236 x_ms_encryption_scope: Option<&str>,
4237 x_ms_access_tier: Option<&str>,
4238 if_modified_since: Option<&str>,
4239 if_unmodified_since: Option<&str>,
4240 if_none_match: Option<&str>,
4241 if_match: Option<&str>,
4242 x_ms_if_tags: Option<&str>,
4243 x_ms_tags: Option<&str>,
4244 x_ms_immutability_policy_until_date: Option<&str>,
4245 x_ms_immutability_policy_mode: Option<&str>,
4246 x_ms_legal_hold: Option<bool>,
4247 x_ms_content_crc64: Option<String>,
4248 x_ms_structured_body: Option<&str>,
4249 x_ms_structured_content_length: Option<i64>,
4250 x_ms_client_request_id: Option<&str>,
4251) -> Result<(), Error<BlockBlobUploadError>> {
4252 let p_header_x_ms_version = x_ms_version;
4254 let p_path_container_name = container_name;
4255 let p_path_blob_name = blob_name;
4256 let p_header_content_length = content_length;
4257 let p_header_x_ms_blob_type = x_ms_blob_type;
4258 let p_body_body = body;
4259 let p_header_x_ms_meta = x_ms_meta;
4260 let p_query_timeout = timeout;
4261 let p_header_content_md5 = content_md5;
4262 let p_header_x_ms_blob_content_type = x_ms_blob_content_type;
4263 let p_header_x_ms_blob_content_encoding = x_ms_blob_content_encoding;
4264 let p_header_x_ms_blob_content_language = x_ms_blob_content_language;
4265 let p_header_x_ms_blob_content_md5 = x_ms_blob_content_md5;
4266 let p_header_x_ms_blob_cache_control = x_ms_blob_cache_control;
4267 let p_header_x_ms_lease_id = x_ms_lease_id;
4268 let p_header_x_ms_blob_content_disposition = x_ms_blob_content_disposition;
4269 let p_header_x_ms_encryption_key = x_ms_encryption_key;
4270 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
4271 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
4272 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
4273 let p_header_x_ms_access_tier = x_ms_access_tier;
4274 let p_header_if_modified_since = if_modified_since;
4275 let p_header_if_unmodified_since = if_unmodified_since;
4276 let p_header_if_none_match = if_none_match;
4277 let p_header_if_match = if_match;
4278 let p_header_x_ms_if_tags = x_ms_if_tags;
4279 let p_header_x_ms_tags = x_ms_tags;
4280 let p_header_x_ms_immutability_policy_until_date = x_ms_immutability_policy_until_date;
4281 let p_header_x_ms_immutability_policy_mode = x_ms_immutability_policy_mode;
4282 let p_header_x_ms_legal_hold = x_ms_legal_hold;
4283 let p_header_x_ms_content_crc64 = x_ms_content_crc64;
4284 let p_header_x_ms_structured_body = x_ms_structured_body;
4285 let p_header_x_ms_structured_content_length = x_ms_structured_content_length;
4286 let p_header_x_ms_client_request_id = x_ms_client_request_id;
4287
4288 let uri_str = format!(
4289 "{}/{containerName}/{blobName}?_overload=upload",
4290 configuration.base_path,
4291 containerName = crate::apis::urlencode(p_path_container_name),
4292 blobName = crate::apis::urlencode(p_path_blob_name)
4293 );
4294 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4295
4296 if let Some(ref param_value) = p_query_timeout {
4297 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
4298 }
4299 if let Some(ref user_agent) = configuration.user_agent {
4300 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4301 }
4302 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
4303 if let Some(param_value) = p_header_x_ms_meta {
4304 req_builder = req_builder.header("x-ms-meta", param_value.to_string());
4305 }
4306 if let Some(param_value) = p_header_content_md5 {
4307 req_builder = req_builder.header("Content-MD5", param_value.to_string());
4308 }
4309 req_builder = req_builder.header("Content-Length", p_header_content_length.to_string());
4310 if let Some(param_value) = p_header_x_ms_blob_content_type {
4311 req_builder = req_builder.header("x-ms-blob-content-type", param_value.to_string());
4312 }
4313 if let Some(param_value) = p_header_x_ms_blob_content_encoding {
4314 req_builder = req_builder.header("x-ms-blob-content-encoding", param_value.to_string());
4315 }
4316 if let Some(param_value) = p_header_x_ms_blob_content_language {
4317 req_builder = req_builder.header("x-ms-blob-content-language", param_value.to_string());
4318 }
4319 if let Some(param_value) = p_header_x_ms_blob_content_md5 {
4320 req_builder = req_builder.header("x-ms-blob-content-md5", param_value.to_string());
4321 }
4322 if let Some(param_value) = p_header_x_ms_blob_cache_control {
4323 req_builder = req_builder.header("x-ms-blob-cache-control", param_value.to_string());
4324 }
4325 if let Some(param_value) = p_header_x_ms_lease_id {
4326 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
4327 }
4328 if let Some(param_value) = p_header_x_ms_blob_content_disposition {
4329 req_builder = req_builder.header("x-ms-blob-content-disposition", param_value.to_string());
4330 }
4331 if let Some(param_value) = p_header_x_ms_encryption_key {
4332 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
4333 }
4334 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
4335 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
4336 }
4337 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
4338 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
4339 }
4340 if let Some(param_value) = p_header_x_ms_encryption_scope {
4341 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
4342 }
4343 if let Some(param_value) = p_header_x_ms_access_tier {
4344 req_builder = req_builder.header("x-ms-access-tier", param_value.to_string());
4345 }
4346 if let Some(param_value) = p_header_if_modified_since {
4347 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
4348 }
4349 if let Some(param_value) = p_header_if_unmodified_since {
4350 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
4351 }
4352 if let Some(param_value) = p_header_if_none_match {
4353 req_builder = req_builder.header("If-None-Match", param_value.to_string());
4354 }
4355 if let Some(param_value) = p_header_if_match {
4356 req_builder = req_builder.header("If-Match", param_value.to_string());
4357 }
4358 if let Some(param_value) = p_header_x_ms_if_tags {
4359 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
4360 }
4361 if let Some(param_value) = p_header_x_ms_tags {
4362 req_builder = req_builder.header("x-ms-tags", param_value.to_string());
4363 }
4364 if let Some(param_value) = p_header_x_ms_immutability_policy_until_date {
4365 req_builder = req_builder.header(
4366 "x-ms-immutability-policy-until-date",
4367 param_value.to_string(),
4368 );
4369 }
4370 if let Some(param_value) = p_header_x_ms_immutability_policy_mode {
4371 req_builder = req_builder.header("x-ms-immutability-policy-mode", param_value.to_string());
4372 }
4373 if let Some(param_value) = p_header_x_ms_legal_hold {
4374 req_builder = req_builder.header("x-ms-legal-hold", param_value.to_string());
4375 }
4376 if let Some(param_value) = p_header_x_ms_content_crc64 {
4377 req_builder = req_builder.header("x-ms-content-crc64", param_value.to_string());
4378 }
4379 if let Some(param_value) = p_header_x_ms_structured_body {
4380 req_builder = req_builder.header("x-ms-structured-body", param_value.to_string());
4381 }
4382 if let Some(param_value) = p_header_x_ms_structured_content_length {
4383 req_builder = req_builder.header("x-ms-structured-content-length", param_value.to_string());
4384 }
4385 req_builder = req_builder.header("x-ms-blob-type", p_header_x_ms_blob_type.to_string());
4386 if let Some(param_value) = p_header_x_ms_client_request_id {
4387 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
4388 }
4389 if let Some(ref token) = configuration.oauth_access_token {
4390 req_builder = req_builder.bearer_auth(token.to_owned());
4391 };
4392 let file = TokioFile::open(p_body_body).await?;
4393 let stream = FramedRead::new(file, BytesCodec::new());
4394 req_builder = req_builder.body(reqwest::Body::wrap_stream(stream));
4395
4396 let req = req_builder.build()?;
4397 let resp = configuration.client.execute(req).await?;
4398
4399 let status = resp.status();
4400
4401 if !status.is_client_error() && !status.is_server_error() {
4402 Ok(())
4403 } else {
4404 let content = resp.text().await?;
4405 let entity: Option<BlockBlobUploadError> = serde_json::from_str(&content).ok();
4406 Err(Error::ResponseError(ResponseContent {
4407 status,
4408 content,
4409 entity,
4410 }))
4411 }
4412}
4413
4414pub async fn container_acquire_lease(
4416 configuration: &configuration::Configuration,
4417 x_ms_version: &str,
4418 container_name: &str,
4419 x_ms_lease_duration: i32,
4420 x_ms_lease_action: &str,
4421 timeout: Option<i32>,
4422 x_ms_proposed_lease_id: Option<&str>,
4423 if_modified_since: Option<&str>,
4424 if_unmodified_since: Option<&str>,
4425 x_ms_client_request_id: Option<&str>,
4426) -> Result<(), Error<ContainerAcquireLeaseError>> {
4427 let p_header_x_ms_version = x_ms_version;
4429 let p_path_container_name = container_name;
4430 let p_header_x_ms_lease_duration = x_ms_lease_duration;
4431 let p_header_x_ms_lease_action = x_ms_lease_action;
4432 let p_query_timeout = timeout;
4433 let p_header_x_ms_proposed_lease_id = x_ms_proposed_lease_id;
4434 let p_header_if_modified_since = if_modified_since;
4435 let p_header_if_unmodified_since = if_unmodified_since;
4436 let p_header_x_ms_client_request_id = x_ms_client_request_id;
4437
4438 let uri_str = format!(
4439 "{}/{containerName}?comp=lease&restype=container&acquire",
4440 configuration.base_path,
4441 containerName = crate::apis::urlencode(p_path_container_name)
4442 );
4443 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4444
4445 if let Some(ref param_value) = p_query_timeout {
4446 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
4447 }
4448 if let Some(ref user_agent) = configuration.user_agent {
4449 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4450 }
4451 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
4452 req_builder = req_builder.header(
4453 "x-ms-lease-duration",
4454 p_header_x_ms_lease_duration.to_string(),
4455 );
4456 if let Some(param_value) = p_header_x_ms_proposed_lease_id {
4457 req_builder = req_builder.header("x-ms-proposed-lease-id", param_value.to_string());
4458 }
4459 if let Some(param_value) = p_header_if_modified_since {
4460 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
4461 }
4462 if let Some(param_value) = p_header_if_unmodified_since {
4463 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
4464 }
4465 req_builder = req_builder.header("x-ms-lease-action", p_header_x_ms_lease_action.to_string());
4466 if let Some(param_value) = p_header_x_ms_client_request_id {
4467 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
4468 }
4469 if let Some(ref token) = configuration.oauth_access_token {
4470 req_builder = req_builder.bearer_auth(token.to_owned());
4471 };
4472
4473 let req = req_builder.build()?;
4474 let resp = configuration.client.execute(req).await?;
4475
4476 let status = resp.status();
4477
4478 if !status.is_client_error() && !status.is_server_error() {
4479 Ok(())
4480 } else {
4481 let content = resp.text().await?;
4482 let entity: Option<ContainerAcquireLeaseError> = serde_json::from_str(&content).ok();
4483 Err(Error::ResponseError(ResponseContent {
4484 status,
4485 content,
4486 entity,
4487 }))
4488 }
4489}
4490
4491pub async fn container_break_lease(
4493 configuration: &configuration::Configuration,
4494 x_ms_version: &str,
4495 container_name: &str,
4496 x_ms_lease_action: &str,
4497 timeout: Option<i32>,
4498 if_modified_since: Option<&str>,
4499 if_unmodified_since: Option<&str>,
4500 x_ms_lease_break_period: Option<i32>,
4501 x_ms_client_request_id: Option<&str>,
4502) -> Result<(), Error<ContainerBreakLeaseError>> {
4503 let p_header_x_ms_version = x_ms_version;
4505 let p_path_container_name = container_name;
4506 let p_header_x_ms_lease_action = x_ms_lease_action;
4507 let p_query_timeout = timeout;
4508 let p_header_if_modified_since = if_modified_since;
4509 let p_header_if_unmodified_since = if_unmodified_since;
4510 let p_header_x_ms_lease_break_period = x_ms_lease_break_period;
4511 let p_header_x_ms_client_request_id = x_ms_client_request_id;
4512
4513 let uri_str = format!(
4514 "{}/{containerName}?comp=lease&restype=container&break",
4515 configuration.base_path,
4516 containerName = crate::apis::urlencode(p_path_container_name)
4517 );
4518 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4519
4520 if let Some(ref param_value) = p_query_timeout {
4521 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
4522 }
4523 if let Some(ref user_agent) = configuration.user_agent {
4524 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4525 }
4526 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
4527 if let Some(param_value) = p_header_if_modified_since {
4528 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
4529 }
4530 if let Some(param_value) = p_header_if_unmodified_since {
4531 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
4532 }
4533 if let Some(param_value) = p_header_x_ms_lease_break_period {
4534 req_builder = req_builder.header("x-ms-lease-break-period", param_value.to_string());
4535 }
4536 req_builder = req_builder.header("x-ms-lease-action", p_header_x_ms_lease_action.to_string());
4537 if let Some(param_value) = p_header_x_ms_client_request_id {
4538 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
4539 }
4540 if let Some(ref token) = configuration.oauth_access_token {
4541 req_builder = req_builder.bearer_auth(token.to_owned());
4542 };
4543
4544 let req = req_builder.build()?;
4545 let resp = configuration.client.execute(req).await?;
4546
4547 let status = resp.status();
4548
4549 if !status.is_client_error() && !status.is_server_error() {
4550 Ok(())
4551 } else {
4552 let content = resp.text().await?;
4553 let entity: Option<ContainerBreakLeaseError> = serde_json::from_str(&content).ok();
4554 Err(Error::ResponseError(ResponseContent {
4555 status,
4556 content,
4557 entity,
4558 }))
4559 }
4560}
4561
4562pub async fn container_change_lease(
4564 configuration: &configuration::Configuration,
4565 x_ms_version: &str,
4566 container_name: &str,
4567 x_ms_lease_id: &str,
4568 x_ms_proposed_lease_id: &str,
4569 x_ms_lease_action: &str,
4570 timeout: Option<i32>,
4571 if_modified_since: Option<&str>,
4572 if_unmodified_since: Option<&str>,
4573 x_ms_client_request_id: Option<&str>,
4574) -> Result<(), Error<ContainerChangeLeaseError>> {
4575 let p_header_x_ms_version = x_ms_version;
4577 let p_path_container_name = container_name;
4578 let p_header_x_ms_lease_id = x_ms_lease_id;
4579 let p_header_x_ms_proposed_lease_id = x_ms_proposed_lease_id;
4580 let p_header_x_ms_lease_action = x_ms_lease_action;
4581 let p_query_timeout = timeout;
4582 let p_header_if_modified_since = if_modified_since;
4583 let p_header_if_unmodified_since = if_unmodified_since;
4584 let p_header_x_ms_client_request_id = x_ms_client_request_id;
4585
4586 let uri_str = format!(
4587 "{}/{containerName}?comp=lease&restype=container&change",
4588 configuration.base_path,
4589 containerName = crate::apis::urlencode(p_path_container_name)
4590 );
4591 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4592
4593 if let Some(ref param_value) = p_query_timeout {
4594 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
4595 }
4596 if let Some(ref user_agent) = configuration.user_agent {
4597 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4598 }
4599 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
4600 req_builder = req_builder.header("x-ms-lease-id", p_header_x_ms_lease_id.to_string());
4601 req_builder = req_builder.header(
4602 "x-ms-proposed-lease-id",
4603 p_header_x_ms_proposed_lease_id.to_string(),
4604 );
4605 if let Some(param_value) = p_header_if_modified_since {
4606 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
4607 }
4608 if let Some(param_value) = p_header_if_unmodified_since {
4609 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
4610 }
4611 req_builder = req_builder.header("x-ms-lease-action", p_header_x_ms_lease_action.to_string());
4612 if let Some(param_value) = p_header_x_ms_client_request_id {
4613 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
4614 }
4615 if let Some(ref token) = configuration.oauth_access_token {
4616 req_builder = req_builder.bearer_auth(token.to_owned());
4617 };
4618
4619 let req = req_builder.build()?;
4620 let resp = configuration.client.execute(req).await?;
4621
4622 let status = resp.status();
4623
4624 if !status.is_client_error() && !status.is_server_error() {
4625 Ok(())
4626 } else {
4627 let content = resp.text().await?;
4628 let entity: Option<ContainerChangeLeaseError> = serde_json::from_str(&content).ok();
4629 Err(Error::ResponseError(ResponseContent {
4630 status,
4631 content,
4632 entity,
4633 }))
4634 }
4635}
4636
4637pub async fn container_create(
4639 configuration: &configuration::Configuration,
4640 x_ms_version: &str,
4641 container_name: &str,
4642 timeout: Option<i32>,
4643 x_ms_meta: Option<&str>,
4644 x_ms_blob_public_access: Option<&str>,
4645 x_ms_default_encryption_scope: Option<&str>,
4646 x_ms_deny_encryption_scope_override: Option<bool>,
4647 x_ms_client_request_id: Option<&str>,
4648) -> Result<(), Error<ContainerCreateError>> {
4649 let p_header_x_ms_version = x_ms_version;
4651 let p_path_container_name = container_name;
4652 let p_query_timeout = timeout;
4653 let p_header_x_ms_meta = x_ms_meta;
4654 let p_header_x_ms_blob_public_access = x_ms_blob_public_access;
4655 let p_header_x_ms_default_encryption_scope = x_ms_default_encryption_scope;
4656 let p_header_x_ms_deny_encryption_scope_override = x_ms_deny_encryption_scope_override;
4657 let p_header_x_ms_client_request_id = x_ms_client_request_id;
4658
4659 let uri_str = format!(
4660 "{}/{containerName}?restype=container",
4661 configuration.base_path,
4662 containerName = crate::apis::urlencode(p_path_container_name)
4663 );
4664 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4665
4666 if let Some(ref param_value) = p_query_timeout {
4667 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
4668 }
4669 if let Some(ref user_agent) = configuration.user_agent {
4670 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4671 }
4672 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
4673 if let Some(param_value) = p_header_x_ms_meta {
4674 req_builder = req_builder.header("x-ms-meta", param_value.to_string());
4675 }
4676 if let Some(param_value) = p_header_x_ms_blob_public_access {
4677 req_builder = req_builder.header("x-ms-blob-public-access", param_value.to_string());
4678 }
4679 if let Some(param_value) = p_header_x_ms_default_encryption_scope {
4680 req_builder = req_builder.header("x-ms-default-encryption-scope", param_value.to_string());
4681 }
4682 if let Some(param_value) = p_header_x_ms_deny_encryption_scope_override {
4683 req_builder = req_builder.header(
4684 "x-ms-deny-encryption-scope-override",
4685 param_value.to_string(),
4686 );
4687 }
4688 if let Some(param_value) = p_header_x_ms_client_request_id {
4689 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
4690 }
4691 if let Some(ref token) = configuration.oauth_access_token {
4692 req_builder = req_builder.bearer_auth(token.to_owned());
4693 };
4694
4695 let req = req_builder.build()?;
4696 let resp = configuration.client.execute(req).await?;
4697
4698 let status = resp.status();
4699
4700 if !status.is_client_error() && !status.is_server_error() {
4701 Ok(())
4702 } else {
4703 let content = resp.text().await?;
4704 let entity: Option<ContainerCreateError> = serde_json::from_str(&content).ok();
4705 Err(Error::ResponseError(ResponseContent {
4706 status,
4707 content,
4708 entity,
4709 }))
4710 }
4711}
4712
4713pub async fn container_delete(
4715 configuration: &configuration::Configuration,
4716 x_ms_version: &str,
4717 container_name: &str,
4718 timeout: Option<i32>,
4719 x_ms_lease_id: Option<&str>,
4720 if_modified_since: Option<&str>,
4721 if_unmodified_since: Option<&str>,
4722 x_ms_client_request_id: Option<&str>,
4723) -> Result<(), Error<ContainerDeleteError>> {
4724 let p_header_x_ms_version = x_ms_version;
4726 let p_path_container_name = container_name;
4727 let p_query_timeout = timeout;
4728 let p_header_x_ms_lease_id = x_ms_lease_id;
4729 let p_header_if_modified_since = if_modified_since;
4730 let p_header_if_unmodified_since = if_unmodified_since;
4731 let p_header_x_ms_client_request_id = x_ms_client_request_id;
4732
4733 let uri_str = format!(
4734 "{}/{containerName}?restype=container&_overload=delete",
4735 configuration.base_path,
4736 containerName = crate::apis::urlencode(p_path_container_name)
4737 );
4738 let mut req_builder = configuration
4739 .client
4740 .request(reqwest::Method::DELETE, &uri_str);
4741
4742 if let Some(ref param_value) = p_query_timeout {
4743 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
4744 }
4745 if let Some(ref user_agent) = configuration.user_agent {
4746 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4747 }
4748 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
4749 if let Some(param_value) = p_header_x_ms_lease_id {
4750 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
4751 }
4752 if let Some(param_value) = p_header_if_modified_since {
4753 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
4754 }
4755 if let Some(param_value) = p_header_if_unmodified_since {
4756 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
4757 }
4758 if let Some(param_value) = p_header_x_ms_client_request_id {
4759 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
4760 }
4761 if let Some(ref token) = configuration.oauth_access_token {
4762 req_builder = req_builder.bearer_auth(token.to_owned());
4763 };
4764
4765 let req = req_builder.build()?;
4766 let resp = configuration.client.execute(req).await?;
4767
4768 let status = resp.status();
4769
4770 if !status.is_client_error() && !status.is_server_error() {
4771 Ok(())
4772 } else {
4773 let content = resp.text().await?;
4774 let entity: Option<ContainerDeleteError> = serde_json::from_str(&content).ok();
4775 Err(Error::ResponseError(ResponseContent {
4776 status,
4777 content,
4778 entity,
4779 }))
4780 }
4781}
4782
4783pub async fn container_filter_blobs(
4785 configuration: &configuration::Configuration,
4786 x_ms_version: &str,
4787 container_name: &str,
4788 timeout: Option<i32>,
4789 r#where: Option<&str>,
4790 marker: Option<&str>,
4791 maxresults: Option<i32>,
4792 include: Option<Vec<String>>,
4793 x_ms_client_request_id: Option<&str>,
4794) -> Result<models::FilterBlobSegment, Error<ContainerFilterBlobsError>> {
4795 let p_header_x_ms_version = x_ms_version;
4797 let p_path_container_name = container_name;
4798 let p_query_timeout = timeout;
4799 let p_query_where = r#where;
4800 let p_query_marker = marker;
4801 let p_query_maxresults = maxresults;
4802 let p_query_include = include;
4803 let p_header_x_ms_client_request_id = x_ms_client_request_id;
4804
4805 let uri_str = format!(
4806 "{}/{containerName}?restype=container&comp=blobs",
4807 configuration.base_path,
4808 containerName = crate::apis::urlencode(p_path_container_name)
4809 );
4810 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4811
4812 if let Some(ref param_value) = p_query_timeout {
4813 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
4814 }
4815 if let Some(ref param_value) = p_query_where {
4816 req_builder = req_builder.query(&[("where", ¶m_value.to_string())]);
4817 }
4818 if let Some(ref param_value) = p_query_marker {
4819 req_builder = req_builder.query(&[("marker", ¶m_value.to_string())]);
4820 }
4821 if let Some(ref param_value) = p_query_maxresults {
4822 req_builder = req_builder.query(&[("maxresults", ¶m_value.to_string())]);
4823 }
4824 if let Some(ref param_value) = p_query_include {
4825 req_builder = match "csv" {
4826 "multi" => req_builder.query(
4827 ¶m_value
4828 .into_iter()
4829 .map(|p| ("include".to_owned(), p.to_string()))
4830 .collect::<Vec<(std::string::String, std::string::String)>>(),
4831 ),
4832 _ => req_builder.query(&[(
4833 "include",
4834 ¶m_value
4835 .into_iter()
4836 .map(|p| p.to_string())
4837 .collect::<Vec<String>>()
4838 .join(",")
4839 .to_string(),
4840 )]),
4841 };
4842 }
4843 if let Some(ref user_agent) = configuration.user_agent {
4844 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4845 }
4846 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
4847 if let Some(param_value) = p_header_x_ms_client_request_id {
4848 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
4849 }
4850 if let Some(ref token) = configuration.oauth_access_token {
4851 req_builder = req_builder.bearer_auth(token.to_owned());
4852 };
4853
4854 let req = req_builder.build()?;
4855 let resp = configuration.client.execute(req).await?;
4856
4857 let status = resp.status();
4858 let content_type = resp
4859 .headers()
4860 .get("content-type")
4861 .and_then(|v| v.to_str().ok())
4862 .unwrap_or("application/octet-stream");
4863 let content_type = super::ContentType::from(content_type);
4864
4865 if !status.is_client_error() && !status.is_server_error() {
4866 let content = resp.text().await?;
4867 match content_type {
4868 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4869 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FilterBlobSegment`"))),
4870 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FilterBlobSegment`")))),
4871 }
4872 } else {
4873 let content = resp.text().await?;
4874 let entity: Option<ContainerFilterBlobsError> = serde_json::from_str(&content).ok();
4875 Err(Error::ResponseError(ResponseContent {
4876 status,
4877 content,
4878 entity,
4879 }))
4880 }
4881}
4882
4883pub async fn container_get_access_policy(
4885 configuration: &configuration::Configuration,
4886 x_ms_version: &str,
4887 container_name: &str,
4888 timeout: Option<i32>,
4889 x_ms_lease_id: Option<&str>,
4890 x_ms_client_request_id: Option<&str>,
4891) -> Result<Vec<models::SignedIdentifier>, Error<ContainerGetAccessPolicyError>> {
4892 let p_header_x_ms_version = x_ms_version;
4894 let p_path_container_name = container_name;
4895 let p_query_timeout = timeout;
4896 let p_header_x_ms_lease_id = x_ms_lease_id;
4897 let p_header_x_ms_client_request_id = x_ms_client_request_id;
4898
4899 let uri_str = format!(
4900 "{}/{containerName}?restype=container&comp=acl",
4901 configuration.base_path,
4902 containerName = crate::apis::urlencode(p_path_container_name)
4903 );
4904 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4905
4906 if let Some(ref param_value) = p_query_timeout {
4907 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
4908 }
4909 if let Some(ref user_agent) = configuration.user_agent {
4910 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4911 }
4912 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
4913 if let Some(param_value) = p_header_x_ms_lease_id {
4914 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
4915 }
4916 if let Some(param_value) = p_header_x_ms_client_request_id {
4917 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
4918 }
4919 if let Some(ref token) = configuration.oauth_access_token {
4920 req_builder = req_builder.bearer_auth(token.to_owned());
4921 };
4922
4923 let req = req_builder.build()?;
4924 let resp = configuration.client.execute(req).await?;
4925
4926 let status = resp.status();
4927 let content_type = resp
4928 .headers()
4929 .get("content-type")
4930 .and_then(|v| v.to_str().ok())
4931 .unwrap_or("application/octet-stream");
4932 let content_type = super::ContentType::from(content_type);
4933
4934 if !status.is_client_error() && !status.is_server_error() {
4935 let content = resp.text().await?;
4936 match content_type {
4937 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4938 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::SignedIdentifier>`"))),
4939 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::SignedIdentifier>`")))),
4940 }
4941 } else {
4942 let content = resp.text().await?;
4943 let entity: Option<ContainerGetAccessPolicyError> = serde_json::from_str(&content).ok();
4944 Err(Error::ResponseError(ResponseContent {
4945 status,
4946 content,
4947 entity,
4948 }))
4949 }
4950}
4951
4952pub async fn container_get_account_info(
4954 configuration: &configuration::Configuration,
4955 x_ms_version: &str,
4956 container_name: &str,
4957 timeout: Option<i32>,
4958 x_ms_client_request_id: Option<&str>,
4959) -> Result<(), Error<ContainerGetAccountInfoError>> {
4960 let p_header_x_ms_version = x_ms_version;
4962 let p_path_container_name = container_name;
4963 let p_query_timeout = timeout;
4964 let p_header_x_ms_client_request_id = x_ms_client_request_id;
4965
4966 let uri_str = format!(
4967 "{}/{containerName}?restype=account&comp=properties",
4968 configuration.base_path,
4969 containerName = crate::apis::urlencode(p_path_container_name)
4970 );
4971 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4972
4973 if let Some(ref param_value) = p_query_timeout {
4974 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
4975 }
4976 if let Some(ref user_agent) = configuration.user_agent {
4977 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4978 }
4979 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
4980 if let Some(param_value) = p_header_x_ms_client_request_id {
4981 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
4982 }
4983 if let Some(ref token) = configuration.oauth_access_token {
4984 req_builder = req_builder.bearer_auth(token.to_owned());
4985 };
4986
4987 let req = req_builder.build()?;
4988 let resp = configuration.client.execute(req).await?;
4989
4990 let status = resp.status();
4991
4992 if !status.is_client_error() && !status.is_server_error() {
4993 Ok(())
4994 } else {
4995 let content = resp.text().await?;
4996 let entity: Option<ContainerGetAccountInfoError> = serde_json::from_str(&content).ok();
4997 Err(Error::ResponseError(ResponseContent {
4998 status,
4999 content,
5000 entity,
5001 }))
5002 }
5003}
5004
5005pub async fn container_get_properties(
5007 configuration: &configuration::Configuration,
5008 x_ms_version: &str,
5009 container_name: &str,
5010 timeout: Option<i32>,
5011 x_ms_lease_id: Option<&str>,
5012 x_ms_client_request_id: Option<&str>,
5013) -> Result<(), Error<ContainerGetPropertiesError>> {
5014 let p_header_x_ms_version = x_ms_version;
5016 let p_path_container_name = container_name;
5017 let p_query_timeout = timeout;
5018 let p_header_x_ms_lease_id = x_ms_lease_id;
5019 let p_header_x_ms_client_request_id = x_ms_client_request_id;
5020
5021 let uri_str = format!(
5022 "{}/{containerName}?restype=container&_overload=getProperties",
5023 configuration.base_path,
5024 containerName = crate::apis::urlencode(p_path_container_name)
5025 );
5026 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5027
5028 if let Some(ref param_value) = p_query_timeout {
5029 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
5030 }
5031 if let Some(ref user_agent) = configuration.user_agent {
5032 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5033 }
5034 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
5035 if let Some(param_value) = p_header_x_ms_lease_id {
5036 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
5037 }
5038 if let Some(param_value) = p_header_x_ms_client_request_id {
5039 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
5040 }
5041 if let Some(ref token) = configuration.oauth_access_token {
5042 req_builder = req_builder.bearer_auth(token.to_owned());
5043 };
5044
5045 let req = req_builder.build()?;
5046 let resp = configuration.client.execute(req).await?;
5047
5048 let status = resp.status();
5049
5050 if !status.is_client_error() && !status.is_server_error() {
5051 Ok(())
5052 } else {
5053 let content = resp.text().await?;
5054 let entity: Option<ContainerGetPropertiesError> = serde_json::from_str(&content).ok();
5055 Err(Error::ResponseError(ResponseContent {
5056 status,
5057 content,
5058 entity,
5059 }))
5060 }
5061}
5062
5063pub async fn container_list_blob_flat_segment(
5065 configuration: &configuration::Configuration,
5066 x_ms_version: &str,
5067 container_name: &str,
5068 prefix: Option<&str>,
5069 marker: Option<&str>,
5070 maxresults: Option<i32>,
5071 include: Option<Vec<String>>,
5072 timeout: Option<i32>,
5073 start_from: Option<&str>,
5074 x_ms_client_request_id: Option<&str>,
5075) -> Result<models::ListBlobsFlatSegmentResponse, Error<ContainerListBlobFlatSegmentError>> {
5076 let p_header_x_ms_version = x_ms_version;
5078 let p_path_container_name = container_name;
5079 let p_query_prefix = prefix;
5080 let p_query_marker = marker;
5081 let p_query_maxresults = maxresults;
5082 let p_query_include = include;
5083 let p_query_timeout = timeout;
5084 let p_query_start_from = start_from;
5085 let p_header_x_ms_client_request_id = x_ms_client_request_id;
5086
5087 let uri_str = format!(
5088 "{}/{containerName}?restype=container&comp=list&flat",
5089 configuration.base_path,
5090 containerName = crate::apis::urlencode(p_path_container_name)
5091 );
5092 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5093
5094 if let Some(ref param_value) = p_query_prefix {
5095 req_builder = req_builder.query(&[("prefix", ¶m_value.to_string())]);
5096 }
5097 if let Some(ref param_value) = p_query_marker {
5098 req_builder = req_builder.query(&[("marker", ¶m_value.to_string())]);
5099 }
5100 if let Some(ref param_value) = p_query_maxresults {
5101 req_builder = req_builder.query(&[("maxresults", ¶m_value.to_string())]);
5102 }
5103 if let Some(ref param_value) = p_query_include {
5104 req_builder = match "csv" {
5105 "multi" => req_builder.query(
5106 ¶m_value
5107 .into_iter()
5108 .map(|p| ("include".to_owned(), p.to_string()))
5109 .collect::<Vec<(std::string::String, std::string::String)>>(),
5110 ),
5111 _ => req_builder.query(&[(
5112 "include",
5113 ¶m_value
5114 .into_iter()
5115 .map(|p| p.to_string())
5116 .collect::<Vec<String>>()
5117 .join(",")
5118 .to_string(),
5119 )]),
5120 };
5121 }
5122 if let Some(ref param_value) = p_query_timeout {
5123 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
5124 }
5125 if let Some(ref param_value) = p_query_start_from {
5126 req_builder = req_builder.query(&[("startFrom", ¶m_value.to_string())]);
5127 }
5128 if let Some(ref user_agent) = configuration.user_agent {
5129 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5130 }
5131 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
5132 if let Some(param_value) = p_header_x_ms_client_request_id {
5133 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
5134 }
5135 if let Some(ref token) = configuration.oauth_access_token {
5136 req_builder = req_builder.bearer_auth(token.to_owned());
5137 };
5138
5139 let req = req_builder.build()?;
5140 let resp = configuration.client.execute(req).await?;
5141
5142 let status = resp.status();
5143 let content_type = resp
5144 .headers()
5145 .get("content-type")
5146 .and_then(|v| v.to_str().ok())
5147 .unwrap_or("application/octet-stream");
5148 let content_type = super::ContentType::from(content_type);
5149
5150 if !status.is_client_error() && !status.is_server_error() {
5151 let content = resp.text().await?;
5152 match content_type {
5153 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5154 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ListBlobsFlatSegmentResponse`"))),
5155 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ListBlobsFlatSegmentResponse`")))),
5156 }
5157 } else {
5158 let content = resp.text().await?;
5159 let entity: Option<ContainerListBlobFlatSegmentError> = serde_json::from_str(&content).ok();
5160 Err(Error::ResponseError(ResponseContent {
5161 status,
5162 content,
5163 entity,
5164 }))
5165 }
5166}
5167
5168pub async fn container_list_blob_hierarchy_segment(
5170 configuration: &configuration::Configuration,
5171 x_ms_version: &str,
5172 container_name: &str,
5173 delimiter: &str,
5174 prefix: Option<&str>,
5175 marker: Option<&str>,
5176 maxresults: Option<i32>,
5177 include: Option<Vec<String>>,
5178 timeout: Option<i32>,
5179 start_from: Option<&str>,
5180 x_ms_client_request_id: Option<&str>,
5181) -> Result<models::ListBlobsHierarchySegmentResponse, Error<ContainerListBlobHierarchySegmentError>>
5182{
5183 let p_header_x_ms_version = x_ms_version;
5185 let p_path_container_name = container_name;
5186 let p_query_delimiter = delimiter;
5187 let p_query_prefix = prefix;
5188 let p_query_marker = marker;
5189 let p_query_maxresults = maxresults;
5190 let p_query_include = include;
5191 let p_query_timeout = timeout;
5192 let p_query_start_from = start_from;
5193 let p_header_x_ms_client_request_id = x_ms_client_request_id;
5194
5195 let uri_str = format!(
5196 "{}/{containerName}?restype=container&comp=list&hierarchy",
5197 configuration.base_path,
5198 containerName = crate::apis::urlencode(p_path_container_name)
5199 );
5200 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5201
5202 req_builder = req_builder.query(&[("delimiter", &p_query_delimiter.to_string())]);
5203 if let Some(ref param_value) = p_query_prefix {
5204 req_builder = req_builder.query(&[("prefix", ¶m_value.to_string())]);
5205 }
5206 if let Some(ref param_value) = p_query_marker {
5207 req_builder = req_builder.query(&[("marker", ¶m_value.to_string())]);
5208 }
5209 if let Some(ref param_value) = p_query_maxresults {
5210 req_builder = req_builder.query(&[("maxresults", ¶m_value.to_string())]);
5211 }
5212 if let Some(ref param_value) = p_query_include {
5213 req_builder = match "csv" {
5214 "multi" => req_builder.query(
5215 ¶m_value
5216 .into_iter()
5217 .map(|p| ("include".to_owned(), p.to_string()))
5218 .collect::<Vec<(std::string::String, std::string::String)>>(),
5219 ),
5220 _ => req_builder.query(&[(
5221 "include",
5222 ¶m_value
5223 .into_iter()
5224 .map(|p| p.to_string())
5225 .collect::<Vec<String>>()
5226 .join(",")
5227 .to_string(),
5228 )]),
5229 };
5230 }
5231 if let Some(ref param_value) = p_query_timeout {
5232 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
5233 }
5234 if let Some(ref param_value) = p_query_start_from {
5235 req_builder = req_builder.query(&[("startFrom", ¶m_value.to_string())]);
5236 }
5237 if let Some(ref user_agent) = configuration.user_agent {
5238 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5239 }
5240 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
5241 if let Some(param_value) = p_header_x_ms_client_request_id {
5242 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
5243 }
5244 if let Some(ref token) = configuration.oauth_access_token {
5245 req_builder = req_builder.bearer_auth(token.to_owned());
5246 };
5247
5248 let req = req_builder.build()?;
5249 let resp = configuration.client.execute(req).await?;
5250
5251 let status = resp.status();
5252 let content_type = resp
5253 .headers()
5254 .get("content-type")
5255 .and_then(|v| v.to_str().ok())
5256 .unwrap_or("application/octet-stream");
5257 let content_type = super::ContentType::from(content_type);
5258
5259 if !status.is_client_error() && !status.is_server_error() {
5260 let content = resp.text().await?;
5261 match content_type {
5262 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5263 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ListBlobsHierarchySegmentResponse`"))),
5264 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ListBlobsHierarchySegmentResponse`")))),
5265 }
5266 } else {
5267 let content = resp.text().await?;
5268 let entity: Option<ContainerListBlobHierarchySegmentError> =
5269 serde_json::from_str(&content).ok();
5270 Err(Error::ResponseError(ResponseContent {
5271 status,
5272 content,
5273 entity,
5274 }))
5275 }
5276}
5277
5278pub async fn container_release_lease(
5280 configuration: &configuration::Configuration,
5281 x_ms_version: &str,
5282 container_name: &str,
5283 x_ms_lease_id: &str,
5284 x_ms_lease_action: &str,
5285 timeout: Option<i32>,
5286 if_modified_since: Option<&str>,
5287 if_unmodified_since: Option<&str>,
5288 x_ms_client_request_id: Option<&str>,
5289) -> Result<(), Error<ContainerReleaseLeaseError>> {
5290 let p_header_x_ms_version = x_ms_version;
5292 let p_path_container_name = container_name;
5293 let p_header_x_ms_lease_id = x_ms_lease_id;
5294 let p_header_x_ms_lease_action = x_ms_lease_action;
5295 let p_query_timeout = timeout;
5296 let p_header_if_modified_since = if_modified_since;
5297 let p_header_if_unmodified_since = if_unmodified_since;
5298 let p_header_x_ms_client_request_id = x_ms_client_request_id;
5299
5300 let uri_str = format!(
5301 "{}/{containerName}?comp=lease&restype=container&release",
5302 configuration.base_path,
5303 containerName = crate::apis::urlencode(p_path_container_name)
5304 );
5305 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5306
5307 if let Some(ref param_value) = p_query_timeout {
5308 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
5309 }
5310 if let Some(ref user_agent) = configuration.user_agent {
5311 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5312 }
5313 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
5314 req_builder = req_builder.header("x-ms-lease-id", p_header_x_ms_lease_id.to_string());
5315 if let Some(param_value) = p_header_if_modified_since {
5316 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
5317 }
5318 if let Some(param_value) = p_header_if_unmodified_since {
5319 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
5320 }
5321 req_builder = req_builder.header("x-ms-lease-action", p_header_x_ms_lease_action.to_string());
5322 if let Some(param_value) = p_header_x_ms_client_request_id {
5323 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
5324 }
5325 if let Some(ref token) = configuration.oauth_access_token {
5326 req_builder = req_builder.bearer_auth(token.to_owned());
5327 };
5328
5329 let req = req_builder.build()?;
5330 let resp = configuration.client.execute(req).await?;
5331
5332 let status = resp.status();
5333
5334 if !status.is_client_error() && !status.is_server_error() {
5335 Ok(())
5336 } else {
5337 let content = resp.text().await?;
5338 let entity: Option<ContainerReleaseLeaseError> = serde_json::from_str(&content).ok();
5339 Err(Error::ResponseError(ResponseContent {
5340 status,
5341 content,
5342 entity,
5343 }))
5344 }
5345}
5346
5347pub async fn container_rename(
5349 configuration: &configuration::Configuration,
5350 x_ms_version: &str,
5351 container_name: &str,
5352 x_ms_source_container_name: &str,
5353 x_ms_source_lease_id: Option<&str>,
5354 timeout: Option<i32>,
5355 x_ms_client_request_id: Option<&str>,
5356) -> Result<(), Error<ContainerRenameError>> {
5357 let p_header_x_ms_version = x_ms_version;
5359 let p_path_container_name = container_name;
5360 let p_header_x_ms_source_container_name = x_ms_source_container_name;
5361 let p_header_x_ms_source_lease_id = x_ms_source_lease_id;
5362 let p_query_timeout = timeout;
5363 let p_header_x_ms_client_request_id = x_ms_client_request_id;
5364
5365 let uri_str = format!(
5366 "{}/{containerName}?restype=container&comp=rename",
5367 configuration.base_path,
5368 containerName = crate::apis::urlencode(p_path_container_name)
5369 );
5370 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5371
5372 if let Some(ref param_value) = p_query_timeout {
5373 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
5374 }
5375 if let Some(ref user_agent) = configuration.user_agent {
5376 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5377 }
5378 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
5379 req_builder = req_builder.header(
5380 "x-ms-source-container-name",
5381 p_header_x_ms_source_container_name.to_string(),
5382 );
5383 if let Some(param_value) = p_header_x_ms_source_lease_id {
5384 req_builder = req_builder.header("x-ms-source-lease-id", param_value.to_string());
5385 }
5386 if let Some(param_value) = p_header_x_ms_client_request_id {
5387 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
5388 }
5389 if let Some(ref token) = configuration.oauth_access_token {
5390 req_builder = req_builder.bearer_auth(token.to_owned());
5391 };
5392
5393 let req = req_builder.build()?;
5394 let resp = configuration.client.execute(req).await?;
5395
5396 let status = resp.status();
5397
5398 if !status.is_client_error() && !status.is_server_error() {
5399 Ok(())
5400 } else {
5401 let content = resp.text().await?;
5402 let entity: Option<ContainerRenameError> = serde_json::from_str(&content).ok();
5403 Err(Error::ResponseError(ResponseContent {
5404 status,
5405 content,
5406 entity,
5407 }))
5408 }
5409}
5410
5411pub async fn container_renew_lease(
5413 configuration: &configuration::Configuration,
5414 x_ms_version: &str,
5415 container_name: &str,
5416 x_ms_lease_id: &str,
5417 x_ms_lease_action: &str,
5418 timeout: Option<i32>,
5419 if_modified_since: Option<&str>,
5420 if_unmodified_since: Option<&str>,
5421 x_ms_client_request_id: Option<&str>,
5422) -> Result<(), Error<ContainerRenewLeaseError>> {
5423 let p_header_x_ms_version = x_ms_version;
5425 let p_path_container_name = container_name;
5426 let p_header_x_ms_lease_id = x_ms_lease_id;
5427 let p_header_x_ms_lease_action = x_ms_lease_action;
5428 let p_query_timeout = timeout;
5429 let p_header_if_modified_since = if_modified_since;
5430 let p_header_if_unmodified_since = if_unmodified_since;
5431 let p_header_x_ms_client_request_id = x_ms_client_request_id;
5432
5433 let uri_str = format!(
5434 "{}/{containerName}?comp=lease&restype=container&renew",
5435 configuration.base_path,
5436 containerName = crate::apis::urlencode(p_path_container_name)
5437 );
5438 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5439
5440 if let Some(ref param_value) = p_query_timeout {
5441 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
5442 }
5443 if let Some(ref user_agent) = configuration.user_agent {
5444 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5445 }
5446 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
5447 req_builder = req_builder.header("x-ms-lease-id", p_header_x_ms_lease_id.to_string());
5448 if let Some(param_value) = p_header_if_modified_since {
5449 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
5450 }
5451 if let Some(param_value) = p_header_if_unmodified_since {
5452 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
5453 }
5454 req_builder = req_builder.header("x-ms-lease-action", p_header_x_ms_lease_action.to_string());
5455 if let Some(param_value) = p_header_x_ms_client_request_id {
5456 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
5457 }
5458 if let Some(ref token) = configuration.oauth_access_token {
5459 req_builder = req_builder.bearer_auth(token.to_owned());
5460 };
5461
5462 let req = req_builder.build()?;
5463 let resp = configuration.client.execute(req).await?;
5464
5465 let status = resp.status();
5466
5467 if !status.is_client_error() && !status.is_server_error() {
5468 Ok(())
5469 } else {
5470 let content = resp.text().await?;
5471 let entity: Option<ContainerRenewLeaseError> = serde_json::from_str(&content).ok();
5472 Err(Error::ResponseError(ResponseContent {
5473 status,
5474 content,
5475 entity,
5476 }))
5477 }
5478}
5479
5480pub async fn container_restore(
5482 configuration: &configuration::Configuration,
5483 x_ms_version: &str,
5484 container_name: &str,
5485 x_ms_deleted_container_name: Option<&str>,
5486 x_ms_deleted_container_version: Option<&str>,
5487 timeout: Option<i32>,
5488 x_ms_client_request_id: Option<&str>,
5489) -> Result<(), Error<ContainerRestoreError>> {
5490 let p_header_x_ms_version = x_ms_version;
5492 let p_path_container_name = container_name;
5493 let p_header_x_ms_deleted_container_name = x_ms_deleted_container_name;
5494 let p_header_x_ms_deleted_container_version = x_ms_deleted_container_version;
5495 let p_query_timeout = timeout;
5496 let p_header_x_ms_client_request_id = x_ms_client_request_id;
5497
5498 let uri_str = format!(
5499 "{}/{containerName}?restype=container&comp=undelete",
5500 configuration.base_path,
5501 containerName = crate::apis::urlencode(p_path_container_name)
5502 );
5503 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5504
5505 if let Some(ref param_value) = p_query_timeout {
5506 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
5507 }
5508 if let Some(ref user_agent) = configuration.user_agent {
5509 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5510 }
5511 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
5512 if let Some(param_value) = p_header_x_ms_deleted_container_name {
5513 req_builder = req_builder.header("x-ms-deleted-container-name", param_value.to_string());
5514 }
5515 if let Some(param_value) = p_header_x_ms_deleted_container_version {
5516 req_builder = req_builder.header("x-ms-deleted-container-version", param_value.to_string());
5517 }
5518 if let Some(param_value) = p_header_x_ms_client_request_id {
5519 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
5520 }
5521 if let Some(ref token) = configuration.oauth_access_token {
5522 req_builder = req_builder.bearer_auth(token.to_owned());
5523 };
5524
5525 let req = req_builder.build()?;
5526 let resp = configuration.client.execute(req).await?;
5527
5528 let status = resp.status();
5529
5530 if !status.is_client_error() && !status.is_server_error() {
5531 Ok(())
5532 } else {
5533 let content = resp.text().await?;
5534 let entity: Option<ContainerRestoreError> = serde_json::from_str(&content).ok();
5535 Err(Error::ResponseError(ResponseContent {
5536 status,
5537 content,
5538 entity,
5539 }))
5540 }
5541}
5542
5543pub async fn container_set_access_policy(
5545 configuration: &configuration::Configuration,
5546 x_ms_version: &str,
5547 container_name: &str,
5548 container_acl: Vec<models::SignedIdentifier>,
5549 timeout: Option<i32>,
5550 x_ms_lease_id: Option<&str>,
5551 x_ms_blob_public_access: Option<&str>,
5552 if_modified_since: Option<&str>,
5553 if_unmodified_since: Option<&str>,
5554 x_ms_client_request_id: Option<&str>,
5555) -> Result<(), Error<ContainerSetAccessPolicyError>> {
5556 let p_header_x_ms_version = x_ms_version;
5558 let p_path_container_name = container_name;
5559 let p_body_container_acl = container_acl;
5560 let p_query_timeout = timeout;
5561 let p_header_x_ms_lease_id = x_ms_lease_id;
5562 let p_header_x_ms_blob_public_access = x_ms_blob_public_access;
5563 let p_header_if_modified_since = if_modified_since;
5564 let p_header_if_unmodified_since = if_unmodified_since;
5565 let p_header_x_ms_client_request_id = x_ms_client_request_id;
5566
5567 let uri_str = format!(
5568 "{}/{containerName}?restype=container&comp=acl&_overload=setAccessPolicy",
5569 configuration.base_path,
5570 containerName = crate::apis::urlencode(p_path_container_name)
5571 );
5572 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5573
5574 if let Some(ref param_value) = p_query_timeout {
5575 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
5576 }
5577 if let Some(ref user_agent) = configuration.user_agent {
5578 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5579 }
5580 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
5581 if let Some(param_value) = p_header_x_ms_lease_id {
5582 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
5583 }
5584 if let Some(param_value) = p_header_x_ms_blob_public_access {
5585 req_builder = req_builder.header("x-ms-blob-public-access", param_value.to_string());
5586 }
5587 if let Some(param_value) = p_header_if_modified_since {
5588 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
5589 }
5590 if let Some(param_value) = p_header_if_unmodified_since {
5591 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
5592 }
5593 if let Some(param_value) = p_header_x_ms_client_request_id {
5594 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
5595 }
5596 if let Some(ref token) = configuration.oauth_access_token {
5597 req_builder = req_builder.bearer_auth(token.to_owned());
5598 };
5599 req_builder = req_builder.json(&p_body_container_acl);
5600
5601 let req = req_builder.build()?;
5602 let resp = configuration.client.execute(req).await?;
5603
5604 let status = resp.status();
5605
5606 if !status.is_client_error() && !status.is_server_error() {
5607 Ok(())
5608 } else {
5609 let content = resp.text().await?;
5610 let entity: Option<ContainerSetAccessPolicyError> = serde_json::from_str(&content).ok();
5611 Err(Error::ResponseError(ResponseContent {
5612 status,
5613 content,
5614 entity,
5615 }))
5616 }
5617}
5618
5619pub async fn container_set_metadata(
5621 configuration: &configuration::Configuration,
5622 x_ms_version: &str,
5623 container_name: &str,
5624 timeout: Option<i32>,
5625 x_ms_lease_id: Option<&str>,
5626 x_ms_meta: Option<&str>,
5627 if_modified_since: Option<&str>,
5628 x_ms_client_request_id: Option<&str>,
5629) -> Result<(), Error<ContainerSetMetadataError>> {
5630 let p_header_x_ms_version = x_ms_version;
5632 let p_path_container_name = container_name;
5633 let p_query_timeout = timeout;
5634 let p_header_x_ms_lease_id = x_ms_lease_id;
5635 let p_header_x_ms_meta = x_ms_meta;
5636 let p_header_if_modified_since = if_modified_since;
5637 let p_header_x_ms_client_request_id = x_ms_client_request_id;
5638
5639 let uri_str = format!(
5640 "{}/{containerName}?restype=container&comp=metadata",
5641 configuration.base_path,
5642 containerName = crate::apis::urlencode(p_path_container_name)
5643 );
5644 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5645
5646 if let Some(ref param_value) = p_query_timeout {
5647 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
5648 }
5649 if let Some(ref user_agent) = configuration.user_agent {
5650 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5651 }
5652 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
5653 if let Some(param_value) = p_header_x_ms_lease_id {
5654 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
5655 }
5656 if let Some(param_value) = p_header_x_ms_meta {
5657 req_builder = req_builder.header("x-ms-meta", param_value.to_string());
5658 }
5659 if let Some(param_value) = p_header_if_modified_since {
5660 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
5661 }
5662 if let Some(param_value) = p_header_x_ms_client_request_id {
5663 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
5664 }
5665 if let Some(ref token) = configuration.oauth_access_token {
5666 req_builder = req_builder.bearer_auth(token.to_owned());
5667 };
5668
5669 let req = req_builder.build()?;
5670 let resp = configuration.client.execute(req).await?;
5671
5672 let status = resp.status();
5673
5674 if !status.is_client_error() && !status.is_server_error() {
5675 Ok(())
5676 } else {
5677 let content = resp.text().await?;
5678 let entity: Option<ContainerSetMetadataError> = serde_json::from_str(&content).ok();
5679 Err(Error::ResponseError(ResponseContent {
5680 status,
5681 content,
5682 entity,
5683 }))
5684 }
5685}
5686
5687pub async fn container_submit_batch(
5689 configuration: &configuration::Configuration,
5690 container_name: &str,
5691 content_length: i64,
5692 x_ms_version: &str,
5693 name: &str,
5694 body: std::path::PathBuf,
5695 timeout: Option<i32>,
5696 x_ms_client_request_id: Option<&str>,
5697) -> Result<String, Error<ContainerSubmitBatchError>> {
5698 let p_path_container_name = container_name;
5700 let p_header_content_length = content_length;
5701 let p_header_x_ms_version = x_ms_version;
5702 let p_form_name = name;
5703 let _p_form_body = body;
5704 let p_query_timeout = timeout;
5705 let p_header_x_ms_client_request_id = x_ms_client_request_id;
5706
5707 let uri_str = format!(
5708 "{}/{containerName}?restype=container&comp=batch",
5709 configuration.base_path,
5710 containerName = crate::apis::urlencode(p_path_container_name)
5711 );
5712 let mut req_builder = configuration
5713 .client
5714 .request(reqwest::Method::POST, &uri_str);
5715
5716 if let Some(ref param_value) = p_query_timeout {
5717 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
5718 }
5719 if let Some(ref user_agent) = configuration.user_agent {
5720 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5721 }
5722 req_builder = req_builder.header("Content-Length", p_header_content_length.to_string());
5723 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
5724 if let Some(param_value) = p_header_x_ms_client_request_id {
5725 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
5726 }
5727 if let Some(ref token) = configuration.oauth_access_token {
5728 req_builder = req_builder.bearer_auth(token.to_owned());
5729 };
5730 let mut multipart_form = reqwest::multipart::Form::new();
5731 multipart_form = multipart_form.text("name", p_form_name.to_string());
5732 req_builder = req_builder.multipart(multipart_form);
5734
5735 let req = req_builder.build()?;
5736 let resp = configuration.client.execute(req).await?;
5737
5738 let status = resp.status();
5739 let content_type = resp
5740 .headers()
5741 .get("content-type")
5742 .and_then(|v| v.to_str().ok())
5743 .unwrap_or("application/octet-stream");
5744 let content_type = super::ContentType::from(content_type);
5745
5746 if !status.is_client_error() && !status.is_server_error() {
5747 let content = resp.text().await?;
5748 match content_type {
5749 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5750 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `String`"))),
5751 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))),
5752 }
5753 } else {
5754 let content = resp.text().await?;
5755 let entity: Option<ContainerSubmitBatchError> = serde_json::from_str(&content).ok();
5756 Err(Error::ResponseError(ResponseContent {
5757 status,
5758 content,
5759 entity,
5760 }))
5761 }
5762}
5763
5764pub async fn filter_blobs(
5766 configuration: &configuration::Configuration,
5767 x_ms_version: &str,
5768 timeout: Option<i32>,
5769 r#where: Option<&str>,
5770 marker: Option<&str>,
5771 maxresults: Option<i32>,
5772 include: Option<Vec<String>>,
5773 x_ms_client_request_id: Option<&str>,
5774) -> Result<models::FilterBlobSegment, Error<FilterBlobsError>> {
5775 let p_header_x_ms_version = x_ms_version;
5777 let p_query_timeout = timeout;
5778 let p_query_where = r#where;
5779 let p_query_marker = marker;
5780 let p_query_maxresults = maxresults;
5781 let p_query_include = include;
5782 let p_header_x_ms_client_request_id = x_ms_client_request_id;
5783
5784 let uri_str = format!("{}/?comp=blobs", configuration.base_path);
5785 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5786
5787 if let Some(ref param_value) = p_query_timeout {
5788 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
5789 }
5790 if let Some(ref param_value) = p_query_where {
5791 req_builder = req_builder.query(&[("where", ¶m_value.to_string())]);
5792 }
5793 if let Some(ref param_value) = p_query_marker {
5794 req_builder = req_builder.query(&[("marker", ¶m_value.to_string())]);
5795 }
5796 if let Some(ref param_value) = p_query_maxresults {
5797 req_builder = req_builder.query(&[("maxresults", ¶m_value.to_string())]);
5798 }
5799 if let Some(ref param_value) = p_query_include {
5800 req_builder = match "csv" {
5801 "multi" => req_builder.query(
5802 ¶m_value
5803 .into_iter()
5804 .map(|p| ("include".to_owned(), p.to_string()))
5805 .collect::<Vec<(std::string::String, std::string::String)>>(),
5806 ),
5807 _ => req_builder.query(&[(
5808 "include",
5809 ¶m_value
5810 .into_iter()
5811 .map(|p| p.to_string())
5812 .collect::<Vec<String>>()
5813 .join(",")
5814 .to_string(),
5815 )]),
5816 };
5817 }
5818 if let Some(ref user_agent) = configuration.user_agent {
5819 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5820 }
5821 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
5822 if let Some(param_value) = p_header_x_ms_client_request_id {
5823 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
5824 }
5825 if let Some(ref token) = configuration.oauth_access_token {
5826 req_builder = req_builder.bearer_auth(token.to_owned());
5827 };
5828
5829 let req = req_builder.build()?;
5830 let resp = configuration.client.execute(req).await?;
5831
5832 let status = resp.status();
5833 let content_type = resp
5834 .headers()
5835 .get("content-type")
5836 .and_then(|v| v.to_str().ok())
5837 .unwrap_or("application/octet-stream");
5838 let content_type = super::ContentType::from(content_type);
5839
5840 if !status.is_client_error() && !status.is_server_error() {
5841 let content = resp.text().await?;
5842 match content_type {
5843 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5844 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FilterBlobSegment`"))),
5845 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FilterBlobSegment`")))),
5846 }
5847 } else {
5848 let content = resp.text().await?;
5849 let entity: Option<FilterBlobsError> = serde_json::from_str(&content).ok();
5850 Err(Error::ResponseError(ResponseContent {
5851 status,
5852 content,
5853 entity,
5854 }))
5855 }
5856}
5857
5858pub async fn get_account_info(
5860 configuration: &configuration::Configuration,
5861 x_ms_version: &str,
5862 timeout: Option<i32>,
5863 x_ms_client_request_id: Option<&str>,
5864) -> Result<(), Error<GetAccountInfoError>> {
5865 let p_header_x_ms_version = x_ms_version;
5867 let p_query_timeout = timeout;
5868 let p_header_x_ms_client_request_id = x_ms_client_request_id;
5869
5870 let uri_str = format!(
5871 "{}/?restype=account&comp=properties",
5872 configuration.base_path
5873 );
5874 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5875
5876 if let Some(ref param_value) = p_query_timeout {
5877 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
5878 }
5879 if let Some(ref user_agent) = configuration.user_agent {
5880 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5881 }
5882 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
5883 if let Some(param_value) = p_header_x_ms_client_request_id {
5884 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
5885 }
5886 if let Some(ref token) = configuration.oauth_access_token {
5887 req_builder = req_builder.bearer_auth(token.to_owned());
5888 };
5889
5890 let req = req_builder.build()?;
5891 let resp = configuration.client.execute(req).await?;
5892
5893 let status = resp.status();
5894
5895 if !status.is_client_error() && !status.is_server_error() {
5896 Ok(())
5897 } else {
5898 let content = resp.text().await?;
5899 let entity: Option<GetAccountInfoError> = serde_json::from_str(&content).ok();
5900 Err(Error::ResponseError(ResponseContent {
5901 status,
5902 content,
5903 entity,
5904 }))
5905 }
5906}
5907
5908pub async fn get_properties(
5910 configuration: &configuration::Configuration,
5911 x_ms_version: &str,
5912 timeout: Option<i32>,
5913 x_ms_client_request_id: Option<&str>,
5914) -> Result<models::StorageServiceProperties, Error<GetPropertiesError>> {
5915 let p_header_x_ms_version = x_ms_version;
5917 let p_query_timeout = timeout;
5918 let p_header_x_ms_client_request_id = x_ms_client_request_id;
5919
5920 let uri_str = format!(
5921 "{}/?restype=service&comp=properties&_overload=getProperties",
5922 configuration.base_path
5923 );
5924 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5925
5926 if let Some(ref param_value) = p_query_timeout {
5927 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
5928 }
5929 if let Some(ref user_agent) = configuration.user_agent {
5930 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5931 }
5932 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
5933 if let Some(param_value) = p_header_x_ms_client_request_id {
5934 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
5935 }
5936 if let Some(ref token) = configuration.oauth_access_token {
5937 req_builder = req_builder.bearer_auth(token.to_owned());
5938 };
5939
5940 let req = req_builder.build()?;
5941 let resp = configuration.client.execute(req).await?;
5942
5943 let status = resp.status();
5944 let content_type = resp
5945 .headers()
5946 .get("content-type")
5947 .and_then(|v| v.to_str().ok())
5948 .unwrap_or("application/octet-stream");
5949 let content_type = super::ContentType::from(content_type);
5950
5951 if !status.is_client_error() && !status.is_server_error() {
5952 let content = resp.text().await?;
5953 match content_type {
5954 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5955 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::StorageServiceProperties`"))),
5956 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::StorageServiceProperties`")))),
5957 }
5958 } else {
5959 let content = resp.text().await?;
5960 let entity: Option<GetPropertiesError> = serde_json::from_str(&content).ok();
5961 Err(Error::ResponseError(ResponseContent {
5962 status,
5963 content,
5964 entity,
5965 }))
5966 }
5967}
5968
5969pub async fn get_statistics(
5971 configuration: &configuration::Configuration,
5972 x_ms_version: &str,
5973 timeout: Option<i32>,
5974 x_ms_client_request_id: Option<&str>,
5975) -> Result<models::StorageServiceStats, Error<GetStatisticsError>> {
5976 let p_header_x_ms_version = x_ms_version;
5978 let p_query_timeout = timeout;
5979 let p_header_x_ms_client_request_id = x_ms_client_request_id;
5980
5981 let uri_str = format!("{}/?restype=service&comp=stats", configuration.base_path);
5982 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5983
5984 if let Some(ref param_value) = p_query_timeout {
5985 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
5986 }
5987 if let Some(ref user_agent) = configuration.user_agent {
5988 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5989 }
5990 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
5991 if let Some(param_value) = p_header_x_ms_client_request_id {
5992 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
5993 }
5994 if let Some(ref token) = configuration.oauth_access_token {
5995 req_builder = req_builder.bearer_auth(token.to_owned());
5996 };
5997
5998 let req = req_builder.build()?;
5999 let resp = configuration.client.execute(req).await?;
6000
6001 let status = resp.status();
6002 let content_type = resp
6003 .headers()
6004 .get("content-type")
6005 .and_then(|v| v.to_str().ok())
6006 .unwrap_or("application/octet-stream");
6007 let content_type = super::ContentType::from(content_type);
6008
6009 if !status.is_client_error() && !status.is_server_error() {
6010 let content = resp.text().await?;
6011 match content_type {
6012 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6013 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::StorageServiceStats`"))),
6014 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::StorageServiceStats`")))),
6015 }
6016 } else {
6017 let content = resp.text().await?;
6018 let entity: Option<GetStatisticsError> = serde_json::from_str(&content).ok();
6019 Err(Error::ResponseError(ResponseContent {
6020 status,
6021 content,
6022 entity,
6023 }))
6024 }
6025}
6026
6027pub async fn get_user_delegation_key(
6029 configuration: &configuration::Configuration,
6030 x_ms_version: &str,
6031 key_info: models::KeyInfo,
6032 timeout: Option<i32>,
6033 x_ms_client_request_id: Option<&str>,
6034) -> Result<models::UserDelegationKey, Error<GetUserDelegationKeyError>> {
6035 let p_header_x_ms_version = x_ms_version;
6037 let p_body_key_info = key_info;
6038 let p_query_timeout = timeout;
6039 let p_header_x_ms_client_request_id = x_ms_client_request_id;
6040
6041 let uri_str = format!(
6042 "{}/?restype=service&comp=userdelegationkey",
6043 configuration.base_path
6044 );
6045 let mut req_builder = configuration
6046 .client
6047 .request(reqwest::Method::POST, &uri_str);
6048
6049 if let Some(ref param_value) = p_query_timeout {
6050 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
6051 }
6052 if let Some(ref user_agent) = configuration.user_agent {
6053 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6054 }
6055 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
6056 if let Some(param_value) = p_header_x_ms_client_request_id {
6057 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
6058 }
6059 if let Some(ref token) = configuration.oauth_access_token {
6060 req_builder = req_builder.bearer_auth(token.to_owned());
6061 };
6062 req_builder = req_builder.json(&p_body_key_info);
6063
6064 let req = req_builder.build()?;
6065 let resp = configuration.client.execute(req).await?;
6066
6067 let status = resp.status();
6068 let content_type = resp
6069 .headers()
6070 .get("content-type")
6071 .and_then(|v| v.to_str().ok())
6072 .unwrap_or("application/octet-stream");
6073 let content_type = super::ContentType::from(content_type);
6074
6075 if !status.is_client_error() && !status.is_server_error() {
6076 let content = resp.text().await?;
6077 match content_type {
6078 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6079 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserDelegationKey`"))),
6080 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserDelegationKey`")))),
6081 }
6082 } else {
6083 let content = resp.text().await?;
6084 let entity: Option<GetUserDelegationKeyError> = serde_json::from_str(&content).ok();
6085 Err(Error::ResponseError(ResponseContent {
6086 status,
6087 content,
6088 entity,
6089 }))
6090 }
6091}
6092
6093pub async fn list_containers_segment(
6095 configuration: &configuration::Configuration,
6096 x_ms_version: &str,
6097 prefix: Option<&str>,
6098 marker: Option<&str>,
6099 maxresults: Option<i32>,
6100 timeout: Option<i32>,
6101 include: Option<Vec<String>>,
6102 x_ms_client_request_id: Option<&str>,
6103) -> Result<models::ListContainersSegmentResponse, Error<ListContainersSegmentError>> {
6104 let p_header_x_ms_version = x_ms_version;
6106 let p_query_prefix = prefix;
6107 let p_query_marker = marker;
6108 let p_query_maxresults = maxresults;
6109 let p_query_timeout = timeout;
6110 let p_query_include = include;
6111 let p_header_x_ms_client_request_id = x_ms_client_request_id;
6112
6113 let uri_str = format!("{}/?comp=list", configuration.base_path);
6114 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6115
6116 if let Some(ref param_value) = p_query_prefix {
6117 req_builder = req_builder.query(&[("prefix", ¶m_value.to_string())]);
6118 }
6119 if let Some(ref param_value) = p_query_marker {
6120 req_builder = req_builder.query(&[("marker", ¶m_value.to_string())]);
6121 }
6122 if let Some(ref param_value) = p_query_maxresults {
6123 req_builder = req_builder.query(&[("maxresults", ¶m_value.to_string())]);
6124 }
6125 if let Some(ref param_value) = p_query_timeout {
6126 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
6127 }
6128 if let Some(ref param_value) = p_query_include {
6129 req_builder = match "csv" {
6130 "multi" => req_builder.query(
6131 ¶m_value
6132 .into_iter()
6133 .map(|p| ("include".to_owned(), p.to_string()))
6134 .collect::<Vec<(std::string::String, std::string::String)>>(),
6135 ),
6136 _ => req_builder.query(&[(
6137 "include",
6138 ¶m_value
6139 .into_iter()
6140 .map(|p| p.to_string())
6141 .collect::<Vec<String>>()
6142 .join(",")
6143 .to_string(),
6144 )]),
6145 };
6146 }
6147 if let Some(ref user_agent) = configuration.user_agent {
6148 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6149 }
6150 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
6151 if let Some(param_value) = p_header_x_ms_client_request_id {
6152 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
6153 }
6154 if let Some(ref token) = configuration.oauth_access_token {
6155 req_builder = req_builder.bearer_auth(token.to_owned());
6156 };
6157
6158 let req = req_builder.build()?;
6159 let resp = configuration.client.execute(req).await?;
6160
6161 let status = resp.status();
6162 let content_type = resp
6163 .headers()
6164 .get("content-type")
6165 .and_then(|v| v.to_str().ok())
6166 .unwrap_or("application/octet-stream");
6167 let content_type = super::ContentType::from(content_type);
6168
6169 if !status.is_client_error() && !status.is_server_error() {
6170 let content = resp.text().await?;
6171 match content_type {
6172 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6173 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ListContainersSegmentResponse`"))),
6174 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ListContainersSegmentResponse`")))),
6175 }
6176 } else {
6177 let content = resp.text().await?;
6178 let entity: Option<ListContainersSegmentError> = serde_json::from_str(&content).ok();
6179 Err(Error::ResponseError(ResponseContent {
6180 status,
6181 content,
6182 entity,
6183 }))
6184 }
6185}
6186
6187pub async fn page_blob_clear_pages(
6189 configuration: &configuration::Configuration,
6190 x_ms_version: &str,
6191 container_name: &str,
6192 blob_name: &str,
6193 content_length: f64,
6194 range: &str,
6195 x_ms_page_write: &str,
6196 timeout: Option<i32>,
6197 x_ms_lease_id: Option<&str>,
6198 x_ms_encryption_key: Option<&str>,
6199 x_ms_encryption_key_sha256: Option<&str>,
6200 x_ms_encryption_algorithm: Option<&str>,
6201 x_ms_encryption_scope: Option<&str>,
6202 x_ms_if_sequence_number_le: Option<i64>,
6203 x_ms_if_sequence_number_lt: Option<i64>,
6204 x_ms_if_sequence_number_eq: Option<i64>,
6205 if_modified_since: Option<&str>,
6206 if_unmodified_since: Option<&str>,
6207 if_none_match: Option<&str>,
6208 if_match: Option<&str>,
6209 x_ms_if_tags: Option<&str>,
6210 x_ms_client_request_id: Option<&str>,
6211) -> Result<(), Error<PageBlobClearPagesError>> {
6212 let p_header_x_ms_version = x_ms_version;
6214 let p_path_container_name = container_name;
6215 let p_path_blob_name = blob_name;
6216 let p_header_content_length = content_length;
6217 let p_header_range = range;
6218 let p_header_x_ms_page_write = x_ms_page_write;
6219 let p_query_timeout = timeout;
6220 let p_header_x_ms_lease_id = x_ms_lease_id;
6221 let p_header_x_ms_encryption_key = x_ms_encryption_key;
6222 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
6223 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
6224 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
6225 let p_header_x_ms_if_sequence_number_le = x_ms_if_sequence_number_le;
6226 let p_header_x_ms_if_sequence_number_lt = x_ms_if_sequence_number_lt;
6227 let p_header_x_ms_if_sequence_number_eq = x_ms_if_sequence_number_eq;
6228 let p_header_if_modified_since = if_modified_since;
6229 let p_header_if_unmodified_since = if_unmodified_since;
6230 let p_header_if_none_match = if_none_match;
6231 let p_header_if_match = if_match;
6232 let p_header_x_ms_if_tags = x_ms_if_tags;
6233 let p_header_x_ms_client_request_id = x_ms_client_request_id;
6234
6235 let uri_str = format!(
6236 "{}/{containerName}/{blobName}?comp=page&clear",
6237 configuration.base_path,
6238 containerName = crate::apis::urlencode(p_path_container_name),
6239 blobName = crate::apis::urlencode(p_path_blob_name)
6240 );
6241 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6242
6243 if let Some(ref param_value) = p_query_timeout {
6244 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
6245 }
6246 if let Some(ref user_agent) = configuration.user_agent {
6247 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6248 }
6249 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
6250 req_builder = req_builder.header("Content-Length", p_header_content_length.to_string());
6251 req_builder = req_builder.header("Range", p_header_range.to_string());
6252 if let Some(param_value) = p_header_x_ms_lease_id {
6253 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
6254 }
6255 if let Some(param_value) = p_header_x_ms_encryption_key {
6256 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
6257 }
6258 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
6259 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
6260 }
6261 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
6262 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
6263 }
6264 if let Some(param_value) = p_header_x_ms_encryption_scope {
6265 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
6266 }
6267 if let Some(param_value) = p_header_x_ms_if_sequence_number_le {
6268 req_builder = req_builder.header("x-ms-if-sequence-number-le", param_value.to_string());
6269 }
6270 if let Some(param_value) = p_header_x_ms_if_sequence_number_lt {
6271 req_builder = req_builder.header("x-ms-if-sequence-number-lt", param_value.to_string());
6272 }
6273 if let Some(param_value) = p_header_x_ms_if_sequence_number_eq {
6274 req_builder = req_builder.header("x-ms-if-sequence-number-eq", param_value.to_string());
6275 }
6276 if let Some(param_value) = p_header_if_modified_since {
6277 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
6278 }
6279 if let Some(param_value) = p_header_if_unmodified_since {
6280 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
6281 }
6282 if let Some(param_value) = p_header_if_none_match {
6283 req_builder = req_builder.header("If-None-Match", param_value.to_string());
6284 }
6285 if let Some(param_value) = p_header_if_match {
6286 req_builder = req_builder.header("If-Match", param_value.to_string());
6287 }
6288 if let Some(param_value) = p_header_x_ms_if_tags {
6289 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
6290 }
6291 req_builder = req_builder.header("x-ms-page-write", p_header_x_ms_page_write.to_string());
6292 if let Some(param_value) = p_header_x_ms_client_request_id {
6293 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
6294 }
6295 if let Some(ref token) = configuration.oauth_access_token {
6296 req_builder = req_builder.bearer_auth(token.to_owned());
6297 };
6298
6299 let req = req_builder.build()?;
6300 let resp = configuration.client.execute(req).await?;
6301
6302 let status = resp.status();
6303
6304 if !status.is_client_error() && !status.is_server_error() {
6305 Ok(())
6306 } else {
6307 let content = resp.text().await?;
6308 let entity: Option<PageBlobClearPagesError> = serde_json::from_str(&content).ok();
6309 Err(Error::ResponseError(ResponseContent {
6310 status,
6311 content,
6312 entity,
6313 }))
6314 }
6315}
6316
6317pub async fn page_blob_copy_incremental(
6319 configuration: &configuration::Configuration,
6320 x_ms_version: &str,
6321 container_name: &str,
6322 blob_name: &str,
6323 x_ms_copy_source: &str,
6324 timeout: Option<i32>,
6325 if_modified_since: Option<&str>,
6326 if_unmodified_since: Option<&str>,
6327 if_none_match: Option<&str>,
6328 if_match: Option<&str>,
6329 x_ms_if_tags: Option<&str>,
6330 x_ms_client_request_id: Option<&str>,
6331) -> Result<(), Error<PageBlobCopyIncrementalError>> {
6332 let p_header_x_ms_version = x_ms_version;
6334 let p_path_container_name = container_name;
6335 let p_path_blob_name = blob_name;
6336 let p_header_x_ms_copy_source = x_ms_copy_source;
6337 let p_query_timeout = timeout;
6338 let p_header_if_modified_since = if_modified_since;
6339 let p_header_if_unmodified_since = if_unmodified_since;
6340 let p_header_if_none_match = if_none_match;
6341 let p_header_if_match = if_match;
6342 let p_header_x_ms_if_tags = x_ms_if_tags;
6343 let p_header_x_ms_client_request_id = x_ms_client_request_id;
6344
6345 let uri_str = format!(
6346 "{}/{containerName}/{blobName}?comp=incrementalcopy",
6347 configuration.base_path,
6348 containerName = crate::apis::urlencode(p_path_container_name),
6349 blobName = crate::apis::urlencode(p_path_blob_name)
6350 );
6351 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6352
6353 if let Some(ref param_value) = p_query_timeout {
6354 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
6355 }
6356 if let Some(ref user_agent) = configuration.user_agent {
6357 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6358 }
6359 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
6360 if let Some(param_value) = p_header_if_modified_since {
6361 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
6362 }
6363 if let Some(param_value) = p_header_if_unmodified_since {
6364 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
6365 }
6366 if let Some(param_value) = p_header_if_none_match {
6367 req_builder = req_builder.header("If-None-Match", param_value.to_string());
6368 }
6369 if let Some(param_value) = p_header_if_match {
6370 req_builder = req_builder.header("If-Match", param_value.to_string());
6371 }
6372 if let Some(param_value) = p_header_x_ms_if_tags {
6373 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
6374 }
6375 req_builder = req_builder.header("x-ms-copy-source", p_header_x_ms_copy_source.to_string());
6376 if let Some(param_value) = p_header_x_ms_client_request_id {
6377 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
6378 }
6379 if let Some(ref token) = configuration.oauth_access_token {
6380 req_builder = req_builder.bearer_auth(token.to_owned());
6381 };
6382
6383 let req = req_builder.build()?;
6384 let resp = configuration.client.execute(req).await?;
6385
6386 let status = resp.status();
6387
6388 if !status.is_client_error() && !status.is_server_error() {
6389 Ok(())
6390 } else {
6391 let content = resp.text().await?;
6392 let entity: Option<PageBlobCopyIncrementalError> = serde_json::from_str(&content).ok();
6393 Err(Error::ResponseError(ResponseContent {
6394 status,
6395 content,
6396 entity,
6397 }))
6398 }
6399}
6400
6401pub async fn page_blob_get_page_ranges(
6403 configuration: &configuration::Configuration,
6404 x_ms_version: &str,
6405 container_name: &str,
6406 blob_name: &str,
6407 snapshot: Option<&str>,
6408 timeout: Option<i32>,
6409 range: Option<&str>,
6410 x_ms_lease_id: Option<&str>,
6411 if_modified_since: Option<&str>,
6412 if_unmodified_since: Option<&str>,
6413 if_none_match: Option<&str>,
6414 if_match: Option<&str>,
6415 x_ms_if_tags: Option<&str>,
6416 marker: Option<&str>,
6417 maxresults: Option<i32>,
6418 x_ms_client_request_id: Option<&str>,
6419) -> Result<models::PageList, Error<PageBlobGetPageRangesError>> {
6420 let p_header_x_ms_version = x_ms_version;
6422 let p_path_container_name = container_name;
6423 let p_path_blob_name = blob_name;
6424 let p_query_snapshot = snapshot;
6425 let p_query_timeout = timeout;
6426 let p_header_range = range;
6427 let p_header_x_ms_lease_id = x_ms_lease_id;
6428 let p_header_if_modified_since = if_modified_since;
6429 let p_header_if_unmodified_since = if_unmodified_since;
6430 let p_header_if_none_match = if_none_match;
6431 let p_header_if_match = if_match;
6432 let p_header_x_ms_if_tags = x_ms_if_tags;
6433 let p_query_marker = marker;
6434 let p_query_maxresults = maxresults;
6435 let p_header_x_ms_client_request_id = x_ms_client_request_id;
6436
6437 let uri_str = format!(
6438 "{}/{containerName}/{blobName}?comp=pagelist",
6439 configuration.base_path,
6440 containerName = crate::apis::urlencode(p_path_container_name),
6441 blobName = crate::apis::urlencode(p_path_blob_name)
6442 );
6443 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6444
6445 if let Some(ref param_value) = p_query_snapshot {
6446 req_builder = req_builder.query(&[("snapshot", ¶m_value.to_string())]);
6447 }
6448 if let Some(ref param_value) = p_query_timeout {
6449 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
6450 }
6451 if let Some(ref param_value) = p_query_marker {
6452 req_builder = req_builder.query(&[("marker", ¶m_value.to_string())]);
6453 }
6454 if let Some(ref param_value) = p_query_maxresults {
6455 req_builder = req_builder.query(&[("maxresults", ¶m_value.to_string())]);
6456 }
6457 if let Some(ref user_agent) = configuration.user_agent {
6458 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6459 }
6460 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
6461 if let Some(param_value) = p_header_range {
6462 req_builder = req_builder.header("Range", param_value.to_string());
6463 }
6464 if let Some(param_value) = p_header_x_ms_lease_id {
6465 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
6466 }
6467 if let Some(param_value) = p_header_if_modified_since {
6468 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
6469 }
6470 if let Some(param_value) = p_header_if_unmodified_since {
6471 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
6472 }
6473 if let Some(param_value) = p_header_if_none_match {
6474 req_builder = req_builder.header("If-None-Match", param_value.to_string());
6475 }
6476 if let Some(param_value) = p_header_if_match {
6477 req_builder = req_builder.header("If-Match", param_value.to_string());
6478 }
6479 if let Some(param_value) = p_header_x_ms_if_tags {
6480 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
6481 }
6482 if let Some(param_value) = p_header_x_ms_client_request_id {
6483 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
6484 }
6485 if let Some(ref token) = configuration.oauth_access_token {
6486 req_builder = req_builder.bearer_auth(token.to_owned());
6487 };
6488
6489 let req = req_builder.build()?;
6490 let resp = configuration.client.execute(req).await?;
6491
6492 let status = resp.status();
6493 let content_type = resp
6494 .headers()
6495 .get("content-type")
6496 .and_then(|v| v.to_str().ok())
6497 .unwrap_or("application/octet-stream");
6498 let content_type = super::ContentType::from(content_type);
6499
6500 if !status.is_client_error() && !status.is_server_error() {
6501 let content = resp.text().await?;
6502 match content_type {
6503 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6504 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PageList`"))),
6505 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PageList`")))),
6506 }
6507 } else {
6508 let content = resp.text().await?;
6509 let entity: Option<PageBlobGetPageRangesError> = serde_json::from_str(&content).ok();
6510 Err(Error::ResponseError(ResponseContent {
6511 status,
6512 content,
6513 entity,
6514 }))
6515 }
6516}
6517
6518pub async fn page_blob_get_page_ranges_diff(
6520 configuration: &configuration::Configuration,
6521 x_ms_version: &str,
6522 container_name: &str,
6523 blob_name: &str,
6524 snapshot: Option<&str>,
6525 timeout: Option<i32>,
6526 prevsnapshot: Option<&str>,
6527 x_ms_previous_snapshot_url: Option<&str>,
6528 range: Option<&str>,
6529 x_ms_lease_id: Option<&str>,
6530 if_modified_since: Option<&str>,
6531 if_unmodified_since: Option<&str>,
6532 if_none_match: Option<&str>,
6533 if_match: Option<&str>,
6534 x_ms_if_tags: Option<&str>,
6535 marker: Option<&str>,
6536 maxresults: Option<i32>,
6537 x_ms_client_request_id: Option<&str>,
6538) -> Result<models::PageList, Error<PageBlobGetPageRangesDiffError>> {
6539 let p_header_x_ms_version = x_ms_version;
6541 let p_path_container_name = container_name;
6542 let p_path_blob_name = blob_name;
6543 let p_query_snapshot = snapshot;
6544 let p_query_timeout = timeout;
6545 let p_query_prevsnapshot = prevsnapshot;
6546 let p_header_x_ms_previous_snapshot_url = x_ms_previous_snapshot_url;
6547 let p_header_range = range;
6548 let p_header_x_ms_lease_id = x_ms_lease_id;
6549 let p_header_if_modified_since = if_modified_since;
6550 let p_header_if_unmodified_since = if_unmodified_since;
6551 let p_header_if_none_match = if_none_match;
6552 let p_header_if_match = if_match;
6553 let p_header_x_ms_if_tags = x_ms_if_tags;
6554 let p_query_marker = marker;
6555 let p_query_maxresults = maxresults;
6556 let p_header_x_ms_client_request_id = x_ms_client_request_id;
6557
6558 let uri_str = format!(
6559 "{}/{containerName}/{blobName}?comp=pagelist&diff",
6560 configuration.base_path,
6561 containerName = crate::apis::urlencode(p_path_container_name),
6562 blobName = crate::apis::urlencode(p_path_blob_name)
6563 );
6564 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6565
6566 if let Some(ref param_value) = p_query_snapshot {
6567 req_builder = req_builder.query(&[("snapshot", ¶m_value.to_string())]);
6568 }
6569 if let Some(ref param_value) = p_query_timeout {
6570 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
6571 }
6572 if let Some(ref param_value) = p_query_prevsnapshot {
6573 req_builder = req_builder.query(&[("prevsnapshot", ¶m_value.to_string())]);
6574 }
6575 if let Some(ref param_value) = p_query_marker {
6576 req_builder = req_builder.query(&[("marker", ¶m_value.to_string())]);
6577 }
6578 if let Some(ref param_value) = p_query_maxresults {
6579 req_builder = req_builder.query(&[("maxresults", ¶m_value.to_string())]);
6580 }
6581 if let Some(ref user_agent) = configuration.user_agent {
6582 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6583 }
6584 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
6585 if let Some(param_value) = p_header_x_ms_previous_snapshot_url {
6586 req_builder = req_builder.header("x-ms-previous-snapshot-url", param_value.to_string());
6587 }
6588 if let Some(param_value) = p_header_range {
6589 req_builder = req_builder.header("Range", param_value.to_string());
6590 }
6591 if let Some(param_value) = p_header_x_ms_lease_id {
6592 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
6593 }
6594 if let Some(param_value) = p_header_if_modified_since {
6595 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
6596 }
6597 if let Some(param_value) = p_header_if_unmodified_since {
6598 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
6599 }
6600 if let Some(param_value) = p_header_if_none_match {
6601 req_builder = req_builder.header("If-None-Match", param_value.to_string());
6602 }
6603 if let Some(param_value) = p_header_if_match {
6604 req_builder = req_builder.header("If-Match", param_value.to_string());
6605 }
6606 if let Some(param_value) = p_header_x_ms_if_tags {
6607 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
6608 }
6609 if let Some(param_value) = p_header_x_ms_client_request_id {
6610 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
6611 }
6612 if let Some(ref token) = configuration.oauth_access_token {
6613 req_builder = req_builder.bearer_auth(token.to_owned());
6614 };
6615
6616 let req = req_builder.build()?;
6617 let resp = configuration.client.execute(req).await?;
6618
6619 let status = resp.status();
6620 let content_type = resp
6621 .headers()
6622 .get("content-type")
6623 .and_then(|v| v.to_str().ok())
6624 .unwrap_or("application/octet-stream");
6625 let content_type = super::ContentType::from(content_type);
6626
6627 if !status.is_client_error() && !status.is_server_error() {
6628 let content = resp.text().await?;
6629 match content_type {
6630 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6631 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PageList`"))),
6632 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PageList`")))),
6633 }
6634 } else {
6635 let content = resp.text().await?;
6636 let entity: Option<PageBlobGetPageRangesDiffError> = serde_json::from_str(&content).ok();
6637 Err(Error::ResponseError(ResponseContent {
6638 status,
6639 content,
6640 entity,
6641 }))
6642 }
6643}
6644
6645pub async fn page_blob_resize(
6647 configuration: &configuration::Configuration,
6648 x_ms_version: &str,
6649 container_name: &str,
6650 blob_name: &str,
6651 x_ms_blob_content_length: i64,
6652 timeout: Option<i32>,
6653 x_ms_lease_id: Option<&str>,
6654 x_ms_encryption_key: Option<&str>,
6655 x_ms_encryption_key_sha256: Option<&str>,
6656 x_ms_encryption_algorithm: Option<&str>,
6657 x_ms_encryption_scope: Option<&str>,
6658 if_modified_since: Option<&str>,
6659 if_unmodified_since: Option<&str>,
6660 if_none_match: Option<&str>,
6661 if_match: Option<&str>,
6662 x_ms_if_tags: Option<&str>,
6663 x_ms_client_request_id: Option<&str>,
6664) -> Result<(), Error<PageBlobResizeError>> {
6665 let p_header_x_ms_version = x_ms_version;
6667 let p_path_container_name = container_name;
6668 let p_path_blob_name = blob_name;
6669 let p_header_x_ms_blob_content_length = x_ms_blob_content_length;
6670 let p_query_timeout = timeout;
6671 let p_header_x_ms_lease_id = x_ms_lease_id;
6672 let p_header_x_ms_encryption_key = x_ms_encryption_key;
6673 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
6674 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
6675 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
6676 let p_header_if_modified_since = if_modified_since;
6677 let p_header_if_unmodified_since = if_unmodified_since;
6678 let p_header_if_none_match = if_none_match;
6679 let p_header_if_match = if_match;
6680 let p_header_x_ms_if_tags = x_ms_if_tags;
6681 let p_header_x_ms_client_request_id = x_ms_client_request_id;
6682
6683 let uri_str = format!(
6684 "{}/{containerName}/{blobName}?comp=properties&Resize",
6685 configuration.base_path,
6686 containerName = crate::apis::urlencode(p_path_container_name),
6687 blobName = crate::apis::urlencode(p_path_blob_name)
6688 );
6689 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6690
6691 if let Some(ref param_value) = p_query_timeout {
6692 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
6693 }
6694 if let Some(ref user_agent) = configuration.user_agent {
6695 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6696 }
6697 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
6698 if let Some(param_value) = p_header_x_ms_lease_id {
6699 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
6700 }
6701 if let Some(param_value) = p_header_x_ms_encryption_key {
6702 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
6703 }
6704 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
6705 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
6706 }
6707 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
6708 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
6709 }
6710 if let Some(param_value) = p_header_x_ms_encryption_scope {
6711 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
6712 }
6713 if let Some(param_value) = p_header_if_modified_since {
6714 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
6715 }
6716 if let Some(param_value) = p_header_if_unmodified_since {
6717 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
6718 }
6719 if let Some(param_value) = p_header_if_none_match {
6720 req_builder = req_builder.header("If-None-Match", param_value.to_string());
6721 }
6722 if let Some(param_value) = p_header_if_match {
6723 req_builder = req_builder.header("If-Match", param_value.to_string());
6724 }
6725 if let Some(param_value) = p_header_x_ms_if_tags {
6726 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
6727 }
6728 req_builder = req_builder.header(
6729 "x-ms-blob-content-length",
6730 p_header_x_ms_blob_content_length.to_string(),
6731 );
6732 if let Some(param_value) = p_header_x_ms_client_request_id {
6733 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
6734 }
6735 if let Some(ref token) = configuration.oauth_access_token {
6736 req_builder = req_builder.bearer_auth(token.to_owned());
6737 };
6738
6739 let req = req_builder.build()?;
6740 let resp = configuration.client.execute(req).await?;
6741
6742 let status = resp.status();
6743
6744 if !status.is_client_error() && !status.is_server_error() {
6745 Ok(())
6746 } else {
6747 let content = resp.text().await?;
6748 let entity: Option<PageBlobResizeError> = serde_json::from_str(&content).ok();
6749 Err(Error::ResponseError(ResponseContent {
6750 status,
6751 content,
6752 entity,
6753 }))
6754 }
6755}
6756
6757pub async fn page_blob_set_sequence_number(
6759 configuration: &configuration::Configuration,
6760 x_ms_version: &str,
6761 container_name: &str,
6762 blob_name: &str,
6763 x_ms_sequence_number_action: &str,
6764 timeout: Option<i32>,
6765 x_ms_lease_id: Option<&str>,
6766 if_modified_since: Option<&str>,
6767 if_unmodified_since: Option<&str>,
6768 if_none_match: Option<&str>,
6769 if_match: Option<&str>,
6770 x_ms_if_tags: Option<&str>,
6771 x_ms_blob_sequence_number: Option<i64>,
6772 x_ms_client_request_id: Option<&str>,
6773) -> Result<(), Error<PageBlobSetSequenceNumberError>> {
6774 let p_header_x_ms_version = x_ms_version;
6776 let p_path_container_name = container_name;
6777 let p_path_blob_name = blob_name;
6778 let p_header_x_ms_sequence_number_action = x_ms_sequence_number_action;
6779 let p_query_timeout = timeout;
6780 let p_header_x_ms_lease_id = x_ms_lease_id;
6781 let p_header_if_modified_since = if_modified_since;
6782 let p_header_if_unmodified_since = if_unmodified_since;
6783 let p_header_if_none_match = if_none_match;
6784 let p_header_if_match = if_match;
6785 let p_header_x_ms_if_tags = x_ms_if_tags;
6786 let p_header_x_ms_blob_sequence_number = x_ms_blob_sequence_number;
6787 let p_header_x_ms_client_request_id = x_ms_client_request_id;
6788
6789 let uri_str = format!(
6790 "{}/{containerName}/{blobName}?comp=properties&UpdateSequenceNumber",
6791 configuration.base_path,
6792 containerName = crate::apis::urlencode(p_path_container_name),
6793 blobName = crate::apis::urlencode(p_path_blob_name)
6794 );
6795 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6796
6797 if let Some(ref param_value) = p_query_timeout {
6798 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
6799 }
6800 if let Some(ref user_agent) = configuration.user_agent {
6801 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6802 }
6803 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
6804 if let Some(param_value) = p_header_x_ms_lease_id {
6805 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
6806 }
6807 if let Some(param_value) = p_header_if_modified_since {
6808 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
6809 }
6810 if let Some(param_value) = p_header_if_unmodified_since {
6811 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
6812 }
6813 if let Some(param_value) = p_header_if_none_match {
6814 req_builder = req_builder.header("If-None-Match", param_value.to_string());
6815 }
6816 if let Some(param_value) = p_header_if_match {
6817 req_builder = req_builder.header("If-Match", param_value.to_string());
6818 }
6819 if let Some(param_value) = p_header_x_ms_if_tags {
6820 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
6821 }
6822 req_builder = req_builder.header(
6823 "x-ms-sequence-number-action",
6824 p_header_x_ms_sequence_number_action.to_string(),
6825 );
6826 if let Some(param_value) = p_header_x_ms_blob_sequence_number {
6827 req_builder = req_builder.header("x-ms-blob-sequence-number", param_value.to_string());
6828 }
6829 if let Some(param_value) = p_header_x_ms_client_request_id {
6830 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
6831 }
6832 if let Some(ref token) = configuration.oauth_access_token {
6833 req_builder = req_builder.bearer_auth(token.to_owned());
6834 };
6835
6836 let req = req_builder.build()?;
6837 let resp = configuration.client.execute(req).await?;
6838
6839 let status = resp.status();
6840
6841 if !status.is_client_error() && !status.is_server_error() {
6842 Ok(())
6843 } else {
6844 let content = resp.text().await?;
6845 let entity: Option<PageBlobSetSequenceNumberError> = serde_json::from_str(&content).ok();
6846 Err(Error::ResponseError(ResponseContent {
6847 status,
6848 content,
6849 entity,
6850 }))
6851 }
6852}
6853
6854pub async fn page_blob_upload_pages(
6856 configuration: &configuration::Configuration,
6857 x_ms_version: &str,
6858 container_name: &str,
6859 blob_name: &str,
6860 content_length: i64,
6861 range: &str,
6862 x_ms_page_write: &str,
6863 body: std::path::PathBuf,
6864 content_md5: Option<String>,
6865 x_ms_content_crc64: Option<String>,
6866 timeout: Option<i32>,
6867 x_ms_lease_id: Option<&str>,
6868 x_ms_encryption_key: Option<&str>,
6869 x_ms_encryption_key_sha256: Option<&str>,
6870 x_ms_encryption_algorithm: Option<&str>,
6871 x_ms_encryption_scope: Option<&str>,
6872 x_ms_if_sequence_number_le: Option<i64>,
6873 x_ms_if_sequence_number_lt: Option<i64>,
6874 x_ms_if_sequence_number_eq: Option<i64>,
6875 if_modified_since: Option<&str>,
6876 if_unmodified_since: Option<&str>,
6877 if_none_match: Option<&str>,
6878 if_match: Option<&str>,
6879 x_ms_if_tags: Option<&str>,
6880 x_ms_structured_body: Option<&str>,
6881 x_ms_structured_content_length: Option<i64>,
6882 x_ms_client_request_id: Option<&str>,
6883) -> Result<(), Error<PageBlobUploadPagesError>> {
6884 let p_header_x_ms_version = x_ms_version;
6886 let p_path_container_name = container_name;
6887 let p_path_blob_name = blob_name;
6888 let p_header_content_length = content_length;
6889 let p_header_range = range;
6890 let p_header_x_ms_page_write = x_ms_page_write;
6891 let p_body_body = body;
6892 let p_header_content_md5 = content_md5;
6893 let p_header_x_ms_content_crc64 = x_ms_content_crc64;
6894 let p_query_timeout = timeout;
6895 let p_header_x_ms_lease_id = x_ms_lease_id;
6896 let p_header_x_ms_encryption_key = x_ms_encryption_key;
6897 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
6898 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
6899 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
6900 let p_header_x_ms_if_sequence_number_le = x_ms_if_sequence_number_le;
6901 let p_header_x_ms_if_sequence_number_lt = x_ms_if_sequence_number_lt;
6902 let p_header_x_ms_if_sequence_number_eq = x_ms_if_sequence_number_eq;
6903 let p_header_if_modified_since = if_modified_since;
6904 let p_header_if_unmodified_since = if_unmodified_since;
6905 let p_header_if_none_match = if_none_match;
6906 let p_header_if_match = if_match;
6907 let p_header_x_ms_if_tags = x_ms_if_tags;
6908 let p_header_x_ms_structured_body = x_ms_structured_body;
6909 let p_header_x_ms_structured_content_length = x_ms_structured_content_length;
6910 let p_header_x_ms_client_request_id = x_ms_client_request_id;
6911
6912 let uri_str = format!(
6913 "{}/{containerName}/{blobName}?comp=page&update",
6914 configuration.base_path,
6915 containerName = crate::apis::urlencode(p_path_container_name),
6916 blobName = crate::apis::urlencode(p_path_blob_name)
6917 );
6918 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6919
6920 if let Some(ref param_value) = p_query_timeout {
6921 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
6922 }
6923 if let Some(ref user_agent) = configuration.user_agent {
6924 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6925 }
6926 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
6927 req_builder = req_builder.header("Content-Length", p_header_content_length.to_string());
6928 if let Some(param_value) = p_header_content_md5 {
6929 req_builder = req_builder.header("Content-MD5", param_value.to_string());
6930 }
6931 if let Some(param_value) = p_header_x_ms_content_crc64 {
6932 req_builder = req_builder.header("x-ms-content-crc64", param_value.to_string());
6933 }
6934 req_builder = req_builder.header("Range", p_header_range.to_string());
6935 if let Some(param_value) = p_header_x_ms_lease_id {
6936 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
6937 }
6938 if let Some(param_value) = p_header_x_ms_encryption_key {
6939 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
6940 }
6941 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
6942 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
6943 }
6944 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
6945 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
6946 }
6947 if let Some(param_value) = p_header_x_ms_encryption_scope {
6948 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
6949 }
6950 if let Some(param_value) = p_header_x_ms_if_sequence_number_le {
6951 req_builder = req_builder.header("x-ms-if-sequence-number-le", param_value.to_string());
6952 }
6953 if let Some(param_value) = p_header_x_ms_if_sequence_number_lt {
6954 req_builder = req_builder.header("x-ms-if-sequence-number-lt", param_value.to_string());
6955 }
6956 if let Some(param_value) = p_header_x_ms_if_sequence_number_eq {
6957 req_builder = req_builder.header("x-ms-if-sequence-number-eq", param_value.to_string());
6958 }
6959 if let Some(param_value) = p_header_if_modified_since {
6960 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
6961 }
6962 if let Some(param_value) = p_header_if_unmodified_since {
6963 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
6964 }
6965 if let Some(param_value) = p_header_if_none_match {
6966 req_builder = req_builder.header("If-None-Match", param_value.to_string());
6967 }
6968 if let Some(param_value) = p_header_if_match {
6969 req_builder = req_builder.header("If-Match", param_value.to_string());
6970 }
6971 if let Some(param_value) = p_header_x_ms_if_tags {
6972 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
6973 }
6974 if let Some(param_value) = p_header_x_ms_structured_body {
6975 req_builder = req_builder.header("x-ms-structured-body", param_value.to_string());
6976 }
6977 if let Some(param_value) = p_header_x_ms_structured_content_length {
6978 req_builder = req_builder.header("x-ms-structured-content-length", param_value.to_string());
6979 }
6980 req_builder = req_builder.header("x-ms-page-write", p_header_x_ms_page_write.to_string());
6981 if let Some(param_value) = p_header_x_ms_client_request_id {
6982 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
6983 }
6984 if let Some(ref token) = configuration.oauth_access_token {
6985 req_builder = req_builder.bearer_auth(token.to_owned());
6986 };
6987 let file = TokioFile::open(p_body_body).await?;
6988 let stream = FramedRead::new(file, BytesCodec::new());
6989 req_builder = req_builder.body(reqwest::Body::wrap_stream(stream));
6990
6991 let req = req_builder.build()?;
6992 let resp = configuration.client.execute(req).await?;
6993
6994 let status = resp.status();
6995
6996 if !status.is_client_error() && !status.is_server_error() {
6997 Ok(())
6998 } else {
6999 let content = resp.text().await?;
7000 let entity: Option<PageBlobUploadPagesError> = serde_json::from_str(&content).ok();
7001 Err(Error::ResponseError(ResponseContent {
7002 status,
7003 content,
7004 entity,
7005 }))
7006 }
7007}
7008
7009pub async fn page_blob_upload_pages_from_url(
7011 configuration: &configuration::Configuration,
7012 x_ms_version: &str,
7013 container_name: &str,
7014 blob_name: &str,
7015 x_ms_copy_source: &str,
7016 x_ms_source_range: &str,
7017 content_length: i64,
7018 x_ms_range: &str,
7019 x_ms_page_write: &str,
7020 x_ms_source_content_md5: Option<String>,
7021 x_ms_source_content_crc64: Option<String>,
7022 timeout: Option<i32>,
7023 x_ms_encryption_key: Option<&str>,
7024 x_ms_encryption_key_sha256: Option<&str>,
7025 x_ms_encryption_algorithm: Option<&str>,
7026 x_ms_encryption_scope: Option<&str>,
7027 x_ms_lease_id: Option<&str>,
7028 x_ms_if_sequence_number_le: Option<i64>,
7029 x_ms_if_sequence_number_lt: Option<i64>,
7030 x_ms_if_sequence_number_eq: Option<i64>,
7031 if_modified_since: Option<&str>,
7032 if_unmodified_since: Option<&str>,
7033 if_none_match: Option<&str>,
7034 if_match: Option<&str>,
7035 x_ms_if_tags: Option<&str>,
7036 x_ms_source_if_modified_since: Option<&str>,
7037 x_ms_source_if_unmodified_since: Option<&str>,
7038 x_ms_source_if_match: Option<&str>,
7039 x_ms_source_if_none_match: Option<&str>,
7040 x_ms_copy_source_authorization: Option<&str>,
7041 x_ms_file_request_intent: Option<&str>,
7042 x_ms_client_request_id: Option<&str>,
7043) -> Result<(), Error<PageBlobUploadPagesFromUrlError>> {
7044 let p_header_x_ms_version = x_ms_version;
7046 let p_path_container_name = container_name;
7047 let p_path_blob_name = blob_name;
7048 let p_header_x_ms_copy_source = x_ms_copy_source;
7049 let p_header_x_ms_source_range = x_ms_source_range;
7050 let p_header_content_length = content_length;
7051 let p_header_x_ms_range = x_ms_range;
7052 let p_header_x_ms_page_write = x_ms_page_write;
7053 let p_header_x_ms_source_content_md5 = x_ms_source_content_md5;
7054 let p_header_x_ms_source_content_crc64 = x_ms_source_content_crc64;
7055 let p_query_timeout = timeout;
7056 let p_header_x_ms_encryption_key = x_ms_encryption_key;
7057 let p_header_x_ms_encryption_key_sha256 = x_ms_encryption_key_sha256;
7058 let p_header_x_ms_encryption_algorithm = x_ms_encryption_algorithm;
7059 let p_header_x_ms_encryption_scope = x_ms_encryption_scope;
7060 let p_header_x_ms_lease_id = x_ms_lease_id;
7061 let p_header_x_ms_if_sequence_number_le = x_ms_if_sequence_number_le;
7062 let p_header_x_ms_if_sequence_number_lt = x_ms_if_sequence_number_lt;
7063 let p_header_x_ms_if_sequence_number_eq = x_ms_if_sequence_number_eq;
7064 let p_header_if_modified_since = if_modified_since;
7065 let p_header_if_unmodified_since = if_unmodified_since;
7066 let p_header_if_none_match = if_none_match;
7067 let p_header_if_match = if_match;
7068 let p_header_x_ms_if_tags = x_ms_if_tags;
7069 let p_header_x_ms_source_if_modified_since = x_ms_source_if_modified_since;
7070 let p_header_x_ms_source_if_unmodified_since = x_ms_source_if_unmodified_since;
7071 let p_header_x_ms_source_if_match = x_ms_source_if_match;
7072 let p_header_x_ms_source_if_none_match = x_ms_source_if_none_match;
7073 let p_header_x_ms_copy_source_authorization = x_ms_copy_source_authorization;
7074 let p_header_x_ms_file_request_intent = x_ms_file_request_intent;
7075 let p_header_x_ms_client_request_id = x_ms_client_request_id;
7076
7077 let uri_str = format!(
7078 "{}/{containerName}/{blobName}?comp=page&update&fromUrl",
7079 configuration.base_path,
7080 containerName = crate::apis::urlencode(p_path_container_name),
7081 blobName = crate::apis::urlencode(p_path_blob_name)
7082 );
7083 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7084
7085 if let Some(ref param_value) = p_query_timeout {
7086 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
7087 }
7088 if let Some(ref user_agent) = configuration.user_agent {
7089 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7090 }
7091 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
7092 req_builder = req_builder.header("x-ms-copy-source", p_header_x_ms_copy_source.to_string());
7093 req_builder = req_builder.header("x-ms-source-range", p_header_x_ms_source_range.to_string());
7094 if let Some(param_value) = p_header_x_ms_source_content_md5 {
7095 req_builder = req_builder.header("x-ms-source-content-md5", param_value.to_string());
7096 }
7097 if let Some(param_value) = p_header_x_ms_source_content_crc64 {
7098 req_builder = req_builder.header("x-ms-source-content-crc64", param_value.to_string());
7099 }
7100 req_builder = req_builder.header("Content-Length", p_header_content_length.to_string());
7101 req_builder = req_builder.header("x-ms-range", p_header_x_ms_range.to_string());
7102 if let Some(param_value) = p_header_x_ms_encryption_key {
7103 req_builder = req_builder.header("x-ms-encryption-key", param_value.to_string());
7104 }
7105 if let Some(param_value) = p_header_x_ms_encryption_key_sha256 {
7106 req_builder = req_builder.header("x-ms-encryption-key-sha256", param_value.to_string());
7107 }
7108 if let Some(param_value) = p_header_x_ms_encryption_algorithm {
7109 req_builder = req_builder.header("x-ms-encryption-algorithm", param_value.to_string());
7110 }
7111 if let Some(param_value) = p_header_x_ms_encryption_scope {
7112 req_builder = req_builder.header("x-ms-encryption-scope", param_value.to_string());
7113 }
7114 if let Some(param_value) = p_header_x_ms_lease_id {
7115 req_builder = req_builder.header("x-ms-lease-id", param_value.to_string());
7116 }
7117 if let Some(param_value) = p_header_x_ms_if_sequence_number_le {
7118 req_builder = req_builder.header("x-ms-if-sequence-number-le", param_value.to_string());
7119 }
7120 if let Some(param_value) = p_header_x_ms_if_sequence_number_lt {
7121 req_builder = req_builder.header("x-ms-if-sequence-number-lt", param_value.to_string());
7122 }
7123 if let Some(param_value) = p_header_x_ms_if_sequence_number_eq {
7124 req_builder = req_builder.header("x-ms-if-sequence-number-eq", param_value.to_string());
7125 }
7126 if let Some(param_value) = p_header_if_modified_since {
7127 req_builder = req_builder.header("If-Modified-Since", param_value.to_string());
7128 }
7129 if let Some(param_value) = p_header_if_unmodified_since {
7130 req_builder = req_builder.header("If-Unmodified-Since", param_value.to_string());
7131 }
7132 if let Some(param_value) = p_header_if_none_match {
7133 req_builder = req_builder.header("If-None-Match", param_value.to_string());
7134 }
7135 if let Some(param_value) = p_header_if_match {
7136 req_builder = req_builder.header("If-Match", param_value.to_string());
7137 }
7138 if let Some(param_value) = p_header_x_ms_if_tags {
7139 req_builder = req_builder.header("x-ms-if-tags", param_value.to_string());
7140 }
7141 if let Some(param_value) = p_header_x_ms_source_if_modified_since {
7142 req_builder = req_builder.header("x-ms-source-if-modified-since", param_value.to_string());
7143 }
7144 if let Some(param_value) = p_header_x_ms_source_if_unmodified_since {
7145 req_builder =
7146 req_builder.header("x-ms-source-if-unmodified-since", param_value.to_string());
7147 }
7148 if let Some(param_value) = p_header_x_ms_source_if_match {
7149 req_builder = req_builder.header("x-ms-source-if-match", param_value.to_string());
7150 }
7151 if let Some(param_value) = p_header_x_ms_source_if_none_match {
7152 req_builder = req_builder.header("x-ms-source-if-none-match", param_value.to_string());
7153 }
7154 if let Some(param_value) = p_header_x_ms_copy_source_authorization {
7155 req_builder = req_builder.header("x-ms-copy-source-authorization", param_value.to_string());
7156 }
7157 if let Some(param_value) = p_header_x_ms_file_request_intent {
7158 req_builder = req_builder.header("x-ms-file-request-intent", param_value.to_string());
7159 }
7160 req_builder = req_builder.header("x-ms-page-write", p_header_x_ms_page_write.to_string());
7161 if let Some(param_value) = p_header_x_ms_client_request_id {
7162 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
7163 }
7164 if let Some(ref token) = configuration.oauth_access_token {
7165 req_builder = req_builder.bearer_auth(token.to_owned());
7166 };
7167
7168 let req = req_builder.build()?;
7169 let resp = configuration.client.execute(req).await?;
7170
7171 let status = resp.status();
7172
7173 if !status.is_client_error() && !status.is_server_error() {
7174 Ok(())
7175 } else {
7176 let content = resp.text().await?;
7177 let entity: Option<PageBlobUploadPagesFromUrlError> = serde_json::from_str(&content).ok();
7178 Err(Error::ResponseError(ResponseContent {
7179 status,
7180 content,
7181 entity,
7182 }))
7183 }
7184}
7185
7186pub async fn set_properties(
7188 configuration: &configuration::Configuration,
7189 x_ms_version: &str,
7190 storage_service_properties: models::StorageServiceProperties,
7191 timeout: Option<i32>,
7192 x_ms_client_request_id: Option<&str>,
7193) -> Result<(), Error<SetPropertiesError>> {
7194 let p_header_x_ms_version = x_ms_version;
7196 let p_body_storage_service_properties = storage_service_properties;
7197 let p_query_timeout = timeout;
7198 let p_header_x_ms_client_request_id = x_ms_client_request_id;
7199
7200 let uri_str = format!(
7201 "{}/?restype=service&comp=properties",
7202 configuration.base_path
7203 );
7204 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7205
7206 if let Some(ref param_value) = p_query_timeout {
7207 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
7208 }
7209 if let Some(ref user_agent) = configuration.user_agent {
7210 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7211 }
7212 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
7213 if let Some(param_value) = p_header_x_ms_client_request_id {
7214 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
7215 }
7216 if let Some(ref token) = configuration.oauth_access_token {
7217 req_builder = req_builder.bearer_auth(token.to_owned());
7218 };
7219 req_builder = req_builder.json(&p_body_storage_service_properties);
7220
7221 let req = req_builder.build()?;
7222 let resp = configuration.client.execute(req).await?;
7223
7224 let status = resp.status();
7225
7226 if !status.is_client_error() && !status.is_server_error() {
7227 Ok(())
7228 } else {
7229 let content = resp.text().await?;
7230 let entity: Option<SetPropertiesError> = serde_json::from_str(&content).ok();
7231 Err(Error::ResponseError(ResponseContent {
7232 status,
7233 content,
7234 entity,
7235 }))
7236 }
7237}
7238
7239pub async fn submit_batch(
7241 configuration: &configuration::Configuration,
7242 x_ms_version: &str,
7243 content_length: i64,
7244 name: &str,
7245 body: std::path::PathBuf,
7246 timeout: Option<i32>,
7247 x_ms_client_request_id: Option<&str>,
7248) -> Result<String, Error<SubmitBatchError>> {
7249 let p_header_x_ms_version = x_ms_version;
7251 let p_header_content_length = content_length;
7252 let p_form_name = name;
7253 let _p_form_body = body;
7254 let p_query_timeout = timeout;
7255 let p_header_x_ms_client_request_id = x_ms_client_request_id;
7256
7257 let uri_str = format!("{}/?comp=batch", configuration.base_path);
7258 let mut req_builder = configuration
7259 .client
7260 .request(reqwest::Method::POST, &uri_str);
7261
7262 if let Some(ref param_value) = p_query_timeout {
7263 req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]);
7264 }
7265 if let Some(ref user_agent) = configuration.user_agent {
7266 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7267 }
7268 req_builder = req_builder.header("x-ms-version", p_header_x_ms_version.to_string());
7269 if let Some(param_value) = p_header_x_ms_client_request_id {
7270 req_builder = req_builder.header("x-ms-client-request-id", param_value.to_string());
7271 }
7272 req_builder = req_builder.header("Content-Length", p_header_content_length.to_string());
7273 if let Some(ref token) = configuration.oauth_access_token {
7274 req_builder = req_builder.bearer_auth(token.to_owned());
7275 };
7276 let mut multipart_form = reqwest::multipart::Form::new();
7277 multipart_form = multipart_form.text("name", p_form_name.to_string());
7278 req_builder = req_builder.multipart(multipart_form);
7280
7281 let req = req_builder.build()?;
7282 let resp = configuration.client.execute(req).await?;
7283
7284 let status = resp.status();
7285 let content_type = resp
7286 .headers()
7287 .get("content-type")
7288 .and_then(|v| v.to_str().ok())
7289 .unwrap_or("application/octet-stream");
7290 let content_type = super::ContentType::from(content_type);
7291
7292 if !status.is_client_error() && !status.is_server_error() {
7293 let content = resp.text().await?;
7294 match content_type {
7295 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7296 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `String`"))),
7297 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))),
7298 }
7299 } else {
7300 let content = resp.text().await?;
7301 let entity: Option<SubmitBatchError> = serde_json::from_str(&content).ok();
7302 Err(Error::ResponseError(ResponseContent {
7303 status,
7304 content,
7305 entity,
7306 }))
7307 }
7308}