Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@

from .feature_properties import FeatureProperties
from .feature_result import FeatureResult
from .operation_display import OperationDisplay
from .operation_definition import OperationDefinition
from .operations_list import OperationsList
from .feature_result_paged import FeatureResultPaged

__all__ = [
'FeatureProperties',
'FeatureResult',
'OperationDisplay',
'OperationDefinition',
'OperationsList',
'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 OperationDefinition(Model):
"""OperationDefinition.

:param name: The name of the operation.
:type name: str
:param display: The operation display definition.
: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=None, display=None):
super(OperationDefinition, self).__init__()
self.name = name
self.display = display
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 OperationDisplay(Model):
"""OperationDisplay.

:param provider: Operation provider.
:type provider: str
:param resource: Operation resource.
:type resource: str
:param operation: Operation.
:type operation: str
:param description: Operation description.
: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, provider=None, resource=None, operation=None, description=None):
super(OperationDisplay, self).__init__()
self.provider = provider
self.resource = resource
self.operation = operation
self.description = description
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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 OperationsList(Model):
"""OperationsList.

:param operations: The array of feature operations.
:type operations:
list[~azure.mgmt.resource.features.v2015_12_01.models.OperationDefinition]
"""

_attribute_map = {
'operations': {'key': 'operations', 'type': '[OperationDefinition]'},
}

def __init__(self, operations=None):
super(OperationsList, self).__init__()
self.operations = operations
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FeaturesOperations(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 this operation. Constant value: "2015-12-01".
"""

Expand Down Expand Up @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Features/features'
url = self.list_all.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
Expand Down Expand Up @@ -101,6 +101,59 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Features/features'}

def operations(
self, custom_headers=None, raw=False, **operation_config):
"""Gets all the preview feature 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: OperationsList or ClientRawResponse if raw=true
:rtype:
~azure.mgmt.resource.features.v2015_12_01.models.OperationsList or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.operations.metadata['url']

# Construct parameters
query_parameters = {}

# Construct headers
header_parameters = {}
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())
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)
response = self._client.send(request, header_parameters, 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('OperationsList', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
operations.metadata = {'url': '/providers/Microsoft.Features/operations'}

def list(
self, resource_provider_namespace, custom_headers=None, raw=False, **operation_config):
Expand All @@ -124,7 +177,7 @@ def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features'
url = self.list.metadata['url']
path_format_arguments = {
'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
Expand Down Expand Up @@ -170,6 +223,7 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features'}

def get(
self, resource_provider_namespace, feature_name, custom_headers=None, raw=False, **operation_config):
Expand All @@ -191,7 +245,7 @@ def get(
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}'
url = self.get.metadata['url']
path_format_arguments = {
'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'),
'featureName': self._serialize.url("feature_name", feature_name, 'str'),
Expand Down Expand Up @@ -232,6 +286,7 @@ def get(
return client_raw_response

return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}'}

def register(
self, resource_provider_namespace, feature_name, custom_headers=None, raw=False, **operation_config):
Expand All @@ -253,7 +308,7 @@ def register(
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/register'
url = self.register.metadata['url']
path_format_arguments = {
'resourceProviderNamespace': self._serialize.url("resource_provider_namespace", resource_provider_namespace, 'str'),
'featureName': self._serialize.url("feature_name", feature_name, 'str'),
Expand Down Expand Up @@ -294,3 +349,4 @@ def register(
return client_raw_response

return deserialized
register.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/register'}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ResourceLinksOperations(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 operation. Constant value: "2016-09-01".
"""

Expand Down Expand Up @@ -57,7 +57,7 @@ def delete(
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = '/{linkId}'
url = self.delete.metadata['url']
path_format_arguments = {
'linkId': self._serialize.url("link_id", link_id, 'str', skip_quote=True)
}
Expand Down Expand Up @@ -89,6 +89,7 @@ def delete(
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
delete.metadata = {'url': '/{linkId}'}

def create_or_update(
self, link_id, properties=None, custom_headers=None, raw=False, **operation_config):
Expand Down Expand Up @@ -116,7 +117,7 @@ def create_or_update(
parameters = models.ResourceLink(properties=properties)

# Construct URL
url = '/{linkId}'
url = self.create_or_update.metadata['url']
path_format_arguments = {
'linkId': self._serialize.url("link_id", link_id, 'str', skip_quote=True)
}
Expand Down Expand Up @@ -161,6 +162,7 @@ def create_or_update(
return client_raw_response

return deserialized
create_or_update.metadata = {'url': '/{linkId}'}

def get(
self, link_id, custom_headers=None, raw=False, **operation_config):
Expand All @@ -181,7 +183,7 @@ def get(
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = '/{linkId}'
url = self.get.metadata['url']
path_format_arguments = {
'linkId': self._serialize.url("link_id", link_id, 'str', skip_quote=True)
}
Expand Down Expand Up @@ -220,6 +222,7 @@ def get(
return client_raw_response

return deserialized
get.metadata = {'url': '/{linkId}'}

def list_at_subscription(
self, filter=None, custom_headers=None, raw=False, **operation_config):
Expand All @@ -243,7 +246,7 @@ def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/links'
url = self.list_at_subscription.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
Expand Down Expand Up @@ -290,6 +293,7 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list_at_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Resources/links'}

def list_at_source_scope(
self, scope, filter=None, custom_headers=None, raw=False, **operation_config):
Expand Down Expand Up @@ -318,7 +322,7 @@ def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/{scope}/providers/Microsoft.Resources/links'
url = self.list_at_source_scope.metadata['url']
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True)
}
Expand Down Expand Up @@ -365,3 +369,4 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list_at_source_scope.metadata = {'url': '/{scope}/providers/Microsoft.Resources/links'}
Loading