1use bytes::Bytes;
2
3use super::{FileUploadProgressPolicy, FileUploadUrls};
4
5#[derive(Debug, Clone)]
7pub struct HttpRequest {
8 pub method: String, pub url: String,
10 pub headers: Vec<(String, String)>,
11 pub body: Option<Bytes>,
12}
13
14#[derive(Debug, Clone)]
16pub struct HttpResponse {
17 pub status: u16,
18 pub headers: Vec<(String, String)>,
19 pub body: Bytes,
20}
21
22#[derive(Debug, Clone)]
24pub struct FileUploadRequest {
25 pub local_path: String,
26 pub object_key: String,
27 pub method: String,
28 pub urls: FileUploadUrls,
29 pub headers: Vec<(String, String)>,
30 pub content_type: Option<String>,
31 pub size: Option<u64>,
32}
33
34impl FileUploadRequest {
35 pub fn progress_policy(&self) -> FileUploadProgressPolicy {
37 self.urls.progress_policy()
38 }
39}
40
41#[derive(Debug, Clone)]
43pub struct FileUploadResponse {
44 pub object_key: String,
45 pub public_url: String,
46 pub etag: Option<String>,
47}