Skip to content

Commit dcf5408

Browse files
committed
Add initial client factories
1 parent 381edcb commit dcf5408

File tree

105 files changed

+3107
-2416
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+3107
-2416
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ credentials = BasicAuthentication('', personal_access_token)
3030
connection = Connection(base_url=organization_url, creds=credentials)
3131

3232
# Get a client (the "core" client provides access to projects, teams, etc)
33-
core_client = connection.get_client('azure.devops.v5_0.core.core_client.CoreClient')
33+
core_client = connection.clients_v5_0.get_core_client()
3434

3535
# Get the list of projects in the org
3636
projects = core_client.get_projects()

azure-devops/azure/devops/connection.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from ._file_cache import RESOURCE_CACHE as RESOURCE_FILE_CACHE
1010
from .exceptions import AzureDevOpsClientRequestError
1111
from .v5_0.location.location_client import LocationClient
12+
from .v5_0.client_factory import ClientFactoryV5_0
13+
from .v5_1.client_factory import ClientFactoryV5_1
1214
from .client_configuration import ClientConfiguration
1315

1416
logger = logging.getLogger(__name__)
@@ -28,6 +30,8 @@ def __init__(self, base_url=None, creds=None, user_agent=None):
2830
self.base_url = base_url
2931
self._creds = creds
3032
self._resource_areas = None
33+
self.clients_v5_0 = ClientFactoryV5_0(self)
34+
self.clients_v5_1 = ClientFactoryV5_1(self)
3135

