@@ -422,16 +422,16 @@ pub struct TasksQuery<'a, T> {
422
422
client : & ' a Client ,
423
423
// Index uids array to only retrieve the tasks of the indexes.
424
424
#[ serde( skip_serializing_if = "Option::is_none" ) ]
425
- index_uid : Option < Vec < & ' a str > > ,
425
+ index_uids : Option < Vec < & ' a str > > ,
426
426
// Statuses array to only retrieve the tasks with these statuses.
427
427
#[ serde( skip_serializing_if = "Option::is_none" ) ]
428
- status : Option < Vec < & ' a str > > ,
428
+ statuses : Option < Vec < & ' a str > > ,
429
429
// Types array to only retrieve the tasks with these [TaskType].
430
430
#[ serde( skip_serializing_if = "Option::is_none" , rename = "type" ) ]
431
- task_type : Option < Vec < & ' a str > > ,
431
+ task_types : Option < Vec < & ' a str > > ,
432
432
// Uids of the tasks to retrieve
433
433
#[ serde( skip_serializing_if = "Option::is_none" ) ]
434
- uid : Option < Vec < & ' a u32 > > ,
434
+ uids : Option < Vec < & ' a u32 > > ,
435
435
// Date to retrieve all tasks that were enqueued before it.
436
436
#[ serde(
437
437
skip_serializing_if = "Option::is_none" ,
@@ -475,32 +475,32 @@ pub struct TasksQuery<'a, T> {
475
475
476
476
#[ allow( missing_docs) ]
477
477
impl < ' a , T > TasksQuery < ' a , T > {
478
- pub fn with_index_uid < ' b > (
478
+ pub fn with_index_uids < ' b > (
479
479
& ' b mut self ,
480
480
index_uid : impl IntoIterator < Item = & ' a str > ,
481
481
) -> & ' b mut TasksQuery < ' a , T > {
482
- self . index_uid = Some ( index_uid. into_iter ( ) . collect ( ) ) ;
482
+ self . index_uids = Some ( index_uid. into_iter ( ) . collect ( ) ) ;
483
483
self
484
484
}
485
- pub fn with_status < ' b > (
485
+ pub fn with_statuses < ' b > (
486
486
& ' b mut self ,
487
487
status : impl IntoIterator < Item = & ' a str > ,
488
488
) -> & ' b mut TasksQuery < ' a , T > {
489
- self . status = Some ( status. into_iter ( ) . collect ( ) ) ;
489
+ self . statuses = Some ( status. into_iter ( ) . collect ( ) ) ;
490
490
self
491
491
}
492
- pub fn with_type < ' b > (
492
+ pub fn with_types < ' b > (
493
493
& ' b mut self ,
494
494
task_type : impl IntoIterator < Item = & ' a str > ,
495
495
) -> & ' b mut TasksQuery < ' a , T > {
496
- self . task_type = Some ( task_type. into_iter ( ) . collect ( ) ) ;
496
+ self . task_types = Some ( task_type. into_iter ( ) . collect ( ) ) ;
497
497
self
498
498
}
499
- pub fn with_uid < ' b > (
499
+ pub fn with_uids < ' b > (
500
500
& ' b mut self ,
501
501
index_uid : impl IntoIterator < Item = & ' a u32 > ,
502
502
) -> & ' b mut TasksQuery < ' a , T > {
503
- self . uid = Some ( index_uid. into_iter ( ) . collect ( ) ) ;
503
+ self . uids = Some ( index_uid. into_iter ( ) . collect ( ) ) ;
504
504
self
505
505
}
506
506
pub fn with_before_enqueued_at < ' b > (
@@ -551,10 +551,10 @@ impl<'a> TasksQuery<'a, TasksDefault> {
551
551
pub fn new ( client : & ' a Client ) -> TasksQuery < ' a , TasksDefault > {
552
552
TasksQuery {
553
553
client,
554
- index_uid : None ,
555
- status : None ,
556
- task_type : None ,
557
- uid : None ,
554
+ index_uids : None ,
555
+ statuses : None ,
556
+ task_types : None ,
557
+ uids : None ,
558
558
before_enqueued_at : None ,
559
559
after_enqueued_at : None ,
560
560
before_started_at : None ,
@@ -574,10 +574,10 @@ impl<'a> TasksQuery<'a, TasksPagination> {
574
574
pub fn new ( client : & ' a Client ) -> TasksQuery < ' a , TasksPagination > {
575
575
TasksQuery {
576
576
client,
577
- index_uid : None ,
578
- status : None ,
579
- task_type : None ,
580
- uid : None ,
577
+ index_uids : None ,
578
+ statuses : None ,
579
+ task_types : None ,
580
+ uids : None ,
581
581
before_enqueued_at : None ,
582
582
after_enqueued_at : None ,
583
583
before_started_at : None ,
@@ -781,12 +781,12 @@ mod test {
781
781
782
782
let mut query = TasksSearchQuery :: new ( & client) ;
783
783
query
784
- . with_index_uid ( [ "movies" , "test" ] )
785
- . with_status ( [ "equeued" ] )
786
- . with_type ( [ "documentDeletion" ] )
784
+ . with_index_uids ( [ "movies" , "test" ] )
785
+ . with_statuses ( [ "equeued" ] )
786
+ . with_types ( [ "documentDeletion" ] )
787
787
. with_from ( 1 )
788
788
. with_limit ( 0 )
789
- . with_uid ( [ & 1 ] ) ;
789
+ . with_uids ( [ & 1 ] ) ;
790
790
791
791
let _ = client. get_tasks_with ( & query) . await ;
792
792
@@ -867,9 +867,9 @@ mod test {
867
867
868
868
let mut query = TasksSearchQuery :: new ( & client) ;
869
869
let _ = query
870
- . with_index_uid ( [ "movies" , "test" ] )
871
- . with_status ( [ "equeued" ] )
872
- . with_type ( [ "documentDeletion" ] )
870
+ . with_index_uids ( [ "movies" , "test" ] )
871
+ . with_statuses ( [ "equeued" ] )
872
+ . with_types ( [ "documentDeletion" ] )
873
873
. execute ( )
874
874
. await ;
875
875
@@ -881,7 +881,7 @@ mod test {
881
881
#[ meilisearch_test]
882
882
async fn test_get_tasks_with_none_existant_index_uid ( client : Client ) -> Result < ( ) , Error > {
883
883
let mut query = TasksSearchQuery :: new ( & client) ;
884
- query. with_index_uid ( [ "no_name" ] ) ;
884
+ query. with_index_uids ( [ "no_name" ] ) ;
885
885
let tasks = client. get_tasks_with ( & query) . await . unwrap ( ) ;
886
886
887
887
assert_eq ! ( tasks. results. len( ) , 0 ) ;
@@ -891,7 +891,7 @@ mod test {
891
891
#[ meilisearch_test]
892
892
async fn test_get_tasks_with_execute ( client : Client ) -> Result < ( ) , Error > {
893
893
let tasks = TasksSearchQuery :: new ( & client)
894
- . with_index_uid ( [ "no_name" ] )
894
+ . with_index_uids ( [ "no_name" ] )
895
895
. execute ( )
896
896
. await
897
897
. unwrap ( ) ;
0 commit comments