/*
* Zernio API
*
* API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
*
* The version of the OpenAPI document: 1.0.4
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetMediaPresignedUrlRequest {
/// Name of the file to upload
#[serde(rename = "filename")]
pub filename: String,
/// MIME type of the file
#[serde(rename = "contentType")]
pub content_type: ContentType,
/// Optional file size in bytes for pre-validation (max 5GB)
#[serde(rename = "size", skip_serializing_if = "Option::is_none")]
pub size: Option<i32>,
}
impl GetMediaPresignedUrlRequest {
pub fn new(filename: String, content_type: ContentType) -> GetMediaPresignedUrlRequest {
GetMediaPresignedUrlRequest {
filename,
content_type,
size: None,
}
}
}
/// MIME type of the file
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ContentType {
#[serde(rename = "image/jpeg")]
ImageSlashJpeg,
#[serde(rename = "image/jpg")]
ImageSlashJpg,
#[serde(rename = "image/png")]
ImageSlashPng,
#[serde(rename = "image/webp")]
ImageSlashWebp,
#[serde(rename = "image/gif")]
ImageSlashGif,
#[serde(rename = "video/mp4")]
VideoSlashMp4,
#[serde(rename = "video/mpeg")]
VideoSlashMpeg,
#[serde(rename = "video/quicktime")]
VideoSlashQuicktime,
#[serde(rename = "video/avi")]
VideoSlashAvi,
#[serde(rename = "video/x-msvideo")]
VideoSlashXMsvideo,
#[serde(rename = "video/webm")]
VideoSlashWebm,
#[serde(rename = "video/x-m4v")]
VideoSlashXM4v,
#[serde(rename = "application/pdf")]
ApplicationSlashPdf,
#[serde(rename = "audio/mpeg")]
AudioSlashMpeg,
#[serde(rename = "audio/mp4")]
AudioSlashMp4,
#[serde(rename = "audio/aac")]
AudioSlashAac,
#[serde(rename = "audio/ogg")]
AudioSlashOgg,
#[serde(rename = "audio/wav")]
AudioSlashWav,
#[serde(rename = "audio/webm")]
AudioSlashWebm,
#[serde(rename = "audio/x-m4a")]
AudioSlashXM4a,
}
impl Default for ContentType {
fn default() -> ContentType {
Self::ImageSlashJpeg
}
}