diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/__init__.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/__init__.py index abc46570bd0f..1e924f04acd0 100644 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/__init__.py +++ b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .marketplace_ordering_agreements import MarketplaceOrderingAgreements -from .version import VERSION +from ._configuration import MarketplaceOrderingAgreementsConfiguration +from ._marketplace_ordering_agreements import MarketplaceOrderingAgreements +__all__ = ['MarketplaceOrderingAgreements', 'MarketplaceOrderingAgreementsConfiguration'] -__all__ = ['MarketplaceOrderingAgreements'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/_configuration.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/_configuration.py new file mode 100644 index 000000000000..8a180894cc3e --- /dev/null +++ b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/_configuration.py @@ -0,0 +1,49 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class MarketplaceOrderingAgreementsConfiguration(AzureConfiguration): + """Configuration for MarketplaceOrderingAgreements + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription ID that identifies an Azure + subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(MarketplaceOrderingAgreementsConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-marketplaceordering/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/marketplace_ordering_agreements.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/_marketplace_ordering_agreements.py similarity index 60% rename from sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/marketplace_ordering_agreements.py rename to sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/_marketplace_ordering_agreements.py index 92405c1b5bcb..9e6e1b1e8149 100644 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/marketplace_ordering_agreements.py +++ b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/_marketplace_ordering_agreements.py @@ -11,44 +11,11 @@ from msrest.service_client import SDKClient from msrest import Serializer, Deserializer -from msrestazure import AzureConfiguration -from .version import VERSION -from .operations.marketplace_agreements_operations import MarketplaceAgreementsOperations -from .operations.operations import Operations -from . import models - - -class MarketplaceOrderingAgreementsConfiguration(AzureConfiguration): - """Configuration for MarketplaceOrderingAgreements - Note that all parameters used to create this instance are saved as instance - attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The subscription ID that identifies an Azure - subscription. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(MarketplaceOrderingAgreementsConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-marketplaceordering/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id +from ._configuration import MarketplaceOrderingAgreementsConfiguration +from .operations import MarketplaceAgreementsOperations +from .operations import Operations +from . import models class MarketplaceOrderingAgreements(SDKClient): diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/__init__.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/__init__.py index cbe83590d336..244a40db5a32 100644 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/__init__.py +++ b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/__init__.py @@ -10,27 +10,27 @@ # -------------------------------------------------------------------------- try: - from .agreement_terms_py3 import AgreementTerms - from .error_response_error_py3 import ErrorResponseError - from .error_response_py3 import ErrorResponse, ErrorResponseException - from .operation_display_py3 import OperationDisplay - from .operation_py3 import Operation - from .resource_py3 import Resource + from ._models_py3 import AgreementTerms + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import ErrorResponseError + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import Resource except (SyntaxError, ImportError): - from .agreement_terms import AgreementTerms - from .error_response_error import ErrorResponseError - from .error_response import ErrorResponse, ErrorResponseException - from .operation_display import OperationDisplay - from .operation import Operation - from .resource import Resource -from .operation_paged import OperationPaged + from ._models import AgreementTerms + from ._models import ErrorResponse, ErrorResponseException + from ._models import ErrorResponseError + from ._models import Operation + from ._models import OperationDisplay + from ._models import Resource +from ._paged_models import OperationPaged __all__ = [ 'AgreementTerms', - 'ErrorResponseError', 'ErrorResponse', 'ErrorResponseException', - 'OperationDisplay', + 'ErrorResponseError', 'Operation', + 'OperationDisplay', 'Resource', 'OperationPaged', ] diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/_models.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/_models.py new file mode 100644 index 000000000000..0885c3cfd708 --- /dev/null +++ b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/_models.py @@ -0,0 +1,222 @@ +# 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 Resource(Model): + """ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AgreementTerms(Resource): + """Terms properties for provided Publisher/Offer/Plan tuple. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param publisher: Publisher identifier string of image being deployed. + :type publisher: str + :param product: Offer identifier string of image being deployed. + :type product: str + :param plan: Plan identifier string of image being deployed. + :type plan: str + :param license_text_link: Link to HTML with Microsoft and Publisher terms. + :type license_text_link: str + :param privacy_policy_link: Link to the privacy policy of the publisher. + :type privacy_policy_link: str + :param retrieve_datetime: Date and time in UTC of when the terms were + accepted. This is empty if Accepted is false. + :type retrieve_datetime: str + :param signature: Terms signature. + :type signature: str + :param accepted: If any version of the terms have been accepted, otherwise + false. + :type accepted: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'plan': {'key': 'properties.plan', 'type': 'str'}, + 'license_text_link': {'key': 'properties.licenseTextLink', 'type': 'str'}, + 'privacy_policy_link': {'key': 'properties.privacyPolicyLink', 'type': 'str'}, + 'retrieve_datetime': {'key': 'properties.retrieveDatetime', 'type': 'str'}, + 'signature': {'key': 'properties.signature', 'type': 'str'}, + 'accepted': {'key': 'properties.accepted', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(AgreementTerms, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.plan = kwargs.get('plan', None) + self.license_text_link = kwargs.get('license_text_link', None) + self.privacy_policy_link = kwargs.get('privacy_policy_link', None) + self.retrieve_datetime = kwargs.get('retrieve_datetime', None) + self.signature = kwargs.get('signature', None) + self.accepted = kwargs.get('accepted', None) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorResponse(Model): + """Error response indicates Microsoft.MarketplaceOrdering service is not able + to process the incoming request. The reason is provided in the error + message. + + :param error: The details of the error. + :type error: ~azure.mgmt.marketplaceordering.models.ErrorResponseError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ErrorResponseError(Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + + +class Operation(Model): + """Microsoft.MarketplaceOrdering REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.marketplaceordering.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.MarketplaceOrdering + :type provider: str + :param resource: Resource on which the operation is performed: Agreement, + virtualmachine, etc. + :type resource: str + :param operation: Operation type: Get Agreement, Sign Agreement, Cancel + Agreement etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + 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) diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/_models_py3.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/_models_py3.py new file mode 100644 index 000000000000..c00832012e4d --- /dev/null +++ b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/_models_py3.py @@ -0,0 +1,222 @@ +# 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 Resource(Model): + """ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AgreementTerms(Resource): + """Terms properties for provided Publisher/Offer/Plan tuple. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param publisher: Publisher identifier string of image being deployed. + :type publisher: str + :param product: Offer identifier string of image being deployed. + :type product: str + :param plan: Plan identifier string of image being deployed. + :type plan: str + :param license_text_link: Link to HTML with Microsoft and Publisher terms. + :type license_text_link: str + :param privacy_policy_link: Link to the privacy policy of the publisher. + :type privacy_policy_link: str + :param retrieve_datetime: Date and time in UTC of when the terms were + accepted. This is empty if Accepted is false. + :type retrieve_datetime: str + :param signature: Terms signature. + :type signature: str + :param accepted: If any version of the terms have been accepted, otherwise + false. + :type accepted: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'plan': {'key': 'properties.plan', 'type': 'str'}, + 'license_text_link': {'key': 'properties.licenseTextLink', 'type': 'str'}, + 'privacy_policy_link': {'key': 'properties.privacyPolicyLink', 'type': 'str'}, + 'retrieve_datetime': {'key': 'properties.retrieveDatetime', 'type': 'str'}, + 'signature': {'key': 'properties.signature', 'type': 'str'}, + 'accepted': {'key': 'properties.accepted', 'type': 'bool'}, + } + + def __init__(self, *, publisher: str=None, product: str=None, plan: str=None, license_text_link: str=None, privacy_policy_link: str=None, retrieve_datetime: str=None, signature: str=None, accepted: bool=None, **kwargs) -> None: + super(AgreementTerms, self).__init__(**kwargs) + self.publisher = publisher + self.product = product + self.plan = plan + self.license_text_link = license_text_link + self.privacy_policy_link = privacy_policy_link + self.retrieve_datetime = retrieve_datetime + self.signature = signature + self.accepted = accepted + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorResponse(Model): + """Error response indicates Microsoft.MarketplaceOrdering service is not able + to process the incoming request. The reason is provided in the error + message. + + :param error: The details of the error. + :type error: ~azure.mgmt.marketplaceordering.models.ErrorResponseError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ErrorResponseError(Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + + +class Operation(Model): + """Microsoft.MarketplaceOrdering REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.marketplaceordering.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.MarketplaceOrdering + :type provider: str + :param resource: Resource on which the operation is performed: Agreement, + virtualmachine, etc. + :type resource: str + :param operation: Operation type: Get Agreement, Sign Agreement, Cancel + Agreement etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_paged.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/_paged_models.py similarity index 100% rename from sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_paged.py rename to sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/_paged_models.py diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/agreement_terms.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/agreement_terms.py deleted file mode 100644 index b30fb3e97b88..000000000000 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/agreement_terms.py +++ /dev/null @@ -1,76 +0,0 @@ -# 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 .resource import Resource - - -class AgreementTerms(Resource): - """Terms properties for provided Publisher/Offer/Plan tuple. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param publisher: Publisher identifier string of image being deployed. - :type publisher: str - :param product: Offer identifier string of image being deployed. - :type product: str - :param plan: Plan identifier string of image being deployed. - :type plan: str - :param license_text_link: Link to HTML with Microsoft and Publisher terms. - :type license_text_link: str - :param privacy_policy_link: Link to the privacy policy of the publisher. - :type privacy_policy_link: str - :param retrieve_datetime: Date and time in UTC of when the terms were - accepted. This is empty if Accepted is false. - :type retrieve_datetime: str - :param signature: Terms signature. - :type signature: str - :param accepted: If any version of the terms have been accepted, otherwise - false. - :type accepted: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'publisher': {'key': 'properties.publisher', 'type': 'str'}, - 'product': {'key': 'properties.product', 'type': 'str'}, - 'plan': {'key': 'properties.plan', 'type': 'str'}, - 'license_text_link': {'key': 'properties.licenseTextLink', 'type': 'str'}, - 'privacy_policy_link': {'key': 'properties.privacyPolicyLink', 'type': 'str'}, - 'retrieve_datetime': {'key': 'properties.retrieveDatetime', 'type': 'str'}, - 'signature': {'key': 'properties.signature', 'type': 'str'}, - 'accepted': {'key': 'properties.accepted', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(AgreementTerms, self).__init__(**kwargs) - self.publisher = kwargs.get('publisher', None) - self.product = kwargs.get('product', None) - self.plan = kwargs.get('plan', None) - self.license_text_link = kwargs.get('license_text_link', None) - self.privacy_policy_link = kwargs.get('privacy_policy_link', None) - self.retrieve_datetime = kwargs.get('retrieve_datetime', None) - self.signature = kwargs.get('signature', None) - self.accepted = kwargs.get('accepted', None) diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/agreement_terms_py3.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/agreement_terms_py3.py deleted file mode 100644 index 4175632dea18..000000000000 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/agreement_terms_py3.py +++ /dev/null @@ -1,76 +0,0 @@ -# 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 .resource_py3 import Resource - - -class AgreementTerms(Resource): - """Terms properties for provided Publisher/Offer/Plan tuple. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param publisher: Publisher identifier string of image being deployed. - :type publisher: str - :param product: Offer identifier string of image being deployed. - :type product: str - :param plan: Plan identifier string of image being deployed. - :type plan: str - :param license_text_link: Link to HTML with Microsoft and Publisher terms. - :type license_text_link: str - :param privacy_policy_link: Link to the privacy policy of the publisher. - :type privacy_policy_link: str - :param retrieve_datetime: Date and time in UTC of when the terms were - accepted. This is empty if Accepted is false. - :type retrieve_datetime: str - :param signature: Terms signature. - :type signature: str - :param accepted: If any version of the terms have been accepted, otherwise - false. - :type accepted: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'publisher': {'key': 'properties.publisher', 'type': 'str'}, - 'product': {'key': 'properties.product', 'type': 'str'}, - 'plan': {'key': 'properties.plan', 'type': 'str'}, - 'license_text_link': {'key': 'properties.licenseTextLink', 'type': 'str'}, - 'privacy_policy_link': {'key': 'properties.privacyPolicyLink', 'type': 'str'}, - 'retrieve_datetime': {'key': 'properties.retrieveDatetime', 'type': 'str'}, - 'signature': {'key': 'properties.signature', 'type': 'str'}, - 'accepted': {'key': 'properties.accepted', 'type': 'bool'}, - } - - def __init__(self, *, publisher: str=None, product: str=None, plan: str=None, license_text_link: str=None, privacy_policy_link: str=None, retrieve_datetime: str=None, signature: str=None, accepted: bool=None, **kwargs) -> None: - super(AgreementTerms, self).__init__(**kwargs) - self.publisher = publisher - self.product = product - self.plan = plan - self.license_text_link = license_text_link - self.privacy_policy_link = privacy_policy_link - self.retrieve_datetime = retrieve_datetime - self.signature = signature - self.accepted = accepted diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response.py deleted file mode 100644 index 1c5cb8d0ea13..000000000000 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 ErrorResponse(Model): - """Error response indicates Microsoft.MarketplaceOrdering service is not able - to process the incoming request. The reason is provided in the error - message. - - :param error: The details of the error. - :type error: ~azure.mgmt.marketplaceordering.models.ErrorResponseError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponseError'}, - } - - def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_error.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_error.py deleted file mode 100644 index 689843352a65..000000000000 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_error.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 ErrorResponseError(Model): - """The details of the error. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: Error code. - :vartype code: str - :ivar message: Error message indicating why the operation failed. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorResponseError, self).__init__(**kwargs) - self.code = None - self.message = None diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_error_py3.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_error_py3.py deleted file mode 100644 index 92a101067f76..000000000000 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_error_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 ErrorResponseError(Model): - """The details of the error. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: Error code. - :vartype code: str - :ivar message: Error message indicating why the operation failed. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ErrorResponseError, self).__init__(**kwargs) - self.code = None - self.message = None diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_py3.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_py3.py deleted file mode 100644 index 4e4585e5f718..000000000000 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 ErrorResponse(Model): - """Error response indicates Microsoft.MarketplaceOrdering service is not able - to process the incoming request. The reason is provided in the error - message. - - :param error: The details of the error. - :type error: ~azure.mgmt.marketplaceordering.models.ErrorResponseError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponseError'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation.py deleted file mode 100644 index 3d365b5774be..000000000000 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Operation(Model): - """Microsoft.MarketplaceOrdering REST API operation. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.marketplaceordering.models.OperationDisplay - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_display.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_display.py deleted file mode 100644 index c536e0888d3b..000000000000 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_display.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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): - """The object that represents the operation. - - :param provider: Service provider: Microsoft.MarketplaceOrdering - :type provider: str - :param resource: Resource on which the operation is performed: Agreement, - virtualmachine, etc. - :type resource: str - :param operation: Operation type: Get Agreement, Sign Agreement, Cancel - Agreement etc. - :type operation: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - 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) diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_display_py3.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_display_py3.py deleted file mode 100644 index 78d3420de4c8..000000000000 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_display_py3.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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): - """The object that represents the operation. - - :param provider: Service provider: Microsoft.MarketplaceOrdering - :type provider: str - :param resource: Resource on which the operation is performed: Agreement, - virtualmachine, etc. - :type resource: str - :param operation: Operation type: Get Agreement, Sign Agreement, Cancel - Agreement etc. - :type operation: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: - super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_py3.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_py3.py deleted file mode 100644 index 1fcec8e5216a..000000000000 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Operation(Model): - """Microsoft.MarketplaceOrdering REST API operation. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.marketplaceordering.models.OperationDisplay - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, *, name: str=None, display=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/resource.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/resource.py deleted file mode 100644 index fc92549d32e9..000000000000 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/resource.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 Resource(Model): - """ARM resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/resource_py3.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/resource_py3.py deleted file mode 100644 index aedc5cfaf0b9..000000000000 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/resource_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 Resource(Model): - """ARM resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/__init__.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/__init__.py index edec9e3a088d..74181049009e 100644 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/__init__.py +++ b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .marketplace_agreements_operations import MarketplaceAgreementsOperations -from .operations import Operations +from ._marketplace_agreements_operations import MarketplaceAgreementsOperations +from ._operations import Operations __all__ = [ 'MarketplaceAgreementsOperations', diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/marketplace_agreements_operations.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/_marketplace_agreements_operations.py similarity index 96% rename from sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/marketplace_agreements_operations.py rename to sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/_marketplace_agreements_operations.py index 55dea1e8eeee..fe48ccee7f1d 100644 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/marketplace_agreements_operations.py +++ b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/_marketplace_agreements_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -19,6 +18,8 @@ class MarketplaceAgreementsOperations(object): """MarketplaceAgreementsOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -58,7 +59,8 @@ def get( :return: AgreementTerms or ClientRawResponse if raw=true :rtype: ~azure.mgmt.marketplaceordering.models.AgreementTerms or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -90,12 +92,9 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('AgreementTerms', response) @@ -169,7 +168,6 @@ def create( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('AgreementTerms', response) @@ -234,7 +232,6 @@ def sign( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('AgreementTerms', response) @@ -299,7 +296,6 @@ def cancel( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('AgreementTerms', response) @@ -329,7 +325,8 @@ def get_agreement( :return: AgreementTerms or ClientRawResponse if raw=true :rtype: ~azure.mgmt.marketplaceordering.models.AgreementTerms or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_agreement.metadata['url'] @@ -360,12 +357,9 @@ def get_agreement( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('AgreementTerms', response) @@ -388,7 +382,8 @@ def list( :return: list or ClientRawResponse if raw=true :rtype: list[~azure.mgmt.marketplaceordering.models.AgreementTerms] or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.list.metadata['url'] @@ -416,12 +411,9 @@ def list( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('[AgreementTerms]', response) diff --git a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/operations.py b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/_operations.py similarity index 90% rename from sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/operations.py rename to sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/_operations.py index 9c187dc3bef3..8cdcd8fff6de 100644 --- a/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/operations.py +++ b/sdk/marketplaceordering/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/_operations.py @@ -18,6 +18,8 @@ class Operations(object): """Operations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -52,8 +54,7 @@ def list( :raises: :class:`ErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list.metadata['url'] @@ -78,6 +79,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -86,12 +92,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/providers/Microsoft.MarketplaceOrdering/operations'}