3 unstable releases
| 0.2.1 | Jun 2, 2024 |
|---|---|
| 0.2.0 | Feb 7, 2024 |
| 0.1.0 | Oct 9, 2023 |
#116 in #pdf
52KB
1K
SLoC
CloudConvert Rust Client
A client library for CloudConvert, built with hapic.
See the docs on docs.rs.
lib.rs:
Creating a client
To create a Client using a bearer token, then create a job:
use cloudconvert::{Client, job};
let client = Client::default_client("your_bearer_token");
client.call(job::Create{
tasks: todo!(),
tag: Some("your_tag".into()),
webhook_url: None,
}).await;
Jobs
Jobs can be crated using the job::Create API call. Jobs consist of a number of named
tasks.
Tasks
A task::Task enum represents one of the following tasks:
Import tasks
task::ImportUrl: Import a document from a URL.task::ImportS3: Import a document from an S3 compatible bucket.task::ImportAzureBlob: Import a document from Azure Blob Storage.task::ImportGoogleCloud: Import a document from Google Cloud Storage.task::ImportOpenStack: Import a document from OpenStack Object Storage (Swift).task::ImportSFTP: Import a document from an SFTP server.
Processing tasks
task::Convert: Convert a document!task::Optimize: Optimize a document.task::Watermark: Watermark a document.task::Thumbnail: Add a thumbnail to a document.task::Merge: Merge multiple documents.task::Archive: Create zip, rar, 7z or tar archives.task::Capture: Capture a website.
Export tasks
task::ExportUrl: Export a document to a URL.task::ExportS3: Export documents to an S3 compatible bucket.task::ExportAzureBlob: Export documents to Azure Blob Storage.task::ExportGoogleCloud: Export documents to Google Cloud Storage.task::ExportOpenStack: Export documents to OpenStack Object Storage (Swift).task::ExportSFTP: Export documents to an SFTP server.
Pre-made jobs
ImportConvertExport: An API call (underneath,job::Create) which creates a job consisting of an import task, convert task, then export task.
Webhooks
Tools for verifying and parsing webhooks can be found within the webhook module.
Dependencies
~8–19MB
~278K SLoC