Skip to content

Commit 1fe43e5

Browse files
author
SDKAuto
committed
CodeGen from PR 11585 in Azure/azure-rest-api-specs
Adding new api version to devops RP (Azure#11585) * Initial commit as per PR review * Actual changes to api spec for new version * Switching to multi-api build for python * Fix python spec to correct namespaces in multiapi mode * Revert changes to python generation * Add systemdata * Fix the path for sys data reference * Fix path once more * remove additional properties after including systemdata * Remove more addtional properties * Move system data to root
1 parent d1a132d commit 1fe43e5

13 files changed

+2018
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from ._configuration import DevOpsClientConfiguration
13+
from ._dev_ops_client import DevOpsClient
14+
__all__ = ['DevOpsClient', 'DevOpsClientConfiguration']
15+
16+
from .version import VERSION
17+
18+
__version__ = VERSION
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
from msrestazure import AzureConfiguration
12+
13+
from .version import VERSION
14+
15+
16+
class DevOpsClientConfiguration(AzureConfiguration):
17+
"""Configuration for DevOpsClient
18+
Note that all parameters used to create this instance are saved as instance
19+
attributes.
20+
21+
:param credentials: Credentials needed for the client to connect to Azure.
22+
:type credentials: :mod:`A msrestazure Credentials
23+
object<msrestazure.azure_active_directory>`
24+
:param subscription_id: Unique identifier of the Azure subscription. This
25+
is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
26+
:type subscription_id: str
27+
:param str base_url: Service URL
28+
"""
29+
30+
def __init__(
31+
self, credentials, subscription_id, base_url=None):
32+
33+
if credentials is None:
34+
raise ValueError("Parameter 'credentials' must not be None.")
35+
if subscription_id is None:
36+
raise ValueError("Parameter 'subscription_id' must not be None.")
37+
if not base_url:
38+
base_url = 'https://management.azure.com'
39+
40+
super(DevOpsClientConfiguration, self).__init__(base_url)
41+
42+
# Starting Autorest.Python 4.0.64, make connection pool activated by default
43+
self.keep_alive = True
44+
45+
self.add_user_agent('azure-mgmt-devops/{}'.format(VERSION))
46+
self.add_user_agent('Azure-SDK-For-Python')
47+
48+
self.credentials = credentials
49+
self.subscription_id = subscription_id
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.service_client import SDKClient
13+
from msrest import Serializer, Deserializer
14+
15+
from ._configuration import DevOpsClientConfiguration
16+
from .operations import Operations
17+
from .operations import PipelineTemplateDefinitionsOperations
18+
from .operations import PipelinesOperations
19+
from . import models
20+
21+
22+
class DevOpsClient(SDKClient):
23+
"""Azure DevOps Resource Provider
24+
25+
:ivar config: Configuration for client.
26+
:vartype config: DevOpsClientConfiguration
27+
28+
:ivar operations: Operations operations
29+
:vartype operations: azure.mgmt.devops.operations.Operations
30+
:ivar pipeline_template_definitions: PipelineTemplateDefinitions operations
31+
:vartype pipeline_template_definitions: azure.mgmt.devops.operations.PipelineTemplateDefinitionsOperations
32+
:ivar pipelines: Pipelines operations
33+
:vartype pipelines: azure.mgmt.devops.operations.PipelinesOperations
34+
35+
:param credentials: Credentials needed for the client to connect to Azure.
36+
:type credentials: :mod:`A msrestazure Credentials
37+
object<msrestazure.azure_active_directory>`
38+
:param subscription_id: Unique identifier of the Azure subscription. This
39+
is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
40+
:type subscription_id: str
41+
:param str base_url: Service URL
42+
"""
43+
44+
def __init__(
45+
self, credentials, subscription_id, base_url=None):
46+
47+
self.config = DevOpsClientConfiguration(credentials, subscription_id, base_url)
48+
super(DevOpsClient, self).__init__(self.config.credentials, self.config)
49+
50+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
51+
self.api_version = '2019-07-01-preview'
52+
self._serialize = Serializer(client_models)
53+
self._deserialize = Deserializer(client_models)
54+
55+
self.operations = Operations(
56+
self._client, self.config, self._serialize, self._deserialize)
57+
self.pipeline_template_definitions = PipelineTemplateDefinitionsOperations(
58+
self._client, self.config, self._serialize, self._deserialize)
59+
self.pipelines = PipelinesOperations(
60+
self._client, self.config, self._serialize, self._deserialize)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
try:
13+
from ._models_py3 import Authorization
14+
from ._models_py3 import BootstrapConfiguration
15+
from ._models_py3 import CodeRepository
16+
from ._models_py3 import InputDescriptor
17+
from ._models_py3 import InputValue
18+
from ._models_py3 import Operation
19+
from ._models_py3 import OrganizationReference
20+
from ._models_py3 import Pipeline
21+
from ._models_py3 import PipelineTemplate
22+
from ._models_py3 import PipelineTemplateDefinition
23+
from ._models_py3 import PipelineUpdateParameters
24+
from ._models_py3 import ProjectReference
25+
from ._models_py3 import Resource
26+
except (SyntaxError, ImportError):
27+
from ._models import Authorization
28+
from ._models import BootstrapConfiguration
29+
from ._models import CodeRepository
30+
from ._models import InputDescriptor
31+
from ._models import InputValue
32+
from ._models import Operation
33+
from ._models import OrganizationReference
34+
from ._models import Pipeline
35+
from ._models import PipelineTemplate
36+
from ._models import PipelineTemplateDefinition
37+
from ._models import PipelineUpdateParameters
38+
from ._models import ProjectReference
39+
from ._models import Resource
40+
from ._paged_models import OperationPaged
41+
from ._paged_models import PipelinePaged
42+
from ._paged_models import PipelineTemplateDefinitionPaged
43+
from ._dev_ops_client_enums import (
44+
InputDataType,
45+
CodeRepositoryType,
46+
)
47+
48+
__all__ = [
49+
'Authorization',
50+
'BootstrapConfiguration',
51+
'CodeRepository',
52+
'InputDescriptor',
53+
'InputValue',
54+
'Operation',
55+
'OrganizationReference',
56+
'Pipeline',
57+
'PipelineTemplate',
58+
'PipelineTemplateDefinition',
59+
'PipelineUpdateParameters',
60+
'ProjectReference',
61+
'Resource',
62+
'OperationPaged',
63+
'PipelineTemplateDefinitionPaged',
64+
'PipelinePaged',
65+
'InputDataType',
66+
'CodeRepositoryType',
67+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from enum import Enum
13+
14+
15+
class InputDataType(str, Enum):
16+
17+
string = "String"
18+
secure_string = "SecureString"
19+
int_enum = "Int"
20+
bool_enum = "Bool"
21+
authorization = "Authorization"
22+
23+
24+
class CodeRepositoryType(str, Enum):
25+
26+
git_hub = "gitHub"
27+
vsts_git = "vstsGit"

0 commit comments

Comments
 (0)