Crate cscart_rs

Source
Expand description

§About

Cscart-rs is an sdk for using the cscart rest api

This library is a work in process and so not all entities are supported for the v1 release

§Example

use cscart_rs::prelude::*;
use cscart_rs::Client;
use serde_json::Value;
use anyhow;
use cscart_rs::GetAllCategoryResponse;

async fn get_categories() -> anyhow::Result<GetAllCategoryResponse> {
    let client = Client::new()
        .host("http://my-ecommerce-site.com")
        .username("my-user-email@email.com")
        .api_key("user-api-key");

    let categories = client
        .category()
        .get_all(GetAllOptions::default()).await;

    categories
}

Modules§

prelude

Macros§

impl_create_method
impl_delete_by_id_method
impl_get_all_entity_method
impl_get_all_method
impl_get_by_id_method
impl_update_by_id_method

Structs§

Client
Configure an api client to perform requests
CreateCategoryResponse
GetAllCategoryResponse
GetAllProductsResponse
UpdateCategoryResponse