Skip to content

Commit 2a783c0

Browse files
committed
add release clients factory
1 parent e4d491f commit 2a783c0

File tree

148 files changed

+11728
-13
lines changed

Some content is hidden

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

148 files changed

+11728
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,5 +297,6 @@ __pycache__/
297297
vsts/build/bdist.win32/
298298

299299
# don't ignore release management client
300+
!azure-devops/azure/devops/released/release
300301
!azure-devops/azure/devops/v5_0/release
301302
!azure-devops/azure/devops/v5_1/release

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.clients_v5_0.get_core_client()
33+
core_client = connection.clients.get_core_client()
3434

3535
# Get the list of projects in the org
3636
projects = core_client.get_projects()
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------
5+
# Generated file, DO NOT EDIT
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------------------------
8+
9+
10+
class ClientFactory(object):
11+
"""ClientFactory.
12+
A factory class to get the 5.0 released clients.
13+
"""
14+
15+
def __init__(self, connection):
16+
self._connection = connection
17+
18+
def get_accounts_client(self):
19+
"""get_accounts_client.
20+
Gets the 5.0 version of the AccountsClient
21+
:rtype: :class:`<AccountsClient> <azure.devops.released.accounts.accounts_client.AccountsClient>`
22+
"""
23+
return self._connection.get_client('azure.devops.released.accounts.accounts_client.AccountsClient')
24+
25+
def get_build_client(self):
26+
"""get_build_client.
27+
Gets the 5.0 version of the BuildClient
28+
:rtype: :class:`<BuildClient> <azure.devops.released.build.build_client.BuildClient>`
29+
"""
30+
return self._connection.get_client('azure.devops.released.build.build_client.BuildClient')
31+
32+
def get_cloud_load_test_client(self):
33+
"""get_cloud_load_test_client.
34+
Gets the 5.0 version of the CloudLoadTestClient
35+
:rtype: :class:`<CloudLoadTestClient> <azure.devops.released.cloud_load_test.cloud_load_test_client.CloudLoadTestClient>`
36+
"""
37+
return self._connection.get_client('azure.devops.released.cloud_load_test.cloud_load_test_client.CloudLoadTestClient')
38+
39+
def get_core_client(self):
40+
"""get_core_client.
41+
Gets the 5.0 version of the CoreClient
42+
:rtype: :class:`<CoreClient> <azure.devops.released.core.core_client.CoreClient>`
43+
"""
44+
return self._connection.get_client('azure.devops.released.core.core_client.CoreClient')
45+
46+
def get_git_client(self):
47+
"""get_git_client.
48+
Gets the 5.0 version of the GitClient
49+
:rtype: :class:`<GitClient> <azure.devops.released.git.git_client.GitClient>`
50+
"""
51+
return self._connection.get_client('azure.devops.released.git.git_client.GitClient')
52+
53+
def get_identity_client(self):
54+
"""get_identity_client.
55+
Gets the 5.0 version of the IdentityClient
56+
:rtype: :class:`<IdentityClient> <azure.devops.released.identity.identity_client.IdentityClient>`
57+
"""
58+
return self._connection.get_client('azure.devops.released.identity.identity_client.IdentityClient')
59+
60+
def get_operations_client(self):
61+
"""get_operations_client.
62+
Gets the 5.0 version of the OperationsClient
63+
:rtype: :class:`<OperationsClient> <azure.devops.released.operations.operations_client.OperationsClient>`
64+
"""
65+
return self._connection.get_client('azure.devops.released.operations.operations_client.OperationsClient')
66+
67+
def get_policy_client(self):
68+
"""get_policy_client.
69+
Gets the 5.0 version of the PolicyClient
70+
:rtype: :class:`<PolicyClient> <azure.devops.released.policy.policy_client.PolicyClient>`
71+
"""
72+
return self._connection.get_client('azure.devops.released.policy.policy_client.PolicyClient')
73+
74+
def get_profile_client(self):
75+
"""get_profile_client.
76+
Gets the 5.0 version of the ProfileClient
77+
:rtype: :class:`<ProfileClient> <azure.devops.released.profile.profile_client.ProfileClient>`
78+
"""
79+
return self._connection.get_client('azure.devops.released.profile.profile_client.ProfileClient')
80+
81+
def get_release_client(self):
82+
"""get_release_client.
83+
Gets the 5.0 version of the ReleaseClient
84+
:rtype: :class:`<ReleaseClient> <azure.devops.released.release.release_client.ReleaseClient>`
85+
"""
86+
return self._connection.get_client('azure.devops.released.release.release_client.ReleaseClient')
87+
88+
def get_security_client(self):
89+
"""get_security_client.
90+
Gets the 5.0 version of the SecurityClient
91+
:rtype: :class:`<SecurityClient> <azure.devops.released.security.security_client.SecurityClient>`
92+
"""
93+
return self._connection.get_client('azure.devops.released.security.security_client.SecurityClient')
94+
95+
def get_service_hooks_client(self):
96+
"""get_service_hooks_client.
97+
Gets the 5.0 version of the ServiceHooksClient
98+
:rtype: :class:`<ServiceHooksClient> <azure.devops.released.service_hooks.service_hooks_client.ServiceHooksClient>`
99+
"""
100+
return self._connection.get_client('azure.devops.released.service_hooks.service_hooks_client.ServiceHooksClient')
101+
102+
def get_task_client(self):
103+
"""get_task_client.
104+
Gets the 5.0 version of the TaskClient
105+
:rtype: :class:`<TaskClient> <azure.devops.released.task.task_client.TaskClient>`
106+
"""
107+
return self._connection.get_client('azure.devops.released.task.task_client.TaskClient')
108+
109+
def get_task_agent_client(self):
110+
"""get_task_agent_client.
111+
Gets the 5.0 version of the TaskAgentClient
112+
:rtype: :class:`<TaskAgentClient> <azure.devops.released.task_agent.task_agent_client.TaskAgentClient>`
113+
"""
114+
return self._connection.get_client('azure.devops.released.task_agent.task_agent_client.TaskAgentClient')
115+
116+
def get_test_client(self):
117+
"""get_test_client.
118+
Gets the 5.0 version of the TestClient
119+
:rtype: :class:`<TestClient> <azure.devops.released.test.test_client.TestClient>`
120+
"""
121+
return self._connection.get_client('azure.devops.released.test.test_client.TestClient')
122+
123+
def get_tfvc_client(self):
124+
"""get_tfvc_client.
125+
Gets the 5.0 version of the TfvcClient
126+
:rtype: :class:`<TfvcClient> <azure.devops.released.tfvc.tfvc_client.TfvcClient>`
127+
"""
128+
return self._connection.get_client('azure.devops.released.tfvc.tfvc_client.TfvcClient')
129+
130+
def get_wiki_client(self):
131+
"""get_wiki_client.
132+
Gets the 5.0 version of the WikiClient
133+
:rtype: :class:`<WikiClient> <azure.devops.released.wiki.wiki_client.WikiClient>`
134+
"""
135+
return self._connection.get_client('azure.devops.released.wiki.wiki_client.WikiClient')
136+
137+
def get_work_client(self):
138+
"""get_work_client.
139+
Gets the 5.0 version of the WorkClient
140+
:rtype: :class:`<WorkClient> <azure.devops.released.work.work_client.WorkClient>`
141+
"""
142+
return self._connection.get_client('azure.devops.released.work.work_client.WorkClient')
143+
144+
def get_work_item_tracking_client(self):
145+
"""get_work_item_tracking_client.
146+
Gets the 5.0 version of the WorkItemTrackingClient
147+
:rtype: :class:`<WorkItemTrackingClient> <azure.devops.released.work_item_tracking.work_item_tracking_client.WorkItemTrackingClient>`
148+
"""
149+
return self._connection.get_client('azure.devops.released.work_item_tracking.work_item_tracking_client.WorkItemTrackingClient')
150+

