Skip to main content

couchbase_core/options/
search_management.rs

1/*
2 *
3 *  * Copyright (c) 2025 Couchbase, Inc.
4 *  *
5 *  * Licensed under the Apache License, Version 2.0 (the "License");
6 *  * you may not use this file except in compliance with the License.
7 *  * You may obtain a copy of the License at
8 *  *
9 *  *    http://www.apache.org/licenses/LICENSE-2.0
10 *  *
11 *  * Unless required by applicable law or agreed to in writing, software
12 *  * distributed under the License is distributed on an "AS IS" BASIS,
13 *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *  * See the License for the specific language governing permissions and
15 *  * limitations under the License.
16 *
17 */
18
19use crate::httpx::request::OnBehalfOfInfo;
20use crate::retry::{RetryStrategy, DEFAULT_RETRY_STRATEGY};
21use crate::searchx;
22use crate::searchx::ensure_index_helper::DesiredState;
23use std::sync::Arc;
24
25#[derive(Debug)]
26#[non_exhaustive]
27pub struct GetIndexOptions<'a> {
28    pub index_name: &'a str,
29    pub bucket_name: Option<&'a str>,
30    pub scope_name: Option<&'a str>,
31    pub on_behalf_of: Option<&'a OnBehalfOfInfo>,
32    pub retry_strategy: Arc<dyn RetryStrategy>,
33    pub endpoint: Option<&'a str>,
34}
35
36impl<'a> GetIndexOptions<'a> {
37    pub fn new(index_name: &'a str) -> Self {
38        Self {
39            index_name,
40            bucket_name: None,
41            scope_name: None,
42            on_behalf_of: None,
43            retry_strategy: DEFAULT_RETRY_STRATEGY.clone(),
44            endpoint: None,
45        }
46    }
47
48    pub fn bucket_name(mut self, bucket_name: &'a str) -> Self {
49        self.bucket_name = Some(bucket_name);
50        self
51    }
52
53    pub fn scope_name(mut self, scope_name: &'a str) -> Self {
54        self.scope_name = Some(scope_name);
55        self
56    }
57
58    pub fn retry_strategy(mut self, retry_strategy: Arc<dyn RetryStrategy>) -> Self {
59        self.retry_strategy = retry_strategy;
60        self
61    }
62
63    pub fn endpoint(mut self, endpoint: &'a str) -> Self {
64        self.endpoint = Some(endpoint);
65        self
66    }
67}
68
69#[derive(Debug)]
70#[non_exhaustive]
71pub struct GetAllIndexesOptions<'a> {
72    pub bucket_name: Option<&'a str>,
73    pub scope_name: Option<&'a str>,
74    pub on_behalf_of: Option<&'a OnBehalfOfInfo>,
75    pub retry_strategy: Arc<dyn RetryStrategy>,
76    pub endpoint: Option<&'a str>,
77}
78
79impl<'a> Default for GetAllIndexesOptions<'a> {
80    fn default() -> Self {
81        Self::new()
82    }
83}
84
85impl<'a> GetAllIndexesOptions<'a> {
86    pub fn new() -> Self {
87        Self {
88            bucket_name: None,
89            scope_name: None,
90            on_behalf_of: None,
91            retry_strategy: DEFAULT_RETRY_STRATEGY.clone(),
92            endpoint: None,
93        }
94    }
95
96    pub fn bucket_name(mut self, bucket_name: &'a str) -> Self {
97        self.bucket_name = Some(bucket_name);
98        self
99    }
100
101    pub fn scope_name(mut self, scope_name: &'a str) -> Self {
102        self.scope_name = Some(scope_name);
103        self
104    }
105
106    pub fn retry_strategy(mut self, retry_strategy: Arc<dyn RetryStrategy>) -> Self {
107        self.retry_strategy = retry_strategy;
108        self
109    }
110
111    pub fn endpoint(mut self, endpoint: &'a str) -> Self {
112        self.endpoint = Some(endpoint);
113        self
114    }
115}
116
117#[derive(Debug)]
118#[non_exhaustive]
119pub struct UpsertIndexOptions<'a> {
120    pub index: &'a searchx::index::Index,
121    pub bucket_name: Option<&'a str>,
122    pub scope_name: Option<&'a str>,
123
124    pub retry_strategy: Arc<dyn RetryStrategy>,
125    pub endpoint: Option<&'a str>,
126
127    pub on_behalf_of: Option<&'a OnBehalfOfInfo>,
128}
129
130impl<'a> UpsertIndexOptions<'a> {
131    pub fn new(index: &'a searchx::index::Index) -> Self {
132        Self {
133            index,
134            bucket_name: None,
135            scope_name: None,
136            retry_strategy: DEFAULT_RETRY_STRATEGY.clone(),
137            endpoint: None,
138            on_behalf_of: None,
139        }
140    }
141
142    pub fn bucket_name(mut self, bucket_name: &'a str) -> Self {
143        self.bucket_name = Some(bucket_name);
144        self
145    }
146
147    pub fn scope_name(mut self, scope_name: &'a str) -> Self {
148        self.scope_name = Some(scope_name);
149        self
150    }
151
152    pub fn retry_strategy(mut self, retry_strategy: Arc<dyn RetryStrategy>) -> Self {
153        self.retry_strategy = retry_strategy;
154        self
155    }
156
157    pub fn endpoint(mut self, endpoint: &'a str) -> Self {
158        self.endpoint = Some(endpoint);
159        self
160    }
161
162    pub fn on_behalf_of(mut self, on_behalf_of: &'a OnBehalfOfInfo) -> Self {
163        self.on_behalf_of = Some(on_behalf_of);
164        self
165    }
166}
167
168#[derive(Debug)]
169#[non_exhaustive]
170pub struct DeleteIndexOptions<'a> {
171    pub index_name: &'a str,
172    pub bucket_name: Option<&'a str>,
173    pub scope_name: Option<&'a str>,
174
175    pub retry_strategy: Arc<dyn RetryStrategy>,
176    pub endpoint: Option<&'a str>,
177
178    pub on_behalf_of: Option<&'a OnBehalfOfInfo>,
179}
180
181impl<'a> DeleteIndexOptions<'a> {
182    pub fn new(index_name: &'a str) -> Self {
183        Self {
184            index_name,
185            bucket_name: None,
186            scope_name: None,
187            retry_strategy: DEFAULT_RETRY_STRATEGY.clone(),
188            endpoint: None,
189            on_behalf_of: None,
190        }
191    }
192
193    pub fn bucket_name(mut self, bucket_name: &'a str) -> Self {
194        self.bucket_name = Some(bucket_name);
195        self
196    }
197
198    pub fn scope_name(mut self, scope_name: &'a str) -> Self {
199        self.scope_name = Some(scope_name);
200        self
201    }
202
203    pub fn retry_strategy(mut self, retry_strategy: Arc<dyn RetryStrategy>) -> Self {
204        self.retry_strategy = retry_strategy;
205        self
206    }
207
208    pub fn endpoint(mut self, endpoint: &'a str) -> Self {
209        self.endpoint = Some(endpoint);
210        self
211    }
212
213    pub fn on_behalf_of(mut self, on_behalf_of: &'a OnBehalfOfInfo) -> Self {
214        self.on_behalf_of = Some(on_behalf_of);
215        self
216    }
217}
218
219#[derive(Debug)]
220#[non_exhaustive]
221pub struct AnalyzeDocumentOptions<'a> {
222    pub index_name: &'a str,
223    pub doc_content: &'a [u8],
224    pub bucket_name: Option<&'a str>,
225    pub scope_name: Option<&'a str>,
226    pub retry_strategy: Arc<dyn RetryStrategy>,
227    pub endpoint: Option<&'a str>,
228    pub on_behalf_of: Option<&'a OnBehalfOfInfo>,
229}
230
231impl<'a> AnalyzeDocumentOptions<'a> {
232    pub fn new(index_name: &'a str, doc_content: &'a [u8]) -> Self {
233        Self {
234            index_name,
235            doc_content,
236            bucket_name: None,
237            scope_name: None,
238            retry_strategy: DEFAULT_RETRY_STRATEGY.clone(),
239            endpoint: None,
240            on_behalf_of: None,
241        }
242    }
243
244    pub fn bucket_name(mut self, bucket_name: &'a str) -> Self {
245        self.bucket_name = Some(bucket_name);
246        self
247    }
248
249    pub fn scope_name(mut self, scope_name: &'a str) -> Self {
250        self.scope_name = Some(scope_name);
251        self
252    }
253
254    pub fn retry_strategy(mut self, retry_strategy: Arc<dyn RetryStrategy>) -> Self {
255        self.retry_strategy = retry_strategy;
256        self
257    }
258
259    pub fn endpoint(mut self, endpoint: &'a str) -> Self {
260        self.endpoint = Some(endpoint);
261        self
262    }
263
264    pub fn on_behalf_of(mut self, on_behalf_of: &'a OnBehalfOfInfo) -> Self {
265        self.on_behalf_of = Some(on_behalf_of);
266        self
267    }
268}
269
270#[derive(Debug)]
271#[non_exhaustive]
272pub struct GetIndexedDocumentsCountOptions<'a> {
273    pub index_name: &'a str,
274    pub bucket_name: Option<&'a str>,
275    pub scope_name: Option<&'a str>,
276    pub retry_strategy: Arc<dyn RetryStrategy>,
277    pub endpoint: Option<&'a str>,
278    pub on_behalf_of: Option<&'a OnBehalfOfInfo>,
279}
280
281impl<'a> GetIndexedDocumentsCountOptions<'a> {
282    pub fn new(index_name: &'a str) -> Self {
283        Self {
284            index_name,
285            bucket_name: None,
286            scope_name: None,
287            retry_strategy: DEFAULT_RETRY_STRATEGY.clone(),
288            endpoint: None,
289            on_behalf_of: None,
290        }
291    }
292
293    pub fn bucket_name(mut self, bucket_name: &'a str) -> Self {
294        self.bucket_name = Some(bucket_name);
295        self
296    }
297
298    pub fn scope_name(mut self, scope_name: &'a str) -> Self {
299        self.scope_name = Some(scope_name);
300        self
301    }
302
303    pub fn retry_strategy(mut self, retry_strategy: Arc<dyn RetryStrategy>) -> Self {
304        self.retry_strategy = retry_strategy;
305        self
306    }
307
308    pub fn endpoint(mut self, endpoint: &'a str) -> Self {
309        self.endpoint = Some(endpoint);
310        self
311    }
312
313    pub fn on_behalf_of(mut self, on_behalf_of: &'a OnBehalfOfInfo) -> Self {
314        self.on_behalf_of = Some(on_behalf_of);
315        self
316    }
317}
318
319#[derive(Debug)]
320#[non_exhaustive]
321pub struct PauseIngestOptions<'a> {
322    pub index_name: &'a str,
323    pub bucket_name: Option<&'a str>,
324    pub scope_name: Option<&'a str>,
325    pub retry_strategy: Arc<dyn RetryStrategy>,
326    pub endpoint: Option<&'a str>,
327    pub on_behalf_of: Option<&'a OnBehalfOfInfo>,
328}
329
330impl<'a> PauseIngestOptions<'a> {
331    pub fn new(index_name: &'a str) -> Self {
332        Self {
333            index_name,
334            bucket_name: None,
335            scope_name: None,
336            retry_strategy: DEFAULT_RETRY_STRATEGY.clone(),
337            endpoint: None,
338            on_behalf_of: None,
339        }
340    }
341
342    pub fn bucket_name(mut self, bucket_name: &'a str) -> Self {
343        self.bucket_name = Some(bucket_name);
344        self
345    }
346
347    pub fn scope_name(mut self, scope_name: &'a str) -> Self {
348        self.scope_name = Some(scope_name);
349        self
350    }
351
352    pub fn retry_strategy(mut self, retry_strategy: Arc<dyn RetryStrategy>) -> Self {
353        self.retry_strategy = retry_strategy;
354        self
355    }
356
357    pub fn endpoint(mut self, endpoint: &'a str) -> Self {
358        self.endpoint = Some(endpoint);
359        self
360    }
361
362    pub fn on_behalf_of(mut self, on_behalf_of: &'a OnBehalfOfInfo) -> Self {
363        self.on_behalf_of = Some(on_behalf_of);
364        self
365    }
366}
367
368#[derive(Debug)]
369#[non_exhaustive]
370pub struct ResumeIngestOptions<'a> {
371    pub index_name: &'a str,
372    pub bucket_name: Option<&'a str>,
373    pub scope_name: Option<&'a str>,
374    pub retry_strategy: Arc<dyn RetryStrategy>,
375    pub endpoint: Option<&'a str>,
376    pub on_behalf_of: Option<&'a OnBehalfOfInfo>,
377}
378
379impl<'a> ResumeIngestOptions<'a> {
380    pub fn new(index_name: &'a str) -> Self {
381        Self {
382            index_name,
383            bucket_name: None,
384            scope_name: None,
385            retry_strategy: DEFAULT_RETRY_STRATEGY.clone(),
386            endpoint: None,
387            on_behalf_of: None,
388        }
389    }
390
391    pub fn bucket_name(mut self, bucket_name: &'a str) -> Self {
392        self.bucket_name = Some(bucket_name);
393        self
394    }
395
396    pub fn scope_name(mut self, scope_name: &'a str) -> Self {
397        self.scope_name = Some(scope_name);
398        self
399    }
400
401    pub fn retry_strategy(mut self, retry_strategy: Arc<dyn RetryStrategy>) -> Self {
402        self.retry_strategy = retry_strategy;
403        self
404    }
405
406    pub fn endpoint(mut self, endpoint: &'a str) -> Self {
407        self.endpoint = Some(endpoint);
408        self
409    }
410
411    pub fn on_behalf_of(mut self, on_behalf_of: &'a OnBehalfOfInfo) -> Self {
412        self.on_behalf_of = Some(on_behalf_of);
413        self
414    }
415}
416
417#[derive(Debug)]
418#[non_exhaustive]
419pub struct AllowQueryingOptions<'a> {
420    pub index_name: &'a str,
421    pub bucket_name: Option<&'a str>,
422    pub scope_name: Option<&'a str>,
423    pub retry_strategy: Arc<dyn RetryStrategy>,
424    pub endpoint: Option<&'a str>,
425    pub on_behalf_of: Option<&'a OnBehalfOfInfo>,
426}
427
428impl<'a> AllowQueryingOptions<'a> {
429    pub fn new(index_name: &'a str) -> Self {
430        Self {
431            index_name,
432            bucket_name: None,
433            scope_name: None,
434            retry_strategy: DEFAULT_RETRY_STRATEGY.clone(),
435            endpoint: None,
436            on_behalf_of: None,
437        }
438    }
439
440    pub fn bucket_name(mut self, bucket_name: &'a str) -> Self {
441        self.bucket_name = Some(bucket_name);
442        self
443    }
444
445    pub fn scope_name(mut self, scope_name: &'a str) -> Self {
446        self.scope_name = Some(scope_name);
447        self
448    }
449
450    pub fn retry_strategy(mut self, retry_strategy: Arc<dyn RetryStrategy>) -> Self {
451        self.retry_strategy = retry_strategy;
452        self
453    }
454
455    pub fn endpoint(mut self, endpoint: &'a str) -> Self {
456        self.endpoint = Some(endpoint);
457        self
458    }
459
460    pub fn on_behalf_of(mut self, on_behalf_of: &'a OnBehalfOfInfo) -> Self {
461        self.on_behalf_of = Some(on_behalf_of);
462        self
463    }
464}
465
466#[derive(Debug)]
467#[non_exhaustive]
468pub struct DisallowQueryingOptions<'a> {
469    pub index_name: &'a str,
470    pub bucket_name: Option<&'a str>,
471    pub scope_name: Option<&'a str>,
472    pub retry_strategy: Arc<dyn RetryStrategy>,
473    pub endpoint: Option<&'a str>,
474    pub on_behalf_of: Option<&'a OnBehalfOfInfo>,
475}
476
477impl<'a> DisallowQueryingOptions<'a> {
478    pub fn new(index_name: &'a str) -> Self {
479        Self {
480            index_name,
481            bucket_name: None,
482            scope_name: None,
483            retry_strategy: DEFAULT_RETRY_STRATEGY.clone(),
484            endpoint: None,
485            on_behalf_of: None,
486        }
487    }
488
489    pub fn bucket_name(mut self, bucket_name: &'a str) -> Self {
490        self.bucket_name = Some(bucket_name);
491        self
492    }
493
494    pub fn scope_name(mut self, scope_name: &'a str) -> Self {
495        self.scope_name = Some(scope_name);
496        self
497    }
498
499    pub fn retry_strategy(mut self, retry_strategy: Arc<dyn RetryStrategy>) -> Self {
500        self.retry_strategy = retry_strategy;
501        self
502    }
503
504    pub fn endpoint(mut self, endpoint: &'a str) -> Self {
505        self.endpoint = Some(endpoint);
506        self
507    }
508
509    pub fn on_behalf_of(mut self, on_behalf_of: &'a OnBehalfOfInfo) -> Self {
510        self.on_behalf_of = Some(on_behalf_of);
511        self
512    }
513}
514
515#[derive(Debug)]
516#[non_exhaustive]
517pub struct FreezePlanOptions<'a> {
518    pub index_name: &'a str,
519    pub bucket_name: Option<&'a str>,
520    pub scope_name: Option<&'a str>,
521    pub retry_strategy: Arc<dyn RetryStrategy>,
522    pub endpoint: Option<&'a str>,
523    pub on_behalf_of: Option<&'a OnBehalfOfInfo>,
524}
525
526impl<'a> FreezePlanOptions<'a> {
527    pub fn new(index_name: &'a str) -> Self {
528        Self {
529            index_name,
530            bucket_name: None,
531            scope_name: None,
532            retry_strategy: DEFAULT_RETRY_STRATEGY.clone(),
533            endpoint: None,
534            on_behalf_of: None,
535        }
536    }
537
538    pub fn bucket_name(mut self, bucket_name: &'a str) -> Self {
539        self.bucket_name = Some(bucket_name);
540        self
541    }
542
543    pub fn scope_name(mut self, scope_name: &'a str) -> Self {
544        self.scope_name = Some(scope_name);
545        self
546    }
547
548    pub fn retry_strategy(mut self, retry_strategy: Arc<dyn RetryStrategy>) -> Self {
549        self.retry_strategy = retry_strategy;
550        self
551    }
552
553    pub fn endpoint(mut self, endpoint: &'a str) -> Self {
554        self.endpoint = Some(endpoint);
555        self
556    }
557
558    pub fn on_behalf_of(mut self, on_behalf_of: &'a OnBehalfOfInfo) -> Self {
559        self.on_behalf_of = Some(on_behalf_of);
560        self
561    }
562}
563
564#[derive(Debug)]
565#[non_exhaustive]
566pub struct UnfreezePlanOptions<'a> {
567    pub index_name: &'a str,
568    pub bucket_name: Option<&'a str>,
569    pub scope_name: Option<&'a str>,
570    pub retry_strategy: Arc<dyn RetryStrategy>,
571    pub endpoint: Option<&'a str>,
572    pub on_behalf_of: Option<&'a OnBehalfOfInfo>,
573}
574
575impl<'a> UnfreezePlanOptions<'a> {
576    pub fn new(index_name: &'a str) -> Self {
577        Self {
578            index_name,
579            bucket_name: None,
580            scope_name: None,
581            retry_strategy: DEFAULT_RETRY_STRATEGY.clone(),
582            endpoint: None,
583            on_behalf_of: None,
584        }
585    }
586
587    pub fn bucket_name(mut self, bucket_name: &'a str) -> Self {
588        self.bucket_name = Some(bucket_name);
589        self
590    }
591
592    pub fn scope_name(mut self, scope_name: &'a str) -> Self {
593        self.scope_name = Some(scope_name);
594        self
595    }
596
597    pub fn retry_strategy(mut self, retry_strategy: Arc<dyn RetryStrategy>) -> Self {
598        self.retry_strategy = retry_strategy;
599        self
600    }
601
602    pub fn endpoint(mut self, endpoint: &'a str) -> Self {
603        self.endpoint = Some(endpoint);
604        self
605    }
606
607    pub fn on_behalf_of(mut self, on_behalf_of: &'a OnBehalfOfInfo) -> Self {
608        self.on_behalf_of = Some(on_behalf_of);
609        self
610    }
611}
612
613#[derive(Debug, Clone)]
614#[non_exhaustive]
615pub struct EnsureIndexOptions<'a> {
616    pub index_name: &'a str,
617    pub bucket_name: Option<&'a str>,
618    pub scope_name: Option<&'a str>,
619    pub on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
620    pub desired_state: DesiredState,
621}
622
623impl<'a> EnsureIndexOptions<'a> {
624    pub fn new(
625        index_name: &'a str,
626        bucket_name: impl Into<Option<&'a str>>,
627        scope_name: impl Into<Option<&'a str>>,
628        desired_state: DesiredState,
629        on_behalf_of_info: Option<&'a OnBehalfOfInfo>,
630    ) -> Self {
631        Self {
632            index_name,
633            bucket_name: bucket_name.into(),
634            scope_name: scope_name.into(),
635            on_behalf_of_info,
636            desired_state,
637        }
638    }
639}
640
641impl<'a> From<&'a GetIndexOptions<'a>> for searchx::mgmt_options::GetIndexOptions<'a> {
642    fn from(opts: &'a GetIndexOptions<'a>) -> searchx::mgmt_options::GetIndexOptions<'a> {
643        searchx::mgmt_options::GetIndexOptions {
644            index_name: opts.index_name,
645            bucket_name: opts.bucket_name,
646            scope_name: opts.scope_name,
647            on_behalf_of: opts.on_behalf_of,
648        }
649    }
650}
651
652impl<'a> From<&'a GetAllIndexesOptions<'a>> for searchx::mgmt_options::GetAllIndexesOptions<'a> {
653    fn from(opts: &'a GetAllIndexesOptions<'a>) -> searchx::mgmt_options::GetAllIndexesOptions<'a> {
654        searchx::mgmt_options::GetAllIndexesOptions {
655            bucket_name: opts.bucket_name,
656            scope_name: opts.scope_name,
657            on_behalf_of: opts.on_behalf_of,
658        }
659    }
660}
661
662impl<'a> From<&UpsertIndexOptions<'a>> for searchx::mgmt_options::UpsertIndexOptions<'a> {
663    fn from(opts: &UpsertIndexOptions<'a>) -> searchx::mgmt_options::UpsertIndexOptions<'a> {
664        searchx::mgmt_options::UpsertIndexOptions {
665            index: opts.index,
666            bucket_name: opts.bucket_name,
667            scope_name: opts.scope_name,
668            on_behalf_of: opts.on_behalf_of,
669        }
670    }
671}
672
673impl<'a> From<&DeleteIndexOptions<'a>> for searchx::mgmt_options::DeleteIndexOptions<'a> {
674    fn from(opts: &DeleteIndexOptions<'a>) -> searchx::mgmt_options::DeleteIndexOptions<'a> {
675        searchx::mgmt_options::DeleteIndexOptions {
676            index_name: opts.index_name,
677            bucket_name: opts.bucket_name,
678            scope_name: opts.scope_name,
679            on_behalf_of: opts.on_behalf_of,
680        }
681    }
682}
683
684impl<'a> From<&'a AnalyzeDocumentOptions<'a>>
685    for searchx::mgmt_options::AnalyzeDocumentOptions<'a>
686{
687    fn from(
688        opts: &'a AnalyzeDocumentOptions<'a>,
689    ) -> searchx::mgmt_options::AnalyzeDocumentOptions<'a> {
690        searchx::mgmt_options::AnalyzeDocumentOptions {
691            index_name: opts.index_name,
692            doc_content: opts.doc_content,
693            bucket_name: opts.bucket_name,
694            scope_name: opts.scope_name,
695            on_behalf_of: opts.on_behalf_of,
696        }
697    }
698}
699
700impl<'a> From<&'a GetIndexedDocumentsCountOptions<'a>>
701    for searchx::mgmt_options::GetIndexedDocumentsCountOptions<'a>
702{
703    fn from(
704        opts: &'a GetIndexedDocumentsCountOptions<'a>,
705    ) -> searchx::mgmt_options::GetIndexedDocumentsCountOptions<'a> {
706        searchx::mgmt_options::GetIndexedDocumentsCountOptions {
707            index_name: opts.index_name,
708            bucket_name: opts.bucket_name,
709            scope_name: opts.scope_name,
710            on_behalf_of: opts.on_behalf_of,
711        }
712    }
713}
714
715impl<'a> From<&'a PauseIngestOptions<'a>> for searchx::mgmt_options::PauseIngestOptions<'a> {
716    fn from(opts: &'a PauseIngestOptions<'a>) -> searchx::mgmt_options::PauseIngestOptions<'a> {
717        searchx::mgmt_options::PauseIngestOptions {
718            index_name: opts.index_name,
719            bucket_name: opts.bucket_name,
720            scope_name: opts.scope_name,
721            on_behalf_of: opts.on_behalf_of,
722        }
723    }
724}
725
726impl<'a> From<&'a ResumeIngestOptions<'a>> for searchx::mgmt_options::ResumeIngestOptions<'a> {
727    fn from(opts: &'a ResumeIngestOptions<'a>) -> searchx::mgmt_options::ResumeIngestOptions<'a> {
728        searchx::mgmt_options::ResumeIngestOptions {
729            index_name: opts.index_name,
730            bucket_name: opts.bucket_name,
731            scope_name: opts.scope_name,
732            on_behalf_of: opts.on_behalf_of,
733        }
734    }
735}
736
737impl<'a> From<&'a AllowQueryingOptions<'a>> for searchx::mgmt_options::AllowQueryingOptions<'a> {
738    fn from(opts: &'a AllowQueryingOptions<'a>) -> searchx::mgmt_options::AllowQueryingOptions<'a> {
739        searchx::mgmt_options::AllowQueryingOptions {
740            index_name: opts.index_name,
741            bucket_name: opts.bucket_name,
742            scope_name: opts.scope_name,
743            on_behalf_of: opts.on_behalf_of,
744        }
745    }
746}
747
748impl<'a> From<&'a DisallowQueryingOptions<'a>>
749    for searchx::mgmt_options::DisallowQueryingOptions<'a>
750{
751    fn from(
752        opts: &'a DisallowQueryingOptions<'a>,
753    ) -> searchx::mgmt_options::DisallowQueryingOptions<'a> {
754        searchx::mgmt_options::DisallowQueryingOptions {
755            index_name: opts.index_name,
756            bucket_name: opts.bucket_name,
757            scope_name: opts.scope_name,
758            on_behalf_of: opts.on_behalf_of,
759        }
760    }
761}
762
763impl<'a> From<&'a FreezePlanOptions<'a>> for searchx::mgmt_options::FreezePlanOptions<'a> {
764    fn from(opts: &'a FreezePlanOptions<'a>) -> searchx::mgmt_options::FreezePlanOptions<'a> {
765        searchx::mgmt_options::FreezePlanOptions {
766            index_name: opts.index_name,
767            bucket_name: opts.bucket_name,
768            scope_name: opts.scope_name,
769            on_behalf_of: opts.on_behalf_of,
770        }
771    }
772}
773
774impl<'a> From<&'a UnfreezePlanOptions<'a>> for searchx::mgmt_options::UnfreezePlanOptions<'a> {
775    fn from(opts: &'a UnfreezePlanOptions<'a>) -> searchx::mgmt_options::UnfreezePlanOptions<'a> {
776        searchx::mgmt_options::UnfreezePlanOptions {
777            index_name: opts.index_name,
778            bucket_name: opts.bucket_name,
779            scope_name: opts.scope_name,
780            on_behalf_of: opts.on_behalf_of,
781        }
782    }
783}