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
/*
* Artifact Keeper API
*
* Enterprise artifact registry supporting 45+ package formats.
*
* The version of the OpenAPI document: 1.2.1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Pagination : Pagination metadata for list responses. Used consistently across all paginated API endpoints to provide standard pagination information to clients.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Pagination {
/// Current page number (1-indexed)
#[serde(rename = "page")]
pub page: i32,
/// Number of items per page
#[serde(rename = "per_page")]
pub per_page: i32,
/// Total number of items across all pages
#[serde(rename = "total")]
pub total: i64,
/// Total number of pages
#[serde(rename = "total_pages")]
pub total_pages: i32,
}
impl Pagination {
/// Pagination metadata for list responses. Used consistently across all paginated API endpoints to provide standard pagination information to clients.
pub fn new(page: i32, per_page: i32, total: i64, total_pages: i32) -> Pagination {
Pagination {
page,
per_page,
total,
total_pages,
}
}
}