azure-devops/azure/devops/connection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
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 .client_factory import ClientFactory
1213
from .v5_0.client_factory import ClientFactoryV5_0
1314
from .v5_1.client_factory import ClientFactoryV5_1
1415
from .client_configuration import ClientConfiguration
@@ -30,6 +31,7 @@ def __init__(self, base_url=None, creds=None, user_agent=None):
3031
self.base_url = base_url
3132
self._creds = creds
3233
self._resource_areas = None
34+
self.clients = ClientFactory(self)
3335
self.clients_v5_0 = ClientFactoryV5_0(self)
3436
self.clients_v5_1 = ClientFactoryV5_1(self)
3537

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------
5+
# Generated file, DO NOT EDIT
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------------------------
8+
9+
from ...v5_0.accounts.models import *
10+
from .accounts_client import AccountsClient
11+
12+
__all__ = [
13+
'Account',
14+
'AccountCreateInfoInternal',
15+
'AccountPreferencesInternal',
16+
'AccountsClient'
17+
]
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------
5+
# Generated file, DO NOT EDIT
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------------------------
8+
9+
from msrest import Serializer, Deserializer
10+
from ...client import Client
11+
from ...v5_0.accounts import models
12+
13+
14+
class AccountsClient(Client):
15+
"""Accounts
16+
:param str base_url: Service URL
17+
:param Authentication creds: Authenticated credentials.
18+
"""
19+
20+
def __init__(self, base_url=None, creds=None):
21+
super(AccountsClient, self).__init__(base_url, creds)
22+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
23+
self._serialize = Serializer(client_models)
24+
self._deserialize = Deserializer(client_models)
25+
26+
resource_area_identifier = '0d55247a-1c47-4462-9b1f-5e2125590ee6'
27+
28+
def get_accounts(self, owner_id=None, member_id=None, properties=None):
29+
"""GetAccounts.
30+
Get a list of accounts for a specific owner or a specific member.
31+
:param str owner_id: ID for the owner of the accounts.
32+
:param str member_id: ID for a member of the accounts.
33+
:param str properties:
34+
:rtype: [Account]
35+
"""
36+
query_parameters = {}
37+
if owner_id is not None:
38+
query_parameters['ownerId'] = self._serialize.query('owner_id', owner_id, 'str')
39+
if member_id is not None:
40+
query_parameters['memberId'] = self._serialize.query('member_id', member_id, 'str')
41+
if properties is not None:
42+
query_parameters['properties'] = self._serialize.query('properties', properties, 'str')
43+
response = self._send(http_method='GET',
44+
location_id='229a6a53-b428-4ffb-a835-e8f36b5b4b1e',
45+
version='5.0',
46+
query_parameters=query_parameters)
47+
return self._deserialize('[Account]', self._unwrap_collection(response))
48+
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------
5+
# Generated file, DO NOT EDIT
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------------------------
8+
9+
from ...v5_0.build.models import *
10+
from .build_client import BuildClient
11+
12+
__all__ = [
13+
'AgentPoolQueue',
14+
'AggregatedResultsAnalysis',
15+
'AggregatedResultsByOutcome',
16+
'AggregatedResultsDifference',
17+
'AggregatedRunsByOutcome',
18+
'AggregatedRunsByState',
19+
'ArtifactResource',
20+
'AssociatedWorkItem',
21+
'Attachment',
22+
'AuthorizationHeader',
23+
'Build',
24+
'BuildArtifact',
25+
'BuildBadge',
26+
'BuildController',
27+
'BuildDefinition',
28+
'BuildDefinition3_2',
29+
'BuildDefinitionReference',
30+
'BuildDefinitionReference3_2',
31+
'BuildDefinitionRevision',
32+
'BuildDefinitionStep',
33+
'BuildDefinitionTemplate',
34+
'BuildDefinitionTemplate3_2',
35+
'BuildDefinitionVariable',
36+
'BuildLog',
37+
'BuildLogReference',
38+
'BuildMetric',
39+
'BuildOption',
40+
'BuildOptionDefinition',
41+
'BuildOptionDefinitionReference',
42+
'BuildOptionGroupDefinition',
43+
'BuildOptionInputDefinition',
44+
'BuildReportMetadata',
45+
'BuildRepository',
46+
'BuildRequestValidationResult',
47+
'BuildResourceUsage',
48+
'BuildSettings',
49+
'Change',
50+
'DataSourceBindingBase',
51+
'DefinitionReference',
52+
'DefinitionResourceReference',
53+
'Deployment',
54+
'Folder',
55+
'GraphSubjectBase',
56+
'IdentityRef',
57+
'Issue',
58+
'JsonPatchOperation',
59+
'ProcessParameters',
60+
'PullRequest',
61+
'ReferenceLinks',
62+
'ReleaseReference',
63+
'RepositoryWebhook',
64+
'ResourceRef',
65+
'RetentionPolicy',
66+
'SourceProviderAttributes',
67+
'SourceRepositories',
68+
'SourceRepository',
69+
'SourceRepositoryItem',
70+
'SupportedTrigger',
71+
'TaskAgentPoolReference',
72+
'TaskDefinitionReference',
73+
'TaskInputDefinitionBase',
74+
'TaskInputValidation',
75+
'TaskOrchestrationPlanReference',
76+
'TaskReference',
77+
'TaskSourceDefinitionBase',
78+
'TeamProjectReference',
79+
'TestResultsContext',
80+
'Timeline',
81+
'TimelineAttempt',
82+
'TimelineRecord',
83+
'TimelineReference',
84+
'VariableGroup',
85+
'VariableGroupReference',
86+
'WebApiConnectedServiceRef',
87+
'XamlBuildControllerReference',
88+
'BuildClient'
89+
]

0 commit comments

Comments
 (0)