/*
* img-src API
*
* Image processing and delivery API. A serverless image processing and delivery API built on Cloudflare Workers with parameter-driven image transformation and on-demand transcoding. ## Features - **Image Upload**: Store original images in R2 with SHA256-based deduplication - **On-Demand Transformation**: Resize, crop, and convert images via URL parameters - **Format Conversion**: WebP, AVIF, JPEG, PNG output formats - **Path Organization**: Organize images into folders with multiple paths per image - **CDN Caching**: Automatic edge caching for transformed images ## Authentication Authenticate using API Keys with `imgsrc_` prefix. Create your API key at https://img-src.io/settings ## Rate Limiting - **Free Plan**: 100 requests/minute - **Pro Plan**: 500 requests/minute Rate limit headers are included in all responses.
*
* The version of the OpenAPI document: 1.0.0
* Contact: taehun@taehun.dev
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SearchResult {
/// Image ID
#[serde(rename = "id")]
pub id: String,
/// Original filename
#[serde(rename = "original_filename")]
pub original_filename: String,
/// Sanitized filename
#[serde(rename = "sanitized_filename", skip_serializing_if = "Option::is_none")]
pub sanitized_filename: Option<String>,
/// All paths for this image
#[serde(rename = "paths")]
pub paths: Vec<String>,
/// Image visibility (public or private)
#[serde(rename = "visibility")]
pub visibility: String,
/// File size in bytes
#[serde(rename = "size")]
pub size: i64,
/// Upload timestamp
#[serde(rename = "uploaded_at")]
pub uploaded_at: String,
/// API endpoint URL
#[serde(rename = "url")]
pub url: String,
/// CDN URL
#[serde(rename = "cdn_url", skip_serializing_if = "Option::is_none")]
pub cdn_url: Option<String>,
}
impl SearchResult {
pub fn new(
id: String,
original_filename: String,
paths: Vec<String>,
visibility: String,
size: i64,
uploaded_at: String,
url: String,
) -> SearchResult {
SearchResult {
id,
original_filename,
sanitized_filename: None,
paths,
visibility,
size,
uploaded_at,
url,
cdn_url: None,
}
}
}