#![allow(
missing_docs,
clippy::doc_lazy_continuation,
clippy::doc_overindented_list_items
)]
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct AddFaqDTO {
#[serde(rename = "locationId")]
pub location_id: String,
pub question: String,
pub answer: String,
#[serde(rename = "knowledgeBaseId")]
pub knowledge_base_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct BadRequestDTO {
#[serde(
rename = "statusCode",
default,
skip_serializing_if = "Option::is_none"
)]
pub status_code: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CrawledUrlDTO {
pub id: String,
pub url: String,
pub title: String,
pub status: String,
#[serde(rename = "locationId")]
pub location_id: String,
#[serde(rename = "knowledgeBaseId")]
pub knowledge_base_id: String,
pub content: String,
#[serde(rename = "contentEditedByUser")]
pub content_edited_by_user: bool,
#[serde(rename = "updatedAt")]
pub updated_at: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CrawlingAggregateDTO {
#[serde(rename = "_id")]
pub id: String,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub records: Vec<CrawlingRecordDTO>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CrawlingRecordDTO {
pub url: String,
pub id: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<ErrorDetailsDTO>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CrawlingStatusDataDTO {
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub aggregate: Vec<CrawlingAggregateDTO>,
#[serde(rename = "operationDetails")]
pub operation_details: OperationDetailsDTO,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CrawlingStatusResponseDTO {
pub success: bool,
pub data: CrawlingStatusDataDTO,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateFaqResponseDTO {
pub success: bool,
pub faq: FaqResponseDTO,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateKnowledgeBaseDTO {
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "locationId")]
pub location_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct CreateKnowledgeBaseResponseDTO {
pub success: bool,
pub data: KnowledgeBaseDataDTO,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteFaqResponseDTO {
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteKnowledgeBaseResponseDTO {
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteWebsiteUrlRequestDTO {
#[serde(rename = "knowledgeBaseId")]
pub knowledge_base_id: String,
#[serde(rename = "locationId")]
pub location_id: String,
#[serde(rename = "urlIds", default, skip_serializing_if = "Vec::is_empty")]
pub url_ids: Vec<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DeleteWebsiteUrlResponseDTO {
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DiscoverWebsiteDataDTO {
#[serde(rename = "operationId")]
pub operation_id: String,
pub status: String,
pub url: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DiscoverWebsiteRequestDTO {
#[serde(rename = "locationId")]
pub location_id: String,
pub url: String,
pub option: String,
#[serde(rename = "knowledgeBaseId")]
pub knowledge_base_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DiscoverWebsiteResponseDTO {
pub success: bool,
pub data: DiscoverWebsiteDataDTO,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ErrorDetailsDTO {
pub stack: String,
pub response: String,
pub status: f64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub options: Option<serde_json::Value>,
pub message: String,
pub name: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct FaqResponseDTO {
pub id: String,
pub question: String,
#[serde(rename = "questionLowerCase")]
pub question_lower_case: String,
pub answer: String,
#[serde(rename = "knowledgeBaseId")]
pub knowledge_base_id: String,
#[serde(rename = "locationId")]
pub location_id: String,
#[serde(rename = "trainedUrlId")]
pub trained_url_id: String,
pub deleted: bool,
#[serde(rename = "createdAt")]
pub created_at: String,
#[serde(rename = "updatedAt")]
pub updated_at: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetAllKnowledgeBasesPaginatedDataDTO {
#[serde(
rename = "knowledgeBases",
default,
skip_serializing_if = "Vec::is_empty"
)]
pub knowledge_bases: Vec<KnowledgeBaseListItemDTO>,
#[serde(rename = "activeCount")]
pub active_count: f64,
#[serde(rename = "hasMore")]
pub has_more: bool,
#[serde(
rename = "lastKnowledgeBaseId",
default,
skip_serializing_if = "Option::is_none"
)]
pub last_knowledge_base_id: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetAllKnowledgeBasesPaginatedResponseDTO {
pub success: bool,
pub data: GetAllKnowledgeBasesPaginatedDataDTO,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetAllUrlsByKnowledgeBaseResponseDTO {
pub count: f64,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub urls: Vec<CrawledUrlDTO>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetKnowledgeBaseByIdDataDTO {
pub id: String,
pub name: String,
#[serde(rename = "nameLowerCase")]
pub name_lower_case: String,
#[serde(rename = "locationId")]
pub location_id: String,
pub deleted: bool,
#[serde(rename = "createdAt")]
pub created_at: String,
#[serde(rename = "updatedAt")]
pub updated_at: String,
#[serde(rename = "kbMetadata")]
pub kb_metadata: KnowledgeBaseMetadataDTO,
#[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")]
pub is_default: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GetKnowledgeBaseByIdResponseDTO {
pub success: bool,
pub data: GetKnowledgeBaseByIdDataDTO,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct InternalServerErrorDTO {
#[serde(
rename = "statusCode",
default,
skip_serializing_if = "Option::is_none"
)]
pub status_code: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct KnowledgeBaseDataDTO {
pub id: String,
pub name: String,
#[serde(rename = "nameLowerCase")]
pub name_lower_case: String,
#[serde(rename = "locationId")]
pub location_id: String,
#[serde(rename = "kbMetadata")]
pub kb_metadata: serde_json::Value,
pub deleted: bool,
#[serde(rename = "createdAt")]
pub created_at: String,
#[serde(rename = "updatedAt")]
pub updated_at: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct KnowledgeBaseListItemDTO {
pub id: String,
pub name: String,
#[serde(rename = "createdAt")]
pub created_at: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct KnowledgeBaseMetadataDTO {
pub faqs: f64,
pub urls: f64,
#[serde(rename = "richText")]
pub rich_text: f64,
pub files: f64,
#[serde(rename = "webSearches")]
pub web_searches: f64,
pub tables: f64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ListFaqsResponseDTO {
pub count: f64,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub faqs: Vec<FaqResponseDTO>,
#[serde(rename = "lastFaqId", default, skip_serializing_if = "Option::is_none")]
pub last_faq_id: Option<String>,
#[serde(rename = "hasMore", default, skip_serializing_if = "Option::is_none")]
pub has_more: Option<bool>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct OperationDetailsDTO {
#[serde(rename = "discoveredUrlsCount")]
pub discovered_urls_count: f64,
#[serde(rename = "trainedUrlsCount")]
pub trained_urls_count: f64,
#[serde(rename = "_id")]
pub id: String,
#[serde(rename = "locationId")]
pub location_id: String,
pub status: String,
pub url: String,
pub mode: String,
#[serde(rename = "knowledgeBaseId")]
pub knowledge_base_id: String,
#[serde(rename = "createdAt")]
pub created_at: String,
#[serde(rename = "updatedAt")]
pub updated_at: String,
#[serde(rename = "__v")]
pub v: f64,
#[serde(
rename = "robotsFileData",
default,
skip_serializing_if = "Option::is_none"
)]
pub robots_file_data: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct TrainDiscoveredUrlsDTO {
#[serde(rename = "locationId")]
pub location_id: String,
#[serde(rename = "urlIds", default, skip_serializing_if = "Vec::is_empty")]
pub url_ids: Vec<String>,
#[serde(rename = "knowledgeBaseId")]
pub knowledge_base_id: String,
#[serde(rename = "operationId")]
pub operation_id: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct TrainDiscoveredUrlsResponseDTO {
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UnauthorizedDTO {
#[serde(
rename = "statusCode",
default,
skip_serializing_if = "Option::is_none"
)]
pub status_code: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UnprocessableDTO {
#[serde(
rename = "statusCode",
default,
skip_serializing_if = "Option::is_none"
)]
pub status_code: Option<f64>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub message: Vec<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateFaqBodyDTO {
pub question: String,
pub answer: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateFaqResponseDTO {
pub success: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateKnowledgeBaseDTO {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct UpdateKnowledgeBaseResponseDTO {
pub success: bool,
}