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
@@ -0,0 +1,19 @@
# 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 ._configuration import FeatureClientConfiguration
from ._feature_client import FeatureClient
__all__ = ['FeatureClient', 'FeatureClientConfiguration']

from .version import VERSION

__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.
# --------------------------------------------------------------------------
from msrestazure import AzureConfiguration

from .version import VERSION


class FeatureClientConfiguration(AzureConfiguration):
"""Configuration for FeatureClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(FeatureClientConfiguration, self).__init__(base_url)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

self.add_user_agent('azure-mgmt-resource/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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.service_client import SDKClient
from msrest import Serializer, Deserializer

from ._configuration import FeatureClientConfiguration
from .operations import FeatureClientOperationsMixin
from .operations import FeaturesOperations
from . import models


class FeatureClient(FeatureClientOperationsMixin, SDKClient):
"""Azure Feature Exposure Control (AFEC) provides a mechanism for the resource providers to control feature exposure to users. Resource providers typically use this mechanism to provide public/private preview for new features prior to making them generally available. Users need to explicitly register for AFEC features to get access to such functionality.

:ivar config: Configuration for client.
:vartype config: FeatureClientConfiguration

:ivar features: Features operations
:vartype features: azure.mgmt.resource.features.v2015_12_01.operations.FeaturesOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = FeatureClientConfiguration(credentials, subscription_id, base_url)
super(FeatureClient, 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-12-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.features = FeaturesOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -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.
# --------------------------------------------------------------------------

try:
from ._models_py3 import FeatureProperties
from ._models_py3 import FeatureResult
from ._models_py3 import Operation
from ._models_py3 import OperationDisplay
except (SyntaxError, ImportError):
from ._models import FeatureProperties
from ._models import FeatureResult
from ._models import Operation
from ._models import OperationDisplay
from ._paged_models import FeatureResultPaged
from ._paged_models import OperationPaged

__all__ = [
'FeatureProperties',
'FeatureResult',
'Operation',
'OperationDisplay',
'OperationPaged',
'FeatureResultPaged',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# 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 CloudError(Model):
"""CloudError.
"""

_attribute_map = {
}


class FeatureProperties(Model):
"""Information about feature.

:param state: The registration state of the feature for the subscription.
:type state: str
"""

_attribute_map = {
'state': {'key': 'state', 'type': 'str'},
}

def __init__(self, **kwargs):
super(FeatureProperties, self).__init__(**kwargs)
self.state = kwargs.get('state', None)


class FeatureResult(Model):
"""Previewed feature information.

:param name: The name of the feature.
:type name: str
:param properties: Properties of the previewed feature.
:type properties:
~azure.mgmt.resource.features.v2015_12_01.models.FeatureProperties
:param id: The resource ID of the feature.
:type id: str
:param type: The resource type of the feature.
:type type: str
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'FeatureProperties'},
'id': {'key': 'id', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}

def __init__(self, **kwargs):
super(FeatureResult, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.properties = kwargs.get('properties', None)
self.id = kwargs.get('id', None)
self.type = kwargs.get('type', None)


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)


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,111 @@
# 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 CloudError(Model):
"""CloudError.
"""

_attribute_map = {
}


class FeatureProperties(Model):
"""Information about feature.

:param state: The registration state of the feature for the subscription.
:type state: str
"""

_attribute_map = {
'state': {'key': 'state', 'type': 'str'},
}

def __init__(self, *, state: str=None, **kwargs) -> None:
super(FeatureProperties, self).__init__(**kwargs)
self.state = state


class FeatureResult(Model):
"""Previewed feature information.

:param name: The name of the feature.
:type name: str
:param properties: Properties of the previewed feature.
:type properties:
~azure.mgmt.resource.features.v2015_12_01.models.FeatureProperties
:param id: The resource ID of the feature.
:type id: str
:param type: The resource type of the feature.
:type type: str
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'FeatureProperties'},
'id': {'key': 'id', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}

def __init__(self, *, name: str=None, properties=None, id: str=None, type: str=None, **kwargs) -> None:
super(FeatureResult, self).__init__(**kwargs)
self.name = name
self.properties = properties
self.id = id
self.type = type


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


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
Loading