tosho_mplus/proto/
mod.rs

1//! A module containing all the models/proto mapping used in the library.
2//!
3//! The following module contains almost all the proto models used in the original app.
4//! Including all the outdated/unused/deprecated models for preservation purpose.
5//!
6//! This module is manually created, if something is missing or broken, please [open an issue](https://github.com/noaione/tosho-mango/issues/new/choose)
7//! or a [pull request](https://github.com/noaione/tosho-mango/compare).
8
9#![allow(clippy::derive_partial_eq_without_eq)]
10#![warn(clippy::missing_docs_in_private_items)]
11
12use tosho_macros::AutoGetter;
13
14pub mod accounts;
15pub mod chapters;
16pub mod comments;
17pub mod common;
18pub mod enums;
19pub mod home_view;
20pub mod others;
21pub mod titles;
22
23pub use accounts::*;
24pub use chapters::*;
25pub use comments::*;
26pub use common::*;
27pub use enums::*;
28pub use home_view::*;
29pub use others::*;
30pub use titles::*;
31
32/// Indicate a success response
33///
34/// Depending on the request type, not all field will be available.
35#[derive(Clone, AutoGetter, PartialEq, ::prost::Message)]
36#[auto_getters(cloned = true)]
37pub struct SuccessResponse {
38    /// Is this a featured manga request or this have featured manga list
39    #[prost(bool, optional, tag = "1")]
40    #[skip_field]
41    featured: ::core::option::Option<bool>,
42    /// Registration response information
43    #[prost(message, optional, tag = "2")]
44    registration: ::core::option::Option<RegistrationData>,
45    /// The homepage view, v1 implementation
46    #[prost(message, optional, tag = "3")]
47    home_view: ::core::option::Option<HomeView>,
48    /// The list of featured titles
49    #[prost(message, optional, tag = "4")]
50    featured_titles: ::core::option::Option<FeaturedTitles>,
51    /// The list of all titles
52    #[prost(message, optional, tag = "5")]
53    all_titles: ::core::option::Option<TitleListOnly>,
54    /// The list of titles ranked depending on the request
55    #[prost(message, optional, tag = "6")]
56    title_ranking: ::core::option::Option<TitleListOnly>,
57    /// The current user subscribed ro favorited titles
58    #[prost(message, optional, tag = "7")]
59    subscribed_titles: ::core::option::Option<TitleListOnly>,
60    /// Information about a title
61    #[prost(message, optional, tag = "8")]
62    title_detail: ::core::option::Option<TitleDetail>,
63    /// The list of comments on a chapter
64    #[prost(message, optional, tag = "9")]
65    comment_list: ::core::option::Option<CommentList>,
66    /// The chapter viewer information
67    #[prost(message, optional, tag = "10")]
68    chapter_viewer: ::core::option::Option<ChapterViewer>,
69    /// The web version of homepage view, v1 implementation
70    #[prost(message, optional, tag = "11")]
71    web_home_view: ::core::option::Option<WebHomeView>,
72    /// The user settings information
73    #[prost(message, optional, tag = "12")]
74    user_settings: ::core::option::Option<UserSettings>,
75    /// The user profile settings information
76    #[prost(message, optional, tag = "13")]
77    user_profile_settings: ::core::option::Option<UserProfileSettings>,
78    /// The update profile result
79    #[prost(message, optional, tag = "14")]
80    update_profile_result: ::core::option::Option<UserUpdateProfileResult>,
81    /// The current service announcement, usually used for maintenance notice
82    #[prost(message, optional, tag = "15")]
83    service_announcements: ::core::option::Option<ServiceAnnouncements>,
84    /// Initial view response, used when booting up the app
85    #[prost(message, optional, tag = "16")]
86    initial_view: ::core::option::Option<InitialView>,
87    /// The feedback response
88    #[prost(message, optional, tag = "17")]
89    feedback_view: ::core::option::Option<FeedbackList>,
90    /// The publisher news list
91    #[prost(message, optional, tag = "18")]
92    publisher_news_list: ::core::option::Option<PublisherNewsList>,
93    /// Questionnaire response
94    #[prost(message, optional, tag = "19")]
95    questionnaire: ::core::option::Option<QuestionnaireResponse>,
96    /// The current title updates
97    #[prost(message, optional, tag = "20")]
98    title_updates: ::core::option::Option<TitleUpdates>,
99    /// The homepage view, v2 implementation
100    #[prost(message, optional, tag = "21")]
101    home_view_v2: ::core::option::Option<HomeViewV2>,
102    /// The updated titles list
103    #[prost(message, optional, tag = "22")]
104    updated_titles: ::core::option::Option<UpdatedTitleList>,
105    /// Title that can be read with tickets
106    #[prost(message, optional, tag = "23")]
107    title_tickets: ::core::option::Option<TitleTicketList>,
108    /// The homepage view, v3 implementation
109    ///
110    /// Currently used in the app
111    #[prost(message, optional, tag = "24")]
112    home_view_v3: ::core::option::Option<HomeViewV3>,
113    /// The list of all titles, v2 implementation
114    ///
115    /// Currently used in the app
116    #[prost(message, optional, tag = "25")]
117    all_titles_v2: ::core::option::Option<TitleListOnlyV2>,
118    /// User settings information, v2 implementation
119    ///
120    /// Currently used in the app
121    #[prost(message, optional, tag = "26")]
122    user_settings_v2: ::core::option::Option<UserSettingsV2>,
123    /// The latest title updates, v2 implementation
124    ///
125    /// Currently used in the app
126    #[prost(message, optional, tag = "27")]
127    title_updates_v2: ::core::option::Option<TitleUpdatesV2>,
128    /// Initial view response, used when booting up the app, v2 implementation
129    ///
130    /// Currently used in the app
131    #[prost(message, optional, tag = "28")]
132    initial_view_v2: ::core::option::Option<InitialViewV2>,
133    /// The list of available languages
134    #[prost(message, optional, tag = "29")]
135    languages: ::core::option::Option<Languages>,
136    /// The web version of homepage view, v2 implementation
137    #[prost(message, optional, tag = "30")]
138    web_home_view_v2: ::core::option::Option<WebHomeViewV2>,
139    /// The web version of homepage view, v3 implementation
140    #[prost(message, optional, tag = "31")]
141    web_home_view_v3: ::core::option::Option<WebHomeViewV3>,
142    /// Push token information, used for notification
143    #[prost(message, optional, tag = "32")]
144    push_token: ::core::option::Option<PushTokenResponse>,
145    /// The list of available or free titles to read
146    #[prost(message, optional, tag = "33")]
147    free_titles: ::core::option::Option<FreeTitles>,
148    /// A list of labelled titles
149    ///
150    /// Currently unknown where this is used
151    #[prost(message, optional, tag = "34")]
152    labelled_titles: ::core::option::Option<LabelledTitles>,
153    /// The search results response
154    #[prost(message, optional, tag = "35")]
155    search_results: ::core::option::Option<SearchResults>,
156    /// The user subscription information and all the available subscription
157    #[prost(message, optional, tag = "36")]
158    subscriptions: ::core::option::Option<SubscriptionResponse>,
159    /// Title ranking information, v2 implementation
160    ///
161    /// Currently used in the app
162    #[prost(message, optional, tag = "37")]
163    title_ranking_v2: ::core::option::Option<TitleRankingList>,
164    /// The web version of homepage view, v4 implementation
165    ///
166    /// Currently used in the web version
167    #[prost(message, optional, tag = "38")]
168    web_home_view_v4: ::core::option::Option<WebHomeViewV4>,
169    /// The list of featured titles, v2 implementation
170    ///
171    /// Currently used in the app
172    #[prost(message, optional, tag = "39")]
173    featured_titles_v2: ::core::option::Option<FeaturedTitlesV2>,
174}
175
176/// A success or error response enum
177///
178/// This is used like `oneOf` in Protobuf so only one of them will be available.
179#[derive(Clone, PartialEq, ::prost::Oneof)]
180pub enum SuccessOrError {
181    /// A [`Box`]-ed [`SuccessResponse`]
182    ///
183    /// Depending on the API request, only some of them
184    /// would be available to be used.
185    #[prost(message, tag = "1")]
186    Success(Box<SuccessResponse>),
187    /// A [`Box`]-ed [`ErrorResponse`]
188    #[prost(message, tag = "2")]
189    Error(Box<ErrorResponse>),
190}
191
192/// Proto response from the API, wrap a simple `oneOf` of [`SuccessOrError`]
193#[derive(Clone, AutoGetter, PartialEq, ::prost::Message)]
194pub struct Response {
195    /// The one-of API response data
196    #[prost(oneof = "SuccessOrError", tags = "1, 2")]
197    #[deref_clone]
198    response: ::core::option::Option<SuccessOrError>,
199}