3236
def get_client(self, client_type):
3337
"""get_client.
@@ -60,7 +64,7 @@ def _get_url_for_client_instance(self, client_class):
6064
resource_areas = self._get_resource_areas()
6165
if resource_areas is None:
6266
raise AzureDevOpsClientRequestError(('Failed to retrieve resource areas '
63-
+ 'from server: {url}').format(url=self.base_url))
67+
+ 'from server: {url}').format(url=self.base_url))
6468
if not resource_areas:
6569
# For OnPrem environments we get an empty list.
6670
return self.base_url

azure-devops/azure/devops/v5_0/build/models.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ class AggregatedResultsAnalysis(Model):
4949
:param not_reported_results_by_outcome:
5050
:type not_reported_results_by_outcome: dict
5151
:param previous_context:
52-
:type previous_context: :class:`TestResultsContext <azure.devops.v5_0.microsoft.-team-foundation.-test-management.-web-api.models.TestResultsContext>`
52+
:type previous_context: :class:`TestResultsContext <azure.devops.v5_0.microsoft._team_foundation._test_management._web_api.models.TestResultsContext>`
5353
:param results_by_outcome:
5454
:type results_by_outcome: dict
5555
:param results_difference:
56-
:type results_difference: :class:`AggregatedResultsDifference <azure.devops.v5_0.microsoft.-team-foundation.-test-management.-web-api.models.AggregatedResultsDifference>`
56+
:type results_difference: :class:`AggregatedResultsDifference <azure.devops.v5_0.microsoft._team_foundation._test_management._web_api.models.AggregatedResultsDifference>`
5757
:param run_summary_by_outcome:
5858
:type run_summary_by_outcome: dict
5959
:param run_summary_by_state:
@@ -1123,7 +1123,7 @@ class DataSourceBindingBase(Model):
11231123
:param endpoint_url: Gets or sets the url of the service endpoint.
11241124
:type endpoint_url: str
11251125
:param headers: Gets or sets the authorization headers.
1126-
:type headers: list of :class:`AuthorizationHeader <azure.devops.v5_0.microsoft.-team-foundation.-distributed-task.-common.-contracts.models.AuthorizationHeader>`
1126+
:type headers: list of :class:`AuthorizationHeader <azure.devops.v5_0.microsoft._team_foundation._distributed_task._common._contracts.models.AuthorizationHeader>`
11271127
:param initial_context_template: Defines the initial value of the query params
11281128
:type initial_context_template: str
11291129
:param parameters: Gets or sets the parameters for the data source.
@@ -1305,7 +1305,7 @@ class GraphSubjectBase(Model):
13051305
"""GraphSubjectBase.
13061306
13071307
:param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.
1308-
:type _links: :class:`ReferenceLinks <azure.devops.v5_0.microsoft.-visual-studio.-services.-web-api.models.ReferenceLinks>`
1308+
:type _links: :class:`ReferenceLinks <azure.devops.v5_0.microsoft._visual_studio._services._web_api.models.ReferenceLinks>`
13091309
:param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.
13101310
:type descriptor: str
13111311
:param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.
@@ -1333,7 +1333,7 @@ class IdentityRef(GraphSubjectBase):
13331333
"""IdentityRef.
13341334
13351335
:param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.
1336-
:type _links: :class:`ReferenceLinks <azure.devops.v5_0.microsoft.-visual-studio.-services.-web-api.models.ReferenceLinks>`
1336+
:type _links: :class:`ReferenceLinks <azure.devops.v5_0.microsoft._visual_studio._services._web_api.models.ReferenceLinks>`
13371337
:param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.
13381338
:type descriptor: str
13391339
:param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.
@@ -1449,11 +1449,11 @@ class ProcessParameters(Model):
14491449
"""ProcessParameters.
14501450
14511451
:param data_source_bindings:
1452-
:type data_source_bindings: list of :class:`DataSourceBindingBase <azure.devops.v5_0.microsoft.-team-foundation.-distributed-task.-common.-contracts.models.DataSourceBindingBase>`
1452+
:type data_source_bindings: list of :class:`DataSourceBindingBase <azure.devops.v5_0.microsoft._team_foundation._distributed_task._common._contracts.models.DataSourceBindingBase>`
14531453
:param inputs:
1454-
:type inputs: list of :class:`TaskInputDefinitionBase <azure.devops.v5_0.microsoft.-team-foundation.-distributed-task.-common.-contracts.models.TaskInputDefinitionBase>`
1454+
:type inputs: list of :class:`TaskInputDefinitionBase <azure.devops.v5_0.microsoft._team_foundation._distributed_task._common._contracts.models.TaskInputDefinitionBase>`
14551455
:param source_definitions:
1456-
:type source_definitions: list of :class:`TaskSourceDefinitionBase <azure.devops.v5_0.microsoft.-team-foundation.-distributed-task.-common.-contracts.models.TaskSourceDefinitionBase>`
1456+
:type source_definitions: list of :class:`TaskSourceDefinitionBase <azure.devops.v5_0.microsoft._team_foundation._distributed_task._common._contracts.models.TaskSourceDefinitionBase>`
14571457
"""
14581458

14591459
_attribute_map = {
@@ -1897,7 +1897,7 @@ class TaskInputDefinitionBase(Model):
18971897
:param type:
18981898
:type type: str
18991899
:param validation:
1900-
:type validation: :class:`TaskInputValidation <azure.devops.v5_0.microsoft.-team-foundation.-distributed-task.-common.-contracts.models.TaskInputValidation>`
1900+
:type validation: :class:`TaskInputValidation <azure.devops.v5_0.microsoft._team_foundation._distributed_task._common._contracts.models.TaskInputValidation>`
19011901
:param visible_rule:
19021902
:type visible_rule: str
19031903
"""
@@ -2081,11 +2081,11 @@ class TestResultsContext(Model):
20812081
"""TestResultsContext.
20822082
20832083
:param build:
2084-
:type build: :class:`BuildReference <azure.devops.v5_0.microsoft.-team-foundation.-test-management.-web-api.models.BuildReference>`
2084+
:type build: :class:`BuildReference <azure.devops.v5_0.microsoft._team_foundation._test_management._web_api.models.BuildReference>`
20852085
:param context_type:
20862086
:type context_type: object
20872087
:param release:
2088-
:type release: :class:`ReleaseReference <azure.devops.v5_0.microsoft.-team-foundation.-test-management.-web-api.models.ReleaseReference>`
2088+
:type release: :class:`ReleaseReference <azure.devops.v5_0.microsoft._team_foundation._test_management._web_api.models.ReleaseReference>`
20892089
"""
20902090

20912091
_attribute_map = {

0 commit comments

Comments
 (0)