mangadex_api::v5::upload::upload_session_id::commit

Module post

Source
Expand description

Builder for committing an active upload session.

https://api.mangadex.org/docs/swagger.html#/Upload/commit-upload-session

§Examples

use uuid::Uuid;

use mangadex_api_types::Language;
use mangadex_api::v5::MangaDexClient;
// use mangadex_api_types::{Password, Username};

let client = MangaDexClient::default();

/*

    let _login_res = client
        .auth()
        .login()
        .post()
        .username(Username::parse("myusername")?)
        .password(Password::parse("hunter23")?)
        .send()
        .await?;

 */

let session_id = Uuid::new_v4();
let res = client
    .upload()
    .upload_session_id(session_id)
    .commit()
    .post()
    .volume(Some("1".to_string()))
    .chapter(Some("1".to_string()))
    .title(Some("Chapter Title".to_string()))
    .translated_language(Language::English)
    .send()
    .await?;

println!("commit upload session: {:?}", res);

Structs§