diff --git a/azure-mgmt-marketplaceordering/HISTORY.rst b/azure-mgmt-marketplaceordering/HISTORY.rst index 7ced0fb4c4d7..b264493f5e59 100644 --- a/azure-mgmt-marketplaceordering/HISTORY.rst +++ b/azure-mgmt-marketplaceordering/HISTORY.rst @@ -3,6 +3,42 @@ Release History =============== +0.2.0 (2019-03-11) +++++++++++++++++++ + +**Features** + +- Added operation MarketplaceAgreementsOperations.sign +- Added operation MarketplaceAgreementsOperations.list +- Added operation MarketplaceAgreementsOperations.cancel +- Added operation MarketplaceAgreementsOperations.get_agreement +- Client class can be used as a context manager to keep the underlying HTTP session open for performance + +**General Breaking changes** + +This version uses a next-generation code generator that *might* introduce breaking changes. + +- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments. + To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments. +- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered. + While this is not a breaking change, the distinctions are important, and are documented here: + https://docs.python.org/3/library/enum.html#others + At a glance: + + - "is" should not be used at all. + - "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered. + +- New Long Running Operation: + + - Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same. + - Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used. + - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, + without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`. + - New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`, + the response of the initial call will be returned without polling. + - `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`. + - `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away. + 0.1.0 (2018-01-22) ++++++++++++++++++ diff --git a/azure-mgmt-marketplaceordering/MANIFEST.in b/azure-mgmt-marketplaceordering/MANIFEST.in index bb37a2723dae..e4884efef41b 100644 --- a/azure-mgmt-marketplaceordering/MANIFEST.in +++ b/azure-mgmt-marketplaceordering/MANIFEST.in @@ -1 +1,5 @@ +recursive-include tests *.py *.yaml include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-marketplaceordering/README.rst b/azure-mgmt-marketplaceordering/README.rst index beb100b029fc..ed233736f475 100644 --- a/azure-mgmt-marketplaceordering/README.rst +++ b/azure-mgmt-marketplaceordering/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 ===== @@ -47,3 +28,6 @@ Provide Feedback If you encounter any bugs or have suggestions, please file an issue in the `Issues `__ section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-marketplaceordering%2FREADME.png diff --git a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/marketplace_ordering_agreements.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/marketplace_ordering_agreements.py index 32b15685431e..92405c1b5bcb 100644 --- a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/marketplace_ordering_agreements.py +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/marketplace_ordering_agreements.py @@ -9,7 +9,7 @@ # 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 @@ -51,7 +51,7 @@ def __init__( self.subscription_id = subscription_id -class MarketplaceOrderingAgreements(object): +class MarketplaceOrderingAgreements(SDKClient): """REST API for MarketplaceOrdering Agreements. :ivar config: Configuration for client. @@ -75,7 +75,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = MarketplaceOrderingAgreementsConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(MarketplaceOrderingAgreements, 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 = '2015-06-01' diff --git a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/__init__.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/__init__.py index 02a7d9c4b255..cbe83590d336 100644 --- a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/__init__.py +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/__init__.py @@ -9,12 +9,20 @@ # regenerated. # -------------------------------------------------------------------------- -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 +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 +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 __all__ = [ diff --git a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/agreement_terms.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/agreement_terms.py index 50a3041019f2..b30fb3e97b88 100644 --- a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/agreement_terms.py +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/agreement_terms.py @@ -64,13 +64,13 @@ class AgreementTerms(Resource): 'accepted': {'key': 'properties.accepted', 'type': 'bool'}, } - def __init__(self, publisher=None, product=None, plan=None, license_text_link=None, privacy_policy_link=None, retrieve_datetime=None, signature=None, accepted=None): - super(AgreementTerms, self).__init__() - 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 + 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/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/agreement_terms_py3.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/agreement_terms_py3.py new file mode 100644 index 000000000000..4175632dea18 --- /dev/null +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/agreement_terms_py3.py @@ -0,0 +1,76 @@ +# 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/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response.py index c0aa7577d7e8..1c5cb8d0ea13 100644 --- a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response.py +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response.py @@ -14,7 +14,7 @@ class ErrorResponse(Model): - """Error reponse indicates Microsoft.MarketplaceOrdering service is not able + """Error response indicates Microsoft.MarketplaceOrdering service is not able to process the incoming request. The reason is provided in the error message. @@ -26,9 +26,9 @@ class ErrorResponse(Model): 'error': {'key': 'error', 'type': 'ErrorResponseError'}, } - def __init__(self, error=None): - super(ErrorResponse, self).__init__() - self.error = error + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) class ErrorResponseException(HttpOperationError): diff --git a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_error.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_error.py index 1b2f2208f619..689843352a65 100644 --- a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_error.py +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_error.py @@ -34,7 +34,7 @@ class ErrorResponseError(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(ErrorResponseError, self).__init__() + def __init__(self, **kwargs): + super(ErrorResponseError, self).__init__(**kwargs) self.code = None self.message = None diff --git a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_error_py3.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_error_py3.py new file mode 100644 index 000000000000..92a101067f76 --- /dev/null +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_error_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 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/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_py3.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_py3.py new file mode 100644 index 000000000000..4e4585e5f718 --- /dev/null +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/error_response_py3.py @@ -0,0 +1,43 @@ +# 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/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation.py index 632d91912755..3d365b5774be 100644 --- a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation.py +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation.py @@ -26,7 +26,7 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, name=None, display=None): - super(Operation, self).__init__() - self.name = name - self.display = display + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_display.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_display.py index 62d6155c0bd3..c536e0888d3b 100644 --- a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_display.py +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_display.py @@ -31,8 +31,8 @@ class OperationDisplay(Model): 'operation': {'key': 'operation', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation + 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/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_display_py3.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_display_py3.py new file mode 100644 index 000000000000..78d3420de4c8 --- /dev/null +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_display_py3.py @@ -0,0 +1,38 @@ +# 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/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_py3.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_py3.py new file mode 100644 index 000000000000..1fcec8e5216a --- /dev/null +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/operation_py3.py @@ -0,0 +1,32 @@ +# 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/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/resource.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/resource.py index a2ddd410be1b..fc92549d32e9 100644 --- a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/resource.py +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/resource.py @@ -38,8 +38,8 @@ class Resource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None diff --git a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/resource_py3.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/resource_py3.py new file mode 100644 index 000000000000..aedc5cfaf0b9 --- /dev/null +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/resource_py3.py @@ -0,0 +1,45 @@ +# 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/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/marketplace_agreements_operations.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/marketplace_agreements_operations.py index b292a4b5ad6c..a323e0a45963 100644 --- a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/marketplace_agreements_operations.py +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/marketplace_agreements_operations.py @@ -22,7 +22,7 @@ class MarketplaceAgreementsOperations(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: The API version to use for the request. Constant value: "2015-06-01". :ivar offer_type: Offer Type, currently only virtualmachine type is supported. Constant value: "virtualmachine". """ @@ -61,7 +61,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/offerTypes/{offerType}/publishers/{publisherId}/offers/{offerId}/plans/{planId}/agreements/current' + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'offerType': self._serialize.url("self.offer_type", self.offer_type, 'str'), @@ -77,7 +77,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: @@ -86,8 +86,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]: exp = CloudError(response) @@ -104,6 +104,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/offerTypes/{offerType}/publishers/{publisherId}/offers/{offerId}/plans/{planId}/agreements/current'} def create( self, publisher_id, offer_id, plan_id, parameters, custom_headers=None, raw=False, **operation_config): @@ -132,7 +133,7 @@ def create( :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/offerTypes/{offerType}/publishers/{publisherId}/offers/{offerId}/plans/{planId}/agreements/current' + url = self.create.metadata['url'] path_format_arguments = { 'offerType': self._serialize.url("self.offer_type", self.offer_type, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -148,6 +149,7 @@ def create( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -160,9 +162,138 @@ def create( body_content = self._serialize.body(parameters, 'AgreementTerms') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AgreementTerms', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/offerTypes/{offerType}/publishers/{publisherId}/offers/{offerId}/plans/{planId}/agreements/current'} + + def sign( + self, publisher_id, offer_id, plan_id, custom_headers=None, raw=False, **operation_config): + """Sign marketplace terms. + + :param publisher_id: Publisher identifier string of image being + deployed. + :type publisher_id: str + :param offer_id: Offer identifier string of image being deployed. + :type offer_id: str + :param plan_id: Plan identifier string of image being deployed. + :type plan_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AgreementTerms or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.marketplaceordering.models.AgreementTerms or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.sign.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'publisherId': self._serialize.url("publisher_id", publisher_id, 'str'), + 'offerId': self._serialize.url("offer_id", offer_id, 'str'), + 'planId': self._serialize.url("plan_id", plan_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # 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.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AgreementTerms', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + sign.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/sign'} + + def cancel( + self, publisher_id, offer_id, plan_id, custom_headers=None, raw=False, **operation_config): + """Cancel marketplace terms. + + :param publisher_id: Publisher identifier string of image being + deployed. + :type publisher_id: str + :param offer_id: Offer identifier string of image being deployed. + :type offer_id: str + :param plan_id: Plan identifier string of image being deployed. + :type plan_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AgreementTerms or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.marketplaceordering.models.AgreementTerms or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.cancel.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'publisherId': self._serialize.url("publisher_id", publisher_id, 'str'), + 'offerId': self._serialize.url("offer_id", offer_id, 'str'), + 'planId': self._serialize.url("plan_id", plan_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # 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.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -177,3 +308,126 @@ def create( return client_raw_response return deserialized + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/cancel'} + + def get_agreement( + self, publisher_id, offer_id, plan_id, custom_headers=None, raw=False, **operation_config): + """Get marketplace agreement. + + :param publisher_id: Publisher identifier string of image being + deployed. + :type publisher_id: str + :param offer_id: Offer identifier string of image being deployed. + :type offer_id: str + :param plan_id: Plan identifier string of image being deployed. + :type plan_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AgreementTerms or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.marketplaceordering.models.AgreementTerms or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_agreement.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'publisherId': self._serialize.url("publisher_id", publisher_id, 'str'), + 'offerId': self._serialize.url("offer_id", offer_id, 'str'), + 'planId': self._serialize.url("plan_id", plan_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AgreementTerms', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_agreement.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List marketplace agreements in the subscription. + + :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: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.marketplaceordering.models.AgreementTerms] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[AgreementTerms]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements'} diff --git a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/operations.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/operations.py index 78fcfd8d8b24..9c187dc3bef3 100644 --- a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/operations.py +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/operations/operations.py @@ -21,7 +21,7 @@ class Operations(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: The API version to use for the request. Constant value: "2015-06-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.MarketplaceOrdering/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -68,7 +68,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: @@ -77,9 +77,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.ErrorResponseException(self._deserialize, response) @@ -95,3 +94,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.MarketplaceOrdering/operations'} diff --git a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/version.py b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/version.py index e0ec669828cb..9bd1dfac7ecb 100644 --- a/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/version.py +++ b/azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "0.2.0"