Skip to content

Commit

Permalink
[AutoPR] resources/resource-manager (#3187)
Browse files Browse the repository at this point in the history
* Generated from 060cf203676c2ea6d7ae479c755c1d31604555b4 (#3186)

Use same identity pattern as resources

* [AutoPR resources/resource-manager] Fix ARMViolation Error for Microsoft.Authorization (#3304)

* Generated from b74ebceb22e46a4c6ceb9fd8ab1cb8347f400839

Fix ARMViolation Error for Microsoft.Authorization

* Packaging update of azure-mgmt-resource

* [AutoPR resources/resource-manager] Fix Swagger Linting Error for Microsoft.Features (#3303)

* Generated from 7a6405dee0b1df4ab7da45c12d03cf1336106221

Fix Swagger Linting Error for Microsoft.Features

* Packaging update of azure-mgmt-resource

* Generated from 79862aa514b96e220ff6c723bcd4f1260659ab8f

Remove additional properties in examples

* Generated from 04a8bcdd0db69e2ac6de225c3774271f5687054b (#3384)

Fix typo, the provider should be Microsoft.Authorization

* Generated from 989797a01b3a189f15fd9cb6b68d938f4a4f119f (#3393)

Change operationId of Microsoft.Authorization

* [AutoPR resources/resource-manager] Fix ARMViolations for Microsoft.Resources (#3356)

* Generated from 2677deefc46f8d0978cc262efb1510a41e3832a0

Fix ARMViolations for Microsoft.Resources

* Generated from d1873c4588fc3653c9d01f38bb51933cfdd13710

Fix ARM Violations in Microsoft.Resources

* Packaging update of azure-mgmt-resource

* Generated from b6aeed45dd11f9251470f6a2f0b5371a1ee914d5 (#3616)

added descriptions for filter and expand

* Packaging update of azure-mgmt-resource

* [AutoPR resources/resource-manager] added to description of allowed characters for resource group name (#3662)

* Generated from 773581c3a2be72522eb2bc770800bbef994454d3

added to description of allowed characters for resource group name

* Generated from 3d920ef4d7524961f809597d3f47f70cfce462ef

changed description

* Generated from b420267e7b1b12292730e47751c35b2ac586c70a (#3828)

Add type for DeploymentExtend and ResourceGroup

* Generated from 3b7e0ff3ba3d3d18ce80d86be227e06f43bd747d (#3987)

typo: resources/resource-manager/Microsoft.Resources

- paramaters -> parameters
- deploymentoutput -> deployment output
- targetid -> targetId
- informaton -> information
- rsources -> resources
- muct -> must

* Generated from b4101839580231ecaf651529783b50f8fa304b52 (#4027)

typo: resources/resource-manager/Microsoft.Authorization

- assigment -> assignment
- reponse -> response

* Generated from 61892a6ae9ebb50edee79da2733c646f7759ac13 (#4069)

typo: resources/resource-manager/Microsoft.Solutions

- reponse -> response

* Packaging update of azure-mgmt-resource

* 2.1.0
  • Loading branch information
AutorestCI authored and lmazuel committed Jan 2, 2019
1 parent 816008e commit 6089d22
Show file tree
Hide file tree
Showing 168 changed files with 5,890 additions and 1,255 deletions.
9 changes: 9 additions & 0 deletions azure-mgmt-resource/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
Release History
===============

2.1.0 (2019-02-01)
++++++++++++++++++

**Features on Policy**

- New API version for Policy 2018-05-01
- Model PolicyAssignment has a new parameter location
- Model PolicyAssignment has a new parameter identity

2.0.0 (2018-07-20)
++++++++++++++++++

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

Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
from .v2015_12_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
def features(self):
"""Instance depends on the API version:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
import uuid
from .operations.features_operations import FeaturesOperations
from . import models

Expand Down Expand Up @@ -79,3 +82,63 @@ def __init__(

self.features = FeaturesOperations(
self._client, self.config, self._serialize, self._deserialize)

def list_operations(
self, custom_headers=None, raw=False, **operation_config):
"""Lists all of the available Microsoft.Features REST API operations.
: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<msrest:optionsforoperations>`.
:return: An iterator like instance of Operation
:rtype:
~azure.mgmt.resource.features.v2015_12_01.models.OperationPaged[~azure.mgmt.resource.features.v2015_12_01.models.Operation]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = self.list_operations.metadata['url']

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

else:
url = next_link
query_parameters = {}

# 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

return response

# Deserialize response
deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies)

if raw:
header_dict = {}
client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict)
return client_raw_response

return deserialized
list_operations.metadata = {'url': '/providers/Microsoft.Features/operations'}
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@
try:
from .feature_properties_py3 import FeatureProperties
from .feature_result_py3 import FeatureResult
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
except (SyntaxError, ImportError):
from .feature_properties import FeatureProperties
from .feature_result import FeatureResult
from .operation_display import OperationDisplay
from .operation import Operation
from .operation_paged import OperationPaged
from .feature_result_paged import FeatureResultPaged

__all__ = [
'FeatureProperties',
'FeatureResult',
'OperationDisplay',
'Operation',
'OperationPaged',
'FeatureResultPaged',
]
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.Features operation.
:param name: Operation name: {provider}/{resource}/{operation}
:type name: str
:param display: The object that represents the operation.
:type display:
~azure.mgmt.resource.features.v2015_12_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,37 @@
# 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.Features
: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
"""

_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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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.Features
: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
"""

_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
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 OperationPaged(Paged):
"""
A paging container for iterating over a list of :class:`Operation <azure.mgmt.resource.features.v2015_12_01.models.Operation>` object
"""

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

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

super(OperationPaged, self).__init__(*args, **kwargs)
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.Features operation.
:param name: Operation name: {provider}/{resource}/{operation}
:type name: str
:param display: The object that represents the operation.
:type display:
~azure.mgmt.resource.features.v2015_12_01.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
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,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:
Expand All @@ -81,9 +81,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]:
exp = CloudError(response)
Expand Down Expand Up @@ -142,7 +141,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:
Expand All @@ -151,9 +150,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]:
exp = CloudError(response)
Expand Down Expand Up @@ -207,7 +205,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:
Expand All @@ -216,8 +214,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)
Expand Down Expand Up @@ -270,7 +268,7 @@ def register(

# 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:
Expand All @@ -279,8 +277,8 @@ def register(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ def models(cls, api_version=DEFAULT_API_VERSION):
from .v2016_09_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-09-01: :class:`Operations<azure.mgmt.resource.links.v2016_09_01.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2016-09-01':
from .v2016_09_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)))

@property
def resource_links(self):
Expand Down
Loading

0 comments on commit 6089d22

Please sign in to comment.