one_doc

Rust API bindings - one_doc

1 unstable release

0.1.1 Feb 13, 2024

MIT license

33KB
708 lines

one_doc rust

Onedoc is the document API for developers.

Authentication

use one_doc::SidekoClient;

let client = SidekoClient::default().with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined"));

post_api_docs_generate

This route is responsible for generating a PDF from a bucket. It expects a JSON body with details of the bucket, user credentials, and PDF generation options.

use one_doc::SidekoClient;
use one_doc::request_types::*;
use one_doc::schemas::*;
let client = SidekoClient::default()
    .with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client
    .post_api_docs_generate(PostApiDocsGenerateRequest {
        data: PostApiDocsGenerateBody {
            ..Default::default()
        },
    });

post_api_docs_initiate

This endpoint creates a bucket for the html and all specified assets. It returns signed urls to the buckets.

use one_doc::SidekoClient;
use one_doc::request_types::*;
use one_doc::schemas::*;
let client = SidekoClient::default()
    .with_api_key_auth(&std::env::var("API_KEY").expect("API key not defined"));
let response = client
    .post_api_docs_initiate(PostApiDocsInitiateRequest {
        data: PostApiDocsInitiateBody {
            ..Default::default()
        },
    });

Dependencies

~5–16MB
~222K SLoC