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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* Hetzner Cloud API
*
* Copied from the official API documentation for the Public Hetzner Cloud.
*
* The version of the OpenAPI document: 0.28.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Pagination : See \"Pagination\" for more information.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Pagination {
/// Page number of the last page available. Can be null if the current page is the last one.
#[serde(rename = "last_page", deserialize_with = "Option::deserialize")]
pub last_page: Option<i64>,
/// Page number of the next page. Can be null if the current page is the last one.
#[serde(rename = "next_page", deserialize_with = "Option::deserialize")]
pub next_page: Option<i64>,
/// Current page number.
#[serde(rename = "page")]
pub page: i64,
/// Maximum number of entries returned per page.
#[serde(rename = "per_page")]
pub per_page: i64,
/// Page number of the previous page. Can be null if the current page is the first one.
#[serde(rename = "previous_page", deserialize_with = "Option::deserialize")]
pub previous_page: Option<i64>,
/// Total number of entries that exist for this query. Can be null if unknown.
#[serde(rename = "total_entries", deserialize_with = "Option::deserialize")]
pub total_entries: Option<i64>,
}
impl Pagination {
/// See \"Pagination\" for more information.
pub fn new(
last_page: Option<i64>,
next_page: Option<i64>,
page: i64,
per_page: i64,
previous_page: Option<i64>,
total_entries: Option<i64>,
) -> Pagination {
Pagination {
last_page,
next_page,
page,
per_page,
previous_page,
total_entries,
}
}
}