/*
* 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.168.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// RedditPost : A normalized Reddit post returned by the feed and search endpoints
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RedditPost {
/// Reddit post ID (without type prefix)
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
/// Reddit fullname (e.g. t3_abc123)
#[serde(rename = "fullname", skip_serializing_if = "Option::is_none")]
pub fullname: Option<String>,
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
#[serde(rename = "author", skip_serializing_if = "Option::is_none")]
pub author: Option<String>,
#[serde(rename = "subreddit", skip_serializing_if = "Option::is_none")]
pub subreddit: Option<String>,
/// Post URL (may be a gallery URL, external link, or self-post URL)
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
/// Full permalink to the Reddit post
#[serde(rename = "permalink", skip_serializing_if = "Option::is_none")]
pub permalink: Option<String>,
/// Self-post body text (empty string for link posts)
#[serde(rename = "selftext", skip_serializing_if = "Option::is_none")]
pub selftext: Option<String>,
/// Unix timestamp of post creation
#[serde(rename = "createdUtc", skip_serializing_if = "Option::is_none")]
pub created_utc: Option<f64>,
#[serde(rename = "score", skip_serializing_if = "Option::is_none")]
pub score: Option<i32>,
#[serde(rename = "numComments", skip_serializing_if = "Option::is_none")]
pub num_comments: Option<i32>,
/// Whether the post is marked NSFW
#[serde(rename = "over18", skip_serializing_if = "Option::is_none")]
pub over18: Option<bool>,
#[serde(rename = "stickied", skip_serializing_if = "Option::is_none")]
pub stickied: Option<bool>,
/// Link flair text if set
#[serde(
rename = "flairText",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub flair_text: Option<Option<String>>,
/// Whether the post is a gallery with multiple images
#[serde(rename = "isGallery", skip_serializing_if = "Option::is_none")]
pub is_gallery: Option<bool>,
/// Individual image URLs for gallery posts (only present when isGallery is true)
#[serde(rename = "galleryImages", skip_serializing_if = "Option::is_none")]
pub gallery_images: Option<Vec<String>>,
}
impl RedditPost {
/// A normalized Reddit post returned by the feed and search endpoints
pub fn new() -> RedditPost {
RedditPost {
id: None,
fullname: None,
title: None,
author: None,
subreddit: None,
url: None,
permalink: None,
selftext: None,
created_utc: None,
score: None,
num_comments: None,
over18: None,
stickied: None,
flair_text: None,
is_gallery: None,
gallery_images: None,
}
}
}