Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions azure-devops/azure/devops/v5_1/search/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
'Repository',
'ScrollSearchRequest',
'SortOption',
'Version',
'Wiki',
'WikiHit',
'WikiResult',
Expand Down
26 changes: 24 additions & 2 deletions azure-devops/azure/devops/v5_1/search/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CodeResult(Model):
: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:`str <azure.devops.v5_1.search.models.str>`
:type versions: list of :class:`Version <azure.devops.v5_1.search.models.Version>`
"""

_attribute_map = {
Expand All @@ -39,7 +39,7 @@ class CodeResult(Model):
'path': {'key': 'path', 'type': 'str'},
'project': {'key': 'project', 'type': 'Project'},
'repository': {'key': 'repository', 'type': 'Repository'},
'versions': {'key': 'versions', 'type': '[str]'}
'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):
Expand Down Expand Up @@ -427,6 +427,27 @@ def __init__(self, field=None, sort_order=None):
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.
Expand Down Expand Up @@ -825,6 +846,7 @@ def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top
'Repository',
'ScrollSearchRequest',
'SortOption',
'Version',
'Wiki',
'WikiHit',
'WikiResult',
Expand Down