From 2178912aaed7dfcfc3f271214428be82b23400e9 Mon Sep 17 00:00:00 2001 From: Jason Prickett Date: Fri, 28 Apr 2017 10:17:06 -0400 Subject: [PATCH] removing AzureTfs folder --- azuretfs/azure_tfs.py | 179 ------------------ azuretfs/models/__init__.py | 38 ---- .../continuous_deployment_configuration.py | 49 ----- .../models/continuous_deployment_operation.py | 40 ---- azuretfs/models/operation.py | 37 ---- azuretfs/models/operation_reference.py | 31 --- azuretfs/models/pipeline_configuration.py | 31 --- azuretfs/models/property.py | 27 --- azuretfs/models/reference_links.py | 24 --- azuretfs/models/resource_configuration.py | 31 --- azuretfs/models/source_configuration.py | 28 --- azuretfs/models/source_repository.py | 33 ---- continuous_delivery/continuous_delivery.py | 8 +- setup.py | 2 +- .../continuous_delivery_manager.py | 2 +- {azuretfs => vsts_info_provider}/__init__.py | 3 +- .../exceptions.py | 0 .../models/__init__.py | 15 +- .../models/collection_info.py | 0 .../models/repository_info.py | 0 .../models/team_project_info.py | 0 .../models/vsts_info.py | 0 {azuretfs => vsts_info_provider}/version.py | 0 .../vsts_info_provider.py | 39 +++- 24 files changed, 52 insertions(+), 565 deletions(-) delete mode 100644 azuretfs/azure_tfs.py delete mode 100644 azuretfs/models/__init__.py delete mode 100644 azuretfs/models/continuous_deployment_configuration.py delete mode 100644 azuretfs/models/continuous_deployment_operation.py delete mode 100644 azuretfs/models/operation.py delete mode 100644 azuretfs/models/operation_reference.py delete mode 100644 azuretfs/models/pipeline_configuration.py delete mode 100644 azuretfs/models/property.py delete mode 100644 azuretfs/models/reference_links.py delete mode 100644 azuretfs/models/resource_configuration.py delete mode 100644 azuretfs/models/source_configuration.py delete mode 100644 azuretfs/models/source_repository.py rename {azuretfs => vsts_info_provider}/__init__.py (85%) rename {azuretfs => vsts_info_provider}/exceptions.py (100%) rename azuretfs/credentials.py => vsts_info_provider/models/__init__.py (54%) rename {azuretfs => vsts_info_provider}/models/collection_info.py (100%) rename {azuretfs => vsts_info_provider}/models/repository_info.py (100%) rename {azuretfs => vsts_info_provider}/models/team_project_info.py (100%) rename {azuretfs => vsts_info_provider}/models/vsts_info.py (100%) rename {azuretfs => vsts_info_provider}/version.py (100%) rename {azuretfs => vsts_info_provider}/vsts_info_provider.py (70%) diff --git a/azuretfs/azure_tfs.py b/azuretfs/azure_tfs.py deleted file mode 100644 index d13b2f3..0000000 --- a/azuretfs/azure_tfs.py +++ /dev/null @@ -1,179 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from __future__ import print_function - -from msrest.service_client import ServiceClient -from msrest import Configuration, Serializer, Deserializer -from .version import VERSION -from msrest.pipeline import ClientRawResponse -from msrest.exceptions import HttpOperationError -from . import models - - -class AzureTfsConfiguration(Configuration): - """Configuration for AzureTfs - Note that all parameters used to create this instance are saved as instance - attributes. - - :param api_version: Version of the API to use. This should be set to - '3.2-preview' to use this version of the api. - :type api_version: str - :param str base_url: Service URL - """ - - def __init__( - self, api_version, base_url=None): - - if api_version is None: - raise ValueError("Parameter 'api_version' must not be None.") - if not isinstance(api_version, str): - raise TypeError("Parameter 'api_version' must be str.") - if not base_url: - base_url = 'https://stamp2.app.portalext.visualstudio.com/' - - super(AzureTfsConfiguration, self).__init__(base_url) - - self.add_user_agent('azuretfs/{}'.format(VERSION)) - - self.api_version = api_version - - -class AzureTfs(object): - """AzureTfs - - :ivar config: Configuration for client. - :vartype config: AzureTfsConfiguration - - :param api_version: Version of the API to use. This should be set to - '3.2-preview' to use this version of the api. - :type api_version: str - :param str base_url: Service URL - :param Credentials creds: credentials for vsts - """ - - def __init__( - self, api_version, base_url=None, creds=None): - self.config = AzureTfsConfiguration(api_version, base_url) - self._client = ServiceClient(creds, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '3.2' if not api_version else api_version - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - def configure_continuous_deployment( - self, body, custom_headers=None, raw=False, **operation_config): - """ConfigureContinuousDeployment. - - :param body: - :type body: :class:`ContinuousDeploymentConfiguration - ` - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: :class:`ContinuousDeploymentOperation - ` - :rtype: :class:`ClientRawResponse` - if raw=true - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = '/_apis/azuretfs/continuousdeploymentconfiguration' - - # Construct parameters - query_parameters = {} - if self.api_version: - query_parameters["api-version"] = self.api_version - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(body, 'ContinuousDeploymentConfiguration') - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - if response.status_code not in [200, 202]: - print("response:", response.status_code) - print(response.text) - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ContinuousDeploymentOperation', response) - if response.status_code == 202: - deserialized = self._deserialize('ContinuousDeploymentOperation', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_continuous_deployment_operation( - self, continuous_deployment_operation_id, custom_headers=None, raw=False, **operation_config): - """GetContinuousDeploymentOperation. - - :param continuous_deployment_operation_id: - :type continuous_deployment_operation_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: :class:`ContinuousDeploymentOperation - ` - :rtype: :class:`ClientRawResponse` - if raw=true - :raises: - :class:`HttpOperationError` - """ - # Construct URL - url = '/_apis/azuretfs/continuousdeploymentconfiguration/{continuousDeploymentOperationId}' - path_format_arguments = { - 'continuousDeploymentOperationId': self._serialize.url("continuous_deployment_operation_id", continuous_deployment_operation_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - if response.status_code not in [200]: - print("response:", response.status_code) - print(response.text) - raise HttpOperationError(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ContinuousDeploymentOperation', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - diff --git a/azuretfs/models/__init__.py b/azuretfs/models/__init__.py deleted file mode 100644 index 85bb2cb..0000000 --- a/azuretfs/models/__init__.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .property import Property -from .resource_configuration import ResourceConfiguration -from .pipeline_configuration import PipelineConfiguration -from .source_repository import SourceRepository -from .source_configuration import SourceConfiguration -from .continuous_deployment_configuration import ContinuousDeploymentConfiguration -from .continuous_deployment_operation import ContinuousDeploymentOperation -from .reference_links import ReferenceLinks -from .operation import Operation -from .operation_reference import OperationReference -from .collection_info import CollectionInfo -from .repository_info import RepositoryInfo -from .team_project_info import TeamProjectInfo -from .vsts_info import VstsInfo - -__all__ = [ - 'Property', - 'ResourceConfiguration', - 'PipelineConfiguration', - 'SourceRepository', - 'SourceConfiguration', - 'ContinuousDeploymentConfiguration', - 'ContinuousDeploymentOperation', - 'ReferenceLinks', - 'Operation', - 'OperationReference', - 'CollectionInfo', - 'RepositoryInfo', - 'TeamProjectInfo', - 'VstsInfo', -] diff --git a/azuretfs/models/continuous_deployment_configuration.py b/azuretfs/models/continuous_deployment_configuration.py deleted file mode 100644 index 01cef10..0000000 --- a/azuretfs/models/continuous_deployment_configuration.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ContinuousDeploymentConfiguration(Model): - """ContinuousDeploymentConfiguration. - - :param account_configuration: - :type account_configuration: :class:`ResourceConfiguration - ` - :param pipeline_configuration: - :type pipeline_configuration: :class:`PipelineConfiguration - ` - :param project_configuration: - :type project_configuration: :class:`ResourceConfiguration - ` - :param source_configuration: - :type source_configuration: :class:`SourceConfiguration - ` - :param target_configuration: - :type target_configuration: list of :class:`Property - ` - :param test_configuration: - :type test_configuration: list of :class:`Property - ` - """ - - _attribute_map = { - 'account_configuration': {'key': 'accountConfiguration', 'type': 'ResourceConfiguration'}, - 'pipeline_configuration': {'key': 'pipelineConfiguration', 'type': 'PipelineConfiguration'}, - 'project_configuration': {'key': 'projectConfiguration', 'type': 'ResourceConfiguration'}, - 'source_configuration': {'key': 'sourceConfiguration', 'type': 'SourceConfiguration'}, - 'target_configuration': {'key': 'targetConfiguration', 'type': '[Property]'}, - 'test_configuration': {'key': 'testConfiguration', 'type': '[Property]'}, - } - - def __init__(self, account_configuration=None, pipeline_configuration=None, project_configuration=None, source_configuration=None, target_configuration=None, test_configuration=None): - self.account_configuration = account_configuration - self.pipeline_configuration = pipeline_configuration - self.project_configuration = project_configuration - self.source_configuration = source_configuration - self.target_configuration = target_configuration - self.test_configuration = test_configuration diff --git a/azuretfs/models/continuous_deployment_operation.py b/azuretfs/models/continuous_deployment_operation.py deleted file mode 100644 index 0295b95..0000000 --- a/azuretfs/models/continuous_deployment_operation.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .operation import Operation - - -class ContinuousDeploymentOperation(Operation): - """ContinuousDeploymentOperation. - - :param id: The identifier for this operation. - :type id: str - :param status: The current status of the operation. - :type status: object - :param url: Url to get the full object. - :type url: str - :param _links: The links to other objects related to this object. - :type _links: :class:`ReferenceLinks ` - :param result_message: The result message which is generally not set. - :type result_message: str - :param deployment_step_ids: - :type deployment_step_ids: list of :class:`Property - ` - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'url': {'key': 'url', 'type': 'str'}, - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'result_message': {'key': 'resultMessage', 'type': 'str'}, - 'deployment_step_ids': {'key': 'deploymentStepIds', 'type': '[Property]'}, - } - - def __init__(self, id=None, status=None, url=None, _links=None, result_message=None, deployment_step_ids=None): - super(ContinuousDeploymentOperation, self).__init__(id=id, status=status, url=url, _links=_links, result_message=result_message) - self.deployment_step_ids = deployment_step_ids diff --git a/azuretfs/models/operation.py b/azuretfs/models/operation.py deleted file mode 100644 index 9787af6..0000000 --- a/azuretfs/models/operation.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .operation_reference import OperationReference - - -class Operation(OperationReference): - """Operation. - - :param id: The identifier for this operation. - :type id: str - :param status: The current status of the operation. - :type status: object - :param url: Url to get the full object. - :type url: str - :param _links: The links to other objects related to this object. - :type _links: :class:`ReferenceLinks ` - :param result_message: The result message which is generally not set. - :type result_message: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'url': {'key': 'url', 'type': 'str'}, - '_links': {'key': '_links', 'type': 'ReferenceLinks'}, - 'result_message': {'key': 'resultMessage', 'type': 'str'}, - } - - def __init__(self, id=None, status=None, url=None, _links=None, result_message=None): - super(Operation, self).__init__(id=id, status=status, url=url) - self._links = _links - self.result_message = result_message diff --git a/azuretfs/models/operation_reference.py b/azuretfs/models/operation_reference.py deleted file mode 100644 index cd97848..0000000 --- a/azuretfs/models/operation_reference.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationReference(Model): - """OperationReference. - - :param id: The identifier for this operation. - :type id: str - :param status: The current status of the operation. - :type status: object - :param url: Url to get the full object. - :type url: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'object'}, - 'url': {'key': 'url', 'type': 'str'}, - } - - def __init__(self, id=None, status=None, url=None): - self.id = id - self.status = status - self.url = url diff --git a/azuretfs/models/pipeline_configuration.py b/azuretfs/models/pipeline_configuration.py deleted file mode 100644 index 4d073b3..0000000 --- a/azuretfs/models/pipeline_configuration.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class PipelineConfiguration(Model): - """PipelineConfiguration. - - :param client_type: - :type client_type: object - :param prod_environment_name: - :type prod_environment_name: str - :param test_environment_name: - :type test_environment_name: str - """ - - _attribute_map = { - 'client_type': {'key': 'clientType', 'type': 'object'}, - 'prod_environment_name': {'key': 'prodEnvironmentName', 'type': 'str'}, - 'test_environment_name': {'key': 'testEnvironmentName', 'type': 'str'}, - } - - def __init__(self, client_type=None, prod_environment_name=None, test_environment_name=None): - self.client_type = client_type - self.prod_environment_name = prod_environment_name - self.test_environment_name = test_environment_name diff --git a/azuretfs/models/property.py b/azuretfs/models/property.py deleted file mode 100644 index dbdadab..0000000 --- a/azuretfs/models/property.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Property(Model): - """Property. - - :param name: - :type name: str - :param value: - :type value: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, name=None, value=None): - self.name = name - self.value = value diff --git a/azuretfs/models/reference_links.py b/azuretfs/models/reference_links.py deleted file mode 100644 index 75a79d5..0000000 --- a/azuretfs/models/reference_links.py +++ /dev/null @@ -1,24 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ReferenceLinks(Model): - """ReferenceLinks. - - :param links: The readonly view of the links. Because Reference links are - readonly, we only want to expose them as read only. - :type links: dict - """ - - _attribute_map = { - 'links': {'key': 'links', 'type': '{object}'}, - } - - def __init__(self, links=None): - self.links = links diff --git a/azuretfs/models/resource_configuration.py b/azuretfs/models/resource_configuration.py deleted file mode 100644 index dba58ac..0000000 --- a/azuretfs/models/resource_configuration.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ResourceConfiguration(Model): - """ResourceConfiguration. - - :param create_if_not_found: - :type create_if_not_found: bool - :param properties: - :type properties: list of :class:`Property ` - :param resource_name: - :type resource_name: str - """ - - _attribute_map = { - 'create_if_not_found': {'key': 'createIfNotFound', 'type': 'bool'}, - 'properties': {'key': 'properties', 'type': '[Property]'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - } - - def __init__(self, create_if_not_found=None, properties=None, resource_name=None): - self.create_if_not_found = create_if_not_found - self.properties = properties - self.resource_name = resource_name diff --git a/azuretfs/models/source_configuration.py b/azuretfs/models/source_configuration.py deleted file mode 100644 index 5ef64f5..0000000 --- a/azuretfs/models/source_configuration.py +++ /dev/null @@ -1,28 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SourceConfiguration(Model): - """SourceConfiguration. - - :param source_repository: - :type source_repository: :class:`SourceRepository - ` - :param source_version: - :type source_version: str - """ - - _attribute_map = { - 'source_repository': {'key': 'sourceRepository', 'type': 'SourceRepository'}, - 'source_version': {'key': 'sourceVersion', 'type': 'str'}, - } - - def __init__(self, source_repository=None, source_version=None): - self.source_repository = source_repository - self.source_version = source_version diff --git a/azuretfs/models/source_repository.py b/azuretfs/models/source_repository.py deleted file mode 100644 index 9140106..0000000 --- a/azuretfs/models/source_repository.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SourceRepository(Model): - """SourceRepository. - - :param identifier: - :type identifier: str - :param properties: The properties cannot be IEnumerable/IList, since XML - serializer does not work well with interfaces. This object gets passed as - job parameter which uses XML serializer. - :type properties: list of :class:`Property ` - :param repository_type: - :type repository_type: object - """ - - _attribute_map = { - 'identifier': {'key': 'identifier', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '[Property]'}, - 'repository_type': {'key': 'repositoryType', 'type': 'object'}, - } - - def __init__(self, identifier=None, properties=None, repository_type=None): - self.identifier = identifier - self.properties = properties - self.repository_type = repository_type diff --git a/continuous_delivery/continuous_delivery.py b/continuous_delivery/continuous_delivery.py index 29a903a..36b205f 100644 --- a/continuous_delivery/continuous_delivery.py +++ b/continuous_delivery/continuous_delivery.py @@ -38,7 +38,7 @@ class ContinuousDeliveryConfiguration(Configuration): super(ContinuousDeliveryConfiguration, self).__init__(base_url) - self.add_user_agent('azurecli/{}/continuousdelivery/{}'.format(VERSION, VERSION)) + self.add_user_agent('azurecli/{} continuousdelivery/{}'.format(VERSION, VERSION)) self.api_version = api_version @@ -72,14 +72,14 @@ class ContinuousDelivery(object): :param body: :type body: :class:`ContinuousDeploymentConfiguration - ` + ` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. :rtype: :class:`ContinuousDeploymentOperation - ` + ` :rtype: :class:`ClientRawResponse` if raw=true :raises: @@ -137,7 +137,7 @@ class ContinuousDelivery(object): :param operation_config: :ref:`Operation configuration overrides`. :rtype: :class:`ContinuousDeploymentOperation - ` + ` :rtype: :class:`ClientRawResponse` if raw=true :raises: diff --git a/setup.py b/setup.py index a89272d..170b355 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from setuptools import setup, find_packages NAME = "vsts-cd-manager" -VERSION = "0.117.2" +VERSION = "0.117.3" # To install the library, run the following # diff --git a/vsts_cd_manager/continuous_delivery_manager.py b/vsts_cd_manager/continuous_delivery_manager.py index b908b15..12c6246 100644 --- a/vsts_cd_manager/continuous_delivery_manager.py +++ b/vsts_cd_manager/continuous_delivery_manager.py @@ -12,7 +12,7 @@ try: except ImportError: from urllib import quote #pylint: disable=no-name-in-module from urlparse import urlparse #pylint: disable=import-error -from azuretfs import VstsInfoProvider +from vsts_info_provider import VstsInfoProvider from continuous_delivery import ContinuousDelivery from continuous_delivery.models import (AuthorizationInfo, AuthorizationInfoParameters, BuildConfiguration, CiArtifact, CiConfiguration, ProvisioningConfiguration, diff --git a/azuretfs/__init__.py b/vsts_info_provider/__init__.py similarity index 85% rename from azuretfs/__init__.py rename to vsts_info_provider/__init__.py index 5aed04e..107c64f 100644 --- a/azuretfs/__init__.py +++ b/vsts_info_provider/__init__.py @@ -5,11 +5,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .azure_tfs import AzureTfs from .vsts_info_provider import VstsInfoProvider from .version import VERSION -__all__ = ['AzureTfs', 'VstsInfoProvider'] +__all__ = ['VstsInfoProvider'] __version__ = VERSION diff --git a/azuretfs/exceptions.py b/vsts_info_provider/exceptions.py similarity index 100% rename from azuretfs/exceptions.py rename to vsts_info_provider/exceptions.py diff --git a/azuretfs/credentials.py b/vsts_info_provider/models/__init__.py similarity index 54% rename from azuretfs/credentials.py rename to vsts_info_provider/models/__init__.py index 43af390..9300871 100644 --- a/azuretfs/credentials.py +++ b/vsts_info_provider/models/__init__.py @@ -5,7 +5,14 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.authentication import ( - BasicAuthentication, - BasicTokenAuthentication, - OAuthTokenAuthentication) +from .collection_info import CollectionInfo +from .repository_info import RepositoryInfo +from .team_project_info import TeamProjectInfo +from .vsts_info import VstsInfo + +__all__ = [ + 'CollectionInfo', + 'RepositoryInfo', + 'TeamProjectInfo', + 'VstsInfo', +] diff --git a/azuretfs/models/collection_info.py b/vsts_info_provider/models/collection_info.py similarity index 100% rename from azuretfs/models/collection_info.py rename to vsts_info_provider/models/collection_info.py diff --git a/azuretfs/models/repository_info.py b/vsts_info_provider/models/repository_info.py similarity index 100% rename from azuretfs/models/repository_info.py rename to vsts_info_provider/models/repository_info.py diff --git a/azuretfs/models/team_project_info.py b/vsts_info_provider/models/team_project_info.py similarity index 100% rename from azuretfs/models/team_project_info.py rename to vsts_info_provider/models/team_project_info.py diff --git a/azuretfs/models/vsts_info.py b/vsts_info_provider/models/vsts_info.py similarity index 100% rename from azuretfs/models/vsts_info.py rename to vsts_info_provider/models/vsts_info.py diff --git a/azuretfs/version.py b/vsts_info_provider/version.py similarity index 100% rename from azuretfs/version.py rename to vsts_info_provider/version.py diff --git a/azuretfs/vsts_info_provider.py b/vsts_info_provider/vsts_info_provider.py similarity index 70% rename from azuretfs/vsts_info_provider.py rename to vsts_info_provider/vsts_info_provider.py index 7c49ad5..a6feef4 100644 --- a/azuretfs/vsts_info_provider.py +++ b/vsts_info_provider/vsts_info_provider.py @@ -6,12 +6,41 @@ # -------------------------------------------------------------------------- from __future__ import print_function +from sys import stderr from msrest.service_client import ServiceClient -from msrest import Serializer, Deserializer +from msrest import Configuration, Serializer, Deserializer from msrest.pipeline import ClientRawResponse from msrest.exceptions import HttpOperationError from . import models -from .azure_tfs import AzureTfsConfiguration +from .version import VERSION + + +class VstsInfoProviderConfiguration(Configuration): + """Configuration for VstsInfoProvider + Note that all parameters used to create this instance are saved as instance + attributes. + + :param api_version: Version of the API to use. This should be set to + '3.2-preview' to use this version of the api. + :type api_version: str + :param str base_url: Service URL + """ + + def __init__( + self, api_version, base_url=None): + + if api_version is None: + raise ValueError("Parameter 'api_version' must not be None.") + if not isinstance(api_version, str): + raise TypeError("Parameter 'api_version' must be str.") + if not base_url: + base_url = 'https://{}.visualstudio.com/' + + super(AzureTfsConfiguration, self).__init__(base_url) + + self.add_user_agent('azurecli/{} vstsinfo/{}'.format(VERSION, VERSION)) + + self.api_version = api_version class VstsInfoProvider(object): @@ -47,7 +76,7 @@ class VstsInfoProvider(object): :param operation_config: :ref:`Operation configuration overrides`. :rtype: :class:`ContinuousDeploymentOperation - ` + ` :rtype: :class:`ClientRawResponse` if raw=true :raises: @@ -69,8 +98,8 @@ class VstsInfoProvider(object): request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: - print("response:", response.status_code) - print(response.text) + print("response:", response.status_code, file=stderr) + print(response.text, file=stderr) raise HttpOperationError(self._deserialize, response) deserialized = None