/*
* 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.513.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 UpdatePostMetadataRequest {
/// The platform to update metadata on
#[serde(rename = "platform")]
pub platform: Platform,
/// YouTube video ID (required for direct mode, ignored for post-based mode)
#[serde(rename = "videoId", skip_serializing_if = "Option::is_none")]
pub video_id: Option<String>,
/// Zernio account ID. Required for direct mode. In post-based mode, picks which account's copy to update when the post was published to several accounts on this platform (required in that case).
#[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
/// New video title (max 100 characters for YouTube)
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
/// New video description
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// Array of keyword tags (max 500 characters combined for YouTube)
#[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
/// YouTube video category ID
#[serde(rename = "categoryId", skip_serializing_if = "Option::is_none")]
pub category_id: Option<String>,
/// Video privacy setting
#[serde(rename = "privacyStatus", skip_serializing_if = "Option::is_none")]
pub privacy_status: Option<PrivacyStatus>,
/// Public URL of a custom thumbnail image (JPEG, PNG, or GIF, max 50 MB, recommended 1280x720). Works on any video you own, including videos not published through Zernio. The channel must be verified (phone verification) to set custom thumbnails. **Errors:** - 400 with the reason, no field updated: YouTube refuses the thumbnail (e.g. channel without the custom-thumbnail permission, video not owned by the connected channel), or the image URL cannot be fetched or has an unsupported format or size. - 429: YouTube thumbnail rate limit (uploadRateLimitExceeded). Retry later, not immediately, because retries keep the channel over its limit. - 500: any other temporary YouTube or network failure; can be retried.
#[serde(rename = "thumbnailUrl", skip_serializing_if = "Option::is_none")]
pub thumbnail_url: Option<String>,
/// COPPA compliance flag. Set true for child-directed content (restricts comments, notifications, ad targeting).
#[serde(rename = "madeForKids", skip_serializing_if = "Option::is_none")]
pub made_for_kids: Option<bool>,
/// AI-generated content disclosure. Set true if the video contains synthetic content that could be mistaken for real. YouTube may add a label.
#[serde(
rename = "containsSyntheticMedia",
skip_serializing_if = "Option::is_none"
)]
pub contains_synthetic_media: Option<bool>,
/// YouTube playlist ID to add the video to (e.g. 'PLxxxxxxxxxxxxx'). Use GET /v1/accounts/{id}/youtube-playlists to list available playlists. Only playlists owned by the channel are supported.
#[serde(rename = "playlistId", skip_serializing_if = "Option::is_none")]
pub playlist_id: Option<String>,
/// Language of the title and description (BCP-47, e.g. ko).
#[serde(rename = "defaultLanguage", skip_serializing_if = "Option::is_none")]
pub default_language: Option<String>,
/// Spoken language of the video (BCP-47, e.g. ko). When a video has no audio language, YouTube may set en-US once its metadata is updated.
#[serde(
rename = "defaultAudioLanguage",
skip_serializing_if = "Option::is_none"
)]
pub default_audio_language: Option<String>,
}
impl UpdatePostMetadataRequest {
pub fn new(platform: Platform) -> UpdatePostMetadataRequest {
UpdatePostMetadataRequest {
platform,
video_id: None,
account_id: None,
title: None,
description: None,
tags: None,
category_id: None,
privacy_status: None,
thumbnail_url: None,
made_for_kids: None,
contains_synthetic_media: None,
playlist_id: None,
default_language: None,
default_audio_language: None,
}
}
}
/// The platform to update metadata on
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platform {
#[serde(rename = "youtube")]
Youtube,
}
impl Default for Platform {
fn default() -> Platform {
Self::Youtube
}
}
/// Video privacy setting
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PrivacyStatus {
#[serde(rename = "public")]
Public,
#[serde(rename = "private")]
Private,
#[serde(rename = "unlisted")]
Unlisted,
}
impl Default for PrivacyStatus {
fn default() -> PrivacyStatus {
Self::Public
}
}