From 2345823653c3edd0759fbf426b4539a93ac2f5c1 Mon Sep 17 00:00:00 2001 From: cdxker Date: Mon, 7 Oct 2024 22:05:57 -0700 Subject: [PATCH] docs: update TR-Dataset and TR-Organization to be uuid::Uuid everywhere --- server/src/handlers/analytics_handler.rs | 20 ++++++------ server/src/handlers/chunk_handler.rs | 30 +++++++++--------- server/src/handlers/dataset_handler.rs | 22 ++++++------- server/src/handlers/event_handler.rs | 2 +- server/src/handlers/file_handler.rs | 8 ++--- server/src/handlers/group_handler.rs | 34 ++++++++++----------- server/src/handlers/invitation_handler.rs | 6 ++-- server/src/handlers/message_handler.rs | 12 ++++---- server/src/handlers/organization_handler.rs | 14 ++++----- server/src/handlers/stripe_handler.rs | 4 +-- server/src/handlers/topic_handler.rs | 8 ++--- 11 files changed, 80 insertions(+), 80 deletions(-) diff --git a/server/src/handlers/analytics_handler.rs b/server/src/handlers/analytics_handler.rs index de8bc24eb..66210c58e 100644 --- a/server/src/handlers/analytics_handler.rs +++ b/server/src/handlers/analytics_handler.rs @@ -29,7 +29,7 @@ use utoipa::ToSchema; (status = 400, description = "Service error relating to getting cluster analytics", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -88,7 +88,7 @@ pub struct RateQueryRequest { (status = 400, description = "Service error relating to rating a search query", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -126,7 +126,7 @@ pub async fn set_search_query_rating( (status = 400, description = "Service error relating to rating a RAG query", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -164,7 +164,7 @@ pub async fn set_rag_query_rating( (status = 400, description = "Service error relating to getting search analytics", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -321,7 +321,7 @@ pub async fn get_search_analytics( (status = 400, description = "Service error relating to getting RAG analytics", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -407,7 +407,7 @@ pub async fn get_rag_analytics( (status = 400, description = "Service error relating to getting recommendation analytics", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -499,7 +499,7 @@ pub struct CTRDataRequestBody { (status = 400, description = "Service error relating to sending CTR data", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -536,7 +536,7 @@ pub async fn send_ctr_data( (status = 400, description = "Service error relating to sending event data", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -572,7 +572,7 @@ pub async fn send_event_data( (status = 400, description = "Service error relating to getting CTR analytics", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -704,7 +704,7 @@ pub struct GetTopDatasetsRequestBody { tag = "Analytics", request_body(content = GetTopDatasetsRequestBody, description = "JSON request payload to filter the top datasets", content_type = "application/json"), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ), responses( (status = 200, description = "The top datasets for the request", body = Vec), diff --git a/server/src/handlers/chunk_handler.rs b/server/src/handlers/chunk_handler.rs index fe525b846..da9773c2b 100644 --- a/server/src/handlers/chunk_handler.rs +++ b/server/src/handlers/chunk_handler.rs @@ -288,7 +288,7 @@ pub enum CreateChunkReqPayloadEnum { (status = 400, description = "Error typically due to deserialization issues", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -446,7 +446,7 @@ pub async fn create_chunk( (status = 400, description = "Service error relating to finding a chunk by tracking_id", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("chunk_id" = Option, Path, description = "Id of the chunk you want to fetch."), ), security( @@ -492,7 +492,7 @@ pub async fn delete_chunk( (status = 400, description = "Service error relating to finding a chunk by tracking_id", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("tracking_id" = Option, Path, description = "tracking_id of the chunk you want to delete"), ), security( @@ -599,7 +599,7 @@ pub struct UpdateIngestionMessage { (status = 400, description = "Service error relating to to updating chunk, likely due to conflicting tracking_id", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -766,7 +766,7 @@ pub struct UpdateChunkByTrackingIdData { (status = 400, description = "Service error relating to to updating chunk", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -1148,7 +1148,7 @@ pub fn parse_query( (status = 400, description = "Service error relating to searching", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("X-API-Version" = Option, Header, description = "The API version to use for this request. Defaults to V2 for orgs created after July 12, 2024 and V1 otherwise.") ), security( @@ -1394,7 +1394,7 @@ impl From for SearchChunksReqPayload { (status = 400, description = "Service error relating to searching", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("X-API-Version" = Option, Header, description = "The API version to use for this request. Defaults to V2 for orgs created after July 12, 2024 and V1 otherwise.") ), security( @@ -1521,7 +1521,7 @@ pub struct ScrollChunksReqPayload { (status = 400, description = "Service error relating to scrolling chunks", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["readonly"]), @@ -1597,7 +1597,7 @@ pub async fn scroll_dataset_chunks( (status = 404, description = "Chunk not found", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("X-API-Version" = Option, Header, description = "The API version to use for this request. Defaults to V2 for orgs created after July 12, 2024 and V1 otherwise."), ("chunk_id" = Option, Path, description = "Id of the chunk you want to fetch."), ), @@ -1697,7 +1697,7 @@ pub struct CountChunkQueryResponseBody { (status = 404, description = "Failed to count chunks", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["readonly"]), @@ -1782,7 +1782,7 @@ pub async fn count_chunks( (status = 404, description = "Chunk not found", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("X-API-Version" = Option, Header, description = "The API version to use for this request. Defaults to V2 for orgs created after July 12, 2024 and V1 otherwise."), ("tracking_id" = Option, Path, description = "tracking_id of the chunk you want to fetch"), ), @@ -1843,7 +1843,7 @@ pub struct GetChunksData { (status = 404, description = "Any one of the specified chunks not found", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("X-API-Version" = Option, Header, description = "The API version to use for this request. Defaults to V2 for orgs created after July 12, 2024 and V1 otherwise.") ), security( @@ -1915,7 +1915,7 @@ pub struct GetTrackingChunksData { (status = 400, description = "Service error relating to finding a chunk by tracking_id", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("X-API-Version" = Option, Header, description = "The API version to use for this request. Defaults to V2 for orgs created after July 12, 2024 and V1 otherwise.") ), security( @@ -2022,7 +2022,7 @@ pub enum RecommendResponseTypes { (status = 400, description = "Service error relating to to getting similar chunks", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("X-API-Version" = Option, Header, description = "The API version to use for this request. Defaults to V2 for orgs created after July 12, 2024 and V1 otherwise.") ), security( @@ -2360,7 +2360,7 @@ pub struct GenerateOffChunksReqPayload { (status = 400, description = "Service error relating to to updating chunk, likely due to conflicting tracking_id", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["readonly"]), diff --git a/server/src/handlers/dataset_handler.rs b/server/src/handlers/dataset_handler.rs index a46839f6d..a0f5b75b7 100644 --- a/server/src/handlers/dataset_handler.rs +++ b/server/src/handlers/dataset_handler.rs @@ -123,7 +123,7 @@ pub struct CreateDatasetRequest { (status = 400, description = "Service error relating to creating the dataset", body = ErrorResponseBody), ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ), security( ("ApiKey" = ["owner"]), @@ -259,7 +259,7 @@ pub struct UpdateDatasetRequest { (status = 404, description = "Dataset not found", body = ErrorResponseBody) ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ), security( ("ApiKey" = ["owner"]), @@ -343,7 +343,7 @@ pub struct GetCrawlOptionsResponse { (status = 404, description = "Dataset not found", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("dataset_id" = uuid, Path, description = "The id of the dataset you want to retrieve."), ), security( @@ -383,7 +383,7 @@ pub async fn get_dataset_crawl_options( (status = 404, description = "Dataset not found", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("dataset_id" = uuid, Path, description = "The id of the dataset you want to delete."), ), @@ -429,7 +429,7 @@ pub async fn delete_dataset( (status = 404, description = "Dataset not found", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("dataset_id" = uuid, Path, description = "The id of the dataset you want to clear."), ), @@ -474,7 +474,7 @@ pub async fn clear_dataset( (status = 404, description = "Dataset not found", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("tracking_id" = String, Path, description = "The tracking id of the dataset you want to delete."), ), security( @@ -520,7 +520,7 @@ pub async fn delete_dataset_by_tracking_id( (status = 404, description = "Dataset not found", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("dataset_id" = uuid, Path, description = "The id of the dataset you want to retrieve."), ), security( @@ -559,7 +559,7 @@ pub async fn get_dataset( (status = 404, description = "Dataset not found", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("dataset_id" = uuid, Path, description = "The id of the dataset you want to retrieve usage for."), ), security( @@ -593,7 +593,7 @@ pub async fn get_usage_by_dataset_id( (status = 404, description = "Dataset not found", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("tracking_id" = String, Path, description = "The tracking id of the dataset you want to retrieve."), ), security( @@ -639,7 +639,7 @@ pub struct GetDatasetsPagination { (status = 404, description = "Could not find organization", body = ErrorResponseBody) ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ("organization_id" = uuid, Path, description = "id of the organization you want to retrieve datasets for"), ("limit" = Option, Query, description = "The number of records to return"), ("offset" = Option, Query, description = "The number of records to skip"), @@ -712,7 +712,7 @@ pub struct GetAllTagsResponse { (status = 400, description = "Service error relating to finding items by tag", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["readonly"]), diff --git a/server/src/handlers/event_handler.rs b/server/src/handlers/event_handler.rs index 96c082420..9e801d408 100644 --- a/server/src/handlers/event_handler.rs +++ b/server/src/handlers/event_handler.rs @@ -37,7 +37,7 @@ pub struct GetEventsData { (status = 400, description = "Service error relating to getting events for the dataset", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["readonly"]), diff --git a/server/src/handlers/file_handler.rs b/server/src/handlers/file_handler.rs index b050e76d9..32232f355 100644 --- a/server/src/handlers/file_handler.rs +++ b/server/src/handlers/file_handler.rs @@ -103,7 +103,7 @@ pub struct UploadFileResult { (status = 400, description = "Service error relating to uploading the file", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -236,7 +236,7 @@ pub async fn upload_file_handler( (status = 404, description = "File not found", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("file_id" = uuid::Uuid, description = "The id of the file to fetch"), ), security( @@ -279,7 +279,7 @@ pub struct FileData { (status = 400, description = "Service error relating to getting the files in the current datase", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("dataset_id" = uuid::Uuid, description = "The id of the dataset to fetch files for."), ("page" = u64, description = "The page number of files you wish to fetch. Each page contains at most 10 files."), ), @@ -337,7 +337,7 @@ pub async fn get_dataset_files_handler( (status = 400, description = "Service error relating to finding or deleting the file", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("file_id" = uuid::Uuid, description = "The id of the file to delete"), ("delete_chunks" = bool, Query, description = "Delete the chunks within the group"), ), diff --git a/server/src/handlers/group_handler.rs b/server/src/handlers/group_handler.rs index 041a1fedf..c0f06190d 100644 --- a/server/src/handlers/group_handler.rs +++ b/server/src/handlers/group_handler.rs @@ -172,7 +172,7 @@ impl From> for CreateChunkGroupResponseEnum { (status = 400, description = "Service error relating to creating the chunk_group(s)", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -311,7 +311,7 @@ pub struct DatasetGroupQuery { (status = 400, description = "Service error relating to getting the groups created by the given dataset", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("dataset_id" = uuid::Uuid, description = "The id of the dataset to fetch groups for."), ("page" = i64, description = "The page of groups to fetch. Page is 1-indexed."), ), @@ -356,7 +356,7 @@ pub struct GetGroupByTrackingIDData { (status = 404, description = "Group not found", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("tracking_id" = String, description = "The tracking id of the group to fetch."), ), security( @@ -401,7 +401,7 @@ pub struct GetGroupData { (status = 404, description = "Group not found", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("group_id" = Option, Path, description = "Id of the group you want to fetch."), ), security( @@ -453,7 +453,7 @@ pub struct UpdateGroupByTrackingIDReqPayload { (status = 400, description = "Service error relating to updating the chunkGroup", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("tracking_id" = uuid::Uuid, description = "Tracking id of the chunk_group to update"), ), security( @@ -514,7 +514,7 @@ pub struct DeleteGroupByTrackingIDData { (status = 400, description = "Service error relating to deleting the chunkGroup", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("tracking_id" = uuid::Uuid, description = "Tracking id of the chunk_group to delete"), ("delete_chunks" = bool, Query, description = "Delete the chunks within the group"), ), @@ -575,7 +575,7 @@ pub struct DeleteGroupData { (status = 400, description = "Service error relating to deleting the chunkGroup", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("group_id" = Option, Path, description = "Id of the group you want to fetch."), ("delete_chunks" = bool, Query, description = "Delete the chunks within the group"), ), @@ -650,7 +650,7 @@ pub struct UpdateChunkGroupReqPayload { (status = 400, description = "Service error relating to updating the chunkGroup", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -741,7 +741,7 @@ pub struct AddChunkToGroupReqPayload { (status = 400, description = "Service error relating to getting the groups that the chunk is in.", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("group_id" = uuid, description = "Id of the group to add the chunk to as a bookmark"), ), security( @@ -796,7 +796,7 @@ pub async fn add_chunk_to_group( (status = 400, description = "Service error related to adding the chunk group by tracking_id", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("tracking_id" = uuid, description = "Tracking id of the group to add the chunk to as a bookmark"), ), security( @@ -895,7 +895,7 @@ pub enum GetChunksInGroupResponse { (status = 404, description = "Group not found", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("group_id" = uuid::Uuid, Path, description = "Id of the group you want to fetch."), ("X-API-Version" = Option, Header, description = "The version of the API to use for the request"), ("page" = Option, description = "The page of chunks to get from the group"), @@ -953,7 +953,7 @@ pub struct GetChunksInGroupByTrackingIdReqPayload { (status = 404, description = "Group not found", body = ErrorResponseBody) ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("group_tracking_id" = String, description = "The id of the group to get the chunks from"), ("X-API-Version" = Option, Header, description = "The version of the API to use for the request"), ("page" = u64, description = "The page of chunks to get from the group"), @@ -1012,7 +1012,7 @@ pub struct GetGroupsForChunksReqPayload { (status = 400, description = "Service error relating to getting the groups that the chunk is in", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["readonly"]), @@ -1054,7 +1054,7 @@ pub struct RemoveChunkFromGroupReqPayload { (status = 400, description = "Service error relating to removing the chunk from the group", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("group_id" = uuid::Uuid, Path, description = "Id of the group you want to remove the chunk from."), ("chunk_id" = Option, Query, description = "Id of the chunk you want to remove from the group"), ), @@ -1151,7 +1151,7 @@ pub enum RecommendGroupsResponse { (status = 400, description = "Service error relating to to getting similar chunks", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("X-API-Version" = Option, Header, description = "The API version to use for this request. Defaults to V2 for orgs created after July 12, 2024 and V1 otherwise.") ), security( @@ -1491,7 +1491,7 @@ impl SearchWithinGroupResults { (status = 400, description = "Service error relating to getting the groups that the chunk is in", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("X-API-Version" = Option, Header, description = "The API version to use for this request. Defaults to V2 for orgs created after July 12, 2024 and V1 otherwise.") ), security( @@ -1672,7 +1672,7 @@ pub struct SearchOverGroupsReqPayload { (status = 400, description = "Service error relating to searching over groups", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("X-API-Version" = Option, Header, description = "The API version to use for this request. Defaults to V2 for orgs created after July 12, 2024 and V1 otherwise.") ), security( diff --git a/server/src/handlers/invitation_handler.rs b/server/src/handlers/invitation_handler.rs index 5878c93f7..4eb350bdd 100644 --- a/server/src/handlers/invitation_handler.rs +++ b/server/src/handlers/invitation_handler.rs @@ -54,7 +54,7 @@ pub struct InvitationData { (status = 400, description = "Invalid email or some other error", body = ErrorResponseBody), ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ), security( ("ApiKey" = ["admin"]), @@ -170,7 +170,7 @@ pub async fn create_invitation( (status = 400, description = "Service error relating to getting invitations for the dataset", body = ErrorResponseBody), ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ("organization_id" = uuid, Path, description = "The organization id to get invitations for"), ), security( @@ -204,7 +204,7 @@ pub async fn get_invitations( (status = 400, description = "Service error relating to deleting invitation", body = ErrorResponseBody), ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ("invitation_id" = uuid, Path, description = "The id of the invitation to delete"), ), security( diff --git a/server/src/handlers/message_handler.rs b/server/src/handlers/message_handler.rs index f85040494..2294d4352 100644 --- a/server/src/handlers/message_handler.rs +++ b/server/src/handlers/message_handler.rs @@ -126,7 +126,7 @@ pub struct CreateMessageReqPayload { (status = 400, description = "Service error relating to getting a chat completion", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["readonly"]), @@ -254,7 +254,7 @@ pub async fn create_message( (status = 400, description = "Service error relating to getting the messages", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("messages_topic_id" = uuid, description = "The ID of the topic to get messages for."), ), security( @@ -397,7 +397,7 @@ impl From for CreateMessageReqPayload { (status = 400, description = "Service error relating to getting a chat completion", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["readonly"]), @@ -471,7 +471,7 @@ pub async fn edit_message( (status = 400, description = "Service error relating to getting a chat completion", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["readonly"]), @@ -615,7 +615,7 @@ pub async fn regenerate_message_patch( (status = 400, description = "Service error relating to getting a chat completion", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["readonly"]), @@ -675,7 +675,7 @@ pub struct SuggestedQueriesResponse { (status = 400, description = "Service error relating to to updating chunk, likely due to conflicting tracking_id", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["readonly"]), diff --git a/server/src/handlers/organization_handler.rs b/server/src/handlers/organization_handler.rs index d0fe51f13..89686b15c 100644 --- a/server/src/handlers/organization_handler.rs +++ b/server/src/handlers/organization_handler.rs @@ -30,7 +30,7 @@ use utoipa::ToSchema; (status = 404, description = "Organization not found", body = ErrorResponseBody) ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ("organization_id" = Option, Path, description = "The id of the organization you want to fetch."), ), security( @@ -66,7 +66,7 @@ pub async fn get_organization( (status = 400, description = "Service error relating to deleting the organization by id", body = ErrorResponseBody), ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ("organization_id" = Option, Path, description = "The id of the organization you want to fetch."), ), security( @@ -119,7 +119,7 @@ pub struct UpdateOrganizationReqPayload { (status = 400, description = "Service error relating to updating the organization", body = ErrorResponseBody), ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ), security( ("ApiKey" = ["owner"]), @@ -215,7 +215,7 @@ pub async fn create_organization( (status = 400, description = "Service error relating to finding the organization's usage by id", body = ErrorResponseBody), ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ("organization_id" = Option, Path, description = "The id of the organization you want to fetch the usage of."), ), security( @@ -252,7 +252,7 @@ pub async fn get_organization_usage( (status = 400, description = "Service error relating to finding the organization's users by id", body = ErrorResponseBody), ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ("organization_id" = Option, Path, description = "The id of the organization you want to fetch the users of."), ), security( @@ -295,7 +295,7 @@ pub struct RemoveUserFromOrgPathParams { (status = 400, description = "Service error relating to removing the user from the organization", body = ErrorResponseBody), ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ("organization_id" = uuid::Uuid, Path, description = "The id of the organization you want to remove the user from"), ("user_id" = uuid::Uuid, Path, description = "The id of the user you want to remove from the organization"), ), @@ -374,7 +374,7 @@ pub struct UpdateAllOrgDatasetConfigsReqPayload { (status = 400, description = "Service error relating to updating the dataset ServerConfigurations", body = ErrorResponseBody), ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ), security( ("ApiKey" = ["owner"]), diff --git a/server/src/handlers/stripe_handler.rs b/server/src/handlers/stripe_handler.rs index f34aa91ca..5ef472dcb 100644 --- a/server/src/handlers/stripe_handler.rs +++ b/server/src/handlers/stripe_handler.rs @@ -294,7 +294,7 @@ pub async fn direct_to_payment_link( (status = 400, description = "Service error relating to creating a URL for a stripe checkout page", body = ErrorResponseBody), ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ("subscription_id" = uuid, Path, description = "id of the subscription you want to cancel"), ), security( @@ -339,7 +339,7 @@ pub struct UpdateSubscriptionData { (status = 400, description = "Service error relating to updating the subscription to the new plan", body = ErrorResponseBody), ), params( - ("TR-Organization" = String, Header, description = "The organization id to use for the request"), + ("TR-Organization" = uuid::Uuid, Header, description = "The organization id to use for the request"), ("subscription_id" = uuid::Uuid, Path, description = "id of the subscription you want to update"), ("plan_id" = uuid::Uuid, Path, description = "id of the plan you want to subscribe to"), ), diff --git a/server/src/handlers/topic_handler.rs b/server/src/handlers/topic_handler.rs index 3a6e4947d..ca00657cf 100644 --- a/server/src/handlers/topic_handler.rs +++ b/server/src/handlers/topic_handler.rs @@ -38,7 +38,7 @@ pub struct CreateTopicReqPayload { (status = 400, description = "Topic name empty or a service error", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -108,7 +108,7 @@ pub struct DeleteTopicData { (status = 400, description = "Service error relating to topic deletion", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ("topic_id" = uuid, Path, description = "The id of the topic you want to delete."), ), security( @@ -151,7 +151,7 @@ pub struct UpdateTopicReqPayload { (status = 400, description = "Service error relating to topic update", body = ErrorResponseBody), ), params( - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]), @@ -191,7 +191,7 @@ pub async fn update_topic( ), params ( ("owner_id", description="The owner_id to get topics of; A common approach is to use a browser fingerprint or your user's id"), - ("TR-Dataset" = String, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), + ("TR-Dataset" = uuid::Uuid, Header, description = "The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid."), ), security( ("ApiKey" = ["admin"]),