Skip to main content

utapi_rs/models/
presigned_url.rs

1use serde::{Deserialize, Serialize};
2
3/// A structure representing the options to generate a presigned URL.
4///
5/// This structure holds the necessary information to create a presigned URL
6/// which can be used to access a file without requiring further authentication.
7#[derive(Serialize)]
8pub struct PresignedUrlOpts {
9    /// The unique key of the file for which the presigned URL will be generated.
10    pub file_key: String,
11    /// Optional expiration time in seconds for the presigned URL.
12    /// If `None`, a default value will be used.
13    pub expires_in: Option<i32>,
14}
15
16/// A structure representing the response received after successfully generating
17/// a presigned URL.
18///
19/// This structure is used to deserialize the response from an API call that
20/// generates a presigned URL for accessing a file.
21#[derive(Debug, Deserialize)]
22pub struct PresignedUrlResponse {
23    /// The presigned URL that can be used to access the file.
24    pub url: String,
25}