aboutsummaryrefslogtreecommitdiff
path: root/src/models/search.rs
diff options
context:
space:
mode:
authorGravatar Jake Swenson <jake@jakeswenson.com> 2021-08-29 12:59:04 -0700
committerGravatar Jake Swenson <jake@jakeswenson.com> 2021-08-29 12:59:04 -0700
commit1c22088640e5deeadd61017bd90920b652685b5f (patch)
tree59d110a7c8792c39e0c1ea180fa972eee1c4662d /src/models/search.rs
parent8d5779a661f4537ef7d87a44bdfbf240eb054ff1 (diff)
downloadnotion-1c22088640e5deeadd61017bd90920b652685b5f.tar.gz
notion-1c22088640e5deeadd61017bd90920b652685b5f.tar.zst
notion-1c22088640e5deeadd61017bd90920b652685b5f.zip
Notion API Version 2021-08-16 support; fix a bunch of modling errors as well
Diffstat (limited to 'src/models/search.rs')
-rw-r--r--src/models/search.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/models/search.rs b/src/models/search.rs
index aa2f62e..3e5d782 100644
--- a/src/models/search.rs
+++ b/src/models/search.rs
@@ -1,5 +1,6 @@
+use crate::ids::{PageId, UserId};
use crate::models::paging::Paging;
-use crate::models::{Number, PageId, UserId};
+use crate::models::Number;
use chrono::{DateTime, Utc};
use serde::ser::SerializeMap;
use serde::{Serialize, Serializer};
@@ -281,8 +282,10 @@ pub struct DatabaseSort {
// Todo: Should property and timestamp be mutually exclusive? (i.e a flattened enum?)
// the documentation is not clear:
// https://developers.notion.com/reference/post-database-query#post-database-query-sort
+ #[serde(skip_serializing_if = "Option::is_none")]
pub property: Option<String>,
/// The name of the timestamp to sort against.
+ #[serde(skip_serializing_if = "Option::is_none")]
pub timestamp: Option<DatabaseSortTimestamp>,
pub direction: SortDirection,
}