pub mod api_endpoints;
pub mod api_utils;
pub mod board_v1_endpoints;
pub mod task_v2_endpoints;
pub use api_endpoints::TaskApiV2;
pub use board_v1_endpoints::BoardV1Endpoint;
pub use task_v2_endpoints::TaskV2Endpoint;
pub mod constants {
pub const DEFAULT_PAGE_SIZE: i32 = 20;
pub const MAX_PAGE_SIZE: i32 = 100;
}
pub mod types {
pub type TaskGuid = String;
pub type TasklistGuid = String;
pub type SectionGuid = String;
pub type CustomFieldGuid = String;
pub type CommentGuid = String;
pub type AttachmentGuid = String;
}
#[cfg(test)]
#[allow(unused_imports)]
mod tests {
use super::constants;
use super::types;
use super::{board_v1_endpoints::BoardV1Endpoint, task_v2_endpoints::TaskV2Endpoint};
#[test]
fn test_default_page_size() {
assert_eq!(constants::DEFAULT_PAGE_SIZE, 20);
}
#[test]
fn test_max_page_size() {
assert_eq!(constants::MAX_PAGE_SIZE, 100);
}
#[test]
fn test_task_guid_type() {
let guid: types::TaskGuid = "test_guid".to_string();
assert_eq!(guid, "test_guid");
}
#[test]
fn test_tasklist_guid_type() {
let guid: types::TasklistGuid = "test_tasklist".to_string();
assert_eq!(guid, "test_tasklist");
}
#[test]
fn test_section_guid_type() {
let guid: types::SectionGuid = "test_section".to_string();
assert_eq!(guid, "test_section");
}
#[test]
fn test_custom_field_guid_type() {
let guid: types::CustomFieldGuid = "test_field".to_string();
assert_eq!(guid, "test_field");
}
#[test]
fn test_comment_guid_type() {
let guid: types::CommentGuid = "test_comment".to_string();
assert_eq!(guid, "test_comment");
}
#[test]
fn test_attachment_guid_type() {
let guid: types::AttachmentGuid = "test_attachment".to_string();
assert_eq!(guid, "test_attachment");
}
#[test]
fn issue_194_split_endpoint_paths() {
assert_eq!(
BoardV1Endpoint::WhiteboardNodeBatchDelete("board_123".to_string()).to_url(),
"/open-apis/board/v1/whiteboards/board_123/nodes/batch_delete"
);
assert_eq!(
TaskV2Endpoint::TaskSetAncestorTask("task_123".to_string()).to_url(),
"/open-apis/task/v2/tasks/task_123/set_ancestor_task"
);
assert_eq!(
TaskV2Endpoint::ListRelatedTask.to_url(),
"/open-apis/task/v2/task_v2/list_related_task"
);
assert_eq!(
TaskV2Endpoint::TaskSubscription.to_url(),
"/open-apis/task/v2/task_v2/task_subscription"
);
}
}