File: models.py

package info (click to toggle)
azure-devops-cli-extension 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,384 kB
  • sloc: python: 160,782; xml: 198; makefile: 56; sh: 51
file content (863 lines) | stat: -rw-r--r-- 35,127 bytes parent folder | download | duplicates (4)
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
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# Generated file, DO NOT EDIT
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------------------------

from msrest.serialization import Model


class CodeResult(Model):
    """
    Defines the code result containing information of the searched files and its metadata.

    :param collection: Collection of the result file.
    :type collection: :class:`Collection <azure.devops.v5_1.search.models.Collection>`
    :param content_id: ContentId of the result file.
    :type content_id: str
    :param file_name: Name of the result file.
    :type file_name: str
    :param matches: 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.
    :type matches: dict
    :param path: Path at which result file is present.
    :type path: str
    :param project: Project of the result file.
    :type project: :class:`Project <azure.devops.v5_1.search.models.Project>`
    :param repository: Repository of the result file.
    :type repository: :class:`Repository <azure.devops.v5_1.search.models.Repository>`
    :param versions: Versions of the result file.
    :type versions: list of :class:`Version <azure.devops.v5_1.search.models.Version>`
    """

    _attribute_map = {
        'collection': {'key': 'collection', 'type': 'Collection'},
        'content_id': {'key': 'contentId', 'type': 'str'},
        'file_name': {'key': 'fileName', 'type': 'str'},
        'matches': {'key': 'matches', 'type': '{[Hit]}'},
        'path': {'key': 'path', 'type': 'str'},
        'project': {'key': 'project', 'type': 'Project'},
        'repository': {'key': 'repository', 'type': 'Repository'},
        'versions': {'key': 'versions', 'type': '[Version]'}
    }

    def __init__(self, collection=None, content_id=None, file_name=None, matches=None, path=None, project=None, repository=None, versions=None):
        super(CodeResult, self).__init__()
        self.collection = collection
        self.content_id = content_id
        self.file_name = file_name
        self.matches = matches
        self.path = path
        self.project = project
        self.repository = repository
        self.versions = versions


class Collection(Model):
    """
    Defines the details of the collection.

    :param name: Name of the collection.
    :type name: str
    """

    _attribute_map = {
        'name': {'key': 'name', 'type': 'str'}
    }

    def __init__(self, name=None):
        super(Collection, self).__init__()
        self.name = name


class EntitySearchRequestBase(Model):
    """
    Base class for search request types.

    :param filters: Filters to be applied. Set it to null if there are no filters to be applied.
    :type filters: dict
    :param search_text: The search text.
    :type search_text: str
    """

    _attribute_map = {
        'filters': {'key': 'filters', 'type': '{[str]}'},
        'search_text': {'key': 'searchText', 'type': 'str'}
    }

    def __init__(self, filters=None, search_text=None):
        super(EntitySearchRequestBase, self).__init__()
        self.filters = filters
        self.search_text = search_text


class EntitySearchResponse(Model):
    """
    Defines the base contract for search response.

    :param facets: A dictionary storing an array of <code>Filter</code> object against each facet.
    :type facets: dict
    :param info_code: 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.
    :type info_code: int
    """

    _attribute_map = {
        'facets': {'key': 'facets', 'type': '{[Filter]}'},
        'info_code': {'key': 'infoCode', 'type': 'int'}
    }

    def __init__(self, facets=None, info_code=None):
        super(EntitySearchResponse, self).__init__()
        self.facets = facets
        self.info_code = info_code


