diff --git a/azure-mgmt-managementpartner/HISTORY.rst b/azure-mgmt-managementpartner/HISTORY.rst deleted file mode 100644 index 08363ec0cb0f..000000000000 --- a/azure-mgmt-managementpartner/HISTORY.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. :changelog: - -Release History -=============== - -0.1.0 (2018-02-06) -++++++++++++++++++ - -* Initial Release diff --git a/azure-mgmt-managementpartner/MANIFEST.in b/azure-mgmt-managementpartner/MANIFEST.in deleted file mode 100644 index bb37a2723dae..000000000000 --- a/azure-mgmt-managementpartner/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include *.rst diff --git a/azure-mgmt-managementpartner/dev_requirements.txt b/azure-mgmt-managementpartner/dev_requirements.txt deleted file mode 100644 index 331cfed8ea26..000000000000 --- a/azure-mgmt-managementpartner/dev_requirements.txt +++ /dev/null @@ -1 +0,0 @@ --e ../azure-sdk-tools diff --git a/sdk/managementpartner/azure-mgmt-managementpartner/HISTORY.rst b/sdk/managementpartner/azure-mgmt-managementpartner/HISTORY.rst new file mode 100644 index 000000000000..52b73893c76e --- /dev/null +++ b/sdk/managementpartner/azure-mgmt-managementpartner/HISTORY.rst @@ -0,0 +1,17 @@ +.. :changelog: + +Release History +=============== + +0.1.1 (2019-05-17) +++++++++++++++++++ + +**Features** + +- Model PartnerResponse has a new parameter partner_name +- Added operation group PartnersOperations + +0.1.0 (2018-02-06) +++++++++++++++++++ + +* Initial Release diff --git a/sdk/managementpartner/azure-mgmt-managementpartner/MANIFEST.in b/sdk/managementpartner/azure-mgmt-managementpartner/MANIFEST.in new file mode 100644 index 000000000000..e4884efef41b --- /dev/null +++ b/sdk/managementpartner/azure-mgmt-managementpartner/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-managementpartner/README.rst b/sdk/managementpartner/azure-mgmt-managementpartner/README.rst similarity index 75% rename from azure-mgmt-managementpartner/README.rst rename to sdk/managementpartner/azure-mgmt-managementpartner/README.rst index 2f19f90f9584..a25ba3d0b956 100644 --- a/azure-mgmt-managementpartner/README.rst +++ b/sdk/managementpartner/azure-mgmt-managementpartner/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== diff --git a/azure-mgmt-managementpartner/azure/__init__.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/__init__.py similarity index 100% rename from azure-mgmt-managementpartner/azure/__init__.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/__init__.py diff --git a/azure-mgmt-managementpartner/azure/mgmt/__init__.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/__init__.py similarity index 100% rename from azure-mgmt-managementpartner/azure/mgmt/__init__.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/__init__.py diff --git a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/__init__.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/__init__.py similarity index 100% rename from azure-mgmt-managementpartner/azure/mgmt/managementpartner/__init__.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/__init__.py diff --git a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/ace_provisioning_management_partner_api.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/ace_provisioning_management_partner_api.py similarity index 85% rename from azure-mgmt-managementpartner/azure/mgmt/managementpartner/ace_provisioning_management_partner_api.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/ace_provisioning_management_partner_api.py index 14b4b6bf0c03..d41c0eed23d0 100644 --- a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/ace_provisioning_management_partner_api.py +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/ace_provisioning_management_partner_api.py @@ -9,12 +9,13 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION from .operations.partner_operations import PartnerOperations from .operations.operation_operations import OperationOperations +from .operations.partners_operations import PartnersOperations from . import models @@ -45,7 +46,7 @@ def __init__( self.credentials = credentials -class ACEProvisioningManagementPartnerAPI(object): +class ACEProvisioningManagementPartnerAPI(SDKClient): """This API describe ACE Provisioning ManagementPartner :ivar config: Configuration for client. @@ -55,6 +56,8 @@ class ACEProvisioningManagementPartnerAPI(object): :vartype partner: azure.mgmt.managementpartner.operations.PartnerOperations :ivar operation: Operation operations :vartype operation: azure.mgmt.managementpartner.operations.OperationOperations + :ivar partners: Partners operations + :vartype partners: azure.mgmt.managementpartner.operations.PartnersOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -66,7 +69,7 @@ def __init__( self, credentials, base_url=None): self.config = ACEProvisioningManagementPartnerAPIConfiguration(credentials, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(ACEProvisioningManagementPartnerAPI, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2018-02-01' @@ -77,3 +80,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.operation = OperationOperations( self._client, self.config, self._serialize, self._deserialize) + self.partners = PartnersOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/__init__.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/__init__.py similarity index 55% rename from azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/__init__.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/__init__.py index a84a69d31c68..c7f8243cb11e 100644 --- a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/__init__.py +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/__init__.py @@ -9,11 +9,18 @@ # regenerated. # -------------------------------------------------------------------------- -from .partner_response import PartnerResponse -from .extended_error_info import ExtendedErrorInfo -from .error import Error, ErrorException -from .operation_display import OperationDisplay -from .operation_response import OperationResponse +try: + from .partner_response_py3 import PartnerResponse + from .extended_error_info_py3 import ExtendedErrorInfo + from .error_py3 import Error, ErrorException + from .operation_display_py3 import OperationDisplay + from .operation_response_py3 import OperationResponse +except (SyntaxError, ImportError): + from .partner_response import PartnerResponse + from .extended_error_info import ExtendedErrorInfo + from .error import Error, ErrorException + from .operation_display import OperationDisplay + from .operation_response import OperationResponse from .operation_response_paged import OperationResponsePaged __all__ = [ diff --git a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/error.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/error.py similarity index 90% rename from azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/error.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/error.py index de426d8a2363..b63843832f6b 100644 --- a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/error.py +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/error.py @@ -24,9 +24,9 @@ class Error(Model): 'error': {'key': 'error', 'type': 'ExtendedErrorInfo'}, } - def __init__(self, error=None): - super(Error, self).__init__() - self.error = error + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.error = kwargs.get('error', None) class ErrorException(HttpOperationError): diff --git a/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/error_py3.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/error_py3.py new file mode 100644 index 000000000000..2dfbf03e2e5e --- /dev/null +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/error_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class Error(Model): + """this is the management partner operations error. + + :param error: this is the ExtendedErrorInfo property + :type error: ~azure.mgmt.managementpartner.models.ExtendedErrorInfo + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ExtendedErrorInfo'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.error = error + + +class ErrorException(HttpOperationError): + """Server responsed with exception of type: 'Error'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/extended_error_info.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/extended_error_info.py similarity index 84% rename from azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/extended_error_info.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/extended_error_info.py index 25cb3debb552..dffd4e6c3038 100644 --- a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/extended_error_info.py +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/extended_error_info.py @@ -27,7 +27,7 @@ class ExtendedErrorInfo(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, message=None): - super(ExtendedErrorInfo, self).__init__() - self.code = code - self.message = message + def __init__(self, **kwargs): + super(ExtendedErrorInfo, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) diff --git a/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/extended_error_info_py3.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/extended_error_info_py3.py new file mode 100644 index 000000000000..6d3289db3d26 --- /dev/null +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/extended_error_info_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExtendedErrorInfo(Model): + """this is the extended error info. + + :param code: this is the error response code. Possible values include: + 'NotFound', 'Conflict', 'BadRequest' + :type code: str or ~azure.mgmt.managementpartner.models.enum + :param message: this is the extended error info message + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code=None, message: str=None, **kwargs) -> None: + super(ExtendedErrorInfo, self).__init__(**kwargs) + self.code = code + self.message = message diff --git a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_display.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_display.py similarity index 79% rename from azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_display.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_display.py index ed8c9c1bf1ff..83b545485f0f 100644 --- a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_display.py +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_display.py @@ -32,9 +32,9 @@ class OperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None, description=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_display_py3.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_display_py3.py new file mode 100644 index 000000000000..e747893666a4 --- /dev/null +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """this is the management partner operation. + + :param provider: the is management partner provider + :type provider: str + :param resource: the is management partner resource + :type resource: str + :param operation: the is management partner operation + :type operation: str + :param description: the is management partner operation description + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_response.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_response.py similarity index 82% rename from azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_response.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_response.py index baaaeab196cc..ef55175250a8 100644 --- a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_response.py +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_response.py @@ -29,8 +29,8 @@ class OperationResponse(Model): 'origin': {'key': 'origin', 'type': 'str'}, } - def __init__(self, name=None, display=None, origin=None): - super(OperationResponse, self).__init__() - self.name = name - self.display = display - self.origin = origin + def __init__(self, **kwargs): + super(OperationResponse, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) diff --git a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_response_paged.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_response_paged.py similarity index 100% rename from azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_response_paged.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_response_paged.py diff --git a/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_response_py3.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_response_py3.py new file mode 100644 index 000000000000..181384a984ab --- /dev/null +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/operation_response_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationResponse(Model): + """this is the management partner operations response. + + :param name: this is the operation response name + :type name: str + :param display: this is the operation display + :type display: ~azure.mgmt.managementpartner.models.OperationDisplay + :param origin: the is operation response origin information + :type origin: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, **kwargs) -> None: + super(OperationResponse, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin diff --git a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/partner_response.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/partner_response.py similarity index 77% rename from azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/partner_response.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/partner_response.py index bb82aae1dd1a..d1f5ba16b7eb 100644 --- a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/partner_response.py +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/partner_response.py @@ -26,6 +26,8 @@ class PartnerResponse(Model): :vartype name: str :param partner_id: This is the partner id :type partner_id: str + :param partner_name: This is the partner name + :type partner_name: str :param tenant_id: This is the tenant id. :type tenant_id: str :param object_id: This is the object id. @@ -54,6 +56,7 @@ class PartnerResponse(Model): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'partner_id': {'key': 'properties.partnerId', 'type': 'str'}, + 'partner_name': {'key': 'properties.partnerName', 'type': 'str'}, 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, 'object_id': {'key': 'properties.objectId', 'type': 'str'}, 'version': {'key': 'properties.version', 'type': 'str'}, @@ -63,16 +66,17 @@ class PartnerResponse(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, etag=None, partner_id=None, tenant_id=None, object_id=None, version=None, updated_time=None, created_time=None, state=None): - super(PartnerResponse, self).__init__() - self.etag = etag + def __init__(self, **kwargs): + super(PartnerResponse, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) self.id = None self.name = None - self.partner_id = partner_id - self.tenant_id = tenant_id - self.object_id = object_id - self.version = version - self.updated_time = updated_time - self.created_time = created_time - self.state = state + self.partner_id = kwargs.get('partner_id', None) + self.partner_name = kwargs.get('partner_name', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.object_id = kwargs.get('object_id', None) + self.version = kwargs.get('version', None) + self.updated_time = kwargs.get('updated_time', None) + self.created_time = kwargs.get('created_time', None) + self.state = kwargs.get('state', None) self.type = None diff --git a/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/partner_response_py3.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/partner_response_py3.py new file mode 100644 index 000000000000..685bcde706ba --- /dev/null +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/partner_response_py3.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PartnerResponse(Model): + """this is the management partner operations response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param etag: Type of the partner + :type etag: int + :ivar id: Identifier of the partner + :vartype id: str + :ivar name: Name of the partner + :vartype name: str + :param partner_id: This is the partner id + :type partner_id: str + :param partner_name: This is the partner name + :type partner_name: str + :param tenant_id: This is the tenant id. + :type tenant_id: str + :param object_id: This is the object id. + :type object_id: str + :param version: This is the version. + :type version: str + :param updated_time: This is the DateTime when the partner was updated. + :type updated_time: datetime + :param created_time: This is the DateTime when the partner was created. + :type created_time: datetime + :param state: This is the partner state. Possible values include: + 'Active', 'Deleted' + :type state: str or ~azure.mgmt.managementpartner.models.enum + :ivar type: Type of resource. "Microsoft.ManagementPartner/partners" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'etag': {'key': 'etag', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'partner_id': {'key': 'properties.partnerId', 'type': 'str'}, + 'partner_name': {'key': 'properties.partnerName', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'object_id': {'key': 'properties.objectId', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'updated_time': {'key': 'properties.updatedTime', 'type': 'iso-8601'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, etag: int=None, partner_id: str=None, partner_name: str=None, tenant_id: str=None, object_id: str=None, version: str=None, updated_time=None, created_time=None, state=None, **kwargs) -> None: + super(PartnerResponse, self).__init__(**kwargs) + self.etag = etag + self.id = None + self.name = None + self.partner_id = partner_id + self.partner_name = partner_name + self.tenant_id = tenant_id + self.object_id = object_id + self.version = version + self.updated_time = updated_time + self.created_time = created_time + self.state = state + self.type = None diff --git a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/__init__.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/__init__.py similarity index 89% rename from azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/__init__.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/__init__.py index 5bf1942d0f76..a109cec82944 100644 --- a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/__init__.py +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/__init__.py @@ -11,8 +11,10 @@ from .partner_operations import PartnerOperations from .operation_operations import OperationOperations +from .partners_operations import PartnersOperations __all__ = [ 'PartnerOperations', 'OperationOperations', + 'PartnersOperations', ] diff --git a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/operation_operations.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/operation_operations.py similarity index 89% rename from azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/operation_operations.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/operation_operations.py index 3ffb2175345e..8bcb1f8b1af7 100644 --- a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/operation_operations.py +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/operation_operations.py @@ -21,7 +21,7 @@ class OperationOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Supported version. Constant value: "2018-02-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.ManagementPartner/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -69,7 +69,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -78,9 +78,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -96,3 +95,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.ManagementPartner/operations'} diff --git a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/partner_operations.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/partner_operations.py similarity index 87% rename from azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/partner_operations.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/partner_operations.py index 9564c1416555..4fec0fba7b28 100644 --- a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/partner_operations.py +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/partner_operations.py @@ -21,7 +21,7 @@ class PartnerOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Supported version. Constant value: "2018-02-01". """ @@ -56,7 +56,7 @@ def get( :class:`ErrorException` """ # Construct URL - url = '/providers/Microsoft.ManagementPartner/partners/{partnerId}' + url = self.get.metadata['url'] path_format_arguments = { 'partnerId': self._serialize.url("partner_id", partner_id, 'str') } @@ -68,7 +68,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -77,8 +77,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -93,6 +93,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/providers/Microsoft.ManagementPartner/partners/{partnerId}'} def create( self, partner_id, custom_headers=None, raw=False, **operation_config): @@ -114,7 +115,7 @@ def create( :class:`ErrorException` """ # Construct URL - url = '/providers/Microsoft.ManagementPartner/partners/{partnerId}' + url = self.create.metadata['url'] path_format_arguments = { 'partnerId': self._serialize.url("partner_id", partner_id, 'str') } @@ -126,7 +127,7 @@ def create( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -135,8 +136,8 @@ def create( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -151,6 +152,7 @@ def create( return client_raw_response return deserialized + create.metadata = {'url': '/providers/Microsoft.ManagementPartner/partners/{partnerId}'} def update( self, partner_id, custom_headers=None, raw=False, **operation_config): @@ -172,7 +174,7 @@ def update( :class:`ErrorException` """ # Construct URL - url = '/providers/Microsoft.ManagementPartner/partners/{partnerId}' + url = self.update.metadata['url'] path_format_arguments = { 'partnerId': self._serialize.url("partner_id", partner_id, 'str') } @@ -184,7 +186,7 @@ def update( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -193,8 +195,8 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.patch(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -209,6 +211,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/providers/Microsoft.ManagementPartner/partners/{partnerId}'} def delete( self, partner_id, custom_headers=None, raw=False, **operation_config): @@ -229,7 +232,7 @@ def delete( :class:`ErrorException` """ # Construct URL - url = '/providers/Microsoft.ManagementPartner/partners/{partnerId}' + url = self.delete.metadata['url'] path_format_arguments = { 'partnerId': self._serialize.url("partner_id", partner_id, 'str') } @@ -241,7 +244,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -250,8 +252,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -259,3 +261,4 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/providers/Microsoft.ManagementPartner/partners/{partnerId}'} diff --git a/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/partners_operations.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/partners_operations.py new file mode 100644 index 000000000000..bd9af1ce622d --- /dev/null +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/operations/partners_operations.py @@ -0,0 +1,90 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PartnersOperations(object): + """PartnersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Supported version. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def get( + self, custom_headers=None, raw=False, **operation_config): + """Get a specific `Partner`. + + Get the management partner using the objectId and tenantId. + + :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`. + :return: PartnerResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.managementpartner.models.PartnerResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PartnerResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.ManagementPartner/partners'} diff --git a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/version.py b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/version.py similarity index 96% rename from azure-mgmt-managementpartner/azure/mgmt/managementpartner/version.py rename to sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/version.py index e0ec669828cb..e7efe25ea7e0 100644 --- a/azure-mgmt-managementpartner/azure/mgmt/managementpartner/version.py +++ b/sdk/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "0.1.1" diff --git a/sdk/managementpartner/azure-mgmt-managementpartner/dev_requirements.txt b/sdk/managementpartner/azure-mgmt-managementpartner/dev_requirements.txt new file mode 100644 index 000000000000..1f0e0d86b735 --- /dev/null +++ b/sdk/managementpartner/azure-mgmt-managementpartner/dev_requirements.txt @@ -0,0 +1 @@ +-e ../../../azure-sdk-tools diff --git a/azure-mgmt-managementpartner/sdk_packaging.toml b/sdk/managementpartner/azure-mgmt-managementpartner/sdk_packaging.toml similarity index 89% rename from azure-mgmt-managementpartner/sdk_packaging.toml rename to sdk/managementpartner/azure-mgmt-managementpartner/sdk_packaging.toml index c3130a663044..f449da4bac64 100644 --- a/azure-mgmt-managementpartner/sdk_packaging.toml +++ b/sdk/managementpartner/azure-mgmt-managementpartner/sdk_packaging.toml @@ -1,7 +1,8 @@ [packaging] package_name = "azure-mgmt-managementpartner" package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "ManagementPartner Management" -package_doc_id = "" is_stable = false is_arm = true +need_msrestazure = true +package_pprint_name = "ManagementPartner Management" +package_doc_id = "" diff --git a/azure-mgmt-managementpartner/setup.cfg b/sdk/managementpartner/azure-mgmt-managementpartner/setup.cfg similarity index 100% rename from azure-mgmt-managementpartner/setup.cfg rename to sdk/managementpartner/azure-mgmt-managementpartner/setup.cfg diff --git a/azure-mgmt-managementpartner/setup.py b/sdk/managementpartner/azure-mgmt-managementpartner/setup.py similarity index 98% rename from azure-mgmt-managementpartner/setup.py rename to sdk/managementpartner/azure-mgmt-managementpartner/setup.py index 4f2d5c01c87a..44a7de7ae9f2 100644 --- a/azure-mgmt-managementpartner/setup.py +++ b/sdk/managementpartner/azure-mgmt-managementpartner/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com', diff --git a/azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_create.yaml b/sdk/managementpartner/azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_create.yaml similarity index 100% rename from azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_create.yaml rename to sdk/managementpartner/azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_create.yaml diff --git a/azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_delete.yaml b/sdk/managementpartner/azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_delete.yaml similarity index 100% rename from azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_delete.yaml rename to sdk/managementpartner/azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_delete.yaml diff --git a/azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_get.yaml b/sdk/managementpartner/azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_get.yaml similarity index 100% rename from azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_get.yaml rename to sdk/managementpartner/azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_get.yaml diff --git a/azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_update.yaml b/sdk/managementpartner/azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_update.yaml similarity index 100% rename from azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_update.yaml rename to sdk/managementpartner/azure-mgmt-managementpartner/tests/recordings/test_mgmt_managementpartner.test_managementpartner_update.yaml diff --git a/azure-mgmt-managementpartner/tests/test_mgmt_managementpartner.py b/sdk/managementpartner/azure-mgmt-managementpartner/tests/test_mgmt_managementpartner.py similarity index 100% rename from azure-mgmt-managementpartner/tests/test_mgmt_managementpartner.py rename to sdk/managementpartner/azure-mgmt-managementpartner/tests/test_mgmt_managementpartner.py