#management #contentful #sdk #content #entry #space #assets

yanked contentful_management

A Rust SDK for managing entities in Contentful

1 unstable release

0.1.3 Jun 12, 2024
0.1.2 May 24, 2024
0.1.1 May 20, 2024
0.1.0 May 20, 2024

#62 in #entry

Download history

224 downloads per month

GPL-3.0 license

27KB
574 lines

Contentful Management

contentful_management is a Rust library designed for seamless interaction with the Contentful Content Management API. This SDK facilitates the management of entries, assets, spaces, and environments within your Contentful space, supporting operations such as fetching, creating, updating, and deleting content. It is an ideal choice for integrating Contentful into your Rust applications.

Installation

To include the contentful_management library in your project, add the following to your Cargo.toml file:

[dependencies]
contentful_management = "0.1"

Usage

Below is an example of how to create a client and fetch a single entry using this library:

use contentful_management::ContentfulClient;
use tokio;

#[tokio::main]
async fn main() {
    let access_token = "your_access_token";
    let space_id = "your_space_id";
    let environment_id = "your_environment_id";

    let client = ContentfulClient::new(access_token);

    match client.entry.get(&space_id, &environment_id, "entry_id").await {
        Ok(entry) => {
            println!("Single Entry: {:?}", entry);
        }
        Err(e) => {
            eprintln!("Error: {}", e);
        }
    }
}

Dependencies

~4–15MB
~199K SLoC