Implements the get and delete tasks route

This commit is contained in:
Tamo 2024-08-08 19:14:19 +02:00
parent f00a285a6d
commit 742d0ee531
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
25 changed files with 1787 additions and 85 deletions

View file

@ -2,6 +2,7 @@ use std::collections::HashMap;
use charabia::Language;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
use crate::fields_ids_map::FieldsIdsMap;
use crate::FieldId;
@ -14,9 +15,10 @@ use crate::FieldId;
/// The pattern `attribute_name*` matches any attribute name that starts with `attribute_name`.
/// The pattern `*attribute_name` matches any attribute name that ends with `attribute_name`.
/// The pattern `*attribute_name*` matches any attribute name that contains `attribute_name`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, ToSchema)]
pub struct LocalizedAttributesRule {
pub attribute_patterns: Vec<String>,
#[schema(value_type = Vec<String>)]
pub locales: Vec<Language>,
}

View file

@ -10,6 +10,7 @@ use itertools::{EitherOrBoth, Itertools};
use roaring::RoaringBitmap;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use time::OffsetDateTime;
use utoipa::{PartialSchema, ToSchema};
use super::del_add::DelAddOperation;
use super::index_documents::{IndexDocumentsConfig, Transform};
@ -40,6 +41,18 @@ pub enum Setting<T> {
NotSet,
}
impl<T: ToSchema> ToSchema for Setting<T> {
fn name() -> std::borrow::Cow<'static, str> {
T::name()
}
}
impl<T: PartialSchema> PartialSchema for Setting<T> {
fn schema() -> utoipa::openapi::RefOr<utoipa::openapi::schema::Schema> {
T::schema()
}
}
impl<T, E> Deserr<E> for Setting<T>
where
T: Deserr<E>,