Skip to main content

Module post

Module post 

Source
Expand description

Post model for Ghost API.

Represents a post/article in Ghost with all its associated metadata, content, and relationships.

§Example

use ghost_io_api::models::post::{Post, PostStatus};

// Typically posts come from API responses
let post = Post {
    id: "5ddc9141c35e7700383b2937".to_string(),
    uuid: Some("a5aa9bd8-ea31-415c-b452-3040dae1e730".to_string()),
    title: "Welcome".to_string(),
    slug: "welcome-short".to_string(),
    status: PostStatus::Published,
    visibility: Some("public".to_string()),
    created_at: Some("2019-11-26T02:43:13.000Z".to_string()),
    updated_at: Some("2019-11-26T02:44:17.000Z".to_string()),
    published_at: Some("2019-11-26T02:44:17.000Z".to_string()),
    // ... other fields
    ..Default::default()
};

assert_eq!(post.status, PostStatus::Published);
assert!(post.is_published());

Structs§

AuthorRef
Reference to an author by id or email, used when creating/updating posts.
Post
A Ghost post/article.
PostCreate
Input model for creating a new Ghost post via POST /ghost/api/admin/posts/.
PostCreateEnvelope
Request envelope for POST /ghost/api/admin/posts/.
PostUpdate
Input model for updating an existing Ghost post via PUT /ghost/api/admin/posts/{id}/.
PostUpdateEnvelope
Request envelope for PUT /ghost/api/admin/posts/{id}/.
TagRef
Reference to a tag by name or slug, used when creating/updating posts.

Enums§

PostStatus
Status of a Ghost post.