mangadex_api/v5/
settings.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//! Settings endpoint handler.
//!
//! <https://api.mangadex.org/docs/swagger.html#/Settings>

pub mod get;
pub mod post;
pub mod template;

use crate::HttpClientRef;
use get::GetUserSettingsBuilder;
use post::CreateOrUpdateUserSettingsBuilder;
use template::SettingsTemplateBuilder;

/// Settings endpoint handler builder.
#[derive(Debug)]
pub struct SettingsBuilder {
    #[allow(unused)]
    http_client: HttpClientRef,
}

impl SettingsBuilder {
    #[doc(hidden)]
    pub(crate) fn new(http_client: HttpClientRef) -> Self {
        Self { http_client }
    }

    pub fn get(&self) -> GetUserSettingsBuilder {
        GetUserSettingsBuilder::default().http_client(self.http_client.clone())
    }
    pub fn post(&self) -> CreateOrUpdateUserSettingsBuilder {
        CreateOrUpdateUserSettingsBuilder::default().http_client(self.http_client.clone())
    }
    pub fn template(&self) -> SettingsTemplateBuilder {
        SettingsTemplateBuilder::new(self.http_client.clone())
    }
}