(
&self,
key: &str,
data: ByteStream,
file_path: Option<&str>,
)
| 78 | } |
| 79 | |
| 80 | async fn upload_object( |
| 81 | &self, |
| 82 | key: &str, |
| 83 | data: ByteStream, |
| 84 | file_path: Option<&str>, |
| 85 | ) -> Result<PutObjectOutput, SdkError<PutObjectError>> { |
| 86 | let key_with_prefix; |
| 87 | if let Some(path) = file_path { |
| 88 | key_with_prefix = format! {"{path}/{key}"}; |
| 89 | } else { |
| 90 | key_with_prefix = key.to_string(); |
| 91 | } |
| 92 | |
| 93 | self.client |
| 94 | .put_object() |
| 95 | .bucket(&self.bucket) |
| 96 | .key(key_with_prefix) |
| 97 | .body(data) |
| 98 | .send() |
| 99 | .await |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | #[async_trait] |
no test coverage detected