1use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum DeleteSeriesFileError {
22 Status400(models::ValidationErrorResponse),
23 UnknownValue(serde_json::Value),
24}
25
26#[derive(Debug, Clone, Serialize, Deserialize)]
28#[serde(untagged)]
29pub enum DownloadSeriesAsZipError {
30 Status400(models::ValidationErrorResponse),
31 UnknownValue(serde_json::Value),
32}
33
34#[derive(Debug, Clone, Serialize, Deserialize)]
36#[serde(untagged)]
37pub enum GetBooksBySeriesIdError {
38 Status400(models::ValidationErrorResponse),
39 UnknownValue(serde_json::Value),
40}
41
42#[derive(Debug, Clone, Serialize, Deserialize)]
44#[serde(untagged)]
45pub enum GetCollectionsBySeriesIdError {
46 Status400(models::ValidationErrorResponse),
47 UnknownValue(serde_json::Value),
48}
49
50#[derive(Debug, Clone, Serialize, Deserialize)]
52#[serde(untagged)]
53pub enum GetSeriesError {
54 Status400(models::ValidationErrorResponse),
55 UnknownValue(serde_json::Value),
56}
57
58#[derive(Debug, Clone, Serialize, Deserialize)]
60#[serde(untagged)]
61pub enum GetSeriesAlphabeticalGroupsError {
62 Status400(models::ValidationErrorResponse),
63 UnknownValue(serde_json::Value),
64}
65
66#[derive(Debug, Clone, Serialize, Deserialize)]
68#[serde(untagged)]
69pub enum GetSeriesAlphabeticalGroupsDeprecatedError {
70 Status400(models::ValidationErrorResponse),
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetSeriesByIdError {
78 Status400(models::ValidationErrorResponse),
79 UnknownValue(serde_json::Value),
80}
81
82#[derive(Debug, Clone, Serialize, Deserialize)]
84#[serde(untagged)]
85pub enum GetSeriesDeprecatedError {
86 Status400(models::ValidationErrorResponse),
87 UnknownValue(serde_json::Value),
88}
89
90#[derive(Debug, Clone, Serialize, Deserialize)]
92#[serde(untagged)]
93pub enum GetSeriesLatestError {
94 Status400(models::ValidationErrorResponse),
95 UnknownValue(serde_json::Value),
96}
97
98#[derive(Debug, Clone, Serialize, Deserialize)]
100#[serde(untagged)]
101pub enum GetSeriesNewError {
102 Status400(models::ValidationErrorResponse),
103 UnknownValue(serde_json::Value),
104}
105
106#[derive(Debug, Clone, Serialize, Deserialize)]
108#[serde(untagged)]
109pub enum GetSeriesUpdatedError {
110 Status400(models::ValidationErrorResponse),
111 UnknownValue(serde_json::Value),
112}
113
114#[derive(Debug, Clone, Serialize, Deserialize)]
116#[serde(untagged)]
117pub enum MarkSeriesAsReadError {
118 Status400(models::ValidationErrorResponse),
119 UnknownValue(serde_json::Value),
120}
121
122#[derive(Debug, Clone, Serialize, Deserialize)]
124#[serde(untagged)]
125pub enum MarkSeriesAsUnreadError {
126 Status400(models::ValidationErrorResponse),
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum SeriesAnalyzeError {
134 Status400(models::ValidationErrorResponse),
135 UnknownValue(serde_json::Value),
136}
137
138#[derive(Debug, Clone, Serialize, Deserialize)]
140#[serde(untagged)]
141pub enum SeriesRefreshMetadataError {
142 Status400(models::ValidationErrorResponse),
143 UnknownValue(serde_json::Value),
144}
145
146#[derive(Debug, Clone, Serialize, Deserialize)]
148#[serde(untagged)]
149pub enum UpdateSeriesMetadataError {
150 Status400(models::ValidationErrorResponse),
151 UnknownValue(serde_json::Value),
152}
153
154
155pub async fn delete_series_file(configuration: &configuration::Configuration, series_id: &str) -> Result<(), Error<DeleteSeriesFileError>> {
157 let p_path_series_id = series_id;
159
160 let uri_str = format!("{}/api/v1/series/{seriesId}/file", configuration.base_path, seriesId=crate::apis::urlencode(p_path_series_id));
161 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
162
163 if let Some(ref user_agent) = configuration.user_agent {
164 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
165 }
166 if let Some(ref apikey) = configuration.api_key {
167 let key = apikey.key.clone();
168 let value = match apikey.prefix {
169 Some(ref prefix) => format!("{} {}", prefix, key),
170 None => key,
171 };
172 req_builder = req_builder.header("X-API-Key", value);
173 };
174 if let Some(ref auth_conf) = configuration.basic_auth {
175 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
176 };
177
178 let req = req_builder.build()?;
179 let resp = configuration.client.execute(req).await?;
180
181 let status = resp.status();
182
183 if !status.is_client_error() && !status.is_server_error() {
184 Ok(())
185 } else {
186 let content = resp.text().await?;
187 let entity: Option<DeleteSeriesFileError> = serde_json::from_str(&content).ok();
188 Err(Error::ResponseError(ResponseContent { status, content, entity }))
189 }
190}
191
192pub async fn download_series_as_zip(configuration: &configuration::Configuration, series_id: &str) -> Result<serde_json::Value, Error<DownloadSeriesAsZipError>> {
194 let p_path_series_id = series_id;
196
197 let uri_str = format!("{}/api/v1/series/{seriesId}/file", configuration.base_path, seriesId=crate::apis::urlencode(p_path_series_id));
198 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
199
200 if let Some(ref user_agent) = configuration.user_agent {
201 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
202 }
203 if let Some(ref apikey) = configuration.api_key {
204 let key = apikey.key.clone();
205 let value = match apikey.prefix {
206 Some(ref prefix) => format!("{} {}", prefix, key),
207 None => key,
208 };
209 req_builder = req_builder.header("X-API-Key", value);
210 };
211 if let Some(ref auth_conf) = configuration.basic_auth {
212 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
213 };
214
215 let req = req_builder.build()?;
216 let resp = configuration.client.execute(req).await?;
217
218 let status = resp.status();
219 let content_type = resp
220 .headers()
221 .get("content-type")
222 .and_then(|v| v.to_str().ok())
223 .unwrap_or("application/octet-stream");
224 let content_type = super::ContentType::from(content_type);
225
226 if !status.is_client_error() && !status.is_server_error() {
227 let content = resp.text().await?;
228 match content_type {
229 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
230 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
231 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
232 }
233 } else {
234 let content = resp.text().await?;
235 let entity: Option<DownloadSeriesAsZipError> = serde_json::from_str(&content).ok();
236 Err(Error::ResponseError(ResponseContent { status, content, entity }))
237 }
238}
239
240pub async fn get_books_by_series_id(configuration: &configuration::Configuration, series_id: &str, media_status: Option<Vec<String>>, read_status: Option<Vec<String>>, tag: Option<Vec<String>>, deleted: Option<bool>, unpaged: Option<bool>, page: Option<i32>, size: Option<i32>, sort: Option<Vec<String>>, author: Option<Vec<String>>) -> Result<models::PageBookDto, Error<GetBooksBySeriesIdError>> {
242 let p_path_series_id = series_id;
244 let p_query_media_status = media_status;
245 let p_query_read_status = read_status;
246 let p_query_tag = tag;
247 let p_query_deleted = deleted;
248 let p_query_unpaged = unpaged;
249 let p_query_page = page;
250 let p_query_size = size;
251 let p_query_sort = sort;
252 let p_query_author = author;
253
254 let uri_str = format!("{}/api/v1/series/{seriesId}/books", configuration.base_path, seriesId=crate::apis::urlencode(p_path_series_id));
255 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
256
257 if let Some(ref param_value) = p_query_media_status {
258 req_builder = match "multi" {
259 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("media_status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
260 _ => req_builder.query(&[("media_status", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
261 };
262 }
263 if let Some(ref param_value) = p_query_read_status {
264 req_builder = match "multi" {
265 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("read_status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
266 _ => req_builder.query(&[("read_status", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
267 };
268 }
269 if let Some(ref param_value) = p_query_tag {
270 req_builder = match "multi" {
271 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("tag".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
272 _ => req_builder.query(&[("tag", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
273 };
274 }
275 if let Some(ref param_value) = p_query_deleted {
276 req_builder = req_builder.query(&[("deleted", ¶m_value.to_string())]);
277 }
278 if let Some(ref param_value) = p_query_unpaged {
279 req_builder = req_builder.query(&[("unpaged", ¶m_value.to_string())]);
280 }
281 if let Some(ref param_value) = p_query_page {
282 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
283 }
284 if let Some(ref param_value) = p_query_size {
285 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
286 }
287 if let Some(ref param_value) = p_query_sort {
288 req_builder = match "multi" {
289 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("sort".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
290 _ => req_builder.query(&[("sort", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
291 };
292 }
293 if let Some(ref param_value) = p_query_author {
294 req_builder = match "multi" {
295 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("author".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
296 _ => req_builder.query(&[("author", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
297 };
298 }
299 if let Some(ref user_agent) = configuration.user_agent {
300 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
301 }
302 if let Some(ref apikey) = configuration.api_key {
303 let key = apikey.key.clone();
304 let value = match apikey.prefix {
305 Some(ref prefix) => format!("{} {}", prefix, key),
306 None => key,
307 };
308 req_builder = req_builder.header("X-API-Key", value);
309 };
310 if let Some(ref auth_conf) = configuration.basic_auth {
311 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
312 };
313
314 let req = req_builder.build()?;
315 let resp = configuration.client.execute(req).await?;
316
317 let status = resp.status();
318 let content_type = resp
319 .headers()
320 .get("content-type")
321 .and_then(|v| v.to_str().ok())
322 .unwrap_or("application/octet-stream");
323 let content_type = super::ContentType::from(content_type);
324
325 if !status.is_client_error() && !status.is_server_error() {
326 let content = resp.text().await?;
327 match content_type {
328 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
329 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PageBookDto`"))),
330 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PageBookDto`")))),
331 }
332 } else {
333 let content = resp.text().await?;
334 let entity: Option<GetBooksBySeriesIdError> = serde_json::from_str(&content).ok();
335 Err(Error::ResponseError(ResponseContent { status, content, entity }))
336 }
337}
338
339pub async fn get_collections_by_series_id(configuration: &configuration::Configuration, series_id: &str) -> Result<Vec<models::CollectionDto>, Error<GetCollectionsBySeriesIdError>> {
340 let p_path_series_id = series_id;
342
343 let uri_str = format!("{}/api/v1/series/{seriesId}/collections", configuration.base_path, seriesId=crate::apis::urlencode(p_path_series_id));
344 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
345
346 if let Some(ref user_agent) = configuration.user_agent {
347 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
348 }
349 if let Some(ref apikey) = configuration.api_key {
350 let key = apikey.key.clone();
351 let value = match apikey.prefix {
352 Some(ref prefix) => format!("{} {}", prefix, key),
353 None => key,
354 };
355 req_builder = req_builder.header("X-API-Key", value);
356 };
357 if let Some(ref auth_conf) = configuration.basic_auth {
358 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
359 };
360
361 let req = req_builder.build()?;
362 let resp = configuration.client.execute(req).await?;
363
364 let status = resp.status();
365 let content_type = resp
366 .headers()
367 .get("content-type")
368 .and_then(|v| v.to_str().ok())
369 .unwrap_or("application/octet-stream");
370 let content_type = super::ContentType::from(content_type);
371
372 if !status.is_client_error() && !status.is_server_error() {
373 let content = resp.text().await?;
374 match content_type {
375 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
376 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::CollectionDto>`"))),
377 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::CollectionDto>`")))),
378 }
379 } else {
380 let content = resp.text().await?;
381 let entity: Option<GetCollectionsBySeriesIdError> = serde_json::from_str(&content).ok();
382 Err(Error::ResponseError(ResponseContent { status, content, entity }))
383 }
384}
385
386pub async fn get_series(configuration: &configuration::Configuration, series_search: models::SeriesSearch, unpaged: Option<bool>, page: Option<i32>, size: Option<i32>, sort: Option<Vec<String>>) -> Result<models::PageSeriesDto, Error<GetSeriesError>> {
387 let p_body_series_search = series_search;
389 let p_query_unpaged = unpaged;
390 let p_query_page = page;
391 let p_query_size = size;
392 let p_query_sort = sort;
393
394 let uri_str = format!("{}/api/v1/series/list", configuration.base_path);
395 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
396
397 if let Some(ref param_value) = p_query_unpaged {
398 req_builder = req_builder.query(&[("unpaged", ¶m_value.to_string())]);
399 }
400 if let Some(ref param_value) = p_query_page {
401 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
402 }
403 if let Some(ref param_value) = p_query_size {
404 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
405 }
406 if let Some(ref param_value) = p_query_sort {
407 req_builder = match "multi" {
408 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("sort".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
409 _ => req_builder.query(&[("sort", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
410 };
411 }
412 if let Some(ref user_agent) = configuration.user_agent {
413 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
414 }
415 if let Some(ref apikey) = configuration.api_key {
416 let key = apikey.key.clone();
417 let value = match apikey.prefix {
418 Some(ref prefix) => format!("{} {}", prefix, key),
419 None => key,
420 };
421 req_builder = req_builder.header("X-API-Key", value);
422 };
423 if let Some(ref auth_conf) = configuration.basic_auth {
424 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
425 };
426 req_builder = req_builder.json(&p_body_series_search);
427
428 let req = req_builder.build()?;
429 let resp = configuration.client.execute(req).await?;
430
431 let status = resp.status();
432 let content_type = resp
433 .headers()
434 .get("content-type")
435 .and_then(|v| v.to_str().ok())
436 .unwrap_or("application/octet-stream");
437 let content_type = super::ContentType::from(content_type);
438
439 if !status.is_client_error() && !status.is_server_error() {
440 let content = resp.text().await?;
441 match content_type {
442 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
443 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PageSeriesDto`"))),
444 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PageSeriesDto`")))),
445 }
446 } else {
447 let content = resp.text().await?;
448 let entity: Option<GetSeriesError> = serde_json::from_str(&content).ok();
449 Err(Error::ResponseError(ResponseContent { status, content, entity }))
450 }
451}
452
453pub async fn get_series_alphabetical_groups(configuration: &configuration::Configuration, series_search: models::SeriesSearch) -> Result<Vec<models::GroupCountDto>, Error<GetSeriesAlphabeticalGroupsError>> {
455 let p_body_series_search = series_search;
457
458 let uri_str = format!("{}/api/v1/series/list/alphabetical-groups", configuration.base_path);
459 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
460
461 if let Some(ref user_agent) = configuration.user_agent {
462 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
463 }
464 if let Some(ref apikey) = configuration.api_key {
465 let key = apikey.key.clone();
466 let value = match apikey.prefix {
467 Some(ref prefix) => format!("{} {}", prefix, key),
468 None => key,
469 };
470 req_builder = req_builder.header("X-API-Key", value);
471 };
472 if let Some(ref auth_conf) = configuration.basic_auth {
473 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
474 };
475 req_builder = req_builder.json(&p_body_series_search);
476
477 let req = req_builder.build()?;
478 let resp = configuration.client.execute(req).await?;
479
480 let status = resp.status();
481 let content_type = resp
482 .headers()
483 .get("content-type")
484 .and_then(|v| v.to_str().ok())
485 .unwrap_or("application/octet-stream");
486 let content_type = super::ContentType::from(content_type);
487
488 if !status.is_client_error() && !status.is_server_error() {
489 let content = resp.text().await?;
490 match content_type {
491 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
492 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GroupCountDto>`"))),
493 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GroupCountDto>`")))),
494 }
495 } else {
496 let content = resp.text().await?;
497 let entity: Option<GetSeriesAlphabeticalGroupsError> = serde_json::from_str(&content).ok();
498 Err(Error::ResponseError(ResponseContent { status, content, entity }))
499 }
500}
501
502pub async fn get_series_alphabetical_groups_deprecated(configuration: &configuration::Configuration, search: Option<&str>, library_id: Option<Vec<String>>, collection_id: Option<Vec<String>>, status: Option<Vec<String>>, read_status: Option<Vec<String>>, publisher: Option<Vec<String>>, language: Option<Vec<String>>, genre: Option<Vec<String>>, tag: Option<Vec<String>>, age_rating: Option<Vec<String>>, release_year: Option<Vec<String>>, sharing_label: Option<Vec<String>>, deleted: Option<bool>, complete: Option<bool>, oneshot: Option<bool>, search_regex: Option<&str>, author: Option<Vec<String>>) -> Result<Vec<models::GroupCountDto>, Error<GetSeriesAlphabeticalGroupsDeprecatedError>> {
504 let p_query_search = search;
506 let p_query_library_id = library_id;
507 let p_query_collection_id = collection_id;
508 let p_query_status = status;
509 let p_query_read_status = read_status;
510 let p_query_publisher = publisher;
511 let p_query_language = language;
512 let p_query_genre = genre;
513 let p_query_tag = tag;
514 let p_query_age_rating = age_rating;
515 let p_query_release_year = release_year;
516 let p_query_sharing_label = sharing_label;
517 let p_query_deleted = deleted;
518 let p_query_complete = complete;
519 let p_query_oneshot = oneshot;
520 let p_query_search_regex = search_regex;
521 let p_query_author = author;
522
523 let uri_str = format!("{}/api/v1/series/alphabetical-groups", configuration.base_path);
524 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
525
526 if let Some(ref param_value) = p_query_search {
527 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
528 }
529 if let Some(ref param_value) = p_query_library_id {
530 req_builder = match "multi" {
531 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("library_id".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
532 _ => req_builder.query(&[("library_id", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
533 };
534 }
535 if let Some(ref param_value) = p_query_collection_id {
536 req_builder = match "multi" {
537 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("collection_id".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
538 _ => req_builder.query(&[("collection_id", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
539 };
540 }
541 if let Some(ref param_value) = p_query_status {
542 req_builder = match "multi" {
543 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
544 _ => req_builder.query(&[("status", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
545 };
546 }
547 if let Some(ref param_value) = p_query_read_status {
548 req_builder = match "multi" {
549 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("read_status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
550 _ => req_builder.query(&[("read_status", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
551 };
552 }
553 if let Some(ref param_value) = p_query_publisher {
554 req_builder = match "multi" {
555 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("publisher".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
556 _ => req_builder.query(&[("publisher", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
557 };
558 }
559 if let Some(ref param_value) = p_query_language {
560 req_builder = match "multi" {
561 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("language".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
562 _ => req_builder.query(&[("language", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
563 };
564 }
565 if let Some(ref param_value) = p_query_genre {
566 req_builder = match "multi" {
567 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("genre".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
568 _ => req_builder.query(&[("genre", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
569 };
570 }
571 if let Some(ref param_value) = p_query_tag {
572 req_builder = match "multi" {
573 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("tag".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
574 _ => req_builder.query(&[("tag", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
575 };
576 }
577 if let Some(ref param_value) = p_query_age_rating {
578 req_builder = match "multi" {
579 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("age_rating".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
580 _ => req_builder.query(&[("age_rating", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
581 };
582 }
583 if let Some(ref param_value) = p_query_release_year {
584 req_builder = match "multi" {
585 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("release_year".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
586 _ => req_builder.query(&[("release_year", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
587 };
588 }
589 if let Some(ref param_value) = p_query_sharing_label {
590 req_builder = match "multi" {
591 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("sharing_label".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
592 _ => req_builder.query(&[("sharing_label", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
593 };
594 }
595 if let Some(ref param_value) = p_query_deleted {
596 req_builder = req_builder.query(&[("deleted", ¶m_value.to_string())]);
597 }
598 if let Some(ref param_value) = p_query_complete {
599 req_builder = req_builder.query(&[("complete", ¶m_value.to_string())]);
600 }
601 if let Some(ref param_value) = p_query_oneshot {
602 req_builder = req_builder.query(&[("oneshot", ¶m_value.to_string())]);
603 }
604 if let Some(ref param_value) = p_query_search_regex {
605 req_builder = req_builder.query(&[("search_regex", ¶m_value.to_string())]);
606 }
607 if let Some(ref param_value) = p_query_author {
608 req_builder = match "multi" {
609 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("author".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
610 _ => req_builder.query(&[("author", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
611 };
612 }
613 if let Some(ref user_agent) = configuration.user_agent {
614 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
615 }
616 if let Some(ref apikey) = configuration.api_key {
617 let key = apikey.key.clone();
618 let value = match apikey.prefix {
619 Some(ref prefix) => format!("{} {}", prefix, key),
620 None => key,
621 };
622 req_builder = req_builder.header("X-API-Key", value);
623 };
624 if let Some(ref auth_conf) = configuration.basic_auth {
625 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
626 };
627
628 let req = req_builder.build()?;
629 let resp = configuration.client.execute(req).await?;
630
631 let status = resp.status();
632 let content_type = resp
633 .headers()
634 .get("content-type")
635 .and_then(|v| v.to_str().ok())
636 .unwrap_or("application/octet-stream");
637 let content_type = super::ContentType::from(content_type);
638
639 if !status.is_client_error() && !status.is_server_error() {
640 let content = resp.text().await?;
641 match content_type {
642 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
643 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GroupCountDto>`"))),
644 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GroupCountDto>`")))),
645 }
646 } else {
647 let content = resp.text().await?;
648 let entity: Option<GetSeriesAlphabeticalGroupsDeprecatedError> = serde_json::from_str(&content).ok();
649 Err(Error::ResponseError(ResponseContent { status, content, entity }))
650 }
651}
652
653pub async fn get_series_by_id(configuration: &configuration::Configuration, series_id: &str) -> Result<models::SeriesDto, Error<GetSeriesByIdError>> {
654 let p_path_series_id = series_id;
656
657 let uri_str = format!("{}/api/v1/series/{seriesId}", configuration.base_path, seriesId=crate::apis::urlencode(p_path_series_id));
658 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
659
660 if let Some(ref user_agent) = configuration.user_agent {
661 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
662 }
663 if let Some(ref apikey) = configuration.api_key {
664 let key = apikey.key.clone();
665 let value = match apikey.prefix {
666 Some(ref prefix) => format!("{} {}", prefix, key),
667 None => key,
668 };
669 req_builder = req_builder.header("X-API-Key", value);
670 };
671 if let Some(ref auth_conf) = configuration.basic_auth {
672 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
673 };
674
675 let req = req_builder.build()?;
676 let resp = configuration.client.execute(req).await?;
677
678 let status = resp.status();
679 let content_type = resp
680 .headers()
681 .get("content-type")
682 .and_then(|v| v.to_str().ok())
683 .unwrap_or("application/octet-stream");
684 let content_type = super::ContentType::from(content_type);
685
686 if !status.is_client_error() && !status.is_server_error() {
687 let content = resp.text().await?;
688 match content_type {
689 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
690 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SeriesDto`"))),
691 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SeriesDto`")))),
692 }
693 } else {
694 let content = resp.text().await?;
695 let entity: Option<GetSeriesByIdError> = serde_json::from_str(&content).ok();
696 Err(Error::ResponseError(ResponseContent { status, content, entity }))
697 }
698}
699
700pub async fn get_series_deprecated(configuration: &configuration::Configuration, search: Option<&str>, library_id: Option<Vec<String>>, collection_id: Option<Vec<String>>, status: Option<Vec<String>>, read_status: Option<Vec<String>>, publisher: Option<Vec<String>>, language: Option<Vec<String>>, genre: Option<Vec<String>>, tag: Option<Vec<String>>, age_rating: Option<Vec<String>>, release_year: Option<Vec<String>>, sharing_label: Option<Vec<String>>, deleted: Option<bool>, complete: Option<bool>, oneshot: Option<bool>, unpaged: Option<bool>, search_regex: Option<&str>, page: Option<i32>, size: Option<i32>, sort: Option<Vec<String>>, author: Option<Vec<String>>) -> Result<models::PageSeriesDto, Error<GetSeriesDeprecatedError>> {
702 let p_query_search = search;
704 let p_query_library_id = library_id;
705 let p_query_collection_id = collection_id;
706 let p_query_status = status;
707 let p_query_read_status = read_status;
708 let p_query_publisher = publisher;
709 let p_query_language = language;
710 let p_query_genre = genre;
711 let p_query_tag = tag;
712 let p_query_age_rating = age_rating;
713 let p_query_release_year = release_year;
714 let p_query_sharing_label = sharing_label;
715 let p_query_deleted = deleted;
716 let p_query_complete = complete;
717 let p_query_oneshot = oneshot;
718 let p_query_unpaged = unpaged;
719 let p_query_search_regex = search_regex;
720 let p_query_page = page;
721 let p_query_size = size;
722 let p_query_sort = sort;
723 let p_query_author = author;
724
725 let uri_str = format!("{}/api/v1/series", configuration.base_path);
726 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
727
728 if let Some(ref param_value) = p_query_search {
729 req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
730 }
731 if let Some(ref param_value) = p_query_library_id {
732 req_builder = match "multi" {
733 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("library_id".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
734 _ => req_builder.query(&[("library_id", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
735 };
736 }
737 if let Some(ref param_value) = p_query_collection_id {
738 req_builder = match "multi" {
739 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("collection_id".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
740 _ => req_builder.query(&[("collection_id", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
741 };
742 }
743 if let Some(ref param_value) = p_query_status {
744 req_builder = match "multi" {
745 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
746 _ => req_builder.query(&[("status", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
747 };
748 }
749 if let Some(ref param_value) = p_query_read_status {
750 req_builder = match "multi" {
751 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("read_status".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
752 _ => req_builder.query(&[("read_status", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
753 };
754 }
755 if let Some(ref param_value) = p_query_publisher {
756 req_builder = match "multi" {
757 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("publisher".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
758 _ => req_builder.query(&[("publisher", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
759 };
760 }
761 if let Some(ref param_value) = p_query_language {
762 req_builder = match "multi" {
763 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("language".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
764 _ => req_builder.query(&[("language", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
765 };
766 }
767 if let Some(ref param_value) = p_query_genre {
768 req_builder = match "multi" {
769 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("genre".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
770 _ => req_builder.query(&[("genre", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
771 };
772 }
773 if let Some(ref param_value) = p_query_tag {
774 req_builder = match "multi" {
775 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("tag".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
776 _ => req_builder.query(&[("tag", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
777 };
778 }
779 if let Some(ref param_value) = p_query_age_rating {
780 req_builder = match "multi" {
781 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("age_rating".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
782 _ => req_builder.query(&[("age_rating", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
783 };
784 }
785 if let Some(ref param_value) = p_query_release_year {
786 req_builder = match "multi" {
787 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("release_year".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
788 _ => req_builder.query(&[("release_year", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
789 };
790 }
791 if let Some(ref param_value) = p_query_sharing_label {
792 req_builder = match "multi" {
793 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("sharing_label".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
794 _ => req_builder.query(&[("sharing_label", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
795 };
796 }
797 if let Some(ref param_value) = p_query_deleted {
798 req_builder = req_builder.query(&[("deleted", ¶m_value.to_string())]);
799 }
800 if let Some(ref param_value) = p_query_complete {
801 req_builder = req_builder.query(&[("complete", ¶m_value.to_string())]);
802 }
803 if let Some(ref param_value) = p_query_oneshot {
804 req_builder = req_builder.query(&[("oneshot", ¶m_value.to_string())]);
805 }
806 if let Some(ref param_value) = p_query_unpaged {
807 req_builder = req_builder.query(&[("unpaged", ¶m_value.to_string())]);
808 }
809 if let Some(ref param_value) = p_query_search_regex {
810 req_builder = req_builder.query(&[("search_regex", ¶m_value.to_string())]);
811 }
812 if let Some(ref param_value) = p_query_page {
813 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
814 }
815 if let Some(ref param_value) = p_query_size {
816 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
817 }
818 if let Some(ref param_value) = p_query_sort {
819 req_builder = match "multi" {
820 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("sort".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
821 _ => req_builder.query(&[("sort", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
822 };
823 }
824 if let Some(ref param_value) = p_query_author {
825 req_builder = match "multi" {
826 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("author".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
827 _ => req_builder.query(&[("author", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
828 };
829 }
830 if let Some(ref user_agent) = configuration.user_agent {
831 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
832 }
833 if let Some(ref apikey) = configuration.api_key {
834 let key = apikey.key.clone();
835 let value = match apikey.prefix {
836 Some(ref prefix) => format!("{} {}", prefix, key),
837 None => key,
838 };
839 req_builder = req_builder.header("X-API-Key", value);
840 };
841 if let Some(ref auth_conf) = configuration.basic_auth {
842 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
843 };
844
845 let req = req_builder.build()?;
846 let resp = configuration.client.execute(req).await?;
847
848 let status = resp.status();
849 let content_type = resp
850 .headers()
851 .get("content-type")
852 .and_then(|v| v.to_str().ok())
853 .unwrap_or("application/octet-stream");
854 let content_type = super::ContentType::from(content_type);
855
856 if !status.is_client_error() && !status.is_server_error() {
857 let content = resp.text().await?;
858 match content_type {
859 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
860 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PageSeriesDto`"))),
861 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PageSeriesDto`")))),
862 }
863 } else {
864 let content = resp.text().await?;
865 let entity: Option<GetSeriesDeprecatedError> = serde_json::from_str(&content).ok();
866 Err(Error::ResponseError(ResponseContent { status, content, entity }))
867 }
868}
869
870pub async fn get_series_latest(configuration: &configuration::Configuration, library_id: Option<Vec<String>>, deleted: Option<bool>, oneshot: Option<bool>, unpaged: Option<bool>, page: Option<i32>, size: Option<i32>) -> Result<models::PageSeriesDto, Error<GetSeriesLatestError>> {
872 let p_query_library_id = library_id;
874 let p_query_deleted = deleted;
875 let p_query_oneshot = oneshot;
876 let p_query_unpaged = unpaged;
877 let p_query_page = page;
878 let p_query_size = size;
879
880 let uri_str = format!("{}/api/v1/series/latest", configuration.base_path);
881 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
882
883 if let Some(ref param_value) = p_query_library_id {
884 req_builder = match "multi" {
885 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("library_id".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
886 _ => req_builder.query(&[("library_id", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
887 };
888 }
889 if let Some(ref param_value) = p_query_deleted {
890 req_builder = req_builder.query(&[("deleted", ¶m_value.to_string())]);
891 }
892 if let Some(ref param_value) = p_query_oneshot {
893 req_builder = req_builder.query(&[("oneshot", ¶m_value.to_string())]);
894 }
895 if let Some(ref param_value) = p_query_unpaged {
896 req_builder = req_builder.query(&[("unpaged", ¶m_value.to_string())]);
897 }
898 if let Some(ref param_value) = p_query_page {
899 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
900 }
901 if let Some(ref param_value) = p_query_size {
902 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
903 }
904 if let Some(ref user_agent) = configuration.user_agent {
905 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
906 }
907 if let Some(ref apikey) = configuration.api_key {
908 let key = apikey.key.clone();
909 let value = match apikey.prefix {
910 Some(ref prefix) => format!("{} {}", prefix, key),
911 None => key,
912 };
913 req_builder = req_builder.header("X-API-Key", value);
914 };
915 if let Some(ref auth_conf) = configuration.basic_auth {
916 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
917 };
918
919 let req = req_builder.build()?;
920 let resp = configuration.client.execute(req).await?;
921
922 let status = resp.status();
923 let content_type = resp
924 .headers()
925 .get("content-type")
926 .and_then(|v| v.to_str().ok())
927 .unwrap_or("application/octet-stream");
928 let content_type = super::ContentType::from(content_type);
929
930 if !status.is_client_error() && !status.is_server_error() {
931 let content = resp.text().await?;
932 match content_type {
933 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
934 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PageSeriesDto`"))),
935 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PageSeriesDto`")))),
936 }
937 } else {
938 let content = resp.text().await?;
939 let entity: Option<GetSeriesLatestError> = serde_json::from_str(&content).ok();
940 Err(Error::ResponseError(ResponseContent { status, content, entity }))
941 }
942}
943
944pub async fn get_series_new(configuration: &configuration::Configuration, library_id: Option<Vec<String>>, deleted: Option<bool>, oneshot: Option<bool>, unpaged: Option<bool>, page: Option<i32>, size: Option<i32>) -> Result<models::PageSeriesDto, Error<GetSeriesNewError>> {
946 let p_query_library_id = library_id;
948 let p_query_deleted = deleted;
949 let p_query_oneshot = oneshot;
950 let p_query_unpaged = unpaged;
951 let p_query_page = page;
952 let p_query_size = size;
953
954 let uri_str = format!("{}/api/v1/series/new", configuration.base_path);
955 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
956
957 if let Some(ref param_value) = p_query_library_id {
958 req_builder = match "multi" {
959 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("library_id".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
960 _ => req_builder.query(&[("library_id", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
961 };
962 }
963 if let Some(ref param_value) = p_query_deleted {
964 req_builder = req_builder.query(&[("deleted", ¶m_value.to_string())]);
965 }
966 if let Some(ref param_value) = p_query_oneshot {
967 req_builder = req_builder.query(&[("oneshot", ¶m_value.to_string())]);
968 }
969 if let Some(ref param_value) = p_query_unpaged {
970 req_builder = req_builder.query(&[("unpaged", ¶m_value.to_string())]);
971 }
972 if let Some(ref param_value) = p_query_page {
973 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
974 }
975 if let Some(ref param_value) = p_query_size {
976 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
977 }
978 if let Some(ref user_agent) = configuration.user_agent {
979 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
980 }
981 if let Some(ref apikey) = configuration.api_key {
982 let key = apikey.key.clone();
983 let value = match apikey.prefix {
984 Some(ref prefix) => format!("{} {}", prefix, key),
985 None => key,
986 };
987 req_builder = req_builder.header("X-API-Key", value);
988 };
989 if let Some(ref auth_conf) = configuration.basic_auth {
990 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
991 };
992
993 let req = req_builder.build()?;
994 let resp = configuration.client.execute(req).await?;
995
996 let status = resp.status();
997 let content_type = resp
998 .headers()
999 .get("content-type")
1000 .and_then(|v| v.to_str().ok())
1001 .unwrap_or("application/octet-stream");
1002 let content_type = super::ContentType::from(content_type);
1003
1004 if !status.is_client_error() && !status.is_server_error() {
1005 let content = resp.text().await?;
1006 match content_type {
1007 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1008 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PageSeriesDto`"))),
1009 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PageSeriesDto`")))),
1010 }
1011 } else {
1012 let content = resp.text().await?;
1013 let entity: Option<GetSeriesNewError> = serde_json::from_str(&content).ok();
1014 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1015 }
1016}
1017
1018pub async fn get_series_updated(configuration: &configuration::Configuration, library_id: Option<Vec<String>>, deleted: Option<bool>, oneshot: Option<bool>, unpaged: Option<bool>, page: Option<i32>, size: Option<i32>) -> Result<models::PageSeriesDto, Error<GetSeriesUpdatedError>> {
1020 let p_query_library_id = library_id;
1022 let p_query_deleted = deleted;
1023 let p_query_oneshot = oneshot;
1024 let p_query_unpaged = unpaged;
1025 let p_query_page = page;
1026 let p_query_size = size;
1027
1028 let uri_str = format!("{}/api/v1/series/updated", configuration.base_path);
1029 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1030
1031 if let Some(ref param_value) = p_query_library_id {
1032 req_builder = match "multi" {
1033 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("library_id".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
1034 _ => req_builder.query(&[("library_id", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
1035 };
1036 }
1037 if let Some(ref param_value) = p_query_deleted {
1038 req_builder = req_builder.query(&[("deleted", ¶m_value.to_string())]);
1039 }
1040 if let Some(ref param_value) = p_query_oneshot {
1041 req_builder = req_builder.query(&[("oneshot", ¶m_value.to_string())]);
1042 }
1043 if let Some(ref param_value) = p_query_unpaged {
1044 req_builder = req_builder.query(&[("unpaged", ¶m_value.to_string())]);
1045 }
1046 if let Some(ref param_value) = p_query_page {
1047 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1048 }
1049 if let Some(ref param_value) = p_query_size {
1050 req_builder = req_builder.query(&[("size", ¶m_value.to_string())]);
1051 }
1052 if let Some(ref user_agent) = configuration.user_agent {
1053 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1054 }
1055 if let Some(ref apikey) = configuration.api_key {
1056 let key = apikey.key.clone();
1057 let value = match apikey.prefix {
1058 Some(ref prefix) => format!("{} {}", prefix, key),
1059 None => key,
1060 };
1061 req_builder = req_builder.header("X-API-Key", value);
1062 };
1063 if let Some(ref auth_conf) = configuration.basic_auth {
1064 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1065 };
1066
1067 let req = req_builder.build()?;
1068 let resp = configuration.client.execute(req).await?;
1069
1070 let status = resp.status();
1071 let content_type = resp
1072 .headers()
1073 .get("content-type")
1074 .and_then(|v| v.to_str().ok())
1075 .unwrap_or("application/octet-stream");
1076 let content_type = super::ContentType::from(content_type);
1077
1078 if !status.is_client_error() && !status.is_server_error() {
1079 let content = resp.text().await?;
1080 match content_type {
1081 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1082 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PageSeriesDto`"))),
1083 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PageSeriesDto`")))),
1084 }
1085 } else {
1086 let content = resp.text().await?;
1087 let entity: Option<GetSeriesUpdatedError> = serde_json::from_str(&content).ok();
1088 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1089 }
1090}
1091
1092pub async fn mark_series_as_read(configuration: &configuration::Configuration, series_id: &str) -> Result<(), Error<MarkSeriesAsReadError>> {
1094 let p_path_series_id = series_id;
1096
1097 let uri_str = format!("{}/api/v1/series/{seriesId}/read-progress", configuration.base_path, seriesId=crate::apis::urlencode(p_path_series_id));
1098 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1099
1100 if let Some(ref user_agent) = configuration.user_agent {
1101 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1102 }
1103 if let Some(ref apikey) = configuration.api_key {
1104 let key = apikey.key.clone();
1105 let value = match apikey.prefix {
1106 Some(ref prefix) => format!("{} {}", prefix, key),
1107 None => key,
1108 };
1109 req_builder = req_builder.header("X-API-Key", value);
1110 };
1111 if let Some(ref auth_conf) = configuration.basic_auth {
1112 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1113 };
1114
1115 let req = req_builder.build()?;
1116 let resp = configuration.client.execute(req).await?;
1117
1118 let status = resp.status();
1119
1120 if !status.is_client_error() && !status.is_server_error() {
1121 Ok(())
1122 } else {
1123 let content = resp.text().await?;
1124 let entity: Option<MarkSeriesAsReadError> = serde_json::from_str(&content).ok();
1125 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1126 }
1127}
1128
1129pub async fn mark_series_as_unread(configuration: &configuration::Configuration, series_id: &str) -> Result<(), Error<MarkSeriesAsUnreadError>> {
1131 let p_path_series_id = series_id;
1133
1134 let uri_str = format!("{}/api/v1/series/{seriesId}/read-progress", configuration.base_path, seriesId=crate::apis::urlencode(p_path_series_id));
1135 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1136
1137 if let Some(ref user_agent) = configuration.user_agent {
1138 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1139 }
1140 if let Some(ref apikey) = configuration.api_key {
1141 let key = apikey.key.clone();
1142 let value = match apikey.prefix {
1143 Some(ref prefix) => format!("{} {}", prefix, key),
1144 None => key,
1145 };
1146 req_builder = req_builder.header("X-API-Key", value);
1147 };
1148 if let Some(ref auth_conf) = configuration.basic_auth {
1149 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1150 };
1151
1152 let req = req_builder.build()?;
1153 let resp = configuration.client.execute(req).await?;
1154
1155 let status = resp.status();
1156
1157 if !status.is_client_error() && !status.is_server_error() {
1158 Ok(())
1159 } else {
1160 let content = resp.text().await?;
1161 let entity: Option<MarkSeriesAsUnreadError> = serde_json::from_str(&content).ok();
1162 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1163 }
1164}
1165
1166pub async fn series_analyze(configuration: &configuration::Configuration, series_id: &str) -> Result<(), Error<SeriesAnalyzeError>> {
1168 let p_path_series_id = series_id;
1170
1171 let uri_str = format!("{}/api/v1/series/{seriesId}/analyze", configuration.base_path, seriesId=crate::apis::urlencode(p_path_series_id));
1172 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1173
1174 if let Some(ref user_agent) = configuration.user_agent {
1175 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1176 }
1177 if let Some(ref apikey) = configuration.api_key {
1178 let key = apikey.key.clone();
1179 let value = match apikey.prefix {
1180 Some(ref prefix) => format!("{} {}", prefix, key),
1181 None => key,
1182 };
1183 req_builder = req_builder.header("X-API-Key", value);
1184 };
1185 if let Some(ref auth_conf) = configuration.basic_auth {
1186 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1187 };
1188
1189 let req = req_builder.build()?;
1190 let resp = configuration.client.execute(req).await?;
1191
1192 let status = resp.status();
1193
1194 if !status.is_client_error() && !status.is_server_error() {
1195 Ok(())
1196 } else {
1197 let content = resp.text().await?;
1198 let entity: Option<SeriesAnalyzeError> = serde_json::from_str(&content).ok();
1199 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1200 }
1201}
1202
1203pub async fn series_refresh_metadata(configuration: &configuration::Configuration, series_id: &str) -> Result<(), Error<SeriesRefreshMetadataError>> {
1205 let p_path_series_id = series_id;
1207
1208 let uri_str = format!("{}/api/v1/series/{seriesId}/metadata/refresh", configuration.base_path, seriesId=crate::apis::urlencode(p_path_series_id));
1209 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1210
1211 if let Some(ref user_agent) = configuration.user_agent {
1212 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1213 }
1214 if let Some(ref apikey) = configuration.api_key {
1215 let key = apikey.key.clone();
1216 let value = match apikey.prefix {
1217 Some(ref prefix) => format!("{} {}", prefix, key),
1218 None => key,
1219 };
1220 req_builder = req_builder.header("X-API-Key", value);
1221 };
1222 if let Some(ref auth_conf) = configuration.basic_auth {
1223 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1224 };
1225
1226 let req = req_builder.build()?;
1227 let resp = configuration.client.execute(req).await?;
1228
1229 let status = resp.status();
1230
1231 if !status.is_client_error() && !status.is_server_error() {
1232 Ok(())
1233 } else {
1234 let content = resp.text().await?;
1235 let entity: Option<SeriesRefreshMetadataError> = serde_json::from_str(&content).ok();
1236 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1237 }
1238}
1239
1240pub async fn update_series_metadata(configuration: &configuration::Configuration, series_id: &str, series_metadata_update_dto: models::SeriesMetadataUpdateDto) -> Result<(), Error<UpdateSeriesMetadataError>> {
1242 let p_path_series_id = series_id;
1244 let p_body_series_metadata_update_dto = series_metadata_update_dto;
1245
1246 let uri_str = format!("{}/api/v1/series/{seriesId}/metadata", configuration.base_path, seriesId=crate::apis::urlencode(p_path_series_id));
1247 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
1248
1249 if let Some(ref user_agent) = configuration.user_agent {
1250 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1251 }
1252 if let Some(ref apikey) = configuration.api_key {
1253 let key = apikey.key.clone();
1254 let value = match apikey.prefix {
1255 Some(ref prefix) => format!("{} {}", prefix, key),
1256 None => key,
1257 };
1258 req_builder = req_builder.header("X-API-Key", value);
1259 };
1260 if let Some(ref auth_conf) = configuration.basic_auth {
1261 req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1262 };
1263 req_builder = req_builder.json(&p_body_series_metadata_update_dto);
1264
1265 let req = req_builder.build()?;
1266 let resp = configuration.client.execute(req).await?;
1267
1268 let status = resp.status();
1269
1270 if !status.is_client_error() && !status.is_server_error() {
1271 Ok(())
1272 } else {
1273 let content = resp.text().await?;
1274 let entity: Option<UpdateSeriesMetadataError> = serde_json::from_str(&content).ok();
1275 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1276 }
1277}
1278