1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use serde::de::{value, Deserializer, IntoDeserializer};
use serde::{Deserialize, Serialize, Serializer};
use std::str::FromStr;
#[doc = "Defines the Board result that matched a Board search request."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct BoardResult {
    #[doc = "Board Type of the board document."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub boardtype: Option<String>,
    #[doc = "Defines the details of the collection."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub collection: Option<Collection>,
    #[doc = "Defines the details of the project."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub project: Option<Project>,
    #[doc = "Defines the details of the team."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub team: Option<Team>,
}
impl BoardResult {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines a Board search request."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct BoardSearchRequest {
    #[serde(flatten)]
    pub entity_search_request: EntitySearchRequest,
}
impl BoardSearchRequest {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines a Board search response item."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct BoardSearchResponse {
    #[serde(flatten)]
    pub entity_search_response: EntitySearchResponse,
    #[doc = "Total number of matched Board documents."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub count: Option<i32>,
    #[doc = "List of top matched Board documents."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub results: Vec<BoardResult>,
}
impl BoardSearchResponse {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Information about the configured branch."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct BranchInfo {
    #[doc = "Name of the indexed branch"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}
impl BranchInfo {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the code result containing information of the searched files and its metadata."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct CodeResult {
    #[doc = "Defines the details of the collection."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub collection: Option<Collection>,
    #[doc = "ContentId of the result file."]
    #[serde(rename = "contentId", default, skip_serializing_if = "Option::is_none")]
    pub content_id: Option<String>,
    #[doc = "Name of the result file."]
    #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")]
    pub file_name: Option<String>,
    #[doc = "Dictionary of field to hit offsets in the result file. Key identifies the area in which hits were found, for ex: file content/file name etc."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub matches: Option<serde_json::Value>,
    #[doc = "Path at which result file is present."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    #[doc = "Defines the details of the project."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub project: Option<Project>,
    #[doc = "Defines the details of the repository."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub repository: Option<Repository>,
    #[doc = "Versions of the result file."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub versions: Vec<Version>,
}
impl CodeResult {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines a code search request."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct CodeSearchRequest {
    #[serde(flatten)]
    pub entity_search_request: EntitySearchRequest,
    #[doc = "Flag to opt for including matched code snippet in the result. Default behavior is false."]
    #[serde(
        rename = "includeSnippet",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub include_snippet: Option<bool>,
}
impl CodeSearchRequest {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines a code search response item."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct CodeSearchResponse {
    #[serde(flatten)]
    pub entity_search_response: EntitySearchResponse,
    #[doc = "Total number of matched files."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub count: Option<i32>,
    #[doc = "List of matched files."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub results: Vec<CodeResult>,
}
impl CodeSearchResponse {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the details of the collection."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Collection {
    #[doc = "Name of the collection."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}
impl Collection {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = ""]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct CustomRepositoryBranchStatusResponse {
    #[serde(
        rename = "lastIndexedChangeId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub last_indexed_change_id: Option<i64>,
    #[serde(
        rename = "lastIndexedChangeIdChangeTime",
        default,
        skip_serializing_if = "Option::is_none",
        with = "crate::date_time::rfc3339::option"
    )]
    pub last_indexed_change_id_change_time: Option<time::OffsetDateTime>,
    #[serde(
        rename = "latestChangeId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub latest_change_id: Option<i64>,
    #[serde(
        rename = "latestChangeIdChangeTime",
        default,
        skip_serializing_if = "Option::is_none",
        with = "crate::date_time::rfc3339::option"
    )]
    pub latest_change_id_change_time: Option<time::OffsetDateTime>,
}
impl CustomRepositoryBranchStatusResponse {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the custom repository status."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct CustomRepositoryStatusResponse {
    #[doc = "Repository Id."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[doc = "List of indexed top level folders info."]
    #[serde(
        rename = "indexedTopLevelFolders",
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub indexed_top_level_folders: Vec<DepotInfo>,
    #[doc = "Repository Name."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}
impl CustomRepositoryStatusResponse {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Information about the custom repository indexing freshness for configured branches and depots."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct DepotInfo {
    #[doc = "Name of the indexed top level folder (depot)."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}
impl DepotInfo {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Base contract for search request types without scroll support."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct EntitySearchRequest {
    #[serde(flatten)]
    pub entity_search_request_base: EntitySearchRequestBase,
    #[doc = "Options for sorting search results. If set to null, the results will be returned sorted by relevance. If more than one sort option is provided, the results are sorted in the order specified in the OrderBy."]
    #[serde(
        rename = "$orderBy",
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub order_by: Vec<SortOption>,
    #[doc = "Number of results to be skipped."]
    #[serde(rename = "$skip", default, skip_serializing_if = "Option::is_none")]
    pub skip: Option<i32>,
    #[doc = "Number of results to be returned."]
    #[serde(rename = "$top", default, skip_serializing_if = "Option::is_none")]
    pub top: Option<i32>,
    #[doc = "Flag to opt for faceting in the result. Default behavior is false."]
    #[serde(
        rename = "includeFacets",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub include_facets: Option<bool>,
}
impl EntitySearchRequest {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Base class for search request types."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct EntitySearchRequestBase {
    #[doc = "Filters to be applied. Set it to null if there are no filters to be applied."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub filters: Option<serde_json::Value>,
    #[doc = "The search text."]
    #[serde(
        rename = "searchText",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub search_text: Option<String>,
}
impl EntitySearchRequestBase {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the base contract for search response."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct EntitySearchResponse {
    #[doc = "A dictionary storing an array of <code>Filter</code> object against each facet."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub facets: Option<serde_json::Value>,
    #[doc = "Numeric code indicating any additional information: 0 - Ok, 1 - Account is being reindexed, 2 - Account indexing has not started, 3 - Invalid Request, 4 - Prefix wildcard query not supported, 5 - MultiWords with code facet not supported, 6 - Account is being onboarded, 7 - Account is being onboarded or reindexed, 8 - Top value trimmed to maxresult allowed 9 - Branches are being indexed, 10 - Faceting not enabled, 11 - Work items not accessible, 19 - Phrase queries with code type filters not supported, 20 - Wildcard queries with code type filters not supported. Any other info code is used for internal purpose."]
    #[serde(rename = "infoCode", default, skip_serializing_if = "Option::is_none")]
    pub info_code: Option<i32>,
}
impl EntitySearchResponse {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the details of a feed."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct FeedInfo {
    #[doc = "Id of the collection."]
    #[serde(
        rename = "collectionId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub collection_id: Option<String>,
    #[doc = "Name of the collection."]
    #[serde(
        rename = "collectionName",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub collection_name: Option<String>,
    #[doc = "Id of the feed."]
    #[serde(rename = "feedId", default, skip_serializing_if = "Option::is_none")]
    pub feed_id: Option<String>,
    #[doc = "Name of the feed."]
    #[serde(rename = "feedName", default, skip_serializing_if = "Option::is_none")]
    pub feed_name: Option<String>,
    #[doc = "Latest matched version of package in this Feed."]
    #[serde(
        rename = "latestMatchedVersion",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub latest_matched_version: Option<String>,
    #[doc = "Latest version of package in this Feed."]
    #[serde(
        rename = "latestVersion",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub latest_version: Option<String>,
    #[doc = "Url of package in this Feed."]
    #[serde(
        rename = "packageUrl",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub package_url: Option<String>,
    #[doc = "List of views which contain the matched package."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub views: Vec<String>,
}
impl FeedInfo {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Describes a filter bucket item representing the total matches of search result, name and id."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Filter {
    #[doc = "Id of the filter bucket."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[doc = "Name of the filter bucket."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[doc = "Count of matches in the filter bucket."]
    #[serde(
        rename = "resultCount",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub result_count: Option<i32>,
}
impl Filter {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Describes the position of a piece of text in a document."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Hit {
    #[doc = "Gets or sets the start character offset of a piece of text."]
    #[serde(
        rename = "charOffset",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub char_offset: Option<i32>,
    #[doc = "Gets or sets an extract of code where the match appears. Usually it is the line where there is the match."]
    #[serde(
        rename = "codeSnippet",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub code_snippet: Option<String>,
    #[doc = "Gets or sets the column number where the match appears in the line."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub column: Option<i32>,
    #[doc = "Gets or sets the length of a piece of text."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub length: Option<i32>,
    #[doc = "Gets or sets the line number where the match appears in the file."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub line: Option<i32>,
    #[doc = "Gets or sets the name of type of a piece of text."]
    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
    pub type_: Option<String>,
}
impl Hit {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the matched terms in the field of the package result."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct PackageHit {
    #[doc = "Reference name of the highlighted field."]
    #[serde(
        rename = "fieldReferenceName",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub field_reference_name: Option<String>,
    #[doc = "Matched/highlighted snippets of the field."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub highlights: Vec<String>,
}
impl PackageHit {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the package result that matched a package search request."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct PackageResult {
    #[doc = "Description of the package."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[doc = "List of feeds which contain the matching package."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub feeds: Vec<FeedInfo>,
    #[doc = "List of highlighted fields for the match."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub hits: Vec<PackageHit>,
    #[doc = "Id of the package."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[doc = "Name of the package."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[doc = "Type of the package."]
    #[serde(
        rename = "protocolType",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub protocol_type: Option<String>,
}
impl PackageResult {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines a package search request."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct PackageSearchRequest {
    #[serde(flatten)]
    pub entity_search_request: EntitySearchRequest,
}
impl PackageSearchRequest {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = ""]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct PackageSearchResponse {
    #[serde(
        rename = "activityId",
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub activity_id: Vec<String>,
    #[doc = "Defines a response item that is returned for a package search request."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub content: Option<PackageSearchResponseContent>,
}
impl PackageSearchResponse {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines a response item that is returned for a package search request."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct PackageSearchResponseContent {
    #[serde(flatten)]
    pub entity_search_response: EntitySearchResponse,
    #[doc = "Total number of matched packages."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub count: Option<i32>,
    #[doc = "List of matched packages."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub results: Vec<PackageResult>,
}
impl PackageSearchResponseContent {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the details of the project."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Project {
    #[doc = "Id of the project."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[doc = "Name of the project."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}
impl Project {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the details of the project."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ProjectReference {
    #[doc = "ID of the project."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[doc = "Name of the project."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[doc = "Visibility of the project."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub visibility: Option<String>,
}
impl ProjectReference {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the details of the repository."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Repository {
    #[doc = "Id of the repository."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[doc = "Name of the repository."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[doc = "Version control type of the result file."]
    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
    pub type_: Option<repository::Type>,
}
impl Repository {
    pub fn new() -> Self {
        Self::default()
    }
}
pub mod repository {
    use super::*;
    #[doc = "Version control type of the result file."]
    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
    pub enum Type {
        #[serde(rename = "git")]
        Git,
        #[serde(rename = "tfvc")]
        Tfvc,
        #[serde(rename = "custom")]
        Custom,
    }
}
#[doc = "Defines the repository status."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct RepositoryStatusResponse {
    #[doc = "Repository Id."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[doc = "List of Indexed branches info."]
    #[serde(
        rename = "indexedBranches",
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub indexed_branches: Vec<BranchInfo>,
    #[doc = "Repository Name."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}
impl RepositoryStatusResponse {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines a scroll code search request."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ScrollSearchRequest {
    #[serde(flatten)]
    pub entity_search_request_base: EntitySearchRequestBase,
    #[doc = "Scroll Id for scroll search query."]
    #[serde(rename = "$scrollId", default, skip_serializing_if = "Option::is_none")]
    pub scroll_id: Option<String>,
    #[doc = "Size of data to return for scroll search query. Min value is 201."]
    #[serde(
        rename = "$scrollSize",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub scroll_size: Option<i32>,
}
impl ScrollSearchRequest {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the setting result that matched a setting search request"]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct SettingResult {
    #[doc = "Description of the settings page"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[doc = "Icon name of the settings page"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub icon: Option<String>,
    #[doc = "Contribution url route id of the corresponding settings page"]
    #[serde(rename = "routeId", default, skip_serializing_if = "Option::is_none")]
    pub route_id: Option<String>,
    #[doc = "Contribution url route parameter of the corresponding settings page"]
    #[serde(
        rename = "routeParameterMapping",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub route_parameter_mapping: Option<serde_json::Value>,
    #[doc = "Scope of the settings page, either organization, project or user"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub scope: Option<setting_result::Scope>,
    #[doc = "Title of the settings page"]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
}
impl SettingResult {
    pub fn new() -> Self {
        Self::default()
    }
}
pub mod setting_result {
    use super::*;
    #[doc = "Scope of the settings page, either organization, project or user"]
    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
    pub enum Scope {
        #[serde(rename = "none")]
        None,
        #[serde(rename = "organization")]
        Organization,
        #[serde(rename = "project")]
        Project,
        #[serde(rename = "user")]
        User,
    }
}
#[doc = "Defines a setting search request"]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct SettingSearchRequest {
    #[serde(flatten)]
    pub entity_search_request: EntitySearchRequest,
}
impl SettingSearchRequest {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines a setting search response item"]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct SettingSearchResponse {
    #[serde(flatten)]
    pub entity_search_response: EntitySearchResponse,
    #[doc = "Total number of matched setting documents."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub count: Option<i32>,
    #[doc = "List of top matched setting documents."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub results: Vec<SettingResult>,
}
impl SettingSearchResponse {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines how to sort the result."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct SortOption {
    #[doc = "Field name on which sorting should be done."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub field: Option<String>,
    #[doc = "Order (ASC/DESC) in which the results should be sorted."]
    #[serde(rename = "sortOrder", default, skip_serializing_if = "Option::is_none")]
    pub sort_order: Option<String>,
}
impl SortOption {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the details of the team."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Team {
    #[doc = "Id of the team."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[doc = "Name of the Team."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}
impl Team {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the TFVC repository status."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct TfvcRepositoryStatusResponse {
    #[doc = "Repository Id."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[doc = "List of Indexing Information for TFVC repository"]
    #[serde(
        rename = "indexingInformation",
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub indexing_information: Vec<BranchInfo>,
    #[doc = "Repository Name."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}
impl TfvcRepositoryStatusResponse {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Describes the details pertaining to a version of the result file."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Version {
    #[doc = "Name of the branch."]
    #[serde(
        rename = "branchName",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub branch_name: Option<String>,
    #[doc = "ChangeId in the given branch associated with this match."]
    #[serde(rename = "changeId", default, skip_serializing_if = "Option::is_none")]
    pub change_id: Option<String>,
}
impl Version {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the details of wiki."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Wiki {
    #[doc = "Id of the wiki."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[doc = "Mapped path for the wiki."]
    #[serde(
        rename = "mappedPath",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub mapped_path: Option<String>,
    #[doc = "Name of the wiki."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[doc = "Version for wiki."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}
impl Wiki {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the matched terms in the field of the wiki result."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct WikiHit {
    #[doc = "Reference name of the highlighted field."]
    #[serde(
        rename = "fieldReferenceName",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub field_reference_name: Option<String>,
    #[doc = "Matched/highlighted snippets of the field."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub highlights: Vec<String>,
}
impl WikiHit {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the wiki result that matched a wiki search request."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct WikiResult {
    #[doc = "Defines the details of the collection."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub collection: Option<Collection>,
    #[doc = "ContentId of the result file."]
    #[serde(rename = "contentId", default, skip_serializing_if = "Option::is_none")]
    pub content_id: Option<String>,
    #[doc = "Name of the result file."]
    #[serde(rename = "fileName", default, skip_serializing_if = "Option::is_none")]
    pub file_name: Option<String>,
    #[doc = "Highlighted snippets of fields that match the search request. The list is sorted by relevance of the snippets."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub hits: Vec<WikiHit>,
    #[doc = "Path at which result file is present."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    #[doc = "Defines the details of the project."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub project: Option<ProjectReference>,
    #[doc = "Defines the details of wiki."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub wiki: Option<Wiki>,
}
impl WikiResult {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines a wiki search request."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct WikiSearchRequest {
    #[serde(flatten)]
    pub entity_search_request: EntitySearchRequest,
}
impl WikiSearchRequest {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines a wiki search response item."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct WikiSearchResponse {
    #[serde(flatten)]
    pub entity_search_response: EntitySearchResponse,
    #[doc = "Total number of matched wiki documents."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub count: Option<i32>,
    #[doc = "List of top matched wiki documents."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub results: Vec<WikiResult>,
}
impl WikiSearchResponse {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the matched terms in the field of the work item result."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct WorkItemHit {
    #[doc = "Reference name of the highlighted field."]
    #[serde(
        rename = "fieldReferenceName",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub field_reference_name: Option<String>,
    #[doc = "Matched/highlighted snippets of the field."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub highlights: Vec<String>,
}
impl WorkItemHit {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines the work item result that matched a work item search request."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct WorkItemResult {
    #[doc = "A standard set of work item fields and their values."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub fields: Option<serde_json::Value>,
    #[doc = "Highlighted snippets of fields that match the search request. The list is sorted by relevance of the snippets."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub hits: Vec<WorkItemHit>,
    #[doc = "Defines the details of the project."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub project: Option<Project>,
    #[doc = "Reference to the work item."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
}
impl WorkItemResult {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines a work item search request."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct WorkItemSearchRequest {
    #[serde(flatten)]
    pub entity_search_request: EntitySearchRequest,
}
impl WorkItemSearchRequest {
    pub fn new() -> Self {
        Self::default()
    }
}
#[doc = "Defines a response item that is returned for a work item search request."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct WorkItemSearchResponse {
    #[serde(flatten)]
    pub entity_search_response: EntitySearchResponse,
    #[doc = "Total number of matched work items."]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub count: Option<i32>,
    #[doc = "List of top matched work items."]
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::serde::deserialize_null_default"
    )]
    pub results: Vec<WorkItemResult>,
}
impl WorkItemSearchResponse {
    pub fn new() -> Self {
        Self::default()
    }
}