Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR resources/resource-manager] Backfilling Microsoft.Resources and subscriptions Swagger specs up to 2019-03-01 API version #4754

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions azure-mgmt-resource/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
recursive-include tests *.py *.yaml
include *.rst
include azure/__init__.py
include azure/mgmt/__init__.py
Expand Down
22 changes: 3 additions & 19 deletions azure-mgmt-resource/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 All @@ -47,3 +28,6 @@ Provide Feedback
If you encounter any bugs or have suggestions, please file an issue in the
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__
section of the project.


.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-resource%2FREADME.png
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,28 @@ def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:

* 2016-06-01: :mod:`v2016_06_01.models<azure.mgmt.resource.subscriptions.v2016_06_01.models>`
* 2016-06-01: :mod:`v2018_06_01.models<azure.mgmt.resource.subscriptions.v2018_06_01.models>`
"""
if api_version == '2016-06-01':
from .v2016_06_01 import models
return models
elif api_version == '2016-06-01':
from .v2018_06_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
def operations(self):
"""Instance depends on the API version:

* 2016-06-01: :class:`Operations<azure.mgmt.resource.subscriptions.v2016_06_01.operations.Operations>`
* 2016-06-01: :class:`Operations<azure.mgmt.resource.subscriptions.v2018_06_01.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2016-06-01':
from .v2016_06_01.operations import Operations as OperationClass
elif api_version == '2016-06-01':
from .v2018_06_01.operations import Operations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -114,10 +121,13 @@ def subscriptions(self):
"""Instance depends on the API version:

* 2016-06-01: :class:`SubscriptionsOperations<azure.mgmt.resource.subscriptions.v2016_06_01.operations.SubscriptionsOperations>`
* 2016-06-01: :class:`SubscriptionsOperations<azure.mgmt.resource.subscriptions.v2018_06_01.operations.SubscriptionsOperations>`
"""
api_version = self._get_api_version('subscriptions')
if api_version == '2016-06-01':
from .v2016_06_01.operations import SubscriptionsOperations as OperationClass
elif api_version == '2016-06-01':
from .v2018_06_01.operations import SubscriptionsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -127,10 +137,13 @@ def tenants(self):
"""Instance depends on the API version:

* 2016-06-01: :class:`TenantsOperations<azure.mgmt.resource.subscriptions.v2016_06_01.operations.TenantsOperations>`
* 2016-06-01: :class:`TenantsOperations<azure.mgmt.resource.subscriptions.v2018_06_01.operations.TenantsOperations>`
"""
api_version = self._get_api_version('tenants')
if api_version == '2016-06-01':
from .v2016_06_01.operations import TenantsOperations as OperationClass
elif api_version == '2016-06-01':
from .v2018_06_01.operations import TenantsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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 .subscription_client import SubscriptionClient
from .version import VERSION

__all__ = ['SubscriptionClient']

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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.
# --------------------------------------------------------------------------

try:
from .location_py3 import Location
from .subscription_policies_py3 import SubscriptionPolicies
from .subscription_py3 import Subscription
from .tenant_id_description_py3 import TenantIdDescription
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
except (SyntaxError, ImportError):
from .location import Location
from .subscription_policies import SubscriptionPolicies
from .subscription import Subscription
from .tenant_id_description import TenantIdDescription
from .operation_display import OperationDisplay
from .operation import Operation
from .operation_paged import OperationPaged
from .location_paged import LocationPaged
from .subscription_paged import SubscriptionPaged
from .tenant_id_description_paged import TenantIdDescriptionPaged
from .subscription_client_enums import (
SubscriptionState,
SpendingLimit,
)

__all__ = [
'Location',
'SubscriptionPolicies',
'Subscription',
'TenantIdDescription',
'OperationDisplay',
'Operation',
'OperationPaged',
'LocationPaged',
'SubscriptionPaged',
'TenantIdDescriptionPaged',
'SubscriptionState',
'SpendingLimit',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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 Location(Model):
"""Location information.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar id: The fully qualified ID of the location. For example,
/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus.
:vartype id: str
:ivar subscription_id: The subscription ID.
:vartype subscription_id: str
:ivar name: The location name.
:vartype name: str
:ivar display_name: The display name of the location.
:vartype display_name: str
:ivar latitude: The latitude of the location.
:vartype latitude: str
:ivar longitude: The longitude of the location.
:vartype longitude: str
"""

_validation = {
'id': {'readonly': True},
'subscription_id': {'readonly': True},
'name': {'readonly': True},
'display_name': {'readonly': True},
'latitude': {'readonly': True},
'longitude': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'subscription_id': {'key': 'subscriptionId', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'latitude': {'key': 'latitude', 'type': 'str'},
'longitude': {'key': 'longitude', 'type': 'str'},
}

def __init__(self, **kwargs):
super(Location, self).__init__(**kwargs)
self.id = None
self.subscription_id = None
self.name = None
self.display_name = None
self.latitude = None
self.longitude = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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.paging import Paged


class LocationPaged(Paged):
"""
A paging container for iterating over a list of :class:`Location <azure.mgmt.resource.subscriptions.v2018_06_01.models.Location>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[Location]'}
}

def __init__(self, *args, **kwargs):

super(LocationPaged, self).__init__(*args, **kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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 Location(Model):
"""Location information.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar id: The fully qualified ID of the location. For example,
/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus.
:vartype id: str
:ivar subscription_id: The subscription ID.
:vartype subscription_id: str
:ivar name: The location name.
:vartype name: str
:ivar display_name: The display name of the location.
:vartype display_name: str
:ivar latitude: The latitude of the location.
:vartype latitude: str
:ivar longitude: The longitude of the location.
:vartype longitude: str
"""

_validation = {
'id': {'readonly': True},
'subscription_id': {'readonly': True},
'name': {'readonly': True},
'display_name': {'readonly': True},
'latitude': {'readonly': True},
'longitude': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'subscription_id': {'key': 'subscriptionId', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'latitude': {'key': 'latitude', 'type': 'str'},
'longitude': {'key': 'longitude', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
super(Location, self).__init__(**kwargs)
self.id = None
self.subscription_id = None
self.name = None
self.display_name = None
self.latitude = None
self.longitude = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class Operation(Model):
"""Microsoft.Resources operation.

:param name: Operation name: {provider}/{resource}/{operation}
:type name: str
:param display: The object that represents the operation.
:type display:
~azure.mgmt.resource.subscriptions.v2018_06_01.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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class OperationDisplay(Model):
"""The object that represents the operation.

:param provider: Service provider: Microsoft.Resources
:type provider: str
:param resource: Resource on which the operation is performed: Profile,
endpoint, etc.
:type resource: str
:param operation: Operation type: Read, write, delete, etc.
:type operation: str
:param description: Description of the operation.
:type description: str
"""

_attribute_map = {
'provider': {'key': 'provider', 'type': 'str'},
'resource': {'key': 'resource', 'type': 'str'},
'operation': {'key': 'operation', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
}

def __init__(self, **kwargs):
super(OperationDisplay, self).__init__(**kwargs)
self.provider = kwargs.get('provider', None)
self.resource = kwargs.get('resource', None)
self.operation = kwargs.get('operation', None)
self.description = kwargs.get('description', None)
Loading