/*
* 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). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
*
* The version of the OpenAPI document: 1.529.1
* 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 UploadFileRequest {
#[serde(rename = "accountId")]
pub account_id: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "contentType")]
pub content_type: String,
/// Target folder; the root when omitted.
#[serde(rename = "parentId", skip_serializing_if = "Option::is_none")]
pub parent_id: Option<String>,
#[serde(rename = "url")]
pub url: String,
/// Google Drive only: import the bytes as a Docs, Sheets or Slides file (a text or Office file becomes an editable document). OneDrive answers 400.
#[serde(rename = "convertTo", skip_serializing_if = "Option::is_none")]
pub convert_to: Option<ConvertTo>,
}
impl UploadFileRequest {
pub fn new(
account_id: String,
name: String,
content_type: String,
url: String,
) -> UploadFileRequest {
UploadFileRequest {
account_id,
name,
content_type,
parent_id: None,
url,
convert_to: None,
}
}
}
/// Google Drive only: import the bytes as a Docs, Sheets or Slides file (a text or Office file becomes an editable document). OneDrive answers 400.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ConvertTo {
#[serde(rename = "application/vnd.google-apps.document")]
ApplicationSlashVndGoogleAppsDocument,
#[serde(rename = "application/vnd.google-apps.spreadsheet")]
ApplicationSlashVndGoogleAppsSpreadsheet,
#[serde(rename = "application/vnd.google-apps.presentation")]
ApplicationSlashVndGoogleAppsPresentation,
}
impl Default for ConvertTo {
fn default() -> ConvertTo {
Self::ApplicationSlashVndGoogleAppsDocument
}
}