Skip to content

Commit

Permalink
[AutoPR] marketplaceordering/resource-manager (#3969)
Browse files Browse the repository at this point in the history
* [AutoPR marketplaceordering/resource-manager] typo: marketplaceordering/resource-manager/Microsoft.MarketplaceOrdering (#3952)

* Generated from 6085607286ab258abaf5d9f5d3aa774c92a9af81

typo: marketplaceordering/resource-manager/Microsoft.MarketplaceOrdering

- reponse -> response

* Packaging update of azure-mgmt-marketplaceordering

* [AutoPR marketplaceordering/resource-manager] Add missing MarketplaceOrdering operations to swagger (#4485)

* Generated from fc54df16998b34ed493122f98c184b67444a6995

Apply suggestions from code review

Clarify operation descriptions

Co-Authored-By: zachraMSFT <[email protected]>

* Packaging update of azure-mgmt-marketplaceordering

* 0.2.0

* Packaging update of azure-mgmt-marketplaceordering
  • Loading branch information
AutorestCI authored and lmazuel committed Mar 11, 2019
1 parent 47490fe commit 504b2b0
Show file tree
Hide file tree
Showing 20 changed files with 628 additions and 71 deletions.
36 changes: 36 additions & 0 deletions azure-mgmt-marketplaceordering/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
++++++++++++++++++

Expand Down
4 changes: 4 additions & 0 deletions azure-mgmt-marketplaceordering/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
recursive-include tests *.py *.yaml
include *.rst
include azure/__init__.py
include azure/mgmt/__init__.py

19 changes: 0 additions & 19 deletions azure-mgmt-marketplaceordering/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see
For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/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
=====

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Loading

0 comments on commit 504b2b0

Please sign in to comment.