ventureinkorea 0.1.2

Async Rust client for the VentureInKorea API -- Korean venture companies, startup glossary, and ecosystem guides.
Documentation
use serde::{Deserialize, Serialize};

/// Paginated API response wrapper.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PaginatedResponse<T> {
    /// Total number of results across all pages.
    pub count: u64,
    /// URL of the next page, if any.
    pub next: Option<String>,
    /// URL of the previous page, if any.
    pub previous: Option<String>,
    /// Results for the current page.
    pub results: Vec<T>,
}

/// A Korean venture/startup glossary term.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GlossaryTerm {
    /// Display name.
    pub name: String,
    /// URL-friendly slug.
    pub slug: String,
    /// Definition text.
    #[serde(default)]
    pub definition: String,
    /// Category (e.g. "legal", "investment", "government").
    #[serde(default)]
    pub category: String,
    /// Related term slugs.
    #[serde(default)]
    pub related_terms: Vec<String>,
    /// Canonical URL.
    #[serde(default)]
    pub url: String,
}

/// A blog post about the Korean startup ecosystem.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BlogPost {
    /// Post title.
    pub title: String,
    /// URL-friendly slug.
    pub slug: String,
    /// Short excerpt.
    #[serde(default)]
    pub excerpt: String,
    /// Full content (HTML or Markdown).
    #[serde(default)]
    pub content: String,
    /// Post category.
    #[serde(default)]
    pub category: String,
    /// ISO 8601 publication date.
    #[serde(default)]
    pub published_at: String,
    /// Associated FAQs.
    #[serde(default)]
    pub faqs: Vec<Faq>,
    /// Canonical URL.
    #[serde(default)]
    pub url: String,
}

/// A venture-certified company (벤처인증기업).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Company {
    /// Unique numeric identifier.
    pub id: u64,
    /// Company name.
    pub name: String,
    /// Company description.
    #[serde(default)]
    pub description: String,
    /// Industry sector.
    #[serde(default)]
    pub industry: String,
    /// Certification track (VC investment, R&D, innovation growth).
    #[serde(default)]
    pub certification_type: String,
    /// Year founded.
    pub founded_year: Option<u32>,
    /// Canonical URL.
    #[serde(default)]
    pub url: String,
}

/// A blog post category.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PostCategory {
    /// Category name.
    pub name: String,
    /// URL-friendly slug.
    pub slug: String,
    /// Number of posts in this category.
    #[serde(default)]
    pub post_count: u64,
}

/// A frequently asked question.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Faq {
    /// Question text.
    pub question: String,
    /// Answer text.
    pub answer: String,
    /// Source content type.
    #[serde(default)]
    pub source_type: String,
    /// Source content slug.
    #[serde(default)]
    pub source_slug: String,
}

/// Platform-wide statistics.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PlatformStats {
    /// Total number of venture companies.
    #[serde(default)]
    pub total_companies: u64,
    /// Total number of blog posts.
    #[serde(default)]
    pub total_posts: u64,
    /// Total number of glossary terms.
    #[serde(default)]
    pub total_terms: u64,
    /// Total number of FAQs.
    #[serde(default)]
    pub total_faqs: u64,
}

/// A unified search result item.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SearchResultItem {
    /// Item name.
    pub name: String,
    /// URL-friendly slug.
    pub slug: String,
    /// Content type (post, term, company).
    #[serde(rename = "type")]
    pub result_type: String,
    /// Canonical URL.
    #[serde(default)]
    pub url: String,
}

/// Response from the search endpoint.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SearchResponse {
    /// Search result items.
    pub results: Vec<SearchResultItem>,
    /// Original query string.
    pub query: String,
    /// Total number of matches.
    pub total: u64,
}

/// An autocomplete suggestion.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AutocompleteItem {
    /// Suggestion name.
    pub name: String,
    /// URL-friendly slug.
    pub slug: String,
    /// Content type.
    #[serde(rename = "type")]
    pub item_type: String,
}

/// Response from the autocomplete endpoint.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AutocompleteResponse {
    /// Suggestions.
    pub suggestions: Vec<AutocompleteItem>,
    /// Original query string.
    pub query: String,
}