desmos_bindings/proto/cosmos/base/query/v1beta1.rs
1/// PageRequest is to be embedded in gRPC request messages for efficient
2/// pagination. Ex:
3///
4/// message SomeRequest {
5/// Foo some_parameter = 1;
6/// PageRequest pagination = 2;
7/// }
8#[allow(clippy::derive_partial_eq_without_eq)]
9#[derive(
10 Clone,
11 PartialEq,
12 ::prost::Message,
13 schemars::JsonSchema,
14 serde::Serialize,
15 serde::Deserialize,
16 desmos_std_derive::CosmwasmExt,
17)]
18#[proto_message(type_url = "/cosmos.base.query.v1beta1.PageRequest")]
19#[serde(rename_all = "snake_case")]
20pub struct PageRequest {
21 /// key is a value returned in PageResponse.next_key to begin
22 /// querying the next page most efficiently. Only one of offset or key
23 /// should be set.
24 #[prost(bytes = "vec", tag = "1")]
25 #[serde(
26 serialize_with = "crate::serde::as_base64::serialize",
27 deserialize_with = "crate::serde::as_base64::deserialize"
28 )]
29 pub key: ::prost::alloc::vec::Vec<u8>,
30 /// offset is a numeric offset that can be used when key is unavailable.
31 /// It is less efficient than using key. Only one of offset or key should
32 /// be set.
33 #[prost(uint64, tag = "2")]
34 #[serde(
35 serialize_with = "crate::serde::as_str::serialize",
36 deserialize_with = "crate::serde::as_str::deserialize"
37 )]
38 pub offset: u64,
39 /// limit is the total number of results to be returned in the result page.
40 /// If left empty it will default to a value to be set by each app.
41 #[prost(uint64, tag = "3")]
42 #[serde(
43 serialize_with = "crate::serde::as_str::serialize",
44 deserialize_with = "crate::serde::as_str::deserialize"
45 )]
46 pub limit: u64,
47 /// count_total is set to true to indicate that the result set should include
48 /// a count of the total number of items available for pagination in UIs.
49 /// count_total is only respected when offset is used. It is ignored when key
50 /// is set.
51 #[prost(bool, tag = "4")]
52 pub count_total: bool,
53 /// reverse is set to true if results are to be returned in the descending order.
54 ///
55 /// Since: cosmos-sdk 0.43
56 #[prost(bool, tag = "5")]
57 pub reverse: bool,
58}
59/// PageResponse is to be embedded in gRPC response messages where the
60/// corresponding request message has used PageRequest.
61///
62/// message SomeResponse {
63/// repeated Bar results = 1;
64/// PageResponse page = 2;
65/// }
66#[allow(clippy::derive_partial_eq_without_eq)]
67#[derive(
68 Clone,
69 PartialEq,
70 ::prost::Message,
71 schemars::JsonSchema,
72 serde::Serialize,
73 serde::Deserialize,
74 desmos_std_derive::CosmwasmExt,
75)]
76#[proto_message(type_url = "/cosmos.base.query.v1beta1.PageResponse")]
77#[serde(rename_all = "snake_case")]
78pub struct PageResponse {
79 /// next_key is the key to be passed to PageRequest.key to
80 /// query the next page most efficiently. It will be empty if
81 /// there are no more results.
82 #[prost(bytes = "vec", tag = "1")]
83 #[serde(
84 serialize_with = "crate::serde::as_base64::serialize",
85 deserialize_with = "crate::serde::as_base64::deserialize"
86 )]
87 pub next_key: ::prost::alloc::vec::Vec<u8>,
88 /// total is total number of results available if PageRequest.count_total
89 /// was set, its value is undefined otherwise
90 #[prost(uint64, tag = "2")]
91 #[serde(
92 serialize_with = "crate::serde::as_str::serialize",
93 deserialize_with = "crate::serde::as_str::deserialize"
94 )]
95 pub total: u64,
96}