Skip to content

Commit 5f12ffa

Browse files
authored
Merge pull request #254 from microsoft/users/tedchamb/dev5
Fix Version model in Search area
2 parents 28fb905 + 52c7ecc commit 5f12ffa

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

azure-devops/azure/devops/v5_1/search/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
'Repository',
3131
'ScrollSearchRequest',
3232
'SortOption',
33+
'Version',
3334
'Wiki',
3435
'WikiHit',
3536
'WikiResult',

azure-devops/azure/devops/v5_1/search/models.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CodeResult(Model):
2828
:param repository: Repository of the result file.
2929
:type repository: :class:`Repository <azure.devops.v5_1.search.models.Repository>`
3030
:param versions: Versions of the result file.
31-
:type versions: list of :class:`str <azure.devops.v5_1.search.models.str>`
31+
:type versions: list of :class:`Version <azure.devops.v5_1.search.models.Version>`
3232
"""
3333

3434
_attribute_map = {
@@ -39,7 +39,7 @@ class CodeResult(Model):
3939
'path': {'key': 'path', 'type': 'str'},
4040
'project': {'key': 'project', 'type': 'Project'},
4141
'repository': {'key': 'repository', 'type': 'Repository'},
42-
'versions': {'key': 'versions', 'type': '[str]'}
42+
'versions': {'key': 'versions', 'type': '[Version]'}
4343
}
4444

4545
def __init__(self, collection=None, content_id=None, file_name=None, matches=None, path=None, project=None, repository=None, versions=None):
@@ -427,6 +427,27 @@ def __init__(self, field=None, sort_order=None):
427427
self.sort_order = sort_order
428428

429429

430+
class Version(Model):
431+
"""
432+
Describes the details pertaining to a version of the result file.
433+
434+
:param branch_name: Name of the branch.
435+
:type branch_name: str
436+
:param change_id: ChangeId in the given branch associated with this match.
437+
:type change_id: str
438+
"""
439+
440+
_attribute_map = {
441+
'branch_name': {'key': 'branchName', 'type': 'str'},
442+
'change_id': {'key': 'changeId', 'type': 'str'}
443+
}
444+
445+
def __init__(self, branch_name=None, change_id=None):
446+
super(Version, self).__init__()
447+
self.branch_name = branch_name
448+
self.change_id = change_id
449+
450+
430451
class Wiki(Model):
431452
"""
432453
Defines the details of wiki.
@@ -825,6 +846,7 @@ def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top
825846
'Repository',
826847
'ScrollSearchRequest',
827848
'SortOption',
849+
'Version',
828850
'Wiki',
829851
'WikiHit',
830852
'WikiResult',

0 commit comments

Comments
 (0)