class FeedInfo(Model):
    """
    Defines the details of a feed.

    :param collection_id: Id of the collection.
    :type collection_id: str
    :param collection_name: Name of the collection.
    :type collection_name: str
    :param feed_id: Id of the feed.
    :type feed_id: str
    :param feed_name: Name of the feed.
    :type feed_name: str
    :param latest_matched_version: Latest matched version of package in this Feed.
    :type latest_matched_version: str
    :param latest_version: Latest version of package in this Feed.
    :type latest_version: str
    :param package_url: Url of package in this Feed.
    :type package_url: str
    :param views: List of views which contain the matched package.
    :type views: list of str
    """

    _attribute_map = {
        'collection_id': {'key': 'collectionId', 'type': 'str'},
        'collection_name': {'key': 'collectionName', 'type': 'str'},
        'feed_id': {'key': 'feedId', 'type': 'str'},
        'feed_name': {'key': 'feedName', 'type': 'str'},
        'latest_matched_version': {'key': 'latestMatchedVersion', 'type': 'str'},
        'latest_version': {'key': 'latestVersion', 'type': 'str'},
        'package_url': {'key': 'packageUrl', 'type': 'str'},
        'views': {'key': 'views', 'type': '[str]'}
    }

    def __init__(self, collection_id=None, collection_name=None, feed_id=None, feed_name=None, latest_matched_version=None, latest_version=None, package_url=None, views=None):
        super(FeedInfo, self).__init__()
        self.collection_id = collection_id
        self.collection_name = collection_name
        self.feed_id = feed_id
        self.feed_name = feed_name
        self.latest_matched_version = latest_matched_version
        self.latest_version = latest_version
        self.package_url = package_url
        self.views = views


class Filter(Model):
    """
    Describes a filter bucket item representing the total matches of search result, name and id.

    :param id: Id of the filter bucket.
    :type id: str
    :param name: Name of the filter bucket.
    :type name: str
    :param result_count: Count of matches in the filter bucket.
    :type result_count: int
    """

    _attribute_map = {
        'id': {'key': 'id', 'type': 'str'},
        'name': {'key': 'name', 'type': 'str'},
        'result_count': {'key': 'resultCount', 'type': 'int'}
    }

    def __init__(self, id=None, name=None, result_count=None):
        super(Filter, self).__init__()
        self.id = id
        self.name = name
        self.result_count = result_count


class Hit(Model):
    """
    Describes the position of a piece of text in a document.

    :param char_offset: Gets or sets the start character offset of a piece of text.
    :type char_offset: int
    :param length: Gets or sets the length of a piece of text.
    :type length: int
    """

    _attribute_map = {
        'char_offset': {'key': 'charOffset', 'type': 'int'},
        'length': {'key': 'length', 'type': 'int'}
    }

    def __init__(self, char_offset=None, length=None):
        super(Hit, self).__init__()
        self.char_offset = char_offset
        self.length = length


class PackageHit(Model):
    """
    Defines the matched terms in the field of the package result.

    :param field_reference_name: Reference name of the highlighted field.
    :type field_reference_name: str
    :param highlights: Matched/highlighted snippets of the field.
    :type highlights: list of str
    """

    _attribute_map = {
        'field_reference_name': {'key': 'fieldReferenceName', 'type': 'str'},
        'highlights': {'key': 'highlights', 'type': '[str]'}
    }

    def __init__(self, field_reference_name=None, highlights=None):
        super(PackageHit, self).__init__()
        self.field_reference_name = field_reference_name
        self.highlights = highlights


class PackageResult(Model):
    """
    Defines the package result that matched a package search request.

    :param description: Description of the package.
    :type description: str
    :param feeds: List of feeds which contain the matching package.
    :type feeds: list of :class:`FeedInfo <azure.devops.v5_1.microsoft._visual_studio._services._search._shared._web_api.models.FeedInfo>`
    :param hits: List of highlighted fields for the match.
    :type hits: list of :class:`PackageHit <azure.devops.v5_1.microsoft._visual_studio._services._search._shared._web_api.models.PackageHit>`
    :param id: Id of the package.
    :type id: str
    :param name: Name of the package.
    :type name: str
    :param protocol_type: Type of the package.
    :type protocol_type: str
    """

    _attribute_map = {
        'description': {'key': 'description', 'type': 'str'},
        'feeds': {'key': 'feeds', 'type': '[FeedInfo]'},
        'hits': {'key': 'hits', 'type': '[PackageHit]'},
        'id': {'key': 'id', 'type': 'str'},
        'name': {'key': 'name', 'type': 'str'},
        'protocol_type': {'key': 'protocolType', 'type': 'str'}
    }

    def __init__(self, description=None, feeds=None, hits=None, id=None, name=None, protocol_type=None):
        super(PackageResult, self).__init__()
        self.description = description
        self.feeds = feeds
        self.hits = hits
        self.id = id
        self.name = name
        self.protocol_type = protocol_type


class PackageSearchResponse(Model):
    """
    :param activity_id:
    :type activity_id: list of str
    :param content:
    :type content: :class:`PackageSearchResponseContent <azure.devops.v5_1.microsoft._visual_studio._services._search._shared._web_api.models.PackageSearchResponseContent>`
    """

    _attribute_map = {
        'activity_id': {'key': 'activityId', 'type': '[str]'},
        'content': {'key': 'content', 'type': 'PackageSearchResponseContent'}
    }

    def __init__(self, activity_id=None, content=None):
        super(PackageSearchResponse, self).__init__()
        self.activity_id = activity_id
        self.content = content


class PackageSearchResponseContent(EntitySearchResponse):
    """
    Defines a response item that is returned for a package search request.

    :param facets: A dictionary storing an array of <code>Filter</code> object against each facet.
    :type facets: dict
    :param info_code: 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.
    :type info_code: int
    :param count: Total number of matched packages.
    :type count: int
    :param results: List of matched packages.
    :type results: list of :class:`PackageResult <azure.devops.v5_1.microsoft._visual_studio._services._search._shared._web_api.models.PackageResult>`
    """

    _attribute_map = {
        'facets': {'key': 'facets', 'type': '{[Filter]}'},
        'info_code': {'key': 'infoCode', 'type': 'int'},
        'count': {'key': 'count', 'type': 'int'},
        'results': {'key': 'results', 'type': '[PackageResult]'}
    }

    def __init__(self, facets=None, info_code=None, count=None, results=None):
        super(PackageSearchResponseContent, self).__init__(facets=facets, info_code=info_code)
        self.count = count
        self.results = results


class Project(Model):
    """
    Defines the details of the project.

    :param id: Id of the project.
    :type id: str
    :param name: Name of the project.
    :type name: str
    """

    _attribute_map = {
        'id': {'key': 'id', 'type': 'str'},
        'name': {'key': 'name', 'type': 'str'}
    }

    def __init__(self, id=None, name=None):
        super(Project, self).__init__()
        self.id = id
        self.name = name


class ProjectReference(Model):
    """
    Defines the details of the project.

    :param id: ID of the project.
    :type id: str
    :param name: Name of the project.
    :type name: str
    :param visibility: Visibility of the project.
    :type visibility: str
    """

    _attribute_map = {
        'id': {'key': 'id', 'type': 'str'},
        'name': {'key': 'name', 'type': 'str'},
        'visibility': {'key': 'visibility', 'type': 'str'}
    }

    def __init__(self, id=None, name=None, visibility=None):
        super(ProjectReference, self).__init__()
        self.id = id
        self.name = name
        self.visibility = visibility


class Repository(Model):
    """
    Defines the details of the repository.

    :param id: Id of the repository.
    :type id: str
    :param name: Name of the repository.
    :type name: str
    :param type: Version control type of the result file.
    :type type: object
    """

    _attribute_map = {
        'id': {'key': 'id', 'type': 'str'},
        'name': {'key': 'name', 'type': 'str'},
        'type': {'key': 'type', 'type': 'object'}
    }

    def __init__(self, id=None, name=None, type=None):
        super(Repository, self).__init__()
        self.id = id
        self.name = name
        self.type = type


class ScrollSearchRequest(EntitySearchRequestBase):
    """
    Defines a scroll code search request.

    :param filters: Filters to be applied. Set it to null if there are no filters to be applied.
    :type filters: dict
    :param search_text: The search text.
    :type search_text: str
    :param scroll_id: Scroll Id for scroll search query.
    :type scroll_id: str
    :param scroll_size: Size of data to return for scroll search query. Min value is 201.
    :type scroll_size: int
    """

    _attribute_map = {
        'filters': {'key': 'filters', 'type': '{[str]}'},
        'search_text': {'key': 'searchText', 'type': 'str'},
        'scroll_id': {'key': '$scrollId', 'type': 'str'},
        'scroll_size': {'key': '$scrollSize', 'type': 'int'}
    }

    def __init__(self, filters=None, search_text=None, scroll_id=None, scroll_size=None):
        super(ScrollSearchRequest, self).__init__(filters=filters, search_text=search_text)
        self.scroll_id = scroll_id
        self.scroll_size = scroll_size


class SortOption(Model):
    """
    Defines how to sort the result.

    :param field: Field name on which sorting should be done.
    :type field: str
    :param sort_order: Order (ASC/DESC) in which the results should be sorted.
    :type sort_order: str
    """

    _attribute_map = {
        'field': {'key': 'field', 'type': 'str'},
        'sort_order': {'key': 'sortOrder', 'type': 'str'}
    }

    def __init__(self, field=None, sort_order=None):
        super(SortOption, self).__init__()
        self.field = field
        self.sort_order = sort_order


class Version(Model):
    """
    Describes the details pertaining to a version of the result file.

    :param branch_name: Name of the branch.
    :type branch_name: str
    :param change_id: ChangeId in the given branch associated with this match.
    :type change_id: str
    """

    _attribute_map = {
        'branch_name': {'key': 'branchName', 'type': 'str'},
        'change_id': {'key': 'changeId', 'type': 'str'}
    }

    def __init__(self, branch_name=None, change_id=None):
        super(Version, self).__init__()
        self.branch_name = branch_name
        self.change_id = change_id


class Wiki(Model):
    """
    Defines the details of wiki.

    :param id: Id of the wiki.
    :type id: str
    :param mapped_path: Mapped path for the wiki.
    :type mapped_path: str
    :param name: Name of the wiki.
    :type name: str
    :param version: Version for wiki.
    :type version: str
    """

    _attribute_map = {
        'id': {'key': 'id', 'type': 'str'},
        'mapped_path': {'key': 'mappedPath', 'type': 'str'},
        'name': {'key': 'name', 'type': 'str'},
        'version': {'key': 'version', 'type': 'str'}
    }

    def __init__(self, id=None, mapped_path=None, name=None, version=None):
        super(Wiki, self).__init__()
        self.id = id
        self.mapped_path = mapped_path
        self.name = name
        self.version = version


class WikiHit(Model):
    """
    Defines the matched terms in the field of the wiki result.

    :param field_reference_name: Reference name of the highlighted field.
    :type field_reference_name: str
    :param highlights: Matched/highlighted snippets of the field.
    :type highlights: list of str
    """

    _attribute_map = {
        'field_reference_name': {'key': 'fieldReferenceName', 'type': 'str'},
        'highlights': {'key': 'highlights', 'type': '[str]'}
    }

    def __init__(self, field_reference_name=None, highlights=None):
        super(WikiHit, self).__init__()
        self.field_reference_name = field_reference_name
        self.highlights = highlights


class WikiResult(Model):
    """
    Defines the wiki result that matched a wiki search request.

    :param collection: Collection of the result file.
    :type collection: :class:`Collection <azure.devops.v5_1.microsoft._visual_studio._services._search._shared._web_api.models.Collection>`
    :param content_id: ContentId of the result file.
    :type content_id: str
    :param file_name: Name of the result file.
    :type file_name: str
    :param hits: Highlighted snippets of fields that match the search request. The list is sorted by relevance of the snippets.
    :type hits: list of :class:`WikiHit <azure.devops.v5_1.microsoft._visual_studio._services._search._shared._web_api.models.WikiHit>`
    :param path: Path at which result file is present.
    :type path: str
    :param project: Project details of the wiki document.
    :type project: :class:`ProjectReference <azure.devops.v5_1.microsoft._visual_studio._services._search._shared._web_api.models.ProjectReference>`
    :param wiki: Wiki information for the result.
    :type wiki: :class:`Wiki <azure.devops.v5_1.microsoft._visual_studio._services._search._shared._web_api.models.Wiki>`
    """

    _attribute_map = {
        'collection': {'key': 'collection', 'type': 'Collection'},
        'content_id': {'key': 'contentId', 'type': 'str'},
        'file_name': {'key': 'fileName', 'type': 'str'},
        'hits': {'key': 'hits', 'type': '[WikiHit]'},
        'path': {'key': 'path', 'type': 'str'},
        'project': {'key': 'project', 'type': 'ProjectReference'},
        'wiki': {'key': 'wiki', 'type': 'Wiki'}
    }

    def __init__(self, collection=None, content_id=None, file_name=None, hits=None, path=None, project=None, wiki=None):
        super(WikiResult, self).__init__()
        self.collection = collection
        self.content_id = content_id
        self.file_name = file_name
        self.hits = hits
        self.path = path
        self.project = project
        self.wiki = wiki


class WikiSearchResponse(EntitySearchResponse):
    """
    Defines a wiki search response item.

    :param facets: A dictionary storing an array of <code>Filter</code> object against each facet.
    :type facets: dict
    :param info_code: 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.
    :type info_code: int
    :param count: Total number of matched wiki documents.
    :type count: int
    :param results: List of top matched wiki documents.
    :type results: list of :class:`WikiResult <azure.devops.v5_1.microsoft._visual_studio._services._search._shared._web_api.models.WikiResult>`
    """

    _attribute_map = {
        'facets': {'key': 'facets', 'type': '{[Filter]}'},
        'info_code': {'key': 'infoCode', 'type': 'int'},
        'count': {'key': 'count', 'type': 'int'},
        'results': {'key': 'results', 'type': '[WikiResult]'}
    }

    def __init__(self, facets=None, info_code=None, count=None, results=None):
        super(WikiSearchResponse, self).__init__(facets=facets, info_code=info_code)
        self.count = count
        self.results = results


class WorkItemHit(Model):
    """
    Defines the matched terms in the field of the work item result.

    :param field_reference_name: Reference name of the highlighted field.
    :type field_reference_name: str
    :param highlights: Matched/highlighted snippets of the field.
    :type highlights: list of str
    """

    _attribute_map = {
        'field_reference_name': {'key': 'fieldReferenceName', 'type': 'str'},
        'highlights': {'key': 'highlights', 'type': '[str]'}
    }

    def __init__(self, field_reference_name=None, highlights=None):
        super(WorkItemHit, self).__init__()
        self.field_reference_name = field_reference_name
        self.highlights = highlights


class WorkItemResult(Model):
    """
    Defines the work item result that matched a work item search request.

    :param fields: A standard set of work item fields and their values.
    :type fields: dict
    :param hits: Highlighted snippets of fields that match the search request. The list is sorted by relevance of the snippets.
    :type hits: list of :class:`WorkItemHit <azure.devops.v5_1.search.models.WorkItemHit>`
    :param project: Project details of the work item.
    :type project: :class:`Project <azure.devops.v5_1.search.models.Project>`
    :param url: Reference to the work item.
    :type url: str
    """

    _attribute_map = {
        'fields': {'key': 'fields', 'type': '{str}'},
        'hits': {'key': 'hits', 'type': '[WorkItemHit]'},
        'project': {'key': 'project', 'type': 'Project'},
        'url': {'key': 'url', 'type': 'str'}
    }

    def __init__(self, fields=None, hits=None, project=None, url=None):
        super(WorkItemResult, self).__init__()
        self.fields = fields
        self.hits = hits
        self.project = project
        self.url = url


class WorkItemSearchResponse(EntitySearchResponse):
    """
    Defines a response item that is returned for a work item search request.

    :param facets: A dictionary storing an array of <code>Filter</code> object against each facet.
    :type facets: dict
    :param info_code: 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.
    :type info_code: int
    :param count: Total number of matched work items.
    :type count: int
    :param results: List of top matched work items.
    :type results: list of :class:`WorkItemResult <azure.devops.v5_1.search.models.WorkItemResult>`
    """

    _attribute_map = {
        'facets': {'key': 'facets', 'type': '{[Filter]}'},
        'info_code': {'key': 'infoCode', 'type': 'int'},
        'count': {'key': 'count', 'type': 'int'},
        'results': {'key': 'results', 'type': '[WorkItemResult]'}
    }

    def __init__(self, facets=None, info_code=None, count=None, results=None):
        super(WorkItemSearchResponse, self).__init__(facets=facets, info_code=info_code)
        self.count = count
        self.results = results


class CodeSearchResponse(EntitySearchResponse):
    """
    Defines a code search response item.

    :param facets: A dictionary storing an array of <code>Filter</code> object against each facet.
    :type facets: dict
    :param info_code: 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.
    :type info_code: int
    :param count: Total number of matched files.
    :type count: int
    :param results: List of matched files.
    :type results: list of :class:`CodeResult <azure.devops.v5_1.search.models.CodeResult>`
    """

    _attribute_map = {
        'facets': {'key': 'facets', 'type': '{[Filter]}'},
        'info_code': {'key': 'infoCode', 'type': 'int'},
        'count': {'key': 'count', 'type': 'int'},
        'results': {'key': 'results', 'type': '[CodeResult]'}
    }

    def __init__(self, facets=None, info_code=None, count=None, results=None):
        super(CodeSearchResponse, self).__init__(facets=facets, info_code=info_code)
        self.count = count
        self.results = results


class EntitySearchRequest(EntitySearchRequestBase):
    """
    Base contract for search request types without scroll support.

    :param filters: Filters to be applied. Set it to null if there are no filters to be applied.
    :type filters: dict
    :param search_text: The search text.
    :type search_text: str
    :param order_by: 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.
    :type order_by: list of :class:`SortOption <azure.devops.v5_1.microsoft._visual_studio._services._search._shared._web_api.models.SortOption>`
    :param skip: Number of results to be skipped.
    :type skip: int
    :param top: Number of results to be returned.
    :type top: int
    :param include_facets: Flag to opt for faceting in the result. Default behavior is false.
    :type include_facets: bool
    """

    _attribute_map = {
        'filters': {'key': 'filters', 'type': '{[str]}'},
        'search_text': {'key': 'searchText', 'type': 'str'},
        'order_by': {'key': '$orderBy', 'type': '[SortOption]'},
        'skip': {'key': '$skip', 'type': 'int'},
        'top': {'key': '$top', 'type': 'int'},
        'include_facets': {'key': 'includeFacets', 'type': 'bool'}
    }

    def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None):
        super(EntitySearchRequest, self).__init__(filters=filters, search_text=search_text)
        self.order_by = order_by
        self.skip = skip
        self.top = top
        self.include_facets = include_facets


class PackageSearchRequest(EntitySearchRequest):
    """
    Defines a package search request.

    :param filters: Filters to be applied. Set it to null if there are no filters to be applied.
    :type filters: dict
    :param search_text: The search text.
    :type search_text: str
    :param order_by: 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.
    :type order_by: list of :class:`SortOption <azure.devops.v5_1.microsoft._visual_studio._services._search._shared._web_api.models.SortOption>`
    :param skip: Number of results to be skipped.
    :type skip: int
    :param top: Number of results to be returned.
    :type top: int
    :param include_facets: Flag to opt for faceting in the result. Default behavior is false.
    :type include_facets: bool
    """

    _attribute_map = {
        'filters': {'key': 'filters', 'type': '{[str]}'},
        'search_text': {'key': 'searchText', 'type': 'str'},
        'order_by': {'key': '$orderBy', 'type': '[SortOption]'},
        'skip': {'key': '$skip', 'type': 'int'},
        'top': {'key': '$top', 'type': 'int'},
        'include_facets': {'key': 'includeFacets', 'type': 'bool'},
    }

    def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None):
        super(PackageSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets)


class WikiSearchRequest(EntitySearchRequest):
    """
    Defines a wiki search request.

    :param filters: Filters to be applied. Set it to null if there are no filters to be applied.
    :type filters: dict
    :param search_text: The search text.
    :type search_text: str
    :param order_by: 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.
    :type order_by: list of :class:`SortOption <azure.devops.v5_1.microsoft._visual_studio._services._search._shared._web_api.models.SortOption>`
    :param skip: Number of results to be skipped.
    :type skip: int
    :param top: Number of results to be returned.
    :type top: int
    :param include_facets: Flag to opt for faceting in the result. Default behavior is false.
    :type include_facets: bool
    """

    _attribute_map = {
        'filters': {'key': 'filters', 'type': '{[str]}'},
        'search_text': {'key': 'searchText', 'type': 'str'},
        'order_by': {'key': '$orderBy', 'type': '[SortOption]'},
        'skip': {'key': '$skip', 'type': 'int'},
        'top': {'key': '$top', 'type': 'int'},
        'include_facets': {'key': 'includeFacets', 'type': 'bool'},
    }

    def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None):
        super(WikiSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets)


class WorkItemSearchRequest(EntitySearchRequest):
    """
    Defines a work item search request.

    :param filters: Filters to be applied. Set it to null if there are no filters to be applied.
    :type filters: dict
    :param search_text: The search text.
    :type search_text: str
    :param order_by: 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.
    :type order_by: list of :class:`SortOption <azure.devops.v5_1.search.models.SortOption>`
    :param skip: Number of results to be skipped.
    :type skip: int
    :param top: Number of results to be returned.
    :type top: int
    :param include_facets: Flag to opt for faceting in the result. Default behavior is false.
    :type include_facets: bool
    """

    _attribute_map = {
        'filters': {'key': 'filters', 'type': '{[str]}'},
        'search_text': {'key': 'searchText', 'type': 'str'},
        'order_by': {'key': '$orderBy', 'type': '[SortOption]'},
        'skip': {'key': '$skip', 'type': 'int'},
        'top': {'key': '$top', 'type': 'int'},
        'include_facets': {'key': 'includeFacets', 'type': 'bool'},
    }

    def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None):
        super(WorkItemSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets)


class CodeSearchRequest(EntitySearchRequest):
    """
    Defines a code search request.

    :param filters: Filters to be applied. Set it to null if there are no filters to be applied.
    :type filters: dict
    :param search_text: The search text.
    :type search_text: str
    :param order_by: 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.
    :type order_by: list of :class:`SortOption <azure.devops.v5_1.search.models.SortOption>`
    :param skip: Number of results to be skipped.
    :type skip: int
    :param top: Number of results to be returned.
    :type top: int
    :param include_facets: Flag to opt for faceting in the result. Default behavior is false.
    :type include_facets: bool
    """

    _attribute_map = {
        'filters': {'key': 'filters', 'type': '{[str]}'},
        'search_text': {'key': 'searchText', 'type': 'str'},
        'order_by': {'key': '$orderBy', 'type': '[SortOption]'},
        'skip': {'key': '$skip', 'type': 'int'},
        'top': {'key': '$top', 'type': 'int'},
        'include_facets': {'key': 'includeFacets', 'type': 'bool'},
    }

    def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None):
        super(CodeSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets)


__all__ = [
    'CodeResult',
    'Collection',
    'EntitySearchRequestBase',
    'EntitySearchResponse',
    'FeedInfo',
    'Filter',
    'Hit',
    'PackageHit',
    'PackageResult',
    'PackageSearchResponse',
    'PackageSearchResponseContent',
    'Project',
    'ProjectReference',
    'Repository',
    'ScrollSearchRequest',
    'SortOption',
    'Version',
    'Wiki',
    'WikiHit',
    'WikiResult',
    'WikiSearchResponse',
    'WorkItemHit',
    'WorkItemResult',
    'WorkItemSearchResponse',
    'CodeSearchResponse',
    'EntitySearchRequest',
    'PackageSearchRequest',
    'WikiSearchRequest',
    'WorkItemSearchRequest',
    'CodeSearchRequest',
]