mangadex_api/v5/
upload.rsuse uuid::Uuid;
use crate::v5::cover::manga_id::post::UploadCoverBuilder;
use crate::HttpClientRef;
pub mod begin;
pub mod check_approval_required;
pub mod get;
pub mod upload_session_id;
use self::begin::BeginEndpoint;
use self::check_approval_required::CheckApprovalRequiredEndpoint;
use self::get::GetUploadSessionBuilder;
use self::upload_session_id::UploadSessionIdEndpoint;
#[derive(Debug)]
pub struct UploadBuilder {
http_client: HttpClientRef,
}
impl UploadBuilder {
#[doc(hidden)]
pub(crate) fn new(http_client: HttpClientRef) -> Self {
Self { http_client }
}
pub fn cover(&self, manga_id: Uuid) -> UploadCoverBuilder {
UploadCoverBuilder::default()
.manga_id(manga_id)
.http_client(self.http_client.clone())
}
pub fn get(&self) -> GetUploadSessionBuilder {
GetUploadSessionBuilder::default().http_client(self.http_client.clone())
}
pub fn begin(&self) -> BeginEndpoint {
BeginEndpoint::new(self.http_client.clone())
}
pub fn upload_session_id(&self, upload_session_id: Uuid) -> UploadSessionIdEndpoint {
UploadSessionIdEndpoint::new(self.http_client.clone(), upload_session_id)
}
pub fn check_approval_required(&self) -> CheckApprovalRequiredEndpoint {
CheckApprovalRequiredEndpoint::new(self.http_client.clone())
